|
5黑币
- #include "delay.h"
- #include "sys.h"
- #include "oled.h"
- #include "bmp.h"
- #include "myiic.h"
- #include "usart.h"
- int main(void)
- {
- uint temp=0;
- delay_init(); //延时函数初始化
- NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级 LED_Init(); //LED端口初始化
- OLED_Init(); //初始化OLED
- OLED_Clear();
- IIC_Init();
- uart_init(9600);
- SD=0;
-
- // WordWrite1314(LDC1314_CONFIG,0x3601);
- // WordWrite1314(LDC1314_REF_COUNT_CH0,0x04d6);
- // WordWrite1314(LDC1314_SETTLE_COUNT_CH0,0x000a); //时钟配置
- // WordWrite1314(LDC1314_CLOCK_DIVIDERS_CH0,0x1002); //启动时间设置
- // WordWrite1314(LDC1314_ERROR_CONFIG,0x0000); //转换时间设置
- // WordWrite1314(LDC1314_MUX_CONFIG,0x020c); //感应电流大小
- // WordWrite1314(LDC1314_DRIVE_CURRENT_CH0,0x9000); //错误报告配置
- // WordWrite1314(LDC1314_CONFIG,0x020c); //单通道连续转换
- // WordWrite1314(LDC1314_RESET_DEVICE,0x8600);
- WordWrite1314(LDC1314_CONFIG,0x0104);
- WordWrite1314(LDC1314_RESET_DEVICE,0X8600);
- while(1)
- {
- temp=WordRead1314(LDC1314_DEVID);
- printf("%d\r\n", temp);
- LED=!LED;
- delay_ms(1000);
- }
-
- }
复制代码
|
|