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

📄 spi_5463.h

📁 电能计量芯片CS5463的SPI口读写程序。
💻 H
字号:

#ifndef _SPI_5463_H
#define _SPI_5463_H
/*
sbit SPI_RESET=P3^3;
sbit SPI_CS=P2^1;
sbit SPI_DO=P3^5;
sbit SPI_CLK=P3^6;
sbit SPI_DI=P3^7;
*/
#define        SELECT_CS5460_CHIP    SPI_CS=0
#define        UNSELECT_CS5460_CHIP SPI_CS=1

#define        RESET_CS5460_HIGH    SPI_RESET=1
#define        RESET_CS5460_LOW    SPI_RESET=0
#define	CLR_CLK		SPI_CLK = 0
#define	SET_CLK		SPI_CLK = 1
#define	CLR_SDA_IN		SPI_DI= 0
#define	SET_SDA_IN		SPI_DI= 1

#ifdef DEBUG_5463
void test_5463( );
void test_spi_io( );
#endif

void send_byte(uchar temp) small;
uchar receive_byte() small;
void Read_From_5460(uchar *ps,uchar which) small;
void Write_To_5460(uchar *ps) small;
void Write_To_5460_code(uchar code *p) small;

#endif



⌨️ 快捷键说明

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