📄 spi.h
字号:
// -------------------------- Header file for spi.c ----------------------------
#ifndef __SPI_BUS__
#define __SPI_BUS__
//#define HW_SPI // HW/SW SPI select(Define it if use hardware SPI)
// --------------------------- Pins Definition ---------------------------------
#ifndef SPI_CLK
#define SPI_CLK 7 // (PB7)CLOCK OUPUT
#define SPI_MISO 6 // (PB6)Master Input and Slave Output(LCD_SDOUT)
#define SPI_MOSI 5 // (PB5)Master Output and Slave Input(LCD_SDIN)
#endif
// -----------------------------------------------------------------------------
// --------------------------- Function Prototypes -----------------------------
// Initialize the SPI as a master
void spi_init(void);
// Send a bit to the SPI device
void spi_sendbit(uint8 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 + -