29 lines
938 B
C
29 lines
938 B
C
#ifndef __GILBRALTAR_SERIAL__
|
|
#define __GILBRALTAR_SERIAL__
|
|
|
|
#include <bcm.h>
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#define ARM_UART0_BASE (ARM_IO_BASE + 0x1001000)
|
|
|
|
#define ARM_UART0_DR (ARM_UART0_BASE + 0x00)
|
|
#define ARM_UART0_FR (ARM_UART0_BASE + 0x18)
|
|
#define ARM_UART0_IBRD (ARM_UART0_BASE + 0x24)
|
|
#define ARM_UART0_FBRD (ARM_UART0_BASE + 0x28)
|
|
#define ARM_UART0_LCRH (ARM_UART0_BASE + 0x2c)
|
|
#define ARM_UART0_CR (ARM_UART0_BASE + 0x30)
|
|
#define ARM_UART0_IFLS (ARM_UART0_BASE + 0x34)
|
|
#define ARM_UART0_IMSC (ARM_UART0_BASE + 0x38)
|
|
#define ARM_UART0_RIS (ARM_UART0_BASE + 0x3c)
|
|
#define ARM_UART0_MIS (ARM_UART0_BASE + 0x40)
|
|
#define ARM_UART0_ICR (ARM_UART0_BASE + 0x44)
|
|
|
|
void gilbraltar_serial_init(void);
|
|
void gilbraltar_serial_send(uint8_t);
|
|
uint8_t gilbraltar_serial_recv(void);
|
|
void gilbraltar_serial_puts(const char *);
|
|
void gilbraltar_serial_putchar(int);
|
|
void gilbraltar_serial_write(const char *, size_t);
|
|
|
|
#endif
|