AUTOSAR-like DMA Driver

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Driver Configuration)
(Build)
Line 64: Line 64:
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
-
   APP_SRC = "<PATH>/Gpt_Cfg.c";
+
   APP_SRC = "<PATH>/Dma_Cfg.c";
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.

Revision as of 05:44, 17 July 2013

Contents

Synopsis

The DMA Driver provides services to offload data transfer tasks from the μC, allowing for more efficient use of the μC and the available bus bandwidth.

File Structure

API Specification

Imported Types

typedef uint8 Std_ReturnType

 #include "Std_Types.h"

Standard Return Type.

This type can be used as standard API return type which is shared between AUTOSAR-like modules.

The Std_ReturnType shall normally be used with value E_OK or E_NOT_OK. If those return values are not sufficient user specific values can be defined by using the 6 least specific bits.

struct Std_VersionInfoType

 #include "Std_Types.h"

Standard Version Informations Type.

This type shall be used to request the version of a AUTOSAR-like module using the <Module Name>_GetVersionInfo() function.

Field Documentation:

 uint16 Std_VersionInfoType::moduleID

Module Identifier.

 uint8 Std_VersionInfoType::sw_major_version

Software Version Major Number.

 uint8 Std_VersionInfoType::sw_minor_version

Software Version Minor Number.

 uint8 Std_VersionInfoType::sw_patch_version

Software Version Patch Number.

 uint16 Std_VersionInfoType::vendorID

Vendor Identifier.

Types Defintions

Functions Definitions

Usage Examples

Build

To enable AUTOSAR DMA Driver for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AS_DMA_DRIVER__";

The configuration C header file inclusion is done by CFLAGS attribute in the OS object of the OSEK/VDX configuration:

 CFLAGS = "-I<PATH>";

Where <PATH> is the absolute or relative directory path which configuration C header file is stored.

Instead the configurations C source file is added to the compilation process by APP_SRC attribute in the CPU_DATA object of the OSEK/VDX configuration:

 APP_SRC = "<PATH>/Dma_Cfg.c";

Where <PATH> is the absolute or relative directory path which configuration C source file is stored.

Supported Architectures

TI Stellaris LM4F232XXXX with ARM KEIL uVision Compiler Toolchain

Driver Configuration

In order to configure the AUTOSAR-like DMA Driver for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain, you have to select the "DMA" tab-sheet on driver configuration instance file.

File:Erika Driver Configurator DMA.png

Configuration Selection

In this section you can add/edit/delete configurations in DMA Driver configuration set:

  • Each configuration SHALL have an Identifier which must be unique inside the configurations set.
  • Each configuration, inside the configurations set, has a set of Channels.
    • Each Channel SHALL have a Name which must be unique inside the Channels.
API Selection

In this section you can select DMA Driver APIs and features will be included in build process:

  • Version Info: Dma_GetVersionInfo() API

File:Erika Driver Configurator DMA set.png

Interrupts

On order to use the DMA driver in interrupt mode, an ISR object must be added to OSEK/VDX configuration for Software DMA Channel Transfer End and another ISR must be added to OSEK/VDX configuration for DMA Transfer Error:

 ISR Dma_SoftwareTransferEnd_ISR {
   CATEGORY = 2;
   ENTRY = "UDMA_SOFT_TRANSF";
   PRIORITY = <ISR Priority>;
 }
 ISR Dma_TransferError_ISR {
   CATEGORY = 2;
   ENTRY = "UDMA_ERR";
   PRIORITY = <ISR Priority>;
 };

Where <ISR Priority> is a number indicating the level of priority (0: Lowest).

Implemetations Demos

Implementation Demos of the AUTOSAR-like GPT Driver can be found at examples/cortex_mx/lm4f232xxxx/as

Personal tools