1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-18 18:06:40 +00:00
Atmosphere/exosphere/src/uart.h

25 lines
764 B
C
Raw Normal View History

2018-02-22 19:27:01 +00:00
#ifndef EXOSPHERE_UART_H
#define EXOSPHERE_UART_H
#include <stdint.h>
2018-02-24 16:13:42 +00:00
#include "memory_map.h"
2018-02-22 19:27:01 +00:00
/* Exosphere driver for the Tegra X1 UARTs. */
/* TODO: Should we bother with support UARTB-D? */
2018-02-22 19:27:01 +00:00
#define UARTA_BASE (mmio_get_device_address(MMIO_DEVID_UART_A))
#define UART_THR_DLAB_0_0 (*((volatile uint32_t *)(UARTA_BASE + 0x0)))
#define UART_IER_DLAB_0_0 (*((volatile uint32_t *)(UARTA_BASE + 0x4)))
#define UART_IIR_FCR_0 (*((volatile uint32_t *)(UARTA_BASE+ 0x8)))
#define UART_LCR_0 (*((volatile uint32_t *)(UARTA_BASE + 0xC)))
#define UART_LSR_0 (*((volatile uint32_t *)(UARTA_BASE + 0x14)))
2018-02-22 19:27:01 +00:00
void uart_initialize(uint16_t divider);
void uart_transmit_char(char ch);
2018-02-22 19:27:22 +00:00
void uart_transmit_str(const char *str);
void uart_transmit_hex(uint32_t value);
2018-02-22 19:27:01 +00:00
2018-02-24 16:13:42 +00:00
#endif