-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
128 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/include/uart_debug.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/*************************************************** | ||
* Ceno Real-time Operating System (CenoRTOS) | ||
* version 0.1 | ||
* author neroyang | ||
* email nerosoft@outlook.com | ||
* time 2019-01-27 | ||
* | ||
* Copyright (C) 2018 CenoCloud. All Rights Reserved | ||
* | ||
* Contract Information: | ||
* https://www.cenocloud.com | ||
****************************************************/ | ||
#ifndef __CENO_RTOS_UART_DEBUG__ | ||
#define __CENO_RTOS_UART_DEBUG__ | ||
|
||
void uart_debug_init(void); | ||
|
||
void uart_debug_print(char* str); | ||
|
||
void uart_debug_print_char(char str); | ||
|
||
void uart_debug_reveive(char* rec); | ||
|
||
char uart_debug_reveive_char(void); | ||
|
||
#endif //! __CENO_RTOS_UART_DEBUG__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ void os_on_startup(void){ | |
} | ||
|
||
|
||
|
||
void disable_irq(void){ | ||
__asm ( | ||
"CPSID I\n\t" | ||
|
56 changes: 56 additions & 0 deletions
56
board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "../include/uart_debug.h" | ||
#include "TM4C123GH6PM.h" | ||
|
||
void uart_debug_init(void){ | ||
SYSCTL->RCGCUART |= (1<<0); | ||
SYSCTL->RCGCGPIO |= (1<<0); | ||
|
||
GPIOA->AFSEL = (1<<1)|(1<<0); | ||
GPIOA->PCTL = (1<<0)|(1<<4); | ||
GPIOA->DEN = (1<<0)|(1<<1); | ||
|
||
UART0->CTL &= ~(1<<0); | ||
UART0->IBRD = 104; | ||
UART0->FBRD = 11; | ||
UART0->LCRH = (0x3<<5); | ||
UART0->CC = 0x0; | ||
|
||
UART0->CTL = (1<<0)|(1<<8)|(1<<9); | ||
} | ||
|
||
void uart_debug_print(char* str){ | ||
while(*str){ | ||
uart_debug_print_char(*(string++)); | ||
} | ||
} | ||
|
||
void uart_debug_print_char(char str){ | ||
while((UART0->FR & (1<<5))!=0); | ||
UART0->DR = str; | ||
} | ||
|
||
|
||
void uart_debug_reveive(char* rec){ | ||
|
||
} | ||
|
||
char uart_debug_reveive_char(void){ | ||
char c; | ||
while((UART0->FR & (1<<1))!=0); | ||
c = UART0->DR; | ||
return c; | ||
} | ||
|
||
int main(){ | ||
uart_debug_init(); | ||
char c; | ||
while(1){ | ||
uart_debug_print("test uart print"); | ||
uart_debug_reveive(c); | ||
switch(c){ | ||
case '1': | ||
break; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
obj/uart_debug.o: \ | ||
/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c \ | ||
/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/../include/uart_debug.h |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
uart_debug.o: \ | ||
/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c \ | ||
/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/../include/uart_debug.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 1 "/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c" | ||
# 1 "/Users/neroyang/project/Ceno-RTOS/user//" | ||
# 1 "<built-in>" | ||
# 1 "<command-line>" | ||
# 1 "/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c" | ||
# 1 "/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/../include/uart_debug.h" 1 | ||
# 16 "/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/../include/uart_debug.h" | ||
void uart_debug_init(void); | ||
|
||
void uart_debug_print(char* str); | ||
|
||
void uart_debug_reveive(char* rec); | ||
# 2 "/Users/neroyang/project/Ceno-RTOS/board/arch/arm32/ek-TM4C123gxl/TM4C123GH6PM/ceno_os/src/uart_debug.c" 2 | ||
|
||
void uart_debug_init(void){ | ||
|
||
} | ||
|
||
void uart_debug_print(char* str){ | ||
|
||
} | ||
|
||
void uart_debug_reveive(char* rec){ | ||
|
||
} |