Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
can1.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 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
214
224
225// Section: CAN1 Module APIs
226
233void CAN1_Initialize(void);
234
241void CAN1_Deinitialize(void);
242
251enum CAN_OP_MODE_STATUS CAN1_OperationModeSet(const enum CAN_OP_MODES requestMode);
252
262
273bool CAN1_Receive(struct CAN_MSG_OBJ *rxCanMsg);
274
286bool CAN1_ReceiveMessageGet(const enum CAN1_RX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *rxCanMsg);
287
298enum CAN_TX_MSG_REQUEST_STATUS CAN1_Transmit(const enum CAN1_TX_FIFO_CHANNELS fifoChannel, struct CAN_MSG_OBJ *txCanMsg);
299
309
318bool CAN1_IsBusOff(void);
319
329bool CAN1_IsTxErrorPassive(void);
330
342bool CAN1_IsTxErrorWarning(void);
343
353bool CAN1_IsTxErrorActive(void);
354
364bool CAN1_IsRxErrorPassive(void);
365
377bool CAN1_IsRxErrorWarning(void);
378
388bool CAN1_IsRxErrorActive(void);
389
398void CAN1_Sleep(void);
399
408uint8_t CAN1_ReceivedMessageCountGet(void);
409
419uint8_t CAN1_RX_FIFO_StatusGet(const enum CAN1_RX_FIFO_CHANNELS fifoNum);
420
429void CAN1_Tasks(void);
430
438void CAN1_InvalidMessageCallbackRegister(void (*handler)(void));
439
449
457void CAN1_BusWakeUpActivityCallbackRegister(void (*handler)(void));
458
468
476void CAN1_BusErrorCallbackRegister(void (*handler)(void));
477
486void CAN1_BusErrorCallback(void);
487
495void CAN1_ModeChangeCallbackRegister(void (*handler)(void));
496
505void CAN1_ModeChangeCallback(void);
506
514void CAN1_SystemErrorCallbackRegister(void (*handler)(void));
515
524void CAN1_SystemErrorCallback(void);
525
533void CAN1_TxAttemptCallbackRegister(void (*handler)(void));
534
543void CAN1_TxAttemptCallback(void);
544
552void CAN1_RxBufferOverFlowCallbackRegister(void (*handler)(void));
553
563#endif //_CAN1_H
@ CAN1_TXQ
Definition can1.h:212
@ CAN1_FIFO_1
Definition can1.h:222
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:978
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:1017
enum CAN_TX_FIFO_STATUS CAN1_TransmitFIFOStatusGet(const enum CAN1_TX_FIFO_CHANNELS fifoChannel)
Returns the CAN1 transmitter FIFO status.
Definition can1.c:794
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:707
bool CAN1_IsTxErrorActive(void)
Returns the transmit error active state.
Definition can1.c:916
bool CAN1_IsRxErrorWarning(void)
Returns the receive error warning state. If Receiver error counter is above 95 to below 128,...
Definition can1.c:890
void CAN1_TxAttemptCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:1012
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:84
void CAN1_Sleep(void)
Sets the CAN node in sleep mode.
Definition can1.c:927
uint8_t CAN1_RX_FIFO_StatusGet(const enum CAN1_RX_FIFO_CHANNELS fifoNum)
This returns the CAN1 receive FIFO status.
Definition can1.c:862
bool CAN1_Receive(struct CAN_MSG_OBJ *rxCanMsg)
Reads the received single message object.
Definition can1.c:661
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:965
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:991
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...
Definition can1.c:960
bool CAN1_IsRxErrorActive(void)
Returns the receive error active state.
Definition can1.c:895
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:1046
void CAN1_SystemErrorCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:999
bool CAN1_IsRxErrorPassive(void)
Returns the receive error passive state.
Definition can1.c:885
void CAN1_ModeChangeCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:986
void CAN1_InvalidMessageCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:947
bool CAN1_IsTxErrorWarning(void)
Returns the transmit error warning state. If Transmitter error counter is above 95 to below 128,...
Definition can1.c:911
bool CAN1_IsTxErrorPassive(void)
Returns the transmit error passive state.
Definition can1.c:906
CAN1_TX_FIFO_CHANNELS
This enumeration defines the can Transmit FIFO Configured in MCC Melody CAN user interface.
Definition can1.h:211
uint8_t CAN1_ReceivedMessageCountGet(void)
Returns the number of CAN messages received in all the FIFO.
Definition can1.c:812
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:880
void CAN1_BusErrorCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:973
void CAN1_RxBufferOverFlowCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition can1.c:1025
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:746
void CAN1_Initialize(void)
Initializes CAN1 module.
Definition can1.c:547
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:939
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:952
CAN1_RX_FIFO_CHANNELS
This enumeration defines the can receive FIFO.
Definition can1.h:221
void CAN1_Deinitialize(void)
Deinitializes CAN1 to POR values.
Definition can1.c:590
enum CAN_OP_MODES CAN1_OperationModeGet(void)
Get the CAN1 operation mode.
Definition can1.c:656
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:1004
enum CAN_OP_MODE_STATUS CAN1_OperationModeSet(const enum CAN_OP_MODES requestMode)
Sets the CAN1 operation mode.
Definition can1.c:629
Structure containing the function pointers of CAN driver.
This data structure used to configure the CAN FD message object.
Definition can_types.h:68