project
Fork of X_NUCLEO_IDB0XA1 by
STM32_BLUENRG_BLE_DMA_LP_Exported_Functions
[STM32_BLUENRG_BLE_DMA_LP]
Functions | |
void | BNRG_SPI_Close (void) |
Closes the SPI when BLE is disabled by the application Releases allocated resources. | |
void | BNRG_SPI_Init (void) |
Initializes the SPI communication with the BlueNRG Shield. | |
void | BNRG_MSP_SPI_Init (SPI_HandleTypeDef *hspi) |
Initializes the SPI communication with the BlueNRG Shield. | |
void | BlueNRG_RST (void) |
Resets the BlueNRG. | |
void | BlueNRG_SPI_Write (uint8_t *header_data, uint8_t *payload_data, uint8_t header_size, uint8_t payload_size) |
Writes data from local buffer to SPI. | |
void | BlueNRG_DMA_RxCallback (void) |
Tx and Rx Transfer completed callbacks. | |
void | BlueNRG_DMA_TxCallback (void) |
Tx and Rx Transfer completed callbacks. | |
void | BlueNRG_SPI_Request_Events (uint8_t *buffer, uint8_t buff_size) |
BlueNRG SPI request event. | |
void | BlueNRG_SPI_IRQ_Callback (void) |
BlueNRG SPI IRQ Callback. | |
static void | pf_nRFResetTimerCallBack (void) |
This function notify when then BlueNRG nRESET may be released. | |
static void | TimerTxRxCallback (void) |
Timer callback to handle RxTx Timers. | |
static void | ReceiveClosure (void) |
Close the receiver path. | |
static void | ProcessEndOfReceive (void) |
Delay Notification to the App to prevent dummy event read. | |
static void | TimerTransmitCallback (void) |
Timer callback to apply timeout SPI FIX. | |
static void | set_irq_as_output (void) |
Set in Output mode the IRQ. | |
static void | set_irq_as_input (void) |
Set the IRQ in input mode. | |
static void | Enable_SPI_Receiving_Path (void) |
Enable SPI IRQ. | |
static void | Disable_SPI_Receiving_Path (void) |
Disable SPI IRQ. | |
static void | Enable_SPI_CS (void) |
Enable SPI CS. | |
static void | Disable_SPI_CS (void) |
Disable SPI CS. | |
static void | DisableEnable_SPI_CS (void) |
Disable and Enable SPI CS. | |
static void | WakeupBlueNRG (void) |
Wakeup BlueNRG. | |
static void | TimerStartupCallback (void) |
Timer callback to apply timeout SPI FIX. | |
static void | TransmitClosure (void) |
Close the transmit mechanism after packet has been sent Wait for the event to come back. | |
static void | SPI_Transmit_Manager (SPI_TRANSMIT_REQUEST_t TransmitRequest) |
Manage the SPI transmit. | |
static void | SPI_Receive_Manager (SPI_RECEIVE_REQUEST_t ReceiveRequest) |
Manage the SPI receive. | |
static void | ReceiveHeader (SPI_RECEIVE_EVENT_t ReceiveEvent, uint8_t *DataHeader) |
Receive header. |
Function Documentation
void BlueNRG_DMA_RxCallback | ( | void | ) |
Tx and Rx Transfer completed callbacks.
- Parameters:
-
hspi,: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
- Return values:
-
None
The TCIF shall be cleared to be able to start a new DMA transmission later on when required. When receiving data, the TCIE is not set as there is no need to handle the interrupt handler of the DMA_Tx. The TCIF clearing is mandatory on STM32F4 but not on STM32L0. In order to keep code identical across platform, the TCIF clearing may be kept as well on the STM32L0 and all other MCUs.
This USE CASE shall never happen as this may break the IRQ/CS specification The IRQ line shall never be low when CS is low to avoid BlueNRG race condition when entering low power mode the SPI_END_RECEIVE_FIX has been implemented to make sure this USE CASE never occurs However, even when the behavior is not compliant to the specification, the BlueNRG may not fail so it is increasing robustness by adding this checking just in case the timeout define in the workaround is too short which will end up to marginally brake the specification. This checking will poping BluenRG for a dummy even
< BlueNRG not ready for reading
< BlueNRG is ready for reading
< BlueNRG not ready for writing
Definition at line 539 of file stm32_bluenrg_ble_dma_lp.c.
void BlueNRG_DMA_TxCallback | ( | void | ) |
Tx and Rx Transfer completed callbacks.
- Parameters:
-
hspi,: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
- Return values:
-
None
Definition at line 721 of file stm32_bluenrg_ble_dma_lp.c.
void BlueNRG_RST | ( | void | ) |
Resets the BlueNRG.
- Parameters:
-
None
- Return values:
-
None
Definition at line 361 of file stm32_bluenrg_ble_dma_lp.c.
void BlueNRG_SPI_IRQ_Callback | ( | void | ) |
BlueNRG SPI IRQ Callback.
- Parameters:
-
None
- Return values:
-
None
Definition at line 954 of file stm32_bluenrg_ble_dma_lp.c.
void BlueNRG_SPI_Request_Events | ( | uint8_t * | buffer, |
uint8_t | buff_size | ||
) |
BlueNRG SPI request event.
- Parameters:
-
buffer,: the event buff_size,: the event size
- Return values:
-
None
Definition at line 939 of file stm32_bluenrg_ble_dma_lp.c.
void BlueNRG_SPI_Write | ( | uint8_t * | header_data, |
uint8_t * | payload_data, | ||
uint8_t | header_size, | ||
uint8_t | payload_size | ||
) |
Writes data from local buffer to SPI.
- Parameters:
-
hspi,: SPI handle header_data,: First data buffer to be written payload_data,: Second data buffer to be written header_size,: Size of first data buffer to be written payload_size,: Size of second data buffer to be written
- Return values:
-
Number of read bytes
Definition at line 417 of file stm32_bluenrg_ble_dma_lp.c.
void BNRG_MSP_SPI_Init | ( | SPI_HandleTypeDef * | hspi ) |
Initializes the SPI communication with the BlueNRG Shield.
- Parameters:
-
None
- Return values:
-
None
Definition at line 336 of file stm32_bluenrg_ble_dma_lp.c.
void BNRG_SPI_Close | ( | void | ) |
Closes the SPI when BLE is disabled by the application Releases allocated resources.
- Parameters:
-
None
- Return values:
-
None
Definition at line 296 of file stm32_bluenrg_ble_dma_lp.c.
void BNRG_SPI_Init | ( | void | ) |
Initializes the SPI communication with the BlueNRG Shield.
- Parameters:
-
None
- Return values:
-
None
Definition at line 311 of file stm32_bluenrg_ble_dma_lp.c.
static void Disable_SPI_CS | ( | void | ) | [static] |
Disable SPI CS.
- Parameters:
-
None
- Return values:
-
None
Definition at line 509 of file stm32_bluenrg_ble_dma_lp.c.
static void Disable_SPI_Receiving_Path | ( | void | ) | [static] |
Disable SPI IRQ.
- Parameters:
-
None
- Return values:
-
None
Definition at line 488 of file stm32_bluenrg_ble_dma_lp.c.
static void DisableEnable_SPI_CS | ( | void | ) | [static] |
Disable and Enable SPI CS.
- Parameters:
-
None
- Return values:
-
None
Definition at line 522 of file stm32_bluenrg_ble_dma_lp.c.
static void Enable_SPI_CS | ( | void | ) | [static] |
Enable SPI CS.
- Parameters:
-
None
- Return values:
-
None
Definition at line 498 of file stm32_bluenrg_ble_dma_lp.c.
static void Enable_SPI_Receiving_Path | ( | void | ) | [static] |
Enable SPI IRQ.
- Parameters:
-
None
- Return values:
-
None
Definition at line 471 of file stm32_bluenrg_ble_dma_lp.c.
static void pf_nRFResetTimerCallBack | ( | void | ) | [static] |
This function notify when then BlueNRG nRESET may be released.
- Parameters:
-
None
- Return values:
-
None
Definition at line 210 of file stm32_bluenrg_ble_dma_lp.c.
static void ProcessEndOfReceive | ( | void | ) | [static] |
Delay Notification to the App to prevent dummy event read.
- Parameters:
-
None
- Return values:
-
None
Definition at line 268 of file stm32_bluenrg_ble_dma_lp.c.
static void ReceiveClosure | ( | void | ) | [static] |
Close the receiver path.
- Parameters:
-
None
- Return values:
-
None
Definition at line 234 of file stm32_bluenrg_ble_dma_lp.c.
static void ReceiveHeader | ( | SPI_RECEIVE_EVENT_t | ReceiveEvent, |
uint8_t * | DataHeader | ||
) | [static] |
Receive header.
- Parameters:
-
hspi,: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
- Return values:
-
None
< Configure DMA to send Tx packet
Definition at line 912 of file stm32_bluenrg_ble_dma_lp.c.
static void set_irq_as_input | ( | void | ) | [static] |
Set the IRQ in input mode.
- Parameters:
-
None
- Return values:
-
None
Definition at line 460 of file stm32_bluenrg_ble_dma_lp.c.
static void set_irq_as_output | ( | void | ) | [static] |
Set in Output mode the IRQ.
- Parameters:
-
None
- Return values:
-
None
Definition at line 448 of file stm32_bluenrg_ble_dma_lp.c.
static void SPI_Receive_Manager | ( | SPI_RECEIVE_REQUEST_t | ReceiveRequest ) | [static] |
Manage the SPI receive.
- Parameters:
-
ReceiveRequest,: the receive request
- Return values:
-
None
Flush the Rx register or FIFO
< Enable Receive packet notification
< Disable Transmit packet notification
< Configure DMA to send same Byte
Definition at line 833 of file stm32_bluenrg_ble_dma_lp.c.
static void SPI_Transmit_Manager | ( | SPI_TRANSMIT_REQUEST_t | TransmitRequest ) | [static] |
Manage the SPI transmit.
- Parameters:
-
TransmitRequest,: the transmit request
- Return values:
-
None
< Disable Receive packet notification
< Clear flag in DMA
< Clear DMA pending bit in NVIC
< Enable Transmit packet notification
< Configure DMA to send Tx packet
< Set counter in DMA TX
< Set memory address in DMA TX
< Set counter in DMA TX
< Set memory address in DMA TX
< Enable DMA TX
Definition at line 784 of file stm32_bluenrg_ble_dma_lp.c.
static void TimerStartupCallback | ( | void | ) | [static] |
Timer callback to apply timeout SPI FIX.
- Parameters:
-
None
- Return values:
-
None
Definition at line 690 of file stm32_bluenrg_ble_dma_lp.c.
static void TimerTransmitCallback | ( | void | ) | [static] |
Timer callback to apply timeout SPI FIX.
- Parameters:
-
None
- Return values:
-
None
< BlueNRG not ready for writing
Definition at line 282 of file stm32_bluenrg_ble_dma_lp.c.
static void TimerTxRxCallback | ( | void | ) | [static] |
Timer callback to handle RxTx Timers.
- Parameters:
-
None
- Return values:
-
None
Definition at line 222 of file stm32_bluenrg_ble_dma_lp.c.
static void TransmitClosure | ( | void | ) | [static] |
Close the transmit mechanism after packet has been sent Wait for the event to come back.
- Parameters:
-
None
- Return values:
-
None
Definition at line 764 of file stm32_bluenrg_ble_dma_lp.c.
static void WakeupBlueNRG | ( | void | ) | [static] |
Wakeup BlueNRG.
- Parameters:
-
None
- Return values:
-
None
Definition at line 673 of file stm32_bluenrg_ble_dma_lp.c.
Generated on Tue Jul 12 2022 19:31:15 by 1.7.2