ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
uart_device.c File Reference

High-level UART controller driver for ESP-IDF. More...

#include "uart_device.h"

Macros

#define UARTD_CHECK(cond, tag, msg)
 

Functions

uartd_config_t uartd_default_config (void)
 Get a default UART configuration to drive the UART1 controller.
 
esp_err_t uartd_init (uartd_config_t *restrict cfg)
 Initialize an UART controller.
 
esp_err_t uartd_deinit (uartd_config_t *restrict cfg)
 Deinitialize a UART device.
 
esp_err_t uartd_wait_event (const uartd_config_t *cfg, uart_event_t *event, TickType_t timeout)
 Wait for an UART event.
 
esp_err_t uartd_read (const uartd_config_t *const restrict cfg, void *restrict buf, size_t sz, size_t len, TickType_t timeout, size_t *out_bytes)
 Read raw data from UART.
 
esp_err_t uartd_write (const uartd_config_t *const restrict cfg, const void *const restrict buf, size_t sz, size_t len, size_t *out_bytes)
 Write raw data to UART.
 
esp_err_t uartd_readline (const uartd_config_t *const restrict cfg, char *restrict line, size_t max_len, TickType_t timeout, size_t *out_len)
 Read up to a newline-terminated string from UART.
 
esp_err_t uartd_writeline (const uartd_config_t *const restrict cfg, const char *const restrict line, size_t *out_len)
 Write a null-terminated line to UART.
 

Variables

static const char * TAG = "uart_device"
 

Detailed Description

High-level UART controller driver for ESP-IDF.

Author
Adrien Chevrier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Version
0.1
Date
2026-02-05

Macro Definition Documentation

◆ UARTD_CHECK

#define UARTD_CHECK ( cond,
tag,
msg )
Value:
do { \
if (!(cond)) { \
ESP_LOGE(tag, msg); \
return ESP_ERR_INVALID_ARG; \
} \
} while (0)

Variable Documentation

◆ TAG

const char* TAG = "uart_device"
static