spisubs.c
来自「dsPIC30F4011 SPI 範例程式 此壓縮檔包含 MCP4921 SP」· C语言 代码 · 共 26 行
C
26 行
#include <p30F4011.h>
#include <spi.h>
#include "spiSubs.h"
#define MODE_SPICS ADPCFGbits.PCFG2
void Init_SPI(void)
{
unsigned int config1 , config2 ;
MODE_SPI_CS = 1 ; // CS PIN for SPIis Digital Mode
SPI_CS = 1 ; // Inactive CS
DIR_SPI_CS = 1 ; // SS PIN is "input" when Slave mode
SPI1CON = 0x22dc ; // 0010 0010 1101 1100
SPI1STAT = 0xa000 ; // 1010 0000 0000 0000
SPI1BUF = 0x00 ;
ConfigIntSPI1(SPI_INT_EN & SPI_INT_PRI_4) ;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?