spi.h
来自「EMB91SAM7S64开发板(全套资料)」· C头文件 代码 · 共 36 行
H
36 行
/*----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support - ROUSSET -
*----------------------------------------------------------------------------
* The software is delivered "AS IS" without warranty or condition of any
* kind, either express, implied or statutory. This includes without
* limitation any warranty or condition with respect to merchantability or
* fitness for any particular purpose, or against the infringements of
* intellectual property rights of others.
*----------------------------------------------------------------------------
* File Name : Board.h
* Object : AT91SAM7S Evaluation Board Features Definition File.
*
* Creation : JPP 16/Jun/2004
*----------------------------------------------------------------------------
*/
#ifndef _SPI_H_
#define _SPI_H_
#include "Board.h"
#include "types.h"
#define SPI_0 AT91C_PA11_NPCS0 /* MCP2510 A */
#define SPI_1 AT91C_PA31_NPCS1 /* MCP2510 A */
#define SPI_CE(DEV_mun,x) (x?((*AT91C_PIOA_SODR)|=DEV_mun):((*AT91C_PIOA_CODR)|=DEV_mun))
#define SPI_CLK(x) (x?((*AT91C_PIOA_SODR)|=AT91C_PA14_SPCK):((*AT91C_PIOA_CODR)|=AT91C_PA14_SPCK))
#define SPI_MOSI(x) (x?((*AT91C_PIOA_SODR)|=AT91C_PA13_MOSI):((*AT91C_PIOA_CODR)|=AT91C_PA13_MOSI))
#define SPI_MISO ( (*AT91C_PIOA_PDSR)&AT91C_PA12_MISO?1:0 )
extern void OutByte(uchar ByteVal);
extern uchar InByte(void);
#endif /* Board_h */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?