📄 main.c
字号:
#include <cdefBF535.h>
#include <defBF535.h>
#include <signal.h>
int READ_DATA_ADC;
void sport0_isr(int i);
void main(void)
{
//Interrupt set up for the SPORT0
interrupt(SIGIVG8, sport0_isr);
*pSIC_IMASK = SIC_MASK_ALL;
//SPORT0 configuration
*pSPORT0_RSCLKDIV = 0x10;//Determines the SCLK frequency and hence the data bit rate
*pSPORT0_RFSDIV = 0x10;
//*pSPORT0_RX_CONFIG = RSPEN | ICLK | DTYPE1 | SLEN14 | IRFS | RFSR | LRFS | LARFS ;
*pSPORT0_RX_CONFIG = 0x37A3;
while(1)
{
//wait for SPORT receive interrupts
}
}
void sport0_isr(int i)
{
READ_DATA_ADC = *pSPORT0_RX;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -