|
PER Firmware
|
Classes | |
| struct | usart_active_transfer_t |
Enumerations | |
| enum | usart_dma_mode_t { USART_DMA_TX , USART_DMA_RX } |
Functions | |
| bool | PHAL_initUSART (usart_init_t *handle, const uint32_t fck) |
| Initialize a USART Peripheral with desired settings. | |
| void | PHAL_usartTxBl (usart_init_t *handle, uint8_t *data, uint32_t len) |
| TX using no DMA (blocks until complete) | |
| void | PHAL_usartRxBl (usart_init_t *handle, uint8_t *data, uint32_t len) |
| RX using no DMA (blocks until complete) | |
| bool | PHAL_usartTxDma (usart_init_t *handle, uint16_t *data, uint32_t len) |
| Starts a tx using dma, use PHAL_usartTxDmaComplete to ensure the previous transmission is complete. | |
| volatile bool | PHAL_usartTxBusy (usart_init_t *handle) |
| Returns whether USART peripheral is currently transmitting data. | |
| bool | PHAL_usartRxDma (usart_init_t *handle, uint16_t *data, uint32_t len, bool cont) |
| Starts an rx using dma of a specific length. | |
| bool | PHAL_disableContinousRxDMA (usart_init_t *handle) |
| Disables the Continous RX that was previously used. | |
| bool | PHAL_usartRxBusy (usart_init_t *handle) |
| Returns whether USART peripheral is currently receiving data. | |
| __WEAK void | usart_recieve_complete_callback (usart_init_t *handle) |
| Callback function called immediately after reception of a USART RX message Uses USART IDLE line interrupt. | |
Variables | |
| volatile usart_active_transfer_t | active_uarts [TOTAL_NUM_UART] |
| enum usart_dma_mode_t |
| bool PHAL_disableContinousRxDMA | ( | usart_init_t * | handle | ) |
Disables the Continous RX that was previously used.
| handle | The handle for the usart configuration |
| bool PHAL_initUSART | ( | usart_init_t * | handle, |
| const uint32_t | fck ) |
Initialize a USART Peripheral with desired settings.
| handle | Handle containing settings for USART peripheral |
| fck | Clock rate going to USART peripheral (APBx bus) |
| void PHAL_usartRxBl | ( | usart_init_t * | handle, |
| uint8_t * | data, | ||
| uint32_t | len ) |
RX using no DMA (blocks until complete)
| handle | The handle for the usart configuration |
| data | The address of the data to receive |
| len | Number of u8s expected to receive. Will block if not received. |
| bool PHAL_usartRxBusy | ( | usart_init_t * | handle | ) |
Returns whether USART peripheral is currently receiving data.
| handle | Handle of USART peripheral check |
| bool PHAL_usartRxDma | ( | usart_init_t * | handle, |
| uint16_t * | data, | ||
| uint32_t | len, | ||
| bool | cont ) |
Starts an rx using dma of a specific length.
| handle | The handle for the usart configuration |
| data | The address to put the received data, ensure a cast to (uint16_t *), even if 8 bits |
| len | Number of units of data, depending on the configured word length |
| cont | Enable Continous RX using the idle line interrupt (only need to call this function once, and HAL will keep recieving messages of the same length) |
| void PHAL_usartTxBl | ( | usart_init_t * | handle, |
| uint8_t * | data, | ||
| uint32_t | len ) |
TX using no DMA (blocks until complete)
| handle | The handle for the usart configuration |
| data | The address of the data to send |
| len | Number of u8s |
| volatile bool PHAL_usartTxBusy | ( | usart_init_t * | handle | ) |
Returns whether USART peripheral is currently transmitting data.
| handle | Handle of USART peripheral to check |
| bool PHAL_usartTxDma | ( | usart_init_t * | handle, |
| uint16_t * | data, | ||
| uint32_t | len ) |
Starts a tx using dma, use PHAL_usartTxDmaComplete to ensure the previous transmission is complete.
| handle | The handle for the usart configuration |
| data | The address of the data to send, ensure a cast to (uint16_t *), even if 8 bits |
| len | Number of units of data, depending on the configured word length |
| __WEAK void usart_recieve_complete_callback | ( | usart_init_t * | handle | ) |
Callback function called immediately after reception of a USART RX message Uses USART IDLE line interrupt.
NOTE: this is executed during an interrupt handler call, so keep code in this function light
| handle | Handle of USART peripheral that just recieved a message |