PER Firmware
Loading...
Searching...
No Matches
can.c File Reference
Include dependency graph for can.c:

Functions

bool PHAL_initCAN (CAN_TypeDef *bus, bool test_mode, uint32_t bit_rate)
 Initilize CAN peripheral to bit_rate.
 
bool PHAL_deinitCAN (CAN_TypeDef *bus)
 
bool PHAL_txCANMessage (CanMsgTypeDef_t *msg, uint8_t txMbox)
 Find an empty TX mailbox and transmit a CAN message if one is found. Function will block until sucessful transmission of message until a specified timeout.
 
bool PHAL_txMailboxFree (CAN_TypeDef *bus, uint8_t mbx)
 
bool PHAL_anyTxMailboxFree (CAN_TypeDef *bus)
 
bool PHAL_getFreeTxMailbox (CAN_TypeDef *bus, uint8_t *mbx)
 
void PHAL_txCANAbort (CAN_TypeDef *bus, uint8_t mbx)
 
bool PHAL_rxCANMessage (CAN_TypeDef *bus, uint8_t fifo, CanMsgTypeDef_t *msg)
 
void PHAL_CAN_rxIRQ (CAN_TypeDef *bus, uint8_t fifo)
 
void __attribute__ ((weak))
 
void PHAL_CAN_txIRQ (CAN_TypeDef *bus)
 
void CAN1_TX_IRQHandler (void)
 
void CAN2_TX_IRQHandler (void)
 
void PHAL_CAN_txCallback (CAN_TypeDef *can)
 
void PHAL_CAN_rxCallback (CanMsgTypeDef_t *msg)
 

Variables

uint32_t APB1ClockRateHz
 

Function Documentation

◆ __attribute__()

void __attribute__ ( (weak) )
Here is the call graph for this function:

◆ CAN1_TX_IRQHandler()

void CAN1_TX_IRQHandler ( void )
Here is the call graph for this function:

◆ CAN2_TX_IRQHandler()

void CAN2_TX_IRQHandler ( void )
Here is the call graph for this function:

◆ PHAL_anyTxMailboxFree()

bool PHAL_anyTxMailboxFree ( CAN_TypeDef * bus)

◆ PHAL_CAN_rxCallback()

void PHAL_CAN_rxCallback ( CanMsgTypeDef_t * msg)
Here is the caller graph for this function:

◆ PHAL_CAN_rxIRQ()

void PHAL_CAN_rxIRQ ( CAN_TypeDef * bus,
uint8_t fifo )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_CAN_txCallback()

void PHAL_CAN_txCallback ( CAN_TypeDef * can)
Here is the caller graph for this function:

◆ PHAL_CAN_txIRQ()

void PHAL_CAN_txIRQ ( CAN_TypeDef * bus)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PHAL_deinitCAN()

bool PHAL_deinitCAN ( CAN_TypeDef * bus)

◆ PHAL_getFreeTxMailbox()

bool PHAL_getFreeTxMailbox ( CAN_TypeDef * bus,
uint8_t * mbx )

◆ PHAL_initCAN()

bool PHAL_initCAN ( CAN_TypeDef * bus,
bool test_mode,
uint32_t bit_rate )

Initilize CAN peripheral to bit_rate.

Parameters
test_modeInitilize CAN peripheral for self test mode
bit_rateBit rate in bps (i.e. 500000)
Returns
true Peripheral sucessfully initalized
false Peripheral stalled during initilization
Here is the caller graph for this function:

◆ PHAL_rxCANMessage()

bool PHAL_rxCANMessage ( CAN_TypeDef * bus,
uint8_t fifo,
CanMsgTypeDef_t * msg )
Here is the caller graph for this function:

◆ PHAL_txCANAbort()

void PHAL_txCANAbort ( CAN_TypeDef * bus,
uint8_t mbx )

◆ PHAL_txCANMessage()

bool PHAL_txCANMessage ( CanMsgTypeDef_t * msg,
uint8_t mbx )

Find an empty TX mailbox and transmit a CAN message if one is found. Function will block until sucessful transmission of message until a specified timeout.

Parameters
canCAN peripheral to transmit with
msgIdMessage ID
Returns
true Sucessful TX of message.
false Unable to find empty message or transmit took too long.

◆ PHAL_txMailboxFree()

bool PHAL_txMailboxFree ( CAN_TypeDef * bus,
uint8_t mbx )

Variable Documentation

◆ APB1ClockRateHz

uint32_t APB1ClockRateHz
extern