stspearnet.c
来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· C语言 代码 · 共 42 行
C
42 行
//-----------------------------------------------------------------------------
// SPEArNet Example UART
//-----------------------------------------------------------------------------
#include "hal_map.h"
#include "hal_type.h"
#include "hal_gpio.h"
#include "hal_uart.h"
#include "SpearNet_uart.h"
//char uart_buffer[50];
//u8 uart_length = 0;
//-----------------------------------------------------------------------------
void Main_Echo (void)
{
u8 text[] = "SpearNet echo.\n\r";
u8 c;
GPIO_Init (GPIO_ALL_AS_OUTs);
UART_SpearNet_Init ();
UART_StringSend (text);
while (1)
{
(void) UART_ByteReceive (&c,0);
UART_ByteSend (&c);
LEDs_Toggle (LED0);
}
}
//-----------------------------------------------------------------------------
int main()
{
Main_Echo();
}
//-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?