For best results, you should enable Javascript for our web site.
Sapphire SoC DS
Sapphire SoC UG
Sapphire HP SoC DS
Sapphire HP SoC UG
RISC-V Embedded IDE UG
Board Support Package
Loading...
Searching...
No Matches
bsp.c
Go to the documentation of this file.
1
#include "
bsp.h
"
2
#include "
syscall.h
"
3
4
uart_instance_t
uart0
;
5
6
void
bsp_init
() {
7
// Init uart 0
8
uart0
.hwreg = UART0_BASE;
9
uart0
.dataLength =
BITS_8
;
10
uart0
.parity =
NONE
;
11
uart0
.stop =
ONE
;
12
uart0
.clockDivider =
BSP_CLINT_HZ
/(
BSP_UART_BAUDRATE
*
BSP_UART_DATA_LEN
)-1;
13
uart_applyConfig
(&
uart0
);
14
}
15
uart0
uart_instance_t uart0
Definition
bsp.c:4
bsp_init
void bsp_init()
Definition
bsp.c:6
bsp.h
BSP_UART_DATA_LEN
#define BSP_UART_DATA_LEN
Definition
bsp.h:28
BSP_UART_BAUDRATE
#define BSP_UART_BAUDRATE
Definition
bsp.h:27
BSP_CLINT_HZ
#define BSP_CLINT_HZ
Definition
bsp.h:30
ONE
@ ONE
One Stop Bit */.
Definition
uart.h:64
BITS_8
@ BITS_8
8-bit data length */
Definition
uart.h:52
NONE
@ NONE
No Parity */.
Definition
uart.h:57
uart_applyConfig
void uart_applyConfig(uart_instance_t *inst)
Apply stored UART configuration to hardware.
Definition
uart.c:68
uart_instance_t
UART instance. Holds the software registers and hardware pointer.
Definition
uart.h:114
syscall.h
For best results, you should enable Javascript for our web site.