CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
uart_control.c File Reference
#include "uart_handler/uart_control.h"
#include "uart_handler/uart_handler.h"
#include <string.h>
Include dependency graph for uart_control.c:

Functions

uint8_t UART_set_baud_rate (UART_HandleTypeDef *port_handle, uint32_t new_baud_rate)
 Set the STM32 UART peripheral's baud rate to a different value.
 
UART_HandleTypeDef * UART_get_port_handle_by_name (const char port_name[])
 Get the UART port handle by its name.
 

Function Documentation

◆ UART_get_port_handle_by_name()

UART_HandleTypeDef * UART_get_port_handle_by_name ( const char port_name[])

Get the UART port handle by its name.

Parameters
port_nameCase-insensitive name of the UART port to retrieve the handle for.
Returns
Pointer to the UART handle structure for the specified port name, or NULL if not found.
Warning
This function MUST be checked for NULL return value before use.
Here is the caller graph for this function:

◆ UART_set_baud_rate()

uint8_t UART_set_baud_rate ( UART_HandleTypeDef * port_handle,
uint32_t new_baud_rate )

Set the STM32 UART peripheral's baud rate to a different value.

Parameters
port_handlePointer to the UART handle structure for the port to change the baud rate of.
new_baud_rateThe new baud rate to set the STM32 UART peripheral to (in bits per second). Common values are 9600, 115200, 230400, etc.
Returns
0 on success, >0 on error.
Here is the caller graph for this function: