s12_spi.h

来自「source code for a sample alarm control p」· C头文件 代码 · 共 44 行

H
44
字号
//=============================================================================
// File: S12_SPI.H - V1.00
// Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd
//=============================================================================

#ifndef __S12_SPI_H
#define __S12_SPI_H

//-- SPI Bit Mask Definitions -------------------------------------------------

// Bits in SPIxCR1:
#define BM_SPIE		0x80
#define BM_SPE		0x40
#define BM_SPTIE	0x20
#define BM_MSTR		0x10
#define BM_CPOL		0x08
#define BM_CPHA		0x04
#define BM_SSOE		0x02
#define BM_LSBFE	0x01

// Bits in SPIxCR2:
//#define reserved	0x80
//#define reserved	0x40
//#define reserved	0x20
#define BM_MODFEN	0x10
#define BM_BIDIROE	0x08
//#define reserved	0x04
#define BM_SPISWAI	0x02
#define BM_SPC0		0x01

// Bits in SPIxSR:
#define BM_SPIF		0x80
//#define reserved	0x40
#define BM_SPTEF	0x20
#define BM_MODF		0x10

//-- Function Prototypes ------------------------------------------------------

void initSPI0(UINT8 bauddiv, UINT8 cpol, UINT8 cpha);
UINT8 xferSPI0(UINT8 abyte);

#endif //__S12_SPI_H ==========================================================

⌨️ 快捷键说明

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