|
hal
Hardware Abstraction Layer
|
Implements serial communication over UART2. More...
#include "stm32f4xx.h"#include "stm32f4_hal.h"#include "stm32f4_uart_util.h"#include "stm32f4_uart2.h"#include "circular_buffer.h"
Macros | |
| #define | UART_BAUDRATE 115200 |
| #define | UART_BUFFER_RX_SIZE CIRCULAR_BUFFER_MAX_SIZE |
| #define | UART_BUFFER_TX_SIZE CIRCULAR_BUFFER_MAX_SIZE |
Functions | |
| void | USART2_IRQHandler (void) |
| hal_status_t | stm32f4_uart2_init () |
| Initialize the UART2. (Connected to the USB) More... | |
| hal_status_t | stm32f4_uart2_deinit () |
| Deinitialize UART channel 2. More... | |
| hal_status_t | stm32f4_uart2_read (uint8_t *data, size_t len, size_t *bytes_read) |
| Reads data from UART2 register. More... | |
| hal_status_t | stm32f4_uart2_write (const uint8_t *data, size_t len, size_t *bytes_written) |
| Writes data to UART2 register. More... | |
Implements serial communication over UART2.
Copyright (c) 2025 Cory McKiel. Licensed under the MIT License. See LICENSE file in the project root.
| hal_status_t stm32f4_uart2_deinit | ( | ) |
Deinitialize UART channel 2.
The channel can only be deinitialized if it has previously been initialized.
| hal_status_t stm32f4_uart2_init | ( | ) |
Initialize the UART2. (Connected to the USB)
Initialize UART channel 2. Must be called prior to using the channel.
| hal_status_t stm32f4_uart2_read | ( | uint8_t * | data, |
| size_t | len, | ||
| size_t * | bytes_read | ||
| ) |
Reads data from UART2 register.
Read an incoming byte stream from UART channel 2.
| hal_status_t stm32f4_uart2_write | ( | const uint8_t * | data, |
| size_t | len, | ||
| size_t * | bytes_written | ||
| ) |
Writes data to UART2 register.
Write an outgoing byte stream to UART channel 2.