68k_spi.h

来自「uCOSII在motorala单片机上的移植」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef	__68K_SPI_H
#define	__68K_SPI_H

// bits in port qs pin assignment register;
#define	BM_PQSPA0	0x01
#define	BM_PQSPA1	0x02
#define	BM_PQSPA3	0x08
#define	BM_PQSPA4	0x10
#define	BM_PQSPA5	0x20
#define	BM_PQSPA6	0x40
// bits in port qs data direction register;
#define	BM_DDQS0	0x01
#define	BM_DDQS1	0x02
#define	BM_DDQS3	0x08
#define	BM_DDQS4	0x10
#define	BM_DDQS5	0x20
#define	BM_DDQS6	0x40
// bits in port qs data register; 
#define	BM_PQS2		0x04
#define	BM_PQS3		0x08
#define	BM_PQS4		0x10	
#define	BM_PQS5		0x20
#define	BM_PQS6		0x40
// bits in QSPI control register 0;
#define	BM_MSTR		0x8000
#define	BM_WOMQ	0x4000
#define	BM_CPOL		0x0200
#define	BM_CPHA		0x0100
// bits in QSPI control register 1;
#define	BM_SPE		0x8000
// bits in QSPI control register 2;
#define	BM_SPIFIE	0x8000
#define	BM_WREN	0x4000
#define	BM_WRTO	0x2000
// bits in QSPI control register 3;
#define	BM_LOOPQ	0x04
#define	BM_HMIE		0x02
#define	BM_HALT		0x01
// bits in QSPI status register;
#define	BM_SPIF		0x80
#define	BM_MODF		0x40
#define	BM_HALTA	0x20

// function declaration;		
void initSPI(void);
void setSPIBaudRate(INT8U spbr);
void setNewQueuePointer(INT8U newqp);
void setEndQueuePointer(INT8U endqp);

#endif

⌨️ 快捷键说明

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