spi.h

来自「应用于测试LCD driver」· C头文件 代码 · 共 25 行

H
25
字号
// -------------------------- Header file for spi.c ----------------------------
#ifndef __SOFTWARE_SPI__
#define __SOFTWARE_SPI__

// --------------------------- Pins Definition ---------------------------------
#ifndef SPI_CLK
	#define SPI_CLK 	P1_0	// CLOCK OUPUT
	#define SPI_MOSI 	P1_1	// Master Output and Slave Input(LCD_SDIN)
	#define SPI_MISO 	P1_2	// Master Input and Slave Output(LCD_SDOUT)
#endif
// -----------------------------------------------------------------------------

// --------------------------- Function Prototypes -----------------------------
// Send a bit to the SPI device
void spi_sendbit(bit bitx);
// Send a byte to the SPI device
void spi_sendbyte(uint8 dByte);
// Read a byte from the SPI device
uint8 spi_readbyte(void);
// -----------------------------------------------------------------------------

#include "spi.c"
#endif
// -----------------------------------------------------------------------------

⌨️ 快捷键说明

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