Bar Logo 4kW dsPIC33C PSFB DC-DC DA (Part-No. )
 
Content
     
Loading...
Searching...
No Matches
can1.h
Go to the documentation of this file.
1
17/*
18© [2025] 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 CAN1_H
39#define CAN1_H
40
41// Section: Included Files
42
43#include <xc.h>
44#include <stdbool.h>
45#include <stdint.h>
46#include "can_types.h"
47#include "can_interface.h"
48
49// Section: Data Type Definitions
50
59extern const struct CAN_INTERFACE CAN_FD1;
64#define CAN_FD1_Initialize CAN1_Initialize
69#define CAN_FD1_Deinitialize CAN1_Deinitialize
74#define CAN_FD1_OperationModeSet CAN1_OperationModeSet
79#define CAN_FD1_OperationModeGet CAN1_OperationModeGet
84#define CAN_FD1_Receive CAN1_Receive
89#define CAN_FD1_ReceiveMessageGet CAN1_ReceiveMessageGet
94#define CAN_FD1_RX_FIFO_StatusGet CAN1_RX_FIFO_StatusGet
99#define CAN_FD1_Transmit CAN1_Transmit
104#define CAN_FD1_TransmitFIFOStatusGet CAN1_TransmitFIFOStatusGet
109#define CAN_FD1_IsBusOff CAN1_IsBusOff
114#define CAN_FD1_IsTxErrorPassive CAN1_IsTxErrorPassive
119#define CAN_FD1_IsTxErrorWarning CAN1_IsTxErrorWarning
124#define CAN_FD1_IsTxErrorActive CAN1_IsTxErrorActive
129#define CAN_FD1_IsRxErrorPassive CAN1_IsRxErrorPassive
134#define CAN_FD1_IsRxErrorWarning CAN1_IsRxErrorWarning
139#define CAN_FD1_IsRxErrorActive CAN1_IsRxErrorActive
144#define CAN_FD1_Sleep CAN1_Sleep
149#define CAN_FD1_ReceivedMessageCountGet CAN1_ReceivedMessageCountGet
154#define CAN_FD1_Tasks CAN1_Tasks
159#define CAN_FD1_InvalidMessageCallbackRegister CAN1_InvalidMessageCallbackRegister
164#define CAN_FD1_BusWakeUpActivityCallbackRegister CAN1_BusWakeUpActivityCallbackRegister
169#define CAN_FD1_BusErrorCallbackRegister CAN1_BusErrorCallbackRegister
174#define CAN_FD1_ModeChangeCallbackRegister CAN1_ModeChangeCallbackRegister
179#define CAN_FD1_SystemErrorCallbackRegister CAN1_SystemErrorCallbackRegister
184#define CAN_FD1_TxAttemptCallbackRegister CAN1_TxAttemptCallbackRegister
189#define CAN_FD1_RxBufferOverFlowCallbackRegister CAN1_RxBufferOverFlowCallbackRegister
190
191
196#define CAN1_TX_TXQ CAN1_TXQ
202#define CAN1_RX_FIFO1 CAN1_FIFO_1
207#define CAN1_RX_FIFO2 CAN1_FIFO_2
219
230
231// Section: CAN1 Module APIs
232
239void CAN1_Initialize(void);
240
247void CAN1_Deinitialize(void);
248
257enum CAN_OP_MODE_STATUS CAN1_OperationModeSet(const enum CAN_OP_MODES requestMode);
258
268
279bool CAN1_Receive(struct CAN_MSG_OBJ *rxCanMsg);
280
292bool CAN1_ReceiveMessageGet(const enum CAN1_RX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *rxCanMsg);
293
304enum CAN_TX_MSG_REQUEST_STATUS CAN1_Transmit(const enum CAN1_TX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *txCanMsg);
305
315
324bool CAN1_IsBusOff(void);
325
335bool CAN1_IsTxErrorPassive(void);
336
348bool CAN1_IsTxErrorWarning(void);
349
359bool CAN1_IsTxErrorActive(void);
360
370bool CAN1_IsRxErrorPassive(void);
371
383bool CAN1_IsRxErrorWarning(void);
384
394bool CAN1_IsRxErrorActive(void);
395
404void CAN1_Sleep(void);
405
414uint8_t CAN1_ReceivedMessageCountGet(void);
415
425uint8_t CAN1_RX_FIFO_StatusGet(const enum CAN1_RX_FIFO_CHANNELS fifoNum);
426
435void CAN1_Tasks(void);
436
444void CAN1_InvalidMessageCallbackRegister(void (*handler)(void));
445
455
463void CAN1_BusWakeUpActivityCallbackRegister(void (*handler)(void));
464
474
482void CAN1_BusErrorCallbackRegister(void (*handler)(void));
483
493
501void CAN1_ModeChangeCallbackRegister(void (*handler)(void));
502
512
520void CAN1_SystemErrorCallbackRegister(void (*handler)(void));
521
531
539void CAN1_TxAttemptCallbackRegister(void (*handler)(void));
540
550
558void CAN1_RxBufferOverFlowCallbackRegister(void (*handler)(void));
559
569#endif //_CAN1_H
@ CAN1_TXQ
Definition can1.h:217
@ CAN1_FIFO_2
Definition can1.h:228
@ CAN1_FIFO_1
Definition can1.h:227
This is the generated driver types header file for the CAN driver using CCL.
void CAN1_ModeChangeCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_ModeCha...
Definition can1.c:1024
void CAN1_RxBufferOverFlowCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_RxBuffe...
Definition can1.c:1063
enum CAN_TX_FIFO_STATUS CAN1_TransmitFIFOStatusGet(const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
Returns the CAN1 transmitter FIFO status.
Definition can1.c:836
bool CAN1_ReceiveMessageGet(const enum CAN1_RX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *rxCanMsg)
Reads the received single message object from the CAN1 receive FIFO.
Definition can1.c:749
bool CAN1_IsTxErrorActive(void)
Returns the transmit error active state.
Definition can1.c:962
bool CAN1_IsRxErrorWarning(void)
Returns the receive error warning state. If Receiver error counter is above 95 to below 128,...
Definition can1.c:936
void CAN1_TxAttemptCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
const struct CAN_INTERFACE CAN_FD1
Structure object of type CAN_INTERFACE with the custom name given by the user in the Melody Driver Us...
Definition can1.c:83
void CAN1_Sleep(void)
Sets the CAN node in sleep mode.
Definition can1.c:973
uint8_t CAN1_RX_FIFO_StatusGet(const enum CAN1_RX_FIFO_CHANNELS fifoNum)
This returns the CAN1 receive FIFO status.
Definition can1.c:904
bool CAN1_Receive(struct CAN_MSG_OBJ *rxCanMsg)
Reads the received single message object.
Definition can1.c:703
void CAN1_BusErrorCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_BusErro...
Definition can1.c:1011
void CAN1_SystemErrorCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_SystemE...
Definition can1.c:1037
CAN_TX_FIFO_STATUS
Defines the CAN transmit status get Api return status.
Definition can_types.h:166
void CAN1_BusWakeUpActivityCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
bool CAN1_IsRxErrorActive(void)
Returns the receive error active state.
Definition can1.c:941
CAN_OP_MODE_STATUS
Defines the CAN operation set Api return status.
Definition can_types.h:154
void CAN1_Tasks(void)
This routine is used to implement the tasks for polled implementations.
Definition can1.c:1092
void CAN1_SystemErrorCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
bool CAN1_IsRxErrorPassive(void)
Returns the receive error passive state.
Definition can1.c:931
void CAN1_ModeChangeCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
void CAN1_InvalidMessageCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
bool CAN1_IsTxErrorWarning(void)
Returns the transmit error warning state. If Transmitter error counter is above 95 to below 128,...
Definition can1.c:957
bool CAN1_IsTxErrorPassive(void)
Returns the transmit error passive state.
Definition can1.c:952
CAN1_TX_FIFO_CHANNELS
This enumeration defines the can Transmit FIFO Configured in MCC Melody CAN user interface.
Definition can1.h:216
uint8_t CAN1_ReceivedMessageCountGet(void)
Returns the number of CAN messages received in all the FIFO.
Definition can1.c:854
CAN_TX_MSG_REQUEST_STATUS
Defines the CAN transmit Api return status.
Definition can_types.h:124
bool CAN1_IsBusOff(void)
Returns the bus off status.
Definition can1.c:926
void CAN1_BusErrorCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
void CAN1_RxBufferOverFlowCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
enum CAN_TX_MSG_REQUEST_STATUS CAN1_Transmit(const enum CAN1_TX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *txCanMsg)
Writes the CAN message object to specified transmit FIFO channel.
Definition can1.c:788
void CAN1_Initialize(void)
Initializes CAN1 module.
Definition can1.c:581
void CAN1_InvalidMessageCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_Invalid...
Definition can1.c:985
CAN_OP_MODES
Defines the CAN operation modes are available for the module to use.
Definition can_types.h:137
void CAN1_BusWakeUpActivityCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_BusWake...
Definition can1.c:998
CAN1_RX_FIFO_CHANNELS
This enumeration defines the can receive FIFO.
Definition can1.h:226
void CAN1_Deinitialize(void)
Deinitializes CAN1 to POR values.
Definition can1.c:624
enum CAN_OP_MODES CAN1_OperationModeGet(void)
Get the CAN1 operation mode.
Definition can1.c:698
void CAN1_TxAttemptCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for CAN1_TxAttem...
Definition can1.c:1050
enum CAN_OP_MODE_STATUS CAN1_OperationModeSet(const enum CAN_OP_MODES requestMode)
Sets the CAN1 operation mode.
Definition can1.c:671
Structure containing the function pointers of CAN driver.
This data structure used to configure the CAN FD message object.
Definition can_types.h:68