![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
Allwinner Platform UART (Universal Asynchronous Receiver/Transmitter) Driver. More...
#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <io.h>#include <timer.h>#include <log.h>#include <sys-uart.h>#include <sys-clk.h>
Functions | |
| void | sunxi_serial_clock_init (sunxi_serial_t *uart) |
| Initialize the UART clock. | |
| void | sunxi_serial_init (sunxi_serial_t *uart) |
| Initialize the UART interface. | |
| void | __attribute__ ((weak)) |
| Output a character to the UART. | |
Allwinner Platform UART (Universal Asynchronous Receiver/Transmitter) Driver.
This file implements the UART driver for Allwinner platforms. The UART driver provides functionality for serial communication, including initialization, configuration, and basic input/output operations. It supports various UART settings such as baud rate, parity, stop bits, and data length.
SPDX-License-Identifier: GPL-2.0+
| void __attribute__ | ( | (weak) | ) |
Output a character to the UART.
Check if a character is available to read from the UART.
Read a character from the UART.
This function sends a single character to the UART transmit buffer. It waits until the transmit holding register is empty before writing the character.
| [in] | arg | Pointer to the UART structure (cast to void* for compatibility) |
| [in] | c | The character to be transmitted |
This function reads a single character from the UART receive buffer. It waits until data is available before reading.
| [in] | arg | Pointer to the UART structure (cast to void* for compatibility) |
This function checks the UART line status register to determine if there is data available in the receive buffer.
| [in] | arg | Pointer to the UART structure (cast to void* for compatibility) |
| void sunxi_serial_clock_init | ( | sunxi_serial_t * | uart | ) |
Initialize the UART clock.
This function configures the UART clock by setting the reset control and enabling the clock gate for the UART module. It prepares the UART hardware for further configuration.
| [in] | uart | Pointer to the UART structure containing clock configuration |
| void sunxi_serial_init | ( | sunxi_serial_t * | uart | ) |
Initialize the UART interface.
Initialize the Sunxi serial interface with the specified configuration.
This function initializes the UART interface by configuring the clock, baud rate, line control settings (parity, stop bits, data length), FIFO control, and GPIO pins. It sets up the UART for serial communication based on the provided configuration.
| [in] | uart | Pointer to the UART structure containing complete configuration including base address, clock settings, baud rate, and GPIO pins |