2 * Copyright (c) 2015-2016 ARM Limited. All rights reserved.
\r
4 * SPDX-License-Identifier: Apache-2.0
\r
6 * Licensed under the Apache License, Version 2.0 (the License); you may
\r
7 * not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
\r
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
18 * $Date: 7. December 2015
\r
21 * Project: CAN (Controller Area Network) Driver definitions
\r
29 #ifndef __DRIVER_CAN_H
\r
30 #define __DRIVER_CAN_H
\r
32 #include "Driver_Common.h"
\r
34 #define ARM_CAN_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1,0)/* API version */
\r
37 /****** CAN Bitrate selection codes *****/
\r
38 typedef enum _ARM_CAN_BITRATE_SELECT {
\r
39 ARM_CAN_BITRATE_NOMINAL, ///< Select nominal (flexible data-rate arbitration) bitrate
\r
40 ARM_CAN_BITRATE_FD_DATA ///< Select flexible data-rate data bitrate
\r
41 } ARM_CAN_BITRATE_SELECT;
\r
43 /****** CAN Bit Propagation Segment codes (PROP_SEG) *****/
\r
44 #define ARM_CAN_BIT_PROP_SEG_Pos 0UL ///< bits 7..0
\r
45 #define ARM_CAN_BIT_PROP_SEG_Msk (0xFFUL << ARM_CAN_BIT_PROP_SEG_Pos)
\r
46 #define ARM_CAN_BIT_PROP_SEG(x) (((x) << ARM_CAN_BIT_PROP_SEG_Pos) & ARM_CAN_BIT_PROP_SEG_Msk)
\r
48 /****** CAN Bit Phase Buffer Segment 1 (PHASE_SEG1) codes *****/
\r
49 #define ARM_CAN_BIT_PHASE_SEG1_Pos 8UL ///< bits 15..8
\r
50 #define ARM_CAN_BIT_PHASE_SEG1_Msk (0xFFUL << ARM_CAN_BIT_PHASE_SEG1_Pos)
\r
51 #define ARM_CAN_BIT_PHASE_SEG1(x) (((x) << ARM_CAN_BIT_PHASE_SEG1_Pos) & ARM_CAN_BIT_PHASE_SEG1_Msk)
\r
53 /****** CAN Bit Phase Buffer Segment 2 (PHASE_SEG2) codes *****/
\r
54 #define ARM_CAN_BIT_PHASE_SEG2_Pos 16UL ///< bits 23..16
\r
55 #define ARM_CAN_BIT_PHASE_SEG2_Msk (0xFFUL << ARM_CAN_BIT_PHASE_SEG2_Pos)
\r
56 #define ARM_CAN_BIT_PHASE_SEG2(x) (((x) << ARM_CAN_BIT_PHASE_SEG2_Pos) & ARM_CAN_BIT_PHASE_SEG2_Msk)
\r
58 /****** CAN Bit (Re)Synchronization Jump Width Segment (SJW) *****/
\r
59 #define ARM_CAN_BIT_SJW_Pos 24UL ///< bits 28..24
\r
60 #define ARM_CAN_BIT_SJW_Msk (0x1FUL << ARM_CAN_BIT_SJW_Pos)
\r
61 #define ARM_CAN_BIT_SJW(x) (((x) << ARM_CAN_BIT_SJW_Pos) & ARM_CAN_BIT_SJW_Msk)
\r
63 /****** CAN Mode codes *****/
\r
64 typedef enum _ARM_CAN_MODE {
\r
65 ARM_CAN_MODE_INITIALIZATION, ///< Initialization mode
\r
66 ARM_CAN_MODE_NORMAL, ///< Normal operation mode
\r
67 ARM_CAN_MODE_RESTRICTED, ///< Restricted operation mode
\r
68 ARM_CAN_MODE_MONITOR, ///< Bus monitoring mode
\r
69 ARM_CAN_MODE_LOOPBACK_INTERNAL, ///< Loopback internal mode
\r
70 ARM_CAN_MODE_LOOPBACK_EXTERNAL ///< Loopback external mode
\r
73 /****** CAN Filter Operation codes *****/
\r
74 typedef enum _ARM_CAN_FILTER_OPERATION {
\r
75 ARM_CAN_FILTER_ID_EXACT_ADD, ///< Add exact id filter
\r
76 ARM_CAN_FILTER_ID_EXACT_REMOVE, ///< Remove exact id filter
\r
77 ARM_CAN_FILTER_ID_RANGE_ADD, ///< Add range id filter
\r
78 ARM_CAN_FILTER_ID_RANGE_REMOVE, ///< Remove range id filter
\r
79 ARM_CAN_FILTER_ID_MASKABLE_ADD, ///< Add maskable id filter
\r
80 ARM_CAN_FILTER_ID_MASKABLE_REMOVE ///< Remove maskable id filter
\r
81 } ARM_CAN_FILTER_OPERATION;
\r
83 /****** CAN Object Configuration codes *****/
\r
84 typedef enum _ARM_CAN_OBJ_CONFIG {
\r
85 ARM_CAN_OBJ_INACTIVE, ///< CAN object inactive
\r
86 ARM_CAN_OBJ_TX, ///< CAN transmit object
\r
87 ARM_CAN_OBJ_RX, ///< CAN receive object
\r
88 ARM_CAN_OBJ_RX_RTR_TX_DATA, ///< CAN object that on RTR reception automatically transmits Data Frame
\r
89 ARM_CAN_OBJ_TX_RTR_RX_DATA ///< CAN object that transmits RTR and automatically receives Data Frame
\r
90 } ARM_CAN_OBJ_CONFIG;
\r
93 \brief CAN Object Capabilities
\r
95 typedef struct _ARM_CAN_OBJ_CAPABILITIES {
\r
96 uint32_t tx : 1; ///< Object supports transmission
\r
97 uint32_t rx : 1; ///< Object supports reception
\r
98 uint32_t rx_rtr_tx_data : 1; ///< Object supports RTR reception and automatic Data Frame transmission
\r
99 uint32_t tx_rtr_rx_data : 1; ///< Object supports RTR transmission and automatic Data Frame reception
\r
100 uint32_t multiple_filters : 1; ///< Object allows assignment of multiple filters to it
\r
101 uint32_t exact_filtering : 1; ///< Object supports exact identifier filtering
\r
102 uint32_t range_filtering : 1; ///< Object supports range identifier filtering
\r
103 uint32_t mask_filtering : 1; ///< Object supports mask identifier filtering
\r
104 uint32_t message_depth : 8; ///< Number of messages buffers (FIFO) for that object
\r
105 } ARM_CAN_OBJ_CAPABILITIES;
\r
107 /****** CAN Control Function Operation codes *****/
\r
108 #define ARM_CAN_CONTROL_Pos 0UL
\r
109 #define ARM_CAN_CONTROL_Msk (0xFFUL << ARM_CAN_CONTROL_Pos)
\r
110 #define ARM_CAN_SET_FD_MODE (1UL << ARM_CAN_CONTROL_Pos) ///< Set FD operation mode; arg: 0 = disable, 1 = enable
\r
111 #define ARM_CAN_ABORT_MESSAGE_SEND (2UL << ARM_CAN_CONTROL_Pos) ///< Abort sending of CAN message; arg = object
\r
112 #define ARM_CAN_CONTROL_RETRANSMISSION (3UL << ARM_CAN_CONTROL_Pos) ///< Enable/disable automatic retransmission; arg: 0 = disable, 1 = enable (default state)
\r
113 #define ARM_CAN_SET_TRANSCEIVER_DELAY (4UL << ARM_CAN_CONTROL_Pos) ///< Set transceiver delay; arg = delay in time quanta
\r
115 /****** CAN ID Frame Format codes *****/
\r
116 #define ARM_CAN_ID_IDE_Pos 31UL
\r
117 #define ARM_CAN_ID_IDE_Msk (1UL << ARM_CAN_ID_IDE_Pos)
\r
119 /****** CAN Identifier encoding *****/
\r
120 #define ARM_CAN_STANDARD_ID(id) (id & 0x000007FFUL) ///< CAN identifier in standard format (11-bits)
\r
121 #define ARM_CAN_EXTENDED_ID(id) ((id & 0x1FFFFFFFUL) | ARM_CAN_ID_IDE_Msk)///< CAN identifier in extended format (29-bits)
\r
124 \brief CAN Message Information
\r
126 typedef struct _ARM_CAN_MSG_INFO {
\r
127 uint32_t id; ///< CAN identifier with frame format specifier (bit 31)
\r
128 uint32_t rtr : 1; ///< Remote transmission request frame
\r
129 uint32_t edl : 1; ///< Flexible data-rate format extended data length
\r
130 uint32_t brs : 1; ///< Flexible data-rate format with bitrate switch
\r
131 uint32_t esi : 1; ///< Flexible data-rate format error state indicator
\r
132 uint32_t dlc : 4; ///< Data length code
\r
133 } ARM_CAN_MSG_INFO;
\r
135 /****** CAN specific error code *****/
\r
136 #define ARM_CAN_INVALID_BITRATE_SELECT (ARM_DRIVER_ERROR_SPECIFIC - 1) ///< Bitrate selection not supported
\r
137 #define ARM_CAN_INVALID_BITRATE (ARM_DRIVER_ERROR_SPECIFIC - 2) ///< Requested bitrate not supported
\r
138 #define ARM_CAN_INVALID_BIT_PROP_SEG (ARM_DRIVER_ERROR_SPECIFIC - 3) ///< Propagation segment value not supported
\r
139 #define ARM_CAN_INVALID_BIT_PHASE_SEG1 (ARM_DRIVER_ERROR_SPECIFIC - 4) ///< Phase segment 1 value not supported
\r
140 #define ARM_CAN_INVALID_BIT_PHASE_SEG2 (ARM_DRIVER_ERROR_SPECIFIC - 5) ///< Phase segment 2 value not supported
\r
141 #define ARM_CAN_INVALID_BIT_SJW (ARM_DRIVER_ERROR_SPECIFIC - 6) ///< SJW value not supported
\r
142 #define ARM_CAN_NO_MESSAGE_AVAILABLE (ARM_DRIVER_ERROR_SPECIFIC - 7) ///< Message is not available
\r
144 /****** CAN Status codes *****/
\r
145 #define ARM_CAN_UNIT_STATE_INACTIVE (0U) ///< Unit state: Not active on bus (initialize or error bus off)
\r
146 #define ARM_CAN_UNIT_STATE_ACTIVE (1U) ///< Unit state: Active on bus (can generate active error frame)
\r
147 #define ARM_CAN_UNIT_STATE_PASSIVE (2U) ///< Unit state: Error passive (can not generate active error frame)
\r
148 #define ARM_CAN_LEC_NO_ERROR (0U) ///< Last error code: No error
\r
149 #define ARM_CAN_LEC_BIT_ERROR (1U) ///< Last error code: Bit error
\r
150 #define ARM_CAN_LEC_STUFF_ERROR (2U) ///< Last error code: Bit stuffing error
\r
151 #define ARM_CAN_LEC_CRC_ERROR (3U) ///< Last error code: CRC error
\r
152 #define ARM_CAN_LEC_FORM_ERROR (4U) ///< Last error code: Illegal fixed-form bit
\r
153 #define ARM_CAN_LEC_ACK_ERROR (5U) ///< Last error code: Acknowledgement error
\r
158 typedef struct _ARM_CAN_STATUS {
\r
159 uint32_t unit_state : 4; ///< Unit bus state
\r
160 uint32_t last_error_code : 4; ///< Last error code
\r
161 uint32_t tx_error_count : 8; ///< Transmitter error count
\r
162 uint32_t rx_error_count : 8; ///< Receiver error count
\r
166 /****** CAN Unit Event *****/
\r
167 #define ARM_CAN_EVENT_UNIT_ACTIVE (1U) ///< Unit entered Error Active state
\r
168 #define ARM_CAN_EVENT_UNIT_WARNING (2U) ///< Unit entered Error Warning state (one or both error counters >= 96)
\r
169 #define ARM_CAN_EVENT_UNIT_PASSIVE (3U) ///< Unit entered Error Passive state
\r
170 #define ARM_CAN_EVENT_UNIT_BUS_OFF (4U) ///< Unit entered bus off state
\r
172 /****** CAN Send/Receive Event *****/
\r
173 #define ARM_CAN_EVENT_SEND_COMPLETE (1UL << 0) ///< Send complete
\r
174 #define ARM_CAN_EVENT_RECEIVE (1UL << 1) ///< Message received
\r
175 #define ARM_CAN_EVENT_RECEIVE_OVERRUN (1UL << 2) ///< Received message overrun
\r
178 // Function documentation
\r
180 \fn ARM_DRIVER_VERSION ARM_CAN_GetVersion (void)
\r
181 \brief Get driver version.
\r
182 \return \ref ARM_DRIVER_VERSION
\r
184 \fn ARM_CAN_CAPABILITIES ARM_CAN_GetCapabilities (void)
\r
185 \brief Get driver capabilities.
\r
186 \return \ref ARM_CAN_CAPABILITIES
\r
188 \fn int32_t ARM_CAN_Initialize (ARM_CAN_SignalUnitEvent_t cb_unit_event,
\r
189 ARM_CAN_SignalObjectEvent_t cb_object_event)
\r
190 \brief Initialize CAN interface and register signal (callback) functions.
\r
191 \param[in] cb_unit_event Pointer to \ref ARM_CAN_SignalUnitEvent callback function
\r
192 \param[in] cb_object_event Pointer to \ref ARM_CAN_SignalObjectEvent callback function
\r
193 \return \ref execution_status
\r
195 \fn int32_t ARM_CAN_Uninitialize (void)
\r
196 \brief De-initialize CAN interface.
\r
197 \return \ref execution_status
\r
199 \fn int32_t ARM_CAN_PowerControl (ARM_POWER_STATE state)
\r
200 \brief Control CAN interface power.
\r
201 \param[in] state Power state
\r
202 - \ref ARM_POWER_OFF : power off: no operation possible
\r
203 - \ref ARM_POWER_LOW : low power mode: retain state, detect and signal wake-up events
\r
204 - \ref ARM_POWER_FULL : power on: full operation at maximum performance
\r
205 \return \ref execution_status
\r
207 \fn uint32_t ARM_CAN_GetClock (void)
\r
208 \brief Retrieve CAN base clock frequency.
\r
209 \return base clock frequency
\r
211 \fn int32_t ARM_CAN_SetBitrate (ARM_CAN_BITRATE_SELECT select, uint32_t bitrate, uint32_t bit_segments)
\r
212 \brief Set bitrate for CAN interface.
\r
213 \param[in] select Bitrate selection
\r
214 - \ref ARM_CAN_BITRATE_NOMINAL : nominal (flexible data-rate arbitration) bitrate
\r
215 - \ref ARM_CAN_BITRATE_FD_DATA : flexible data-rate data bitrate
\r
216 \param[in] bitrate Bitrate
\r
217 \param[in] bit_segments Bit segments settings
\r
218 - \ref ARM_CAN_BIT_PROP_SEG(x) : number of time quanta for propagation time segment
\r
219 - \ref ARM_CAN_BIT_PHASE_SEG1(x) : number of time quanta for phase buffer segment 1
\r
220 - \ref ARM_CAN_BIT_PHASE_SEG2(x) : number of time quanta for phase buffer Segment 2
\r
221 - \ref ARM_CAN_BIT_SJW(x) : number of time quanta for (re-)synchronization jump width
\r
222 \return \ref execution_status
\r
224 \fn int32_t ARM_CAN_SetMode (ARM_CAN_MODE mode)
\r
225 \brief Set operating mode for CAN interface.
\r
226 \param[in] mode Operating mode
\r
227 - \ref ARM_CAN_MODE_INITIALIZATION : initialization mode
\r
228 - \ref ARM_CAN_MODE_NORMAL : normal operation mode
\r
229 - \ref ARM_CAN_MODE_RESTRICTED : restricted operation mode
\r
230 - \ref ARM_CAN_MODE_MONITOR : bus monitoring mode
\r
231 - \ref ARM_CAN_MODE_LOOPBACK_INTERNAL : loopback internal mode
\r
232 - \ref ARM_CAN_MODE_LOOPBACK_EXTERNAL : loopback external mode
\r
233 \return \ref execution_status
\r
235 \fn ARM_CAN_OBJ_CAPABILITIES ARM_CAN_ObjectGetCapabilities (uint32_t obj_idx)
\r
236 \brief Retrieve capabilities of an object.
\r
237 \param[in] obj_idx Object index
\r
238 \return \ref ARM_CAN_OBJ_CAPABILITIES
\r
240 \fn int32_t ARM_CAN_ObjectSetFilter (uint32_t obj_idx, ARM_CAN_FILTER_OPERATION operation, uint32_t id, uint32_t arg)
\r
241 \brief Add or remove filter for message reception.
\r
242 \param[in] obj_idx Object index of object that filter should be or is assigned to
\r
243 \param[in] operation Operation on filter
\r
244 - \ref ARM_CAN_FILTER_ID_EXACT_ADD : add exact id filter
\r
245 - \ref ARM_CAN_FILTER_ID_EXACT_REMOVE : remove exact id filter
\r
246 - \ref ARM_CAN_FILTER_ID_RANGE_ADD : add range id filter
\r
247 - \ref ARM_CAN_FILTER_ID_RANGE_REMOVE : remove range id filter
\r
248 - \ref ARM_CAN_FILTER_ID_MASKABLE_ADD : add maskable id filter
\r
249 - \ref ARM_CAN_FILTER_ID_MASKABLE_REMOVE : remove maskable id filter
\r
250 \param[in] id ID or start of ID range (depending on filter type)
\r
251 \param[in] arg Mask or end of ID range (depending on filter type)
\r
252 \return \ref execution_status
\r
254 \fn int32_t ARM_CAN_ObjectConfigure (uint32_t obj_idx, ARM_CAN_OBJ_CONFIG obj_cfg)
\r
255 \brief Configure object.
\r
256 \param[in] obj_idx Object index
\r
257 \param[in] obj_cfg Object configuration state
\r
258 - \ref ARM_CAN_OBJ_INACTIVE : deactivate object
\r
259 - \ref ARM_CAN_OBJ_RX : configure object for reception
\r
260 - \ref ARM_CAN_OBJ_TX : configure object for transmission
\r
261 - \ref ARM_CAN_OBJ_RX_RTR_TX_DATA : configure object that on RTR reception automatically transmits Data Frame
\r
262 - \ref ARM_CAN_OBJ_TX_RTR_RX_DATA : configure object that transmits RTR and automatically receives Data Frame
\r
263 \return \ref execution_status
\r
265 \fn int32_t ARM_CAN_MessageSend (uint32_t obj_idx, ARM_CAN_MSG_INFO *msg_info, const uint8_t *data, uint8_t size)
\r
266 \brief Send message on CAN bus.
\r
267 \param[in] obj_idx Object index
\r
268 \param[in] msg_info Pointer to CAN message information
\r
269 \param[in] data Pointer to data buffer
\r
270 \param[in] size Number of data bytes to send
\r
271 \return value >= 0 number of data bytes accepted to send
\r
272 \return value < 0 \ref execution_status
\r
274 \fn int32_t ARM_CAN_MessageRead (uint32_t obj_idx, ARM_CAN_MSG_INFO *msg_info, uint8_t *data, uint8_t size)
\r
275 \brief Read message received on CAN bus.
\r
276 \param[in] obj_idx Object index
\r
277 \param[out] msg_info Pointer to read CAN message information
\r
278 \param[out] data Pointer to data buffer for read data
\r
279 \param[in] size Maximum number of data bytes to read
\r
280 \return value >= 0 number of data bytes read
\r
281 \return value < 0 \ref execution_status
\r
283 \fn int32_t ARM_CAN_Control (uint32_t control, uint32_t arg)
\r
284 \brief Control CAN interface.
\r
285 \param[in] control Operation
\r
286 - \ref ARM_CAN_SET_FD_MODE : set FD operation mode
\r
287 - \ref ARM_CAN_ABORT_MESSAGE_SEND : abort sending of CAN message
\r
288 - \ref ARM_CAN_CONTROL_RETRANSMISSION : enable/disable automatic retransmission
\r
289 - \ref ARM_CAN_SET_TRANSCEIVER_DELAY : set transceiver delay
\r
290 \param[in] arg Argument of operation
\r
291 \return \ref execution_status
\r
293 \fn ARM_CAN_STATUS ARM_CAN_GetStatus (void)
\r
294 \brief Get CAN status.
\r
295 \return CAN status \ref ARM_CAN_STATUS
\r
297 \fn void ARM_CAN_SignalUnitEvent (uint32_t event)
\r
298 \brief Signal CAN unit event.
\r
299 \param[in] event \ref CAN_unit_events
\r
302 \fn void ARM_CAN_SignalObjectEvent (uint32_t obj_idx, uint32_t event)
\r
303 \brief Signal CAN object event.
\r
304 \param[in] obj_idx Object index
\r
305 \param[in] event \ref CAN_events
\r
309 typedef void (*ARM_CAN_SignalUnitEvent_t) (uint32_t event); ///< Pointer to \ref ARM_CAN_SignalUnitEvent : Signal CAN Unit Event.
\r
310 typedef void (*ARM_CAN_SignalObjectEvent_t) (uint32_t obj_idx, uint32_t event); ///< Pointer to \ref ARM_CAN_SignalObjectEvent : Signal CAN Object Event.
\r
314 \brief CAN Device Driver Capabilities.
\r
316 typedef struct _ARM_CAN_CAPABILITIES {
\r
317 uint32_t num_objects : 8; ///< Number of \ref can_objects available
\r
318 uint32_t reentrant_operation : 1; ///< Support for reentrant calls to \ref ARM_CAN_MessageSend, \ref ARM_CAN_MessageRead, \ref ARM_CAN_ObjectConfigure and abort message sending used by \ref ARM_CAN_Control
\r
319 uint32_t fd_mode : 1; ///< Support for CAN with flexible data-rate mode (CAN_FD) (set by \ref ARM_CAN_Control)
\r
320 uint32_t restricted_mode : 1; ///< Support for restricted operation mode (set by \ref ARM_CAN_SetMode)
\r
321 uint32_t monitor_mode : 1; ///< Support for bus monitoring mode (set by \ref ARM_CAN_SetMode)
\r
322 uint32_t internal_loopback : 1; ///< Support for internal loopback mode (set by \ref ARM_CAN_SetMode)
\r
323 uint32_t external_loopback : 1; ///< Support for external loopback mode (set by \ref ARM_CAN_SetMode)
\r
324 } ARM_CAN_CAPABILITIES;
\r
328 \brief Access structure of the CAN Driver.
\r
330 typedef struct _ARM_DRIVER_CAN {
\r
331 ARM_DRIVER_VERSION (*GetVersion) (void); ///< Pointer to \ref ARM_CAN_GetVersion : Get driver version.
\r
332 ARM_CAN_CAPABILITIES (*GetCapabilities) (void); ///< Pointer to \ref ARM_CAN_GetCapabilities : Get driver capabilities.
\r
333 int32_t (*Initialize) (ARM_CAN_SignalUnitEvent_t cb_unit_event,
\r
334 ARM_CAN_SignalObjectEvent_t cb_object_event); ///< Pointer to \ref ARM_CAN_Initialize : Initialize CAN interface.
\r
335 int32_t (*Uninitialize) (void); ///< Pointer to \ref ARM_CAN_Uninitialize : De-initialize CAN interface.
\r
336 int32_t (*PowerControl) (ARM_POWER_STATE state); ///< Pointer to \ref ARM_CAN_PowerControl : Control CAN interface power.
\r
337 uint32_t (*GetClock) (void); ///< Pointer to \ref ARM_CAN_GetClock : Retrieve CAN base clock frequency.
\r
338 int32_t (*SetBitrate) (ARM_CAN_BITRATE_SELECT select,
\r
340 uint32_t bit_segments); ///< Pointer to \ref ARM_CAN_SetBitrate : Set bitrate for CAN interface.
\r
341 int32_t (*SetMode) (ARM_CAN_MODE mode); ///< Pointer to \ref ARM_CAN_SetMode : Set operating mode for CAN interface.
\r
342 ARM_CAN_OBJ_CAPABILITIES (*ObjectGetCapabilities) (uint32_t obj_idx); ///< Pointer to \ref ARM_CAN_ObjectGetCapabilities : Retrieve capabilities of an object.
\r
343 int32_t (*ObjectSetFilter) (uint32_t obj_idx,
\r
344 ARM_CAN_FILTER_OPERATION operation,
\r
346 uint32_t arg); ///< Pointer to \ref ARM_CAN_ObjectSetFilter : Add or remove filter for message reception.
\r
347 int32_t (*ObjectConfigure) (uint32_t obj_idx,
\r
348 ARM_CAN_OBJ_CONFIG obj_cfg); ///< Pointer to \ref ARM_CAN_ObjectConfigure : Configure object.
\r
349 int32_t (*MessageSend) (uint32_t obj_idx,
\r
350 ARM_CAN_MSG_INFO *msg_info,
\r
351 const uint8_t *data,
\r
352 uint8_t size); ///< Pointer to \ref ARM_CAN_MessageSend : Send message on CAN bus.
\r
353 int32_t (*MessageRead) (uint32_t obj_idx,
\r
354 ARM_CAN_MSG_INFO *msg_info,
\r
356 uint8_t size); ///< Pointer to \ref ARM_CAN_MessageRead : Read message received on CAN bus.
\r
357 int32_t (*Control) (uint32_t control,
\r
358 uint32_t arg); ///< Pointer to \ref ARM_CAN_Control : Control CAN interface.
\r
359 ARM_CAN_STATUS (*GetStatus) (void); ///< Pointer to \ref ARM_CAN_GetStatus : Get CAN status.
\r
360 } const ARM_DRIVER_CAN;
\r
362 #endif /* __DRIVER_CAN_H */
\r