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

Loading...
Searching...
No Matches
can_interface.h
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_INTERFACE_H
39#define CAN_INTERFACE_H
40
41// Section: Included Files
42
43#include <stdbool.h>
44#include <stdint.h>
45#include "can_types.h"
46
47// Section: Data Type Definitions
48
54 struct CAN_INTERFACE
55{
56 void (*Initialize)(void);
58
59 void (*Deinitialize)(void);
61
62 enum CAN_OP_MODE_STATUS (*OperationModeSet)(const enum CAN_OP_MODES requestMode);
64
65 enum CAN_OP_MODES (*OperationModeGet)(void);
67
68 void (*SleepMode)(void);
70
71 bool (*IsBusOff)(void);
73
74 enum CAN_TX_MSG_REQUEST_STATUS (*Transmit)(const unsigned fifoChannel, struct CAN_MSG_OBJ *txCanMsg);
76
77 enum CAN_TX_FIFO_STATUS (*TransmitFIFOStatusGet)(const unsigned fifoChannel);
79
80 bool (*IsTxErrorPassive)(void);
82
83 bool (*IsTxErrorWarning)(void);
85
86 bool (*IsTxErrorActive)(void);
88
89 bool (*Receive)(struct CAN_MSG_OBJ *rxCanMsg);
91
92 bool (*ReceiveMessageGet)(const unsigned fifoChannel, struct CAN_MSG_OBJ *rxCanMsg);
94
95 bool (*IsRxErrorPassive)(void);
97
98 bool (*IsRxErrorWarning)(void);
100
101 bool (*IsRxErrorActive)(void);
103
104 uint8_t (*ReceivedMessageCountGet)(void);
106
107 uint8_t (*RX_FIFO_StatusGet)(const unsigned fifoNum);
109
110 void (*InvalidMessageCallbackRegister)(void (*CallbackHandler)(void));
112
113 void (*BusWakeUpActivityCallbackRegister)(void (*CallbackHandler)(void));
115
116 void (*BusErrorCallbackRegister)(void (*CallbackHandler)(void));
118
119 void (*ModeChangeCallbackRegister)(void (*CallbackHandler)(void));
121
122 void (*SystemErrorCallbackRegister)(void (*CallbackHandler)(void));
124
125 void (*TxAttemptCallbackRegister)(void (*CallbackHandler)(void));
127
128 void (*RxBufferOverFlowCallbackRegister)(void (*CallbackHandler)(void));
130
131 void (*Tasks)(void);
133};
134
135#endif
136
can_types.h
This is the generated driver types header file for the CAN driver using CCL.
CAN_TX_FIFO_STATUS
CAN_TX_FIFO_STATUS
Definition can_types.h:166
CAN_OP_MODE_STATUS
CAN_OP_MODE_STATUS
Definition can_types.h:154
CAN_TX_MSG_REQUEST_STATUS
CAN_TX_MSG_REQUEST_STATUS
Definition can_types.h:124
CAN_OP_MODES
CAN_OP_MODES
Definition can_types.h:137
CAN_INTERFACE
Structure containing the function pointers of CAN driver.
Definition can_interface.h:55
CAN_INTERFACE::TransmitFIFOStatusGet
enum CAN_TX_FIFO_STATUS(* TransmitFIFOStatusGet)(const unsigned fifoChannel)
Pointer to CANx_TransmitFIFOStatusGet e.g. CAN1_TransmitFIFOStatusGet.
Definition can_interface.h:77
CAN_INTERFACE::RxBufferOverFlowCallbackRegister
void(* RxBufferOverFlowCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_RxBufferOverFlowCallbackRegister e.g. CAN1_RxBufferOverFlowCallbackRegister.
Definition can_interface.h:128
CAN_INTERFACE::TxAttemptCallbackRegister
void(* TxAttemptCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_TxAttemptCallbackRegister e.g. CAN1_TxAttemptCallbackRegister.
Definition can_interface.h:125
CAN_INTERFACE::Tasks
void(* Tasks)(void)
Pointer to CANx_Tasks e.g. CAN1_Tasks (Supported only in polling mode)
Definition can_interface.h:131
CAN_INTERFACE::RX_FIFO_StatusGet
uint8_t(* RX_FIFO_StatusGet)(const unsigned fifoNum)
Pointer to CANx_RX_FIFO_StatusGet e.g. CAN1_RX_FIFO_StatusGet.
Definition can_interface.h:107
CAN_INTERFACE::IsBusOff
bool(* IsBusOff)(void)
Pointer to CANx_IsBusOff e.g. CAN1_IsBusOff.
Definition can_interface.h:71
CAN_INTERFACE::IsRxErrorPassive
bool(* IsRxErrorPassive)(void)
Pointer to CANx_IsRxErrorPassive e.g. CAN1_IsRxErrorPassive.
Definition can_interface.h:95
CAN_INTERFACE::OperationModeSet
enum CAN_OP_MODE_STATUS(* OperationModeSet)(const enum CAN_OP_MODES requestMode)
Pointer to CANx_OperationModeSet e.g. CAN1_OperationModeSet.
Definition can_interface.h:62
CAN_INTERFACE::BusWakeUpActivityCallbackRegister
void(* BusWakeUpActivityCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_BusWakeUpActivityCallbackRegister e.g. CAN1_BusWakeUpActivityCallbackRegister.
Definition can_interface.h:113
CAN_INTERFACE::BusErrorCallbackRegister
void(* BusErrorCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_BusErrorCallbackRegister e.g. CAN1_BusErrorCallbackRegister.
Definition can_interface.h:116
CAN_INTERFACE::IsTxErrorActive
bool(* IsTxErrorActive)(void)
Pointer to CANx_IsTxErrorActive e.g. CAN1_IsTxErrorActive.
Definition can_interface.h:86
CAN_INTERFACE::Receive
bool(* Receive)(struct CAN_MSG_OBJ *rxCanMsg)
Pointer to CANx_Receive e.g. CAN1_Receive.
Definition can_interface.h:89
CAN_INTERFACE::SystemErrorCallbackRegister
void(* SystemErrorCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_SystemErrorCallbackRegister e.g. CAN1_SystemErrorCallbackRegister.
Definition can_interface.h:122
CAN_INTERFACE::IsTxErrorPassive
bool(* IsTxErrorPassive)(void)
Pointer to CANx_IsTxErrorPassive e.g. CAN1_IsTxErrorPassive.
Definition can_interface.h:80
CAN_INTERFACE::ModeChangeCallbackRegister
void(* ModeChangeCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_ModeChangeCallbackRegister e.g. CAN1_ModeChangeCallbackRegister.
Definition can_interface.h:119
CAN_INTERFACE::Transmit
enum CAN_TX_MSG_REQUEST_STATUS(* Transmit)(const unsigned fifoChannel, struct CAN_MSG_OBJ *txCanMsg)
Pointer to CANx_Transmit e.g. CAN1_Transmit.
Definition can_interface.h:74
CAN_INTERFACE::IsRxErrorWarning
bool(* IsRxErrorWarning)(void)
Pointer to CANx_IsRxErrorWarning e.g. CAN1_IsRxErrorWarning.
Definition can_interface.h:98
CAN_INTERFACE::InvalidMessageCallbackRegister
void(* InvalidMessageCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_InvalidMessageCallbackRegister e.g. CAN1_InvalidMessageCallbackRegister.
Definition can_interface.h:110
CAN_INTERFACE::Deinitialize
void(* Deinitialize)(void)
Pointer to CANx_Deinitialize e.g. CAN1_Deinitialize.
Definition can_interface.h:59
CAN_INTERFACE::IsTxErrorWarning
bool(* IsTxErrorWarning)(void)
Pointer to CANx_IsTxErrorWarning e.g. CAN1_IsTxErrorWarning.
Definition can_interface.h:83
CAN_INTERFACE::ReceivedMessageCountGet
uint8_t(* ReceivedMessageCountGet)(void)
Pointer to CANx_ReceivedMessageCountGet e.g. CAN1_ReceivedMessageCountGet.
Definition can_interface.h:104
CAN_INTERFACE::OperationModeGet
enum CAN_OP_MODES(* OperationModeGet)(void)
Pointer to CANx_OperationModeGet e.g. CAN1_OperationModeGet.
Definition can_interface.h:65
CAN_INTERFACE::IsRxErrorActive
bool(* IsRxErrorActive)(void)
Pointer to CANx_IsRxErrorActive e.g. CAN1_IsRxErrorActive.
Definition can_interface.h:101
CAN_INTERFACE::SleepMode
void(* SleepMode)(void)
Pointer to CANx_Sleep e.g. CAN1_Sleep.
Definition can_interface.h:68
CAN_INTERFACE::Initialize
void(* Initialize)(void)
Pointer to CANx_Initialize e.g. CAN1_Initialize.
Definition can_interface.h:56
CAN_INTERFACE::ReceiveMessageGet
bool(* ReceiveMessageGet)(const unsigned fifoChannel, struct CAN_MSG_OBJ *rxCanMsg)
Pointer to CANx_ReceiveMessageGet e.g. CAN1_ReceiveMessageGet.
Definition can_interface.h:92
CAN_MSG_OBJ
This data structure used to configure the CAN FD message object.
Definition can_types.h:68