|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
can_types.h
Go to the documentation of this file.
1
17/*
18© [2024] Microchip Technology Inc. and its subsidiaries.
19
20 Subject to your compliance with these terms, you may use Microchip
21 software and any derivatives exclusively with Microchip products.
22 You are responsible for complying with 3rd party license terms
23 applicable to your use of 3rd party software (including open source
24 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35 THIS SOFTWARE.
36*/
37
38#ifndef CAN_TYPES_H
39#define CAN_TYPES_H
40
41// Section: Included Files
42
43#include <stdint.h>
44
52 struct CAN_MSG_FIELD
53{
54 unsigned int idType:1;
55 unsigned int frameType:1;
56 unsigned int dlc:4;
57 unsigned int formatType:1;
58 unsigned int brs:1;
59};
60
61
67 struct CAN_MSG_OBJ
68{
69 uint32_t msgId;
70 struct CAN_MSG_FIELD field;
71 uint8_t *data;
72};
73
79 enum CAN_MSG_OBJ_BRS_MODE
80{
81 CAN_NON_BRS_MODE = 0,
82 CAN_BRS_MODE = 1
83} ;
84
90 enum CAN_MSG_OBJ_ID_TYPE
91{
92 CAN_FRAME_STD = 0,
93 CAN_FRAME_EXT = 1,
94};
95
101 enum CAN_MSG_OBJ_FRAME_TYPE
102{
103 CAN_FRAME_DATA = 0,
104 CAN_FRAME_RTR = 1,
105};
106
112 enum CAN_MSG_OBJ_TYPE
113{
114 CAN_2_0_FORMAT = 0,
115 CAN_FD_FORMAT = 1
116};
117
123 enum CAN_TX_MSG_REQUEST_STATUS
124{
125 CAN_TX_MSG_REQUEST_SUCCESS = 0,
126 CAN_TX_MSG_REQUEST_DLC_EXCEED_ERROR = 1,
127 CAN_TX_MSG_REQUEST_BRS_ERROR = 2,
128 CAN_TX_MSG_REQUEST_FIFO_FULL = 3,
129};
130
136 enum CAN_OP_MODES
137{
138 CAN_NORMAL_FD_MODE = 0x0,
139 CAN_DISABLE_MODE = 0x1,
140 CAN_INTERNAL_LOOPBACK_MODE = 0x2,
141 CAN_LISTEN_ONLY_MODE = 0x3,
142 CAN_CONFIGURATION_MODE = 0x4,
143 CAN_EXTERNAL_LOOPBACK_MODE = 0x5,
144 CAN_NORMAL_2_0_MODE = 0x6,
145 CAN_RESTRICTED_OPERATION_MODE =0x7,
146};
147
153 enum CAN_OP_MODE_STATUS
154{
155 CAN_OP_MODE_REQUEST_SUCCESS,
156 CAN_OP_MODE_REQUEST_FAIL,
157 CAN_OP_MODE_SYS_ERROR_OCCURED
158};
159
165 enum CAN_TX_FIFO_STATUS
166{
167 CAN_TX_FIFO_FULL,
168 CAN_TX_FIFO_AVAILABLE,
169};
170
176 enum CAN_DLC
177{
178 // DLC_0 to DLC_8 for CAN 2.0 and CAN FD
179 DLC_0,
180 DLC_1,
181 DLC_2,
182 DLC_3,
183 DLC_4,
184 DLC_5,
185 DLC_6,
186 DLC_7,
187 DLC_8,
189 // <Supported only in CAN FD mode
190 // DLC_12 to DLC_64 for CAN FD
191 DLC_12,
192 DLC_16,
193 DLC_20,
194 DLC_24,
195 DLC_32,
196 DLC_48,
197 DLC_64,
198};
199
205 enum CAN_RX_FIFO_STATUS
206{
207 CAN_RX_MSG_NOT_AVAILABLE = 0x0,
208 CAN_RX_MSG_AVAILABLE = 0x1,
209 CAN_RX_MSG_OVERFLOW = 0x8
210};
211
212#endif //CAN_TYPES_H
CAN_DLC
CAN_DLC
Definition can_types.h:177
DLC_24
@ DLC_24
Definition can_types.h:194
DLC_0
@ DLC_0
Definition can_types.h:179
DLC_5
@ DLC_5
Definition can_types.h:184
DLC_20
@ DLC_20
Definition can_types.h:193
DLC_2
@ DLC_2
Definition can_types.h:181
DLC_12
@ DLC_12
Definition can_types.h:191
DLC_8
@ DLC_8
Definition can_types.h:187
DLC_16
@ DLC_16
Definition can_types.h:192
DLC_1
@ DLC_1
Definition can_types.h:180
DLC_48
@ DLC_48
Definition can_types.h:196
DLC_3
@ DLC_3
Definition can_types.h:182
DLC_4
@ DLC_4
Definition can_types.h:183
DLC_64
@ DLC_64
Definition can_types.h:197
DLC_6
@ DLC_6
Definition can_types.h:185
DLC_32
@ DLC_32
Definition can_types.h:195
DLC_7
@ DLC_7
Definition can_types.h:186
CAN_MSG_OBJ_ID_TYPE
CAN_MSG_OBJ_ID_TYPE
Definition can_types.h:91
CAN_FRAME_STD
@ CAN_FRAME_STD
Definition can_types.h:92
CAN_FRAME_EXT
@ CAN_FRAME_EXT
Definition can_types.h:93
CAN_MSG_OBJ_FRAME_TYPE
CAN_MSG_OBJ_FRAME_TYPE
Definition can_types.h:102
CAN_FRAME_DATA
@ CAN_FRAME_DATA
Definition can_types.h:103
CAN_FRAME_RTR
@ CAN_FRAME_RTR
Definition can_types.h:104
CAN_TX_FIFO_STATUS
CAN_TX_FIFO_STATUS
Definition can_types.h:166
CAN_TX_FIFO_AVAILABLE
@ CAN_TX_FIFO_AVAILABLE
Definition can_types.h:168
CAN_TX_FIFO_FULL
@ CAN_TX_FIFO_FULL
Definition can_types.h:167
CAN_MSG_OBJ_TYPE
CAN_MSG_OBJ_TYPE
Definition can_types.h:113
CAN_2_0_FORMAT
@ CAN_2_0_FORMAT
Definition can_types.h:114
CAN_FD_FORMAT
@ CAN_FD_FORMAT
Definition can_types.h:115
CAN_OP_MODE_STATUS
CAN_OP_MODE_STATUS
Definition can_types.h:154
CAN_OP_MODE_SYS_ERROR_OCCURED
@ CAN_OP_MODE_SYS_ERROR_OCCURED
Definition can_types.h:157
CAN_OP_MODE_REQUEST_FAIL
@ CAN_OP_MODE_REQUEST_FAIL
Definition can_types.h:156
CAN_OP_MODE_REQUEST_SUCCESS
@ CAN_OP_MODE_REQUEST_SUCCESS
Definition can_types.h:155
CAN_MSG_OBJ_BRS_MODE
CAN_MSG_OBJ_BRS_MODE
Definition can_types.h:80
CAN_BRS_MODE
@ CAN_BRS_MODE
Definition can_types.h:82
CAN_NON_BRS_MODE
@ CAN_NON_BRS_MODE
Definition can_types.h:81
CAN_TX_MSG_REQUEST_STATUS
CAN_TX_MSG_REQUEST_STATUS
Definition can_types.h:124
CAN_TX_MSG_REQUEST_BRS_ERROR
@ CAN_TX_MSG_REQUEST_BRS_ERROR
Definition can_types.h:127
CAN_TX_MSG_REQUEST_SUCCESS
@ CAN_TX_MSG_REQUEST_SUCCESS
Definition can_types.h:125
CAN_TX_MSG_REQUEST_DLC_EXCEED_ERROR
@ CAN_TX_MSG_REQUEST_DLC_EXCEED_ERROR
Definition can_types.h:126
CAN_TX_MSG_REQUEST_FIFO_FULL
@ CAN_TX_MSG_REQUEST_FIFO_FULL
Definition can_types.h:128
CAN_RX_FIFO_STATUS
CAN_RX_FIFO_STATUS
Definition can_types.h:206
CAN_RX_MSG_OVERFLOW
@ CAN_RX_MSG_OVERFLOW
Definition can_types.h:209
CAN_RX_MSG_NOT_AVAILABLE
@ CAN_RX_MSG_NOT_AVAILABLE
Definition can_types.h:207
CAN_RX_MSG_AVAILABLE
@ CAN_RX_MSG_AVAILABLE
Definition can_types.h:208
CAN_OP_MODES
CAN_OP_MODES
Definition can_types.h:137
CAN_LISTEN_ONLY_MODE
@ CAN_LISTEN_ONLY_MODE
Definition can_types.h:141
CAN_DISABLE_MODE
@ CAN_DISABLE_MODE
Definition can_types.h:139
CAN_RESTRICTED_OPERATION_MODE
@ CAN_RESTRICTED_OPERATION_MODE
Definition can_types.h:145
CAN_INTERNAL_LOOPBACK_MODE
@ CAN_INTERNAL_LOOPBACK_MODE
Definition can_types.h:140
CAN_NORMAL_FD_MODE
@ CAN_NORMAL_FD_MODE
Definition can_types.h:138
CAN_NORMAL_2_0_MODE
@ CAN_NORMAL_2_0_MODE
Definition can_types.h:144
CAN_EXTERNAL_LOOPBACK_MODE
@ CAN_EXTERNAL_LOOPBACK_MODE
Definition can_types.h:143
CAN_CONFIGURATION_MODE
@ CAN_CONFIGURATION_MODE
Definition can_types.h:142
CAN_MSG_FIELD
This data structure used to configure the message fields. Some of the fields formatType and brs data ...
Definition can_types.h:53
CAN_MSG_FIELD::frameType
unsigned int frameType
Definition can_types.h:55
CAN_MSG_FIELD::formatType
unsigned int formatType
Definition can_types.h:57
CAN_MSG_FIELD::dlc
unsigned int dlc
Definition can_types.h:56
CAN_MSG_FIELD::idType
unsigned int idType
Definition can_types.h:54
CAN_MSG_FIELD::brs
unsigned int brs
Definition can_types.h:58
CAN_MSG_OBJ
This data structure used to configure the CAN FD message object.
Definition can_types.h:68
CAN_MSG_OBJ::field
struct CAN_MSG_FIELD field
Definition can_types.h:70
CAN_MSG_OBJ::msgId
uint32_t msgId
Definition can_types.h:69
CAN_MSG_OBJ::data
uint8_t * data
Definition can_types.h:71