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