27#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__)
74#if CAN_ENFORCE_USE_CALLBACKS == FALSE
78#if CAN_USE_SLEEP_MODE == TRUE
83 canp->rxfull_cb = NULL;
84 canp->txempty_cb = NULL;
85 canp->error_cb = NULL;
86#if CAN_USE_SLEEP_MODE == TRUE
87 canp->wakeup_cb = NULL;
119#if defined(CAN_LLD_ENHANCED_API)
347#if (CAN_USE_SLEEP_MODE == TRUE) || defined(__DOXYGEN__)
370#if CAN_ENFORCE_USE_CALLBACKS == FALSE
395#if CAN_ENFORCE_USE_CALLBACKS == FALSE
void canWakeup(CANDriver *canp)
Enforces leaving the sleep mode.
void can_lld_receive(CANDriver *canp, canmbx_t mailbox, CANRxFrame *crfp)
Receives a frame from the input queue.
uint32_t canmbx_t
Type of a transmission mailbox index.
#define CAN_ANY_MAILBOX
Special mailbox identifier.
void canInit(void)
CAN Driver initialization.
void can_lld_transmit(CANDriver *canp, canmbx_t mailbox, const CANTxFrame *ctfp)
Inserts a frame into the transmit queue.
bool canTryTransmitI(CANDriver *canp, canmbx_t mailbox, const CANTxFrame *ctfp)
Can frame transmission attempt.
void canStop(CANDriver *canp)
Deactivates the CAN peripheral.
msg_t canTransmitTimeout(CANDriver *canp, canmbx_t mailbox, const CANTxFrame *ctfp, sysinterval_t timeout)
Can frame transmission.
void can_lld_abort(CANDriver *canp, canmbx_t mailbox)
Tries to abort an ongoing transmission.
void can_lld_wakeup(CANDriver *canp)
Enforces leaving the sleep mode.
void can_lld_sleep(CANDriver *canp)
Enters the sleep mode.
struct hal_can_config CANConfig
Type of a CAN configuration structure.
void canSleep(CANDriver *canp)
Enters the sleep mode.
void can_lld_init(void)
Low level CAN driver initialization.
void canTryAbortX(CANDriver *canp, canmbx_t mailbox)
Tries to abort an ongoing transmission.
#define CAN_RX_MAILBOXES
Number of receive mailboxes.
#define CAN_TX_MAILBOXES
Number of transmit mailboxes.
struct hal_can_driver CANDriver
Type of a structure representing an CAN driver.
msg_t canReceiveTimeout(CANDriver *canp, canmbx_t mailbox, CANRxFrame *crfp, sysinterval_t timeout)
Can frame receive.
msg_t canStart(CANDriver *canp, const CANConfig *config)
Configures and activates the CAN peripheral.
void can_lld_stop(CANDriver *canp)
Deactivates the CAN peripheral.
void canObjectInit(CANDriver *canp)
Initializes the standard part of a CANDriver structure.
bool can_lld_is_rx_nonempty(CANDriver *canp, canmbx_t mailbox)
Determines whether a frame has been received.
bool can_lld_is_tx_empty(CANDriver *canp, canmbx_t mailbox)
Determines whether a frame can be transmitted.
void can_lld_start(CANDriver *canp)
Configures and activates the CAN peripheral.
bool canTryReceiveI(CANDriver *canp, canmbx_t mailbox, CANRxFrame *crfp)
Can frame receive attempt.
msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp, sysinterval_t timeout)
Enqueues the caller thread.
static void osalSysLock(void)
Enters a critical zone from thread context.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg)
Dequeues and wakes up all threads from the queue.
static void osalThreadQueueObjectInit(threads_queue_t *tqp)
Initializes a threads queue object.
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
static void osalEventObjectInit(event_source_t *esp)
Initializes an event source object.
#define osalDbgAssert(c, remark)
Condition assertion.
#define osalDbgCheck(c)
Function parameters check.
void osalEventBroadcastFlagsI(event_source_t *esp, eventflags_t flags)
Add flags to an event source object.
#define osalDbgCheckClassI()
I-Class state check.
#define MSG_OK
Normal wakeup message.
#define MSG_RESET
Wakeup caused by a reset condition.
uint64_t sysinterval_t
Type of time interval.
const CANConfig * config
Current configuration data.
canstate_t state
Driver state.
event_source_t sleep_event
Entering sleep state event.
event_source_t wakeup_event
Exiting sleep state event.
threads_queue_t txqueue
Transmission threads queue.
event_source_t error_event
A CAN bus error happened.
event_source_t rxfull_event
One or more frames become available.
event_source_t txempty_event
One or more transmission mailbox become available.
threads_queue_t rxqueue
Receive threads queue.