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

📄 spi.h

📁 ST7032i驱动应用实例(I2C接口)
💻 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 + -