STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
|
Control functions. More...
Functions | |
uint32_t | HAL_CAN_GetError (CAN_HandleTypeDef *hcan) |
HAL_CAN_StateTypeDef | HAL_CAN_GetState (CAN_HandleTypeDef *hcan) |
HAL_StatusTypeDef | HAL_CAN_Start (CAN_HandleTypeDef *hcan) |
Start the CAN module. | |
HAL_StatusTypeDef | HAL_CAN_Stop (CAN_HandleTypeDef *hcan) |
Stop the CAN module and enable access to configuration registers. | |
HAL_StatusTypeDef | HAL_CAN_RequestSleep (CAN_HandleTypeDef *hcan) |
Request the sleep mode (low power) entry. When returning from this function, Sleep mode will be entered as soon as the current CAN activity (transmission or reception of a CAN frame) has been completed. | |
HAL_StatusTypeDef | HAL_CAN_WakeUp (CAN_HandleTypeDef *hcan) |
Wake up from sleep mode. When returning with HAL_OK status from this function, Sleep mode is exited. | |
uint32_t | HAL_CAN_IsSleepActive (const CAN_HandleTypeDef *hcan) |
Check is sleep mode is active. | |
HAL_StatusTypeDef | HAL_CAN_AddTxMessage (CAN_HandleTypeDef *hcan, const CAN_TxHeaderTypeDef *pHeader, const uint8_t aData[], uint32_t *pTxMailbox) |
Add a message to the first free Tx mailbox and activate the corresponding transmission request. | |
HAL_StatusTypeDef | HAL_CAN_AbortTxRequest (CAN_HandleTypeDef *hcan, uint32_t TxMailboxes) |
Abort transmission requests. | |
uint32_t | HAL_CAN_GetTxMailboxesFreeLevel (const CAN_HandleTypeDef *hcan) |
Return Tx Mailboxes free level: number of free Tx Mailboxes. | |
uint32_t | HAL_CAN_IsTxMessagePending (const CAN_HandleTypeDef *hcan, uint32_t TxMailboxes) |
Check if a transmission request is pending on the selected Tx Mailboxes. | |
uint32_t | HAL_CAN_GetTxTimestamp (const CAN_HandleTypeDef *hcan, uint32_t TxMailbox) |
Return timestamp of Tx message sent, if time triggered communication mode is enabled. | |
HAL_StatusTypeDef | HAL_CAN_GetRxMessage (CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]) |
Get an CAN frame from the Rx FIFO zone into the message RAM. | |
uint32_t | HAL_CAN_GetRxFifoFillLevel (const CAN_HandleTypeDef *hcan, uint32_t RxFifo) |
Return Rx FIFO fill level. | |
Control functions.
============================================================================== ##### Control functions ##### ============================================================================== [..] This section provides functions allowing to: (+) HAL_CAN_Start : Start the CAN module (+) HAL_CAN_Stop : Stop the CAN module (+) HAL_CAN_RequestSleep : Request sleep mode entry. (+) HAL_CAN_WakeUp : Wake up from sleep mode. (+) HAL_CAN_IsSleepActive : Check is sleep mode is active. (+) HAL_CAN_AddTxMessage : Add a message to the Tx mailboxes and activate the corresponding transmission request (+) HAL_CAN_AbortTxRequest : Abort transmission request (+) HAL_CAN_GetTxMailboxesFreeLevel : Return Tx mailboxes free level (+) HAL_CAN_IsTxMessagePending : Check if a transmission request is pending on the selected Tx mailbox (+) HAL_CAN_GetRxMessage : Get a CAN frame from the Rx FIFO (+) HAL_CAN_GetRxFifoFillLevel : Return Rx FIFO fill level
uint32_t HAL_CAN_GetError | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can_legacy.h>
HAL_CAN_StateTypeDef HAL_CAN_GetState | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can_legacy.h>
HAL_StatusTypeDef HAL_CAN_Start | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Start the CAN module.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
HAL | status |
Definition at line 1034 of file stm32f4xx_hal_can.c.
References CAN_TIMEOUT_VALUE, CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NONE, HAL_CAN_ERROR_NOT_READY, HAL_CAN_ERROR_TIMEOUT, HAL_CAN_STATE_ERROR, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_GetTick(), HAL_OK, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
HAL_StatusTypeDef HAL_CAN_Stop | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Stop the CAN module and enable access to configuration registers.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
HAL | status |
Definition at line 1086 of file stm32f4xx_hal_can.c.
References CAN_TIMEOUT_VALUE, CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NOT_STARTED, HAL_CAN_ERROR_TIMEOUT, HAL_CAN_STATE_ERROR, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_GetTick(), HAL_OK, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
Referenced by HAL_CAN_DeInit().
HAL_StatusTypeDef HAL_CAN_RequestSleep | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Request the sleep mode (low power) entry. When returning from this function, Sleep mode will be entered as soon as the current CAN activity (transmission or reception of a CAN frame) has been completed.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
HAL | status. |
Definition at line 1141 of file stm32f4xx_hal_can.c.
References CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
HAL_StatusTypeDef HAL_CAN_WakeUp | ( | CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Wake up from sleep mode. When returning with HAL_OK status from this function, Sleep mode is exited.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
HAL | status. |
Definition at line 1172 of file stm32f4xx_hal_can.c.
References CAN_WAKEUP_TIMEOUT_COUNTER, CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_ERROR_TIMEOUT, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
uint32_t HAL_CAN_IsSleepActive | ( | const CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Check is sleep mode is active.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
Status |
|
Definition at line 1219 of file stm32f4xx_hal_can.c.
References HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
HAL_StatusTypeDef HAL_CAN_AddTxMessage | ( | CAN_HandleTypeDef * | hcan, |
const CAN_TxHeaderTypeDef * | pHeader, | ||
const uint8_t | aData[], | ||
uint32_t * | pTxMailbox ) |
#include <stm32f4xx_hal_can.h>
Add a message to the first free Tx mailbox and activate the corresponding transmission request.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
pHeader | pointer to a CAN_TxHeaderTypeDef structure. |
aData | array containing the payload of the Tx frame. |
pTxMailbox | pointer to a variable where the function will return the TxMailbox used to store the Tx message. This parameter can be a value of
|
HAL | status |
Definition at line 1250 of file stm32f4xx_hal_can.c.
References assert_param, CAN_ID_STD, CAN_TxHeaderTypeDef::DLC, CAN_HandleTypeDef::ErrorCode, CAN_TxHeaderTypeDef::ExtId, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_ERROR_PARAM, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, CAN_TxHeaderTypeDef::IDE, CAN_HandleTypeDef::Instance, IS_CAN_DLC, IS_CAN_EXTID, IS_CAN_IDTYPE, IS_CAN_RTR, IS_CAN_STDID, CAN_TxHeaderTypeDef::RTR, CAN_HandleTypeDef::State, CAN_TxHeaderTypeDef::StdId, and CAN_TxHeaderTypeDef::TransmitGlobalTime.
HAL_StatusTypeDef HAL_CAN_AbortTxRequest | ( | CAN_HandleTypeDef * | hcan, |
uint32_t | TxMailboxes ) |
#include <stm32f4xx_hal_can.h>
Abort transmission requests.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
TxMailboxes | List of the Tx Mailboxes to abort. This parameter can be any combination of
|
HAL | status |
Definition at line 1350 of file stm32f4xx_hal_can.c.
References assert_param, CAN_TX_MAILBOX0, CAN_TX_MAILBOX1, CAN_TX_MAILBOX2, CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, CAN_HandleTypeDef::Instance, IS_CAN_TX_MAILBOX_LIST, and CAN_HandleTypeDef::State.
uint32_t HAL_CAN_GetTxMailboxesFreeLevel | ( | const CAN_HandleTypeDef * | hcan | ) |
#include <stm32f4xx_hal_can.h>
Return Tx Mailboxes free level: number of free Tx Mailboxes.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
Number | of free Tx Mailboxes. |
Definition at line 1399 of file stm32f4xx_hal_can.c.
References HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.
uint32_t HAL_CAN_IsTxMessagePending | ( | const CAN_HandleTypeDef * | hcan, |
uint32_t | TxMailboxes ) |
#include <stm32f4xx_hal_can.h>
Check if a transmission request is pending on the selected Tx Mailboxes.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
TxMailboxes | List of Tx Mailboxes to check. This parameter can be any combination of
|
Status |
|
Definition at line 1442 of file stm32f4xx_hal_can.c.
References assert_param, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, CAN_HandleTypeDef::Instance, IS_CAN_TX_MAILBOX_LIST, and CAN_HandleTypeDef::State.
uint32_t HAL_CAN_GetTxTimestamp | ( | const CAN_HandleTypeDef * | hcan, |
uint32_t | TxMailbox ) |
#include <stm32f4xx_hal_can.h>
Return timestamp of Tx message sent, if time triggered communication mode is enabled.
hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
TxMailbox | Tx Mailbox where the timestamp of message sent will be read. This parameter can be one value of
|
Timestamp | of message sent from Tx Mailbox. |
Definition at line 1474 of file stm32f4xx_hal_can.c.
References assert_param, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, CAN_HandleTypeDef::Instance, IS_CAN_TX_MAILBOX, and CAN_HandleTypeDef::State.
HAL_StatusTypeDef HAL_CAN_GetRxMessage | ( | CAN_HandleTypeDef * | hcan, |
uint32_t | RxFifo, | ||
CAN_RxHeaderTypeDef * | pHeader, | ||
uint8_t | aData[] ) |
#include <stm32f4xx_hal_can.h>
Get an CAN frame from the Rx FIFO zone into the message RAM.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
RxFifo | Fifo number of the received message to be read. This parameter can be a value of
|
pHeader | pointer to a CAN_RxHeaderTypeDef structure where the header of the Rx frame will be stored. |
aData | array where the payload of the Rx frame will be stored. |
HAL | status |
Definition at line 1508 of file stm32f4xx_hal_can.c.
References assert_param, CAN_ID_STD, CAN_RX_FIFO0, CAN_RxHeaderTypeDef::DLC, CAN_HandleTypeDef::ErrorCode, CAN_RxHeaderTypeDef::ExtId, CAN_RxHeaderTypeDef::FilterMatchIndex, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_ERROR_PARAM, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, CAN_RxHeaderTypeDef::IDE, CAN_HandleTypeDef::Instance, IS_CAN_RX_FIFO, CAN_RxHeaderTypeDef::RTR, CAN_HandleTypeDef::State, CAN_RxHeaderTypeDef::StdId, and CAN_RxHeaderTypeDef::Timestamp.
uint32_t HAL_CAN_GetRxFifoFillLevel | ( | const CAN_HandleTypeDef * | hcan, |
uint32_t | RxFifo ) |
#include <stm32f4xx_hal_can.h>
Return Rx FIFO fill level.
hcan | pointer to an CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
RxFifo | Rx FIFO. This parameter can be a value of
|
Number | of messages available in Rx FIFO. |
Definition at line 1608 of file stm32f4xx_hal_can.c.
References assert_param, CAN_RX_FIFO0, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, CAN_HandleTypeDef::Instance, IS_CAN_RX_FIFO, and CAN_HandleTypeDef::State.