]> rtime.felk.cvut.cz Git - arc.git/blobdiff - include/CanTp_Types.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / include / CanTp_Types.h
index fc4dc6e97dc683a9874fb7e6e0086a54fded903c..8aa714b7391cbe60e6b0c466bace6cc15beb4bea 100644 (file)
  * for more details.\r
  * -------------------------------- Arctic Core ------------------------------*/\r
 \r
+/*\r
+ *  General requirements\r
+ */\r
+/** @req CANTP160 */\r
+\r
+/*\r
+ * Definitions generated by tools
+ */\r
+/** @req CANTP239 */\r
+/** @req CANTP242 */\r
+\r
+//lint -save -e451 //PC-Lint Wrong interpretation, "Platform_Types.h included twice without a standard include guard."\r
 \r
 #ifndef CANTP_TYPES_H_\r
 #define CANTP_TYPES_H_\r
@@ -35,7 +47,7 @@ typedef enum {
        CANTP_OFF, CANTP_ON\r
 } CanTp_StateType;\r
 \r
-typedef enum {  /* req: CanTp030 */\r
+typedef enum {\r
        CANTP_RX_WAIT,\r
        CANTP_RX_PROCESSING,\r
        CANTP_TX_WAIT,\r
@@ -49,87 +61,84 @@ typedef enum {
 \r
 \r
 typedef struct {\r
-       uint32 CanTpNSa; /** req: CanTp254 */\r
-} CanTp_NSaType; /** req: CanTp256: .. */\r
+       uint32 CanTpNSa; /** @req CANTP254 */\r
+} CanTp_NSaType; /** @req CANTP253 */\r
 \r
 typedef struct {\r
-       uint32 CanTpNTa; /** req: CanTp255 */\r
-} CanTp_NTaType;\r
+       uint32 CanTpNTa; /** @req CANTP255 */ /* TODO John: Why is this 32-bit */\r
+} CanTp_NTaType; /** @req CANTP139 */\r
 \r
 typedef struct {\r
-       const uint32 CanTpRxNPduId; /** req: CanTp258: */\r
-       const uint32 CanTpRxNPduRef; /** req: CanTp257: */\r
-} CanTp_RxNPduType;\r
+       const uint32 CanTpRxNPduId; /** @req CANTP258 */\r
+       const uint32 CanTpRxNPduRef; /** @req CANTP257 */\r
+} CanTp_RxNPduType; /** @req CANTP256 */\r
 \r
 typedef struct {\r
-       const uint32 CanTpTxNPduId; /** req: CanTp258: */\r
-       const uint32 CanTpTxNPduRef; /** req: CanTp257: */\r
-} CanTp_TxNPduType;\r
+       const uint32 CanTpTxNPduId; /* TODO: Remove this? */\r
+       const uint32 CanTpTxNPduRef; /** @req CANTP275 */\r
+} CanTp_TxNPduType; /** @req CANTP274 */\r
 \r
 typedef struct {\r
-       const uint32 CanTpTxFcNPduRef; /** req: CanTp259: Reference to a PDU in the COM stack. */\r
-} CanTp_TxFcNPduType;\r
+       const uint32 CanTpTxFcNPduRef; /** @req CANTP260 */ /* Reference to a PDU in the COM stack. */\r
+} CanTp_TxFcNPduType; /** @req CANTP259 */\r
 \r
 typedef struct {\r
-       const uint32 CanTpRxFcNPduRef; /** req: CanTp259: Reference to a PDU in the COM stack. */\r
-       const uint32 CanTpRxFcNPduId; /** req: CanTp274: */\r
-} CanTp_RxFcNPduType;\r
+       const uint32 CanTpRxFcNPduRef; /** @req CANTP272 */ /* Reference to a PDU in the COM stack. */\r
+       const uint32 CanTpRxFcNPduId; /** @req CANTP273 */\r
+} CanTp_RxFcNPduType; /** @req CANTP271 */\r
 \r
 \r
 typedef struct {\r
-       const int CanIf_CanTxPduId; // The polite CanIf PDU index.\r
-       const int PduR_CanTpTxPduId; // The polite PduR index.\r
-       const CanTp_AddressingFormantType CanTpAddressingFormant;\r
-       const uint32 CanTpBs; /** req: CanTp243: Sets the maximum number of messages of N-PDUs before flow control. */\r
-       const uint32 CanTpNar; /** req: CanTp244: Timeout for transmission of a CAN frame (ms). */\r
-       const uint32 CanTpNbr; /** req: CanTp245: ?? */\r
-       const uint32 CanTpNcr; /** req: CanTp246: Time out for consecutive frames (ms). */\r
-       const uint8 CanTpRxChannel; /* Connection to runtime variable index, see CanTp 266. */\r
-       const uint32 CanTpRxDI; /** req: CanTp248: Data length code for of this RxNsdu. */\r
-       CanTp_StateType CanTpRxPaddingActivation; /** req: CanTp249: Enable use of padding. */\r
-       CanTp_TaTypeType CanTpRxTaType; /** req: CanTp250: Functional or physical addressing. */\r
-       const uint8 CanTpWftMax; /** req: CanTp251: Max number FC wait that can be transmitted consecutively. */\r
-       const uint32 CanTpSTmin; /** req: CanTp252: Minimum time the sender shall wait between transmissions of two N-PDU. */\r
+       const PduIdType CanTp_FcPduId; // When recieving this Pdu this conf can be used (if TA match in extended).\r
+       const PduIdType CanIf_FcPduId; // The polite CanIf PDU index.\r
+       const PduIdType PduR_PduId; // The polite PduR index.\r
+       const CanTp_AddressingFormantType CanTpAddressingFormant;       /** @req CANTP242 */\r
+       const uint8 CanTpBs; /** @req CANTP243 */ /* Sets the maximum number of messages of N-PDUs before flow control. */\r
+       const uint16 CanTpNar; /** @req CANTP244 */ /* Timeout for transmission of a CAN frame (ms). */\r
+       const uint16 CanTpNbr; /** @req CANTP245 */\r
+       const uint16 CanTpNcr; /** @req CANTP246 */ /* Time out for consecutive frames (ms). */\r
+       const uint8 CanTpRxChannel; /** @req CANTP247 */ /* Connection to runtime variable index, see CanTp 266. */\r
+       const uint16 CanTpRxDI; /** @req CANTP248 */ /* Data length code for of this RxNsdu. */\r
+       CanTp_StateType CanTpRxPaddingActivation; /** @req CANTP249 */ /* Enable use of padding. */\r
+       CanTp_TaTypeType CanTpRxTaType; /** @req CANTP250 */ /* Functional or physical addressing. */\r
+       const uint8 CanTpWftMax; /** @req CANTP251 */ /* Max number FC wait that can be transmitted consecutively. */\r
+       const uint16 CanTpSTmin; /** @req CANTP252 */ /* Minimum time the sender shall wait between transmissions of two N-PDU. */\r
        /*const uint32                                                  CanTpNSduRef ** req: CanTp241. This is PDU id - typeless enum. */\r
-       CanTp_NSaType *CanTpNSa;\r
-       CanTp_NTaType *CanTpNTa;\r
+       const CanTp_NSaType *CanTpNSa;\r
+       const CanTp_NTaType *CanTpNTa;\r
        //CanTp_RxNPduType *CanTpRxNPdu;\r
        //CanTp_TxFcNPduType *CanTpTxFcNPdu;\r
        //const PduIdType CanTpRxPduId;\r
 \r
-} CanTp_RxNSduType;\r
+} CanTp_RxNSduType; /** @req CANTP137 */\r
 \r
 typedef struct {\r
-       const int CanIf_CanTxPduId; // The polite CanIf index.\r
-       const int PduR_CanTpTxPduId; // The polite PduR index.\r
-       const CanTp_AddressingFormantType CanTpAddressingMode; /** req: CanTp138: */\r
-       const uint8 CanTpNas; /** req: CanTp263: N_As timeout for transmission of any CAN frame. */\r
-       const uint8 CanTpNbs; /** req: CanTp264: N_Bs timeout of transmission until reception of next Flow Control. */\r
-       const uint8 CanTpNcs; /** req: CanTp265: N_Bs timeout of transmission until reception of next Flow Control. */\r
-       const uint8     CanTpTxChannel; /** req: CanTp266: Link to the TX connection channel (why?). */\r
-       const uint32 CanTpTxDI; /** req: CanTp267: Data length code for of this TxNsdu. */\r
+       const PduIdType CanIf_PduId; // The polite CanIf index.\r
+       const PduIdType PduR_PduId; // The polite PduR index.\r
+       const PduIdType CanTp_FcPduId;\r
+       const CanTp_AddressingFormantType CanTpAddressingMode; /** @req CANTP262 */\r
+       const uint16 CanTpNas; /** @req CANTP263 */ /* N_As timeout for transmission of any CAN frame. */\r
+       const uint16 CanTpNbs; /** @req CANTP264 */ /* N_Bs timeout of transmission until reception of next Flow Control. */\r
+       const uint16 CanTpNcs; /** @req CANTP265 */ /* N_Bs timeout of transmission until reception of next Flow Control. */\r
+       const uint8     CanTpTxChannel; /** @req CANTP266 */ /* Link to the TX connection channel (why?). */\r
+       const uint16 CanTpTxDI; /** @req CANTP267 */ /* Data length code for of this TxNsdu. */\r
        /*const uint32                                          CanTpTxNSduId; / ** req: CanTp268: Data length code for of this TxNsdu. */\r
-       CanTp_StateType CanTpTxPaddingActivation; /** req: CanTp249: Enable use of padding. */\r
-       CanTp_TaTypeType CanTpTxTaType; /** req: CanTp270: Functional or physical addressing. */\r
+       CanTp_StateType CanTpTxPaddingActivation; /** @req CANTP269 */ /* Enable use of padding. */\r
+       CanTp_TaTypeType CanTpTxTaType; /** @req CANTP270 */ /* Functional or physical addressing. */\r
        /*const uint32                                          CanTpNSduRef ** req: CanTp261. This is PDU id - typeless enum. */\r
-       CanTp_NSaType *CanTpNSa;\r
-       CanTp_NTaType *CanTpNTa;\r
+       const CanTp_NSaType *CanTpNSa;\r
+       const CanTp_NTaType *CanTpNTa;\r
        //CanTp_RxFcNPduType *CanTpRxFcNPdu;\r
        //CanTp_TxNPduType *CanTpTxNPdu;\r
        //PduIdType CanTpTxPduId;\r
 \r
-} CanTp_TxNSduType; /** req: CanTp138: */\r
+} CanTp_TxNSduType; /** @req CANTP138 */\r
 \r
 // - - - - - - - - - - -\r
 \r
-// These constants needs to move later.\r
-#define CANTP_DEV_ERROR_DETECT                                 STD_ON  /** req: CanTp239, development error detection on/off. */\r
-#define CANTP_MAIN_FUNCTION_PERIOD                             0.1250  /** req: CanTp240, allow to configure time for MainFunction. */\r
-#define CANTP_TC                                                               STD_ON  /** req: CanTp242, enabling transmit Cancellation. */\r
-\r
 typedef struct {\r
-       uint32 main_function_period; /** req: CanTp240: ?? */\r
-} CanTp_GeneralType;\r
+       uint32 main_function_period; /** @req CANTP240 */\r
+} CanTp_GeneralType; /** @req CANTP238 */\r
 \r
 // - - - - - - - - - - -\r
 \r
@@ -149,6 +158,12 @@ typedef struct {
        } configData;\r
 } CanTp_NSduType;\r
 \r
+typedef struct {\r
+       const CanTp_AddressingFormantType CanTpAddressingMode;\r
+       const PduIdType CanTpNSduIndex;\r
+       const PduIdType CanTpReferringTxIndex;\r
+} CanTp_RxIdType;\r
+\r
 // - - - - - - - - - - -\r
 \r
 /** Top level config container for CANTP implementation. */\r
@@ -159,6 +174,8 @@ typedef struct {
        /** */\r
        const CanTp_NSduType *CanTpNSduList;\r
 \r
+       const CanTp_RxIdType *CanTpRxIdList;\r
+\r
        /**  */\r
        //const CanTp_RxNSduType        *CanTpRxNSduList;\r
 \r