Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
Loading...
Searching...
No Matches
uart.h
Go to the documentation of this file.
1
12#ifndef DRIVERS_UART_H
13#define DRIVERS_UART_H
14
15#include <stdbool.h>
16#include <stdint.h>
17
21typedef struct uart_device {
23 uintptr_t mmio_base;
24
26 void (*putc)(struct uart_device *dev, char c);
27
29 char (*getc)(struct uart_device *dev);
31
37void pl011_init(uart_device_t *dev, uintptr_t base);
38
53
54#endif /* DRIVERS_UART_H */
Hardware abstraction for a UART device.
Definition uart.h:21
char(* getc)(struct uart_device *dev)
Function pointer to receive a character.
Definition uart.h:29
void(* putc)(struct uart_device *dev, char c)
Function pointer to transmit a character.
Definition uart.h:26
uintptr_t mmio_base
Base address for Memory-Mapped I/O.
Definition uart.h:23
void pl011_init(uart_device_t *dev, uintptr_t base)
Initialize a UART device struct.
Definition uart.c:140
bool pl011_register_handler(uart_device_t *dev)
Register the PL011 UART receive interrupt handler with the ICU.
Definition uart.c:131
struct uart_device uart_device_t
Hardware abstraction for a UART device.