⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serial_config.h

📁 the UART control demo source for the NEC mcu
💻 H
字号:

#include "uart.h"


 
 
////////////////////////////////////////////
///          UART selection               ///
////////////////////////////////////////////

#define Uart_Parity			Uart_Not_Parity  // can slect other:
                                                            // Uart_Zero_Parity 			
                                                            // Uart_Odd_Parity 			
                                                            // Uart_Even_Parity
#define Uart_Data_Bit			Uart_Data_Bit_8  // can select 7bit
#define Uart_Stop_Bit			Uart_Stop_Bit_2  // can select 1bit
#define Uart6_Reception_Error_Interrupt Uart6_Reception_Error_Interrupt_is_INTSRE6 // can select INTSR6
#define Uart6_First			Uart6_First_LSB  // can select MSB
#define Uart6_TxD6_Output_Level		Uart6_TxD6_Output_Normal  // can select Interval

#define Uart0_BaseClk			Uart0_BaseClk_2  // can select:
                                                         //Uart0_BaseClk_1//fxclk0 = TM50 output
                                                         //Uart0_BaseClk_2// fxclk0 = fprs/2
                                                         //Uart0_BaseClk_3// fxclk0 = fprs/8
                                                         //Uart0_BaseClk_4// fxclk0 = fprs/32	
#define Uart0_CounterClk		8          // = fxclk0/8, can select from 8 to 31

// Format of Clock Selection Register 6 (CKSR6).  only for UART6. Pls refer to page358 in manual
#define Uart6_BaseClk_1			0          // fxclk6 = fprs/(2^n), can select n from 0 to 10
#define Uart6_BaseClk_2			11         // fxclk6 = TM50 output
#define Uart6_BaseClk			Uart6_BaseClk_1  // can select Uart6_BaseClk_2

//Format of Baud Rate Generator Control Register 6 (BRGC6). only for UART6. Pls refer to page359 in manual
#define Uart6_CounterClk		8          // = fxclk0/8, can select from 8 to 255

#define Uart0_Transmit_Operation()		Uart0_Transmit_Enable() // can select Disable
#define Uart0_Receive_Operation()		Uart0_Receive_Enable() // can select Disable
#define Uart6_Transmit_Operation()		Uart6_Transmit_Enable() // can select Disable
#define Uart6_Receive_Operation()		Uart6_Receive_Enable() // can select Disable

#define Uart0_ReceiveSize          	0x01 
#define Uart0_SendSize          	0x01 
#define Uart6_ReceiveSize           	0x01 
#define Uart6_SendSize          	0x01
   
 unsigned char Uart0_SendDataBuf[Uart0_SendSize]={0x55};
 unsigned char Uart0_ReceiveDataBuf[Uart0_ReceiveSize]={0x55};

 unsigned char Uart6_SendDataBuf[Uart6_SendSize]={0x55};
 unsigned char Uart6_ReceiveDataBuf[Uart6_ReceiveSize]={0x55};
 
unsigned char *Uart0_SendBuf = Uart0_SendDataBuf;
unsigned char *Uart0_ReceiveBuf = Uart0_ReceiveDataBuf;
unsigned char *Uart6_SendBuf = Uart6_SendDataBuf;
unsigned char *Uart6_ReceiveBuf = Uart6_ReceiveDataBuf;


unsigned char Uart0_ReceiveCount = Uart0_ReceiveSize;       	 
unsigned char Uart0_SendCount = Uart0_SendSize;       	 
unsigned char Uart6_ReceiveCount = Uart6_ReceiveSize;          	 
unsigned char Uart6_SendCount = Uart6_SendSize;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -