|
HRI board firmware
v2.1
Microcontroller firmware of the board used during the HRI labs.
|
Driver for the UART serial communication peripheral. More...
Typedefs | |
| typedef void(* | uart_rxByteHandlerFunc) (uint8_t rxByte) |
Functions | |
| void | uart_Init (void) |
| Initializes the UART module. More... | |
| void | uart_Step (void) |
| Copies the received bytes into the user-accessible queue. Reads all the available bytes in the DMA RX buffer, and copies them to the user-accessible queue. More... | |
| cb_CircularBuffer * | uart_GetRxQueue (void) |
| Gets the user-accessible queue of the received bytes. More... | |
| void | uart_SendByteAsync (uint8_t data) |
| Asynchronously sends the given byte through the UART bus. More... | |
| void | uart_SendBytesAsync (uint8_t *data, int length) |
| Asynchronously sends the given bytes through the UART bus. More... | |
| void | uart_FlushTx (void) |
| Start the DMA to send the bytes waiting in the intermediate buffer. More... | |
Driver for the UART serial communication peripheral.
This driver controls the UART peripheral of the STM32, connected to the USB-to-serial chip.
Call uart_Init() first in the initialization code, specifiying the function to call when a byte arrives (sent from the computer). To send data, call uart_SendByte() or uart_SendBytes().
Note that this module should not be used directly. It is a better option to use it through the Communication module, to benefit from the already implemented communication protocol between the board and MATLAB.
| typedef void(* uart_rxByteHandlerFunc) (uint8_t rxByte) |
Typedef for a pointer to a function to call automatically when a byte arrives from the computer.
| void uart_FlushTx | ( | void | ) |
Start the DMA to send the bytes waiting in the intermediate buffer.
| cb_CircularBuffer* uart_GetRxQueue | ( | void | ) |
Gets the user-accessible queue of the received bytes.
| void uart_Init | ( | void | ) |
Initializes the UART module.
| void uart_SendByteAsync | ( | uint8_t | data | ) |
Asynchronously sends the given byte through the UART bus.
| data | the data byte to send. |
| void uart_SendBytesAsync | ( | uint8_t * | data, |
| int | length | ||
| ) |
Asynchronously sends the given bytes through the UART bus.
| data | pointer to the data bytes array to send. |
| length | number of bytes to send (array size). |
| void uart_Step | ( | void | ) |
Copies the received bytes into the user-accessible queue. Reads all the available bytes in the DMA RX buffer, and copies them to the user-accessible queue.
1.8.13