#include "common/phal_F4_F7/phal_F4_F7.h"
Go to the source code of this file.
|
|
#define | PHAL_CAN_TX_TIMEOUT (5000U) |
| |
|
#define | PHAL_CAN_INIT_TIMEOUT (5000U) |
| |
|
#define | PHAL_CAN_16MHz_500k (0x033a0001) |
| |
|
#define | PHAL_CAN_24MHz_500k (0x033a0002) |
| |
|
#define | PHAL_CAN_36MHz_500k (0x03270005) |
| |
|
#define | PHAL_CAN_42MHz_500k (0x034e0003) |
| |
|
#define | PHAL_CAN_16MHz_250k (0x003a0003) |
| |
|
#define | PHAL_CAN_24MHz_250k (0x003a0005) |
| |
|
#define | PHAL_CAN_36MHz_250k (0x003a0008) |
| |
|
| 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 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.
|
| |
|
bool | PHAL_txMailboxFree (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) |
| |
- Author
- Adam Busch (busch.nosp@m.8@pu.nosp@m.rdue..nosp@m.edu)
- Version
- 0.1
- Date
- 2021-03-20
- Copyright
- Copyright (c) 2021
◆ PHAL_initCAN()
| bool PHAL_initCAN |
( |
CAN_TypeDef * | bus, |
|
|
bool | test_mode, |
|
|
uint32_t | bit_rate ) |
Initilize CAN peripheral to bit_rate.
- Parameters
-
| test_mode | Initilize CAN peripheral for self test mode |
| bit_rate | Bit rate in bps (i.e. 500000) |
- Returns
- true Peripheral sucessfully initalized
-
false Peripheral stalled during initilization
◆ PHAL_txCANMessage()
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
-
| can | CAN peripheral to transmit with |
| msgId | Message ID |
- Returns
- true Sucessful TX of message.
-
false Unable to find empty message or transmit took too long.