diff options
Diffstat (limited to 'VexRiscvSocSoftware/projects/briey/uart/src')
-rwxr-xr-x | VexRiscvSocSoftware/projects/briey/uart/src/crt.S | 1 | ||||
-rwxr-xr-x | VexRiscvSocSoftware/projects/briey/uart/src/main.c | 39 |
2 files changed, 40 insertions, 0 deletions
diff --git a/VexRiscvSocSoftware/projects/briey/uart/src/crt.S b/VexRiscvSocSoftware/projects/briey/uart/src/crt.S new file mode 100755 index 0000000..b0a8ddb --- /dev/null +++ b/VexRiscvSocSoftware/projects/briey/uart/src/crt.S @@ -0,0 +1 @@ +#include "../../../../resources/crt.S" diff --git a/VexRiscvSocSoftware/projects/briey/uart/src/main.c b/VexRiscvSocSoftware/projects/briey/uart/src/main.c new file mode 100755 index 0000000..d1fbe17 --- /dev/null +++ b/VexRiscvSocSoftware/projects/briey/uart/src/main.c @@ -0,0 +1,39 @@ +#include <stdio.h> +#include <string.h> +#include <stdint.h> +#include <stdlib.h> +#include <briey.h> + +void print(char *str){ + while(*str){ + uart_write(UART,*(str++)); + } +} + +int main() { + Uart_Config uartConfig; + uartConfig.dataLength = 8; + uartConfig.parity = NONE; + uartConfig.stop = ONE; + uartConfig.clockDivider = 50000000/8/115200-1; + uart_applyConfig(UART,&uartConfig); + + print("Hello !\n"); + + while(1){ + for(uint32_t idx = '0';idx <= '9';idx++){ + uart_write(UART, idx); + } + for(uint32_t idx = 'a';idx <= 'z';idx++){ + uart_write(UART, idx); + } + for(uint32_t idx = 'A';idx <= 'Z';idx++){ + uart_write(UART, idx); + } + } +} + + +void irqCallback(){ + +} |