]> rtime.felk.cvut.cz Git - arc.git/blobdiff - include/Com_Types.h
Added an example of CAN communication for the TMS570LS31x HDK
[arc.git] / include / Com_Types.h
index 41d1e70f1c33c13cdd01bf0c3eb1665ae583881e..f606032db3d8a7c1949355dd96e3834fac0cc034 100644 (file)
 typedef uint8 Com_PduGroupIdType;\r
 typedef uint16 Com_SignalIdType;\r
 typedef uint8 Com_SignalGroupIdType;\r
-\r
+typedef uint16 Com_BitPositionType;\r
 typedef enum {\r
        IMMEDIATE,\r
-       DEFERRED,\r
+       DEFERRED\r
 } Com_IPduSignalProcessingMode;\r
 \r
 typedef enum {\r
@@ -50,6 +50,7 @@ typedef enum {
        UINT16,\r
        UINT32,\r
        UINT8_N,\r
+       UINT8_DYN,\r
        SINT8,\r
        SINT16,\r
        SINT32\r
@@ -60,14 +61,14 @@ typedef enum {
 \r
 typedef enum {\r
        PENDING,\r
-       TRIGGERED,\r
+       TRIGGERED\r
 } ComTransferProperty_type;\r
 \r
 typedef enum {\r
        DIRECT,\r
        MIXED,\r
        NONE,\r
-       PERIODIC,\r
+       PERIODIC\r
 } ComTxModeMode_type;\r
 \r
 \r
@@ -79,18 +80,13 @@ typedef enum {
        NEVER,\r
        NEW_IS_OUTSIDE,\r
        NEW_IS_WITHIN,\r
-       ONE_EVERY_N,\r
+       ONE_EVERY_N\r
 } ComFilterAlgorithm_type;\r
 \r
-#if defined(BIG_ENDIAN) || defined(LITTLE_ENDIAN)\r
-#undef BIG_ENDIAN\r
-#undef LITTLE_ENDIAN\r
-#endif\r
-\r
 typedef enum {\r
-       BIG_ENDIAN,\r
-       LITTLE_ENDIAN,\r
-       OPAQUE,\r
+       COM_BIG_ENDIAN,\r
+       COM_LITTLE_ENDIAN,\r
+       COM_OPAQUE\r
 } ComSignalEndianess_type;\r
 \r
 typedef enum {\r
@@ -124,7 +120,7 @@ typedef enum {
        type == SINT32  ? sizeof(sint32) : sizeof(boolean)) \\r
 \r
 #define SignalTypeSignedness(type) \\r
-               ((type == SINT8 || type == SINT16 || type == SINT32) ? \\r
+               (( (type == SINT8) || (type == SINT16) || (type == SINT32) ) ? \\r
                                COM_SIGNALTYPE_SIGNED : COM_SIGNALTYPE_UNSIGNED)\r
 \r
 /** Filter configuration type.\r
@@ -154,7 +150,7 @@ typedef struct {
        /** Starting position (bit) of the signal within the IPDU.\r
         * Range 0 to 63.\r
         */\r
-       const uint8 ComBitPosition;\r
+       const Com_BitPositionType ComBitPosition;\r
 \r
        /** The size of the signal in bits.\r
         * Range 0 to 64.\r
@@ -179,7 +175,7 @@ typedef struct {
        /** Filter for this signal.\r
         * NOT SUPPORTED\r
         */\r
-       const ComFilter_type ComFilter;\r
+       //const ComFilter_type ComFilter;\r
 \r
        /* Pointer to the shadow buffer of the signal group that this group signal is contained in.\r
         *\r
@@ -208,9 +204,9 @@ typedef struct {
 typedef struct {\r
 \r
        /** Starting position (bit) of the signal within the IPDU.\r
-        * Range 0 to 63.\r
+        * Range 0 to 2031.\r
         */\r
-       const uint8 ComBitPosition;\r
+       const Com_BitPositionType ComBitPosition;\r
 \r
        /** The size of the signal in bits.\r
         * Range 0 to 63.\r
@@ -243,7 +239,7 @@ typedef struct {
        /** The number of bytes if the signal has type UINT8_N;\r
         * Range 1 to 8.\r
         */\r
-       const uint8 ComSignalLength;\r
+       //const uint8 ComSignalLength;\r
 \r
        /** Defines the type of the signal. */\r
        const Com_SignalType ComSignalType;\r
@@ -254,13 +250,14 @@ typedef struct {
        /** Timeout notification function. */\r
        void (*ComTimeoutNotification) (void);\r
 \r
+       /** Defines if a write access to this signal can trigger the transmission of the corresponding I-PDU. */\r
        const ComTransferProperty_type ComTransferProperty;\r
 \r
        /** The bit position in the PDU for this signal's update bit.\r
-        * Range 0 to 63.\r
+        * Range 0 to 2031.\r
         * Only applicable if an update bit is used. NULL otherwise.\r
         */\r
-       const uint8 ComUpdateBitPosition;\r
+       const Com_BitPositionType ComUpdateBitPosition;\r
 \r
        /** Marks if this signal uses an update bit.\r
         * Should be set to one if an update bit is used.\r
@@ -270,7 +267,7 @@ typedef struct {
        /** Filter for this signal.\r
         * NOT SUPPORTED.\r
         */\r
-       const ComFilter_type ComFilter;\r
+       //const ComFilter_type ComFilter;\r
 \r
        /** Marks if this signal is a signal group.\r
         * Should be set to 1 if the signal is a signal group.\r
@@ -283,7 +280,7 @@ typedef struct {
        const ComGroupSignal_type * const *ComGroupSignal;\r
 \r
 \r
-       //void *Com_Arc_ShadowBuffer;\r
+       const void *Com_Arc_ShadowBuffer;\r
        //void *Com_Arc_IPduDataPtr;\r
 \r
        /* Pointer to the data storage of this signals IPDU.\r
@@ -294,8 +291,11 @@ typedef struct {
        /* IPDU id of the IPDU that this signal belongs to.\r
         * This is initialized by Com_Init() and should not be configured.\r
         */\r
-\r
-       //const uint8 ComIPduHandleId;\r
+       /** The numerical value used as the ID of this I-PDU.\r
+        * TheComIPduHandleId is required by the API calls to receive I-PDUs from the PduR (ComIP-duDirection: Receive).\r
+        * For Tx-I-PDUs (ComIPduDirection: Send) this handle Id is used by the PduR to confirm the transmission of the ComIPdu\r
+        */\r
+       const uint16 ComIPduHandleId;\r
        //const uint8 ComSignalUpdated;\r
 \r
        /* Callback function used when an invalid signal is received.\r
@@ -380,9 +380,6 @@ typedef struct {
        boolean (*ComIPduCallout)(PduIdType PduId, const uint8 *IPduData);\r
 \r
 \r
-       /** The ID of this IPDU. */\r
-       const uint8 ComIPduRxHandleId;\r
-\r
        /** The outgoing PDU id. For polite PDU id handling. */\r
        const uint8 ArcIPduOutgoingId;\r
 \r
@@ -403,11 +400,17 @@ typedef struct {
        /** Container of transmission related parameters. */\r
        const ComTxIPdu_type ComTxIPdu;\r
 \r
+       /** Reference to the actual pdu data storage */\r
+       void *const ComIPduDataPtr;\r
+       void *const ComIPduDeferredDataPtr;\r
+\r
        /** References to all signals and signal groups contained in this IPDU.\r
         * It probably makes little sense not to define at least one signal or signal group for each IPDU.\r
         */\r
        const ComSignal_type * const *ComIPduSignalRef;\r
 \r
+       const ComSignal_type * const ComIPduDynSignalRef;\r
+\r
        /*\r
         * The following two variables are used to control the per I-PDU based Rx/Tx-deadline monitoring.\r
         */\r