serial.h

来自「nec 78K0 样例对程序初始化电表样」· C头文件 代码 · 共 56 行

H
56
字号
/*
*******************************************************************************
**
**  This device driver was created by Applilet for the 78K0/KB2, 78K0/KC2,
**  78K0/KD2, 78K0/KE2 and 78K0/KF2 8-Bit Single-Chip Microcontrollers.
**
**  Copyright(C) NEC Electronics Corporation 2002 - 2005
**  All rights reserved by NEC Electronics Corporation.
**
**  This program should be used on your own responsibility.
**  NEC Electronics Corporation assumes no responsibility for any losses
**  incurred by customers or third parties arising from the use of this file.
**
**  Filename :	serial.h
**  Abstract :	This file implements device driver for SERIAL module.
**  APIlib :	NEC78K0KX2.lib V1.01 [09 Aug. 2005]
**
**  Device :	uPD78F0513(44-pin)
**
**  Compiler :	NEC/CC78K0
**
*******************************************************************************
*/
#ifndef _MDSERIAL_
#define _MDSERIAL_
/*
*******************************************************************************
**  Global variables
*******************************************************************************
*/
#define	UART_BAUDRATE_M0	0x3
#define	UART_BAUDRATE_K0	0x1a
#define	UART_BAUDRATE_M6	0x4
#define	UART_BAUDRATE_K6	0xd0
#define	IIC0_SLAVEADDRESS	0x0

void UART0_Init( void );
MD_STATUS UART0_SendData( UCHAR* txbuf, UCHAR txnum );
MD_STATUS UART0_ReceiveData( UCHAR* rxbuf, UCHAR rxnum );
__interrupt void MD_INTSR0( void );
__interrupt void MD_INTST0( void );
void UART6_Init( void );
MD_STATUS UART6_SendData( UCHAR* txbuf, UCHAR txnum );
MD_STATUS UART6_ReceiveData( UCHAR* rxbuf, UCHAR rxnum );
__interrupt void MD_INTSR6( void );
__interrupt void MD_INTST6( void );

enum TransferMode { Send, Receive };
__interrupt void MD_INTIIC0( void ) ;
MD_STATUS IIC0_SlaveHandler( void );
MD_STATUS IIC0_MasterHandler( void );
void CALL_IIC0_SlaveAddressMatch( void );
void CALL_IIC0_MasterFindSlave( void );

#endif

⌨️ 快捷键说明

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