Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
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
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
This is the generated driver types header file for the CAN driver using CCL.
CAN_TX_FIFO_STATUS
Defines the CAN transmit status get Api return status.
Definition can_types.h:166
CAN_OP_MODE_STATUS
Defines the CAN operation set Api return status.
Definition can_types.h:154
CAN_TX_MSG_REQUEST_STATUS
Defines the CAN transmit Api return status.
Definition can_types.h:124
CAN_OP_MODES
Defines the CAN operation modes are available for the module to use.
Definition can_types.h:137
Structure containing the function pointers of CAN driver.
enum CAN_TX_FIFO_STATUS(* TransmitFIFOStatusGet)(const unsigned fifoChannel)
Pointer to CANx_TransmitFIFOStatusGet e.g. CAN1_TransmitFIFOStatusGet.
void(* RxBufferOverFlowCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_RxBufferOverFlowCallbackRegister e.g. CAN1_RxBufferOverFlowCallbackRegister.
void(* TxAttemptCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_TxAttemptCallbackRegister e.g. CAN1_TxAttemptCallbackRegister.
void(* Tasks)(void)
Pointer to CANx_Tasks e.g. CAN1_Tasks (Supported only in polling mode)
uint8_t(* RX_FIFO_StatusGet)(const unsigned fifoNum)
Pointer to CANx_RX_FIFO_StatusGet e.g. CAN1_RX_FIFO_StatusGet.
bool(* IsBusOff)(void)
Pointer to CANx_IsBusOff e.g. CAN1_IsBusOff.
bool(* IsRxErrorPassive)(void)
Pointer to CANx_IsRxErrorPassive e.g. CAN1_IsRxErrorPassive.
enum CAN_OP_MODE_STATUS(* OperationModeSet)(const enum CAN_OP_MODES requestMode)
Pointer to CANx_OperationModeSet e.g. CAN1_OperationModeSet.
void(* BusWakeUpActivityCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_BusWakeUpActivityCallbackRegister e.g. CAN1_BusWakeUpActivityCallbackRegister.
void(* BusErrorCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_BusErrorCallbackRegister e.g. CAN1_BusErrorCallbackRegister.
bool(* IsTxErrorActive)(void)
Pointer to CANx_IsTxErrorActive e.g. CAN1_IsTxErrorActive.
bool(* Receive)(struct CAN_MSG_OBJ *rxCanMsg)
Pointer to CANx_Receive e.g. CAN1_Receive.
void(* SystemErrorCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_SystemErrorCallbackRegister e.g. CAN1_SystemErrorCallbackRegister.
bool(* IsTxErrorPassive)(void)
Pointer to CANx_IsTxErrorPassive e.g. CAN1_IsTxErrorPassive.
void(* ModeChangeCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_ModeChangeCallbackRegister e.g. CAN1_ModeChangeCallbackRegister.
enum CAN_TX_MSG_REQUEST_STATUS(* Transmit)(const unsigned fifoChannel, struct CAN_MSG_OBJ *txCanMsg)
Pointer to CANx_Transmit e.g. CAN1_Transmit.
bool(* IsRxErrorWarning)(void)
Pointer to CANx_IsRxErrorWarning e.g. CAN1_IsRxErrorWarning.
void(* InvalidMessageCallbackRegister)(void(*CallbackHandler)(void))
Pointer to CANx_InvalidMessageCallbackRegister e.g. CAN1_InvalidMessageCallbackRegister.
void(* Deinitialize)(void)
Pointer to CANx_Deinitialize e.g. CAN1_Deinitialize.
bool(* IsTxErrorWarning)(void)
Pointer to CANx_IsTxErrorWarning e.g. CAN1_IsTxErrorWarning.
uint8_t(* ReceivedMessageCountGet)(void)
Pointer to CANx_ReceivedMessageCountGet e.g. CAN1_ReceivedMessageCountGet.
enum CAN_OP_MODES(* OperationModeGet)(void)
Pointer to CANx_OperationModeGet e.g. CAN1_OperationModeGet.
bool(* IsRxErrorActive)(void)
Pointer to CANx_IsRxErrorActive e.g. CAN1_IsRxErrorActive.
void(* SleepMode)(void)
Pointer to CANx_Sleep e.g. CAN1_Sleep.
void(* Initialize)(void)
Pointer to CANx_Initialize e.g. CAN1_Initialize.
bool(* ReceiveMessageGet)(const unsigned fifoChannel, struct CAN_MSG_OBJ *rxCanMsg)
Pointer to CANx_ReceiveMessageGet e.g. CAN1_ReceiveMessageGet.
This data structure used to configure the CAN FD message object.
Definition can_types.h:68