raspberry3_bare/uart.h

17 lines
613 B
C
Raw Normal View History

2022-03-14 07:46:32 +01:00
#pragma once
#include "mmio.h"
/* PL011 UART */
2022-03-14 20:28:46 +01:00
#define UART0_DR (*(volatile unsigned *)(UART0_BASE + 0x0))
#define UART0_FR (*(volatile unsigned *)(UART0_BASE + 0x18))
#define UART0_IBRD (*(volatile unsigned *)(UART0_BASE + 0x24))
#define UART0_FBRD (*(volatile unsigned *)(UART0_BASE + 0x28))
#define UART0_LCRH (*(volatile unsigned *)(UART0_BASE + 0x2C))
#define UART0_CR (*(volatile unsigned *)(UART0_BASE + 0x30))
#define UART0_IMSC (*(volatile unsigned *)(UART0_BASE + 0x38))
#define UART0_ICR (*(volatile unsigned *)(UART0_BASE + 0x44))
2022-03-14 07:46:32 +01:00
void init_uart(void);
void putc(char c);
2022-03-14 20:28:46 +01:00
void puts(const char *s);