📄 spi.h
字号:
// -------------------------- 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -