1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
16 /** @req CANTP160 */
\r
18 #ifndef CANTP_TYPES_H_
\r
19 #define CANTP_TYPES_H_
\r
21 #include "Platform_Types.h"
\r
22 #include "ComStack_Types.h"
\r
24 // - - - - - - - - - - -
\r
27 CANTP_NOT_LAST_ENTRY, CANTP_END_OF_LIST
\r
28 } CanTp_ListItemType;
\r
32 CANTP_EXTENDED, CANTP_STANDARD
\r
33 } CanTp_AddressingFormantType;
\r
39 typedef enum { /* req: CanTp030 */
\r
41 CANTP_RX_PROCESSING,
\r
44 } CanTp_TransferInstanceMode;
\r
48 CANTP_FUNCTIONAL, CANTP_PHYSICAL
\r
53 uint32 CanTpNSa; /** req: CanTp254 */
\r
54 } CanTp_NSaType; /** req: CanTp256: .. */
\r
57 uint32 CanTpNTa; /** req: CanTp255 */
\r
61 const uint32 CanTpRxNPduId; /** req: CanTp258: */
\r
62 const uint32 CanTpRxNPduRef; /** req: CanTp257: */
\r
66 const uint32 CanTpTxNPduId; /** req: CanTp258: */
\r
67 const uint32 CanTpTxNPduRef; /** req: CanTp257: */
\r
71 const uint32 CanTpTxFcNPduRef; /** req: CanTp259: Reference to a PDU in the COM stack. */
\r
72 } CanTp_TxFcNPduType;
\r
75 const uint32 CanTpRxFcNPduRef; /** req: CanTp259: Reference to a PDU in the COM stack. */
\r
76 const uint32 CanTpRxFcNPduId; /** req: CanTp274: */
\r
77 } CanTp_RxFcNPduType;
\r
81 const int CanIf_FcPduId; // The polite CanIf PDU index.
\r
82 const int PduR_PduId; // The polite PduR index.
\r
83 const CanTp_AddressingFormantType CanTpAddressingFormant;
\r
84 const uint32 CanTpBs; /** req: CanTp243: Sets the maximum number of messages of N-PDUs before flow control. */
\r
85 const uint32 CanTpNar; /** req: CanTp244: Timeout for transmission of a CAN frame (ms). */
\r
86 const uint32 CanTpNbr; /** req: CanTp245: ?? */
\r
87 const uint32 CanTpNcr; /** req: CanTp246: Time out for consecutive frames (ms). */
\r
88 const uint8 CanTpRxChannel; /* Connection to runtime variable index, see CanTp 266. */
\r
89 const uint32 CanTpRxDI; /** req: CanTp248: Data length code for of this RxNsdu. */
\r
90 CanTp_StateType CanTpRxPaddingActivation; /** req: CanTp249: Enable use of padding. */
\r
91 CanTp_TaTypeType CanTpRxTaType; /** req: CanTp250: Functional or physical addressing. */
\r
92 const uint8 CanTpWftMax; /** req: CanTp251: Max number FC wait that can be transmitted consecutively. */
\r
93 const uint32 CanTpSTmin; /** req: CanTp252: Minimum time the sender shall wait between transmissions of two N-PDU. */
\r
94 /*const uint32 CanTpNSduRef ** req: CanTp241. This is PDU id - typeless enum. */
\r
95 const CanTp_NSaType *CanTpNSa;
\r
96 const CanTp_NTaType *CanTpNTa;
\r
97 //CanTp_RxNPduType *CanTpRxNPdu;
\r
98 //CanTp_TxFcNPduType *CanTpTxFcNPdu;
\r
99 //const PduIdType CanTpRxPduId;
\r
101 } CanTp_RxNSduType;
\r
104 const int CanIf_PduId; // The polite CanIf index.
\r
105 const int PduR_PduId; // The polite PduR index.
\r
106 const CanTp_AddressingFormantType CanTpAddressingMode; /** req: CanTp138: */
\r
107 const uint8 CanTpNas; /** req: CanTp263: N_As timeout for transmission of any CAN frame. */
\r
108 const uint8 CanTpNbs; /** req: CanTp264: N_Bs timeout of transmission until reception of next Flow Control. */
\r
109 const uint8 CanTpNcs; /** req: CanTp265: N_Bs timeout of transmission until reception of next Flow Control. */
\r
110 const uint8 CanTpTxChannel; /** req: CanTp266: Link to the TX connection channel (why?). */
\r
111 const uint32 CanTpTxDI; /** req: CanTp267: Data length code for of this TxNsdu. */
\r
112 /*const uint32 CanTpTxNSduId; / ** req: CanTp268: Data length code for of this TxNsdu. */
\r
113 CanTp_StateType CanTpTxPaddingActivation; /** req: CanTp249: Enable use of padding. */
\r
114 CanTp_TaTypeType CanTpTxTaType; /** req: CanTp270: Functional or physical addressing. */
\r
115 /*const uint32 CanTpNSduRef ** req: CanTp261. This is PDU id - typeless enum. */
\r
116 const CanTp_NSaType *CanTpNSa;
\r
117 const CanTp_NTaType *CanTpNTa;
\r
118 //CanTp_RxFcNPduType *CanTpRxFcNPdu;
\r
119 //CanTp_TxNPduType *CanTpTxNPdu;
\r
120 //PduIdType CanTpTxPduId;
\r
122 } CanTp_TxNSduType; /** req: CanTp138: */
\r
124 // - - - - - - - - - - -
\r
126 // These constants needs to move later.
\r
127 #define CANTP_DEV_ERROR_DETECT STD_ON /** req: CanTp239, development error detection on/off. */
\r
128 #define CANTP_MAIN_FUNCTION_PERIOD 0.1250 /** req: CanTp240, allow to configure time for MainFunction. */
\r
129 #define CANTP_TC STD_ON /** req: CanTp242, enabling transmit Cancellation. */
\r
132 uint32 main_function_period; /** req: CanTp240: ?? */
\r
133 } CanTp_GeneralType;
\r
135 // - - - - - - - - - - -
\r
138 IS015765_TRANSMIT, ISO15765_RECEIVE
\r
139 } CanTp_DirectionType;
\r
142 // - - - - - - - - - - -
\r
145 const CanTp_DirectionType direction;
\r
146 const CanTp_ListItemType listItemType;
\r
148 const CanTp_RxNSduType CanTpRxNSdu;
\r
149 const CanTp_TxNSduType CanTpTxNSdu;
\r
153 // - - - - - - - - - - -
\r
155 /** Top level config container for CANTP implementation. */
\r
157 /** General configuration paramters for the CANTP module. */
\r
158 const CanTp_GeneralType *CanTpGeneral; // 10.2.3
\r
161 const CanTp_NSduType *CanTpNSduList;
\r
164 //const CanTp_RxNSduType *CanTpRxNSduList;
\r
166 /** This container contains the init parameters of the CAN Interface. */
\r
167 //const CanTp_TxNSduType *CanTpTxNSduList;
\r
169 } CanTp_ConfigType;
\r
171 #endif /* CANTP_TYPES_H_ */
\r