描述
本文来源电子发烧友社区,作者:卢松涛, 帖子地址:
https://bbs.elecfans.com/jishu_2249212_1_1.html新建的项目有很多功能的参考用法demo 红绿蓝色LED灯: ///----Chapter 5 GPIO Test Init --------------------------------------------------------------------------------- GPIO_MODE_Init(GPIOA,PIN8,GPIO_MODE_OUTPUT); //GPIO 模式 GPIO_MODE_Init(GPIOA,PIN10,GPIO_MODE_OUTPUT); //GPIO 模式 GPIO_MODE_Init(GPIOA,PIN12,GPIO_MODE_OUTPUT); //GPIO 模式demo UART: ///---- Chapter 15 UART Test Init ------------------------------------------------------------------------------- //uint8_t upack1[20] = {0,1,2,3,4,5,6,7,8,9}; //uint8_t upack2[20] = {0,1,2,3,4,5,6,7,8,9}; //uint8_t upack3[20] = {0,1,2,3,4,5,6,7,8,9}; //uint8_t upack4[20] = {10,1,2,3,4,5,6,7,8,9}; //UART_Init_case1(UART2);//非中断模式 //UART_Init_case1(UART3);//非中断模式 //UART_Init_case1(UART4);//非中断模式 UART_Init_IT_case1(UART1);//中断模式 //UART_Init_IT_case1(UART4);//中断模式 Interrupt_Enable(UART1_int_ID);//CLIC使能单个中断 UART1->CTRL |= 0x00000001U; //清除中断标志位,防止开机先进一次中断 //Interrupt_Enable(UART4_int_ID);//CLIC使能单个中断 SYS_Interrupt_Enable();//CLIC开总中断 //printf("uart init:rn");串口控制a8GPIO_Write(GPIOA,PIN8,GPIO_RESET);10000ms a10GPIO_Toggle(GPIOA,PIN10); //GPIO 翻转
-
#include "headfile.h"
-
-
void mp_receive_data(uint8_t *buf, uint16_t *len)
-
{
-
uint8_t rxlen = UART1_RX_CNT;
-
uint16_t i = 0;
-
*len = 0; //默认为0
-
Delay32M_ms(10); //等待40ms,连续超过10ms没有接收到一个数据,则认为接收结束
-
if (rxlen == UART1_RX_CNT && rxlen) //接收到了数据,且接收完成了
-
{
-
for (i = 0; i < rxlen; i++)
-
{
-
buf[i] = uart_dev.rxbuf[i];
-
}
-
*len = UART1_RX_CNT; //记录本次数据长度
-
UART1_RX_CNT = 0; //清零
-
uart_dev.frameok=1; //标记完成一帧数据接收
-
// getData=0; //数据接收完成,标志位清零
-
}
-
}
-
#define Max_Column 128
-
-
uint8_t ReceiveBuff[RECV_LEN];
-
int main(void)
-
{
-
-
uint16_t rlen=0;
-
uart_dev.rxlen=0;
-
///----System Init ---------------------------------------------------------------------------------------------
-
CLIC_Init();//系统中断配置
-
System_Clock_Init();//系统时钟初始化
-
-
///----Chapter 3 LowPower Test Init ---------------------------------------------------------------------------------
-
//低功耗测功耗需要IO不能悬空
-
//Delay32M_ms(5000);
-
//LowPower_Config_case1();//所有IO设置为输入,下拉
-
//LowPower_Config_case2();//所有IO设置为输入,上拉
-
-
//使用外部中断唤醒
-
//GPIO_EXIT_Init_case1(GPIOA, PIN2);//检测高电平
-
//Interrupt_Level(EXIT2_int_ID, INT_LEVEL0);//CLIC设置中断抢占级别
-
//Interrupt_Enable(EXIT2_int_ID);//CLIC使能EXIT中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
//配置不同低功耗模式
-
//System_Halt();//待机模式 halt1
-
//System_Sleep();//睡眠模式 halt2
-
//System_Powerdown();//掉电模式 powerdown1
-
//System_DeepPwd();//掉电模式 powerdown2
-
-
///----Chapter 5 GPIO Test Init ---------------------------------------------------------------------------------
-
GPIO_MODE_Init(GPIOA,PIN8,GPIO_MODE_OUTPUT); //GPIO 模式
-
GPIO_MODE_Init(GPIOA,PIN10,GPIO_MODE_OUTPUT); //GPIO 模式
-
GPIO_MODE_Init(GPIOA,PIN12,GPIO_MODE_OUTPUT); //GPIO 模式
-
//GPIO_MODE_Init(GPIOA,PIN14,GPIO_MODE_OUTPUT); //GPIO 模式
-
//GPIO_MODE_Init(GPIOA,PIN15,GPIO_MODE_OUTPUT); //GPIO 模式
-
-
//GPIO_Write(GPIOA,PIN8,GPIO_SET); //GPIO 输出
-
//GPIO_Write(GPIOA,PIN10,GPIO_SET); //GPIO 输出
-
//GPIO_Write(GPIOA,PIN12,GPIO_SET); //GPIO 输出
-
//GPIO_Write(GPIOA,PIN14,GPIO_RESET); //GPIO 输出
-
//GPIO_Write(GPIOA,PIN15,GPIO_RESET); //GPIO 输出
-
-
//GPIO_Toggle(GPIOA,PIN15); //GPIO 翻转
-
//GPIO_MODE_Init(GPIOA,PIN15,GPIO_MODE_INTPUT); //GPIO 模式
-
for(uint8_t i=0;i<10;i++)
-
{
-
GPIO_Toggle(GPIOA,PIN8); //GPIO 翻转
-
Delay32M_ms(100);
-
}
-
-
///---- Chapter 6 EXIT Test Init -------------------------------------------------------------------------------------
-
//GPIO_EXIT_Init_case1(GPIOA, PIN2);//检测高电平
-
//GPIO_EXIT_Init_case2(GPIOA, PIN2);//检测低电平
-
//GPIO_EXIT_Init_case3(GPIOA, PIN2);//检测上升沿
-
//GPIO_EXIT_Init_case4(GPIOA, PIN2);//检测下降沿
-
-
//Interrupt_Level(EXIT2_int_ID, INT_LEVEL0);//CLIC设置中断抢占级别
-
//Interrupt_Enable(EXIT2_int_ID);//CLIC使能EXIT中断
-
-
//载波检测中断
-
//CAW_Init();//载波检测
-
//Interrupt_Enable(CAW_int_ID);//CLIC使能中断
-
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
///---- Chapter 7 RTC Test Init --------------------------------------------------------------------------------------
-
//RTC_Init_case1();
-
-
///---- Chapter 8 IWDG Test Init -------------------------------------------------------------------------------------
-
//IWDG_Init(9000); //配置看门狗计数值(时钟频率3K)
-
//Delay32M_ms(1000);
-
//IWDG_Start(); //启动看门狗
-
//IWDG_Refresh(); //喂狗
-
-
///---- Chapter 9 timer Test Init ------------------------------------------------------------------------------------
-
//GPIO_MODE_Init(GPIOB,PIN11,GPIO_MODE_OUTPUT); //GPIO 模式
-
//GPIO_MODE_Init(GPIOA,PIN9,GPIO_MODE_OUTPUT);
-
//GPIO_MODE_Init(GPIOA,PIN11,GPIO_MODE_OUTPUT);
-
//GPIO_MODE_Init(GPIOA,PIN13,GPIO_MODE_OUTPUT);
-
-
//外设配置
-
//Timer1_UpCounting_Mode_Init();//向上计数
-
//Timer1_6StepPWM_Mode_Init();//6stepPWM输出
-
//Timer2_UpCounting_Mode_Init();//向上计数
-
//Timer2_DownCounting_Mode_Init();//向下计数
-
//Timer2_ExternalClock_Mode_Init();//外部时钟
-
//Timer2_InputCapture_Mode_Init();//输入捕获
-
//Timer2_PWM_InputCapture_Mode_Init();//PWM输入捕获
-
//Timer2_Input_XOR_Mode_Init();//输入异或
-
//Timer2_PWM_Mode_Init();//PWM输出
-
//Timer2_6StepPWM_Mode_Init();//6stepPWM输出
-
-
//设置中断优先级
-
//Interrupt_Level(TIMER1_updata_int_ID, INT_LEVEL1);//CLIC设置中断抢占级别
-
-
//使能外设中断
-
//Interrupt_Enable(TIMER1_break_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER1_updata_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER1_capture_compare_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER1_trigger_comm_int_ID);//CLIC使能中断
-
-
//Interrupt_Enable(TIMER2_break_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER2_updata_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER2_capture_compare_int_ID);//CLIC使能中断
-
//Interrupt_Enable(TIMER2_trigger_comm_int_ID);//CLIC使能中断
-
-
//使能系统总中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
///---- Chapter 10 WUP Test Init -------------------------------------------------------------------------------------
-
//GPIO_MODE_Init(GPIOA,PIN2,GPIO_MODE_OUTPUT);
-
//GPIO_MODE_Init(GPIOA,PIN3,GPIO_MODE_OUTPUT);
-
-
//WUP_Init_case1(9000);//设置中断周期,使能WUP中断
-
//Interrupt_Enable(WUP_int_ID);//CLIC使能中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
//配置不同低功耗模式
-
//System_Halt();//待机模式 halt1
-
//System_Sleep();//睡眠模式 halt2
-
//System_Powerdown();//掉电模式 powerdown1
-
//System_DeepPwd();//掉电模式 powerdown2
-
-
///---- Chapter 11 ADC Test Init -------------------------------------------------------------------------------------
-
-
-
-
///---- Chapter 12 I2C Test Init -------------------------------------------------------------------------------------
-
-
//I2C_Init_case2();//ready中断模式
-
//I2C_Init_case3();//error中断模式
-
//I2C_Init_case4();//ready & error中断模式
-
-
//Interrupt_Enable(I2C_ready_int_ID);//CLIC使能i2c_ready中断
-
//Interrupt_Enable(I2C_error_int_ID);//CLIC使能i2c_error中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
///---- Chapter 13 SPI1 Test Init ------------------------------------------------------------------------------------
-
//uint8_t sTxpack[10] = {0,1,2,3,4,5,6,7,8,9};
-
//uint8_t sRxpack[10] = {0,1,2,3,4,5,6,7,8,9};
-
//uint8_t REG_Data;
-
-
//SPI1 Init Test
-
//SPI_Init_case1(SPI1);//非中断模式
-
//SPI1_CSN_Init_case1();//CFG: CE-GPIO7,CSN-GPIO8
-
//SPI_Init_case2(SPI1);//中断模式
-
//Interrupt_Enable(SPI1_int_ID);//CLIC使能单个中断
-
-
//SPI2 Init Test
-
//SPI_Init_case1(SPI2);//非中断模式
-
//SPI2_CSN_Init_case1();//CFG: CE-GPIO7,CSN-GPIO8
-
//SPI_Init_case2(SPI2);//中断模式
-
//Interrupt_Enable(SPI2_int_ID);//CLIC使能单个中断
-
-
-
///---- Chapter 15 UART Test Init -------------------------------------------------------------------------------
-
//uint8_t upack1[20] = {0,1,2,3,4,5,6,7,8,9};
-
//uint8_t upack2[20] = {0,1,2,3,4,5,6,7,8,9};
-
//uint8_t upack3[20] = {0,1,2,3,4,5,6,7,8,9};
-
//uint8_t upack4[20] = {10,1,2,3,4,5,6,7,8,9};
-
-
//UART_Init_case1(UART2);//非中断模式
-
//UART_Init_case1(UART3);//非中断模式
-
//UART_Init_case1(UART4);//非中断模式
-
-
UART_Init_IT_case1(UART1);//中断模式
-
//UART_Init_IT_case1(UART4);//中断模式
-
Interrupt_Enable(UART1_int_ID);//CLIC使能单个中断
-
UART1->CTRL |= 0x00000001U; //清除中断标志位,防止开机先进一次中断
-
//Interrupt_Enable(UART4_int_ID);//CLIC使能单个中断
-
-
SYS_Interrupt_Enable();//CLIC开总中断
-
//printf("uart init:rn");
-
-
///---- Chapter 16 LV Test Init --------------------------------------------------------------------------------------
-
//LV_Init_case1(12);//设置低压报警阈值
-
//LV_Interrupt_Enable();//使能低压报警中断
-
//Interrupt_Enable(LV_int_ID);//CLIC使能单个中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
///---- Chapter 17 RANDGEN Test Init ---------------------------------------------------------------------------------
-
//uint32_t rand_data;
-
-
///---- Chapter 18 compare Test Init ---------------------------------------------------------------------------------
-
//COPM1_Init();//COPM1
-
//Interrupt_Enable(COMP1_int_ID);//CLIC使能单个中断
-
//COPM2_Init();//COPM2
-
//Interrupt_Enable(COMP2_int_ID);//CLIC使能单个中断
-
//COPM3_Init();//COPM3
-
//Interrupt_Enable(COMP3_int_ID);//CLIC使能单个中断
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
-
///---- Chapter 22 flash Test Init ----------------------------------------------------------------------------------
-
//NVR_RW_Test();//NVR read and write test
-
//Flash_RW_Test();
-
-
///---- 系统总中断控制 -------------------------------------------------------------------------------------------------
-
//SYS_Interrupt_Enable();//CLIC开总中断
-
//SYS_Interrupt_Disable();//CLIC关总中断
-
adc_pack[0]=read_csr(mcycle);
-
adc_pack[1]=read_csr(mcycle);
-
ee_printf("nHello CSM32RV20:n");
-
ee_printf("mcycle:%d n",read_csr(mcycle));//比如mcycle这一CSR用于处理器运行的时钟周期计数
-
ee_printf("read_csr(mcycle):%d n",adc_pack[1]-adc_pack[0]);//比如mcycle这一CSR用于处理器运行的时钟周期计数
-
ee_printf("CMU->OSC_SR:%x n",CMU->OSC_SR );
-
if(CMU->OSC_SR==210 ) ee_printf("CMU->OSC_SR:210,OSC 时钟已稳定,RCOSC 时钟已稳定,:OSC 在为 MCU 提供时钟;OSC 在为外设提供时钟; n" );
-
//printf("Hello CSM32RV20:rn");
-
-
ee_printf("请输入:on 或者off (开灯/关灯)rn");
-
uint32_t rt_tick1 = rt_tick_get();
-
uint32_t rt_tick2 = rt_tick_get();
-
-
Delay32M_ms(1000);
-
// OLED_Light();
-
// OLED_DrawBMP(0,0,128,8,BAD_APPLE);
-
-
while(1)
-
{
-
mp_receive_data(ReceiveBuff, &rlen);
-
if(uart_dev.frameok==1) //如果接收到数据
-
{
-
ee_printf("收到数据:");
-
-
Uart_Send(UART1,(uint8_t *)ReceiveBuff,rlen);
-
-
ee_printf("rn");
-
uint8_t aton= (uint8_t)ReceiveBuff[0];
-
uint32_t data=0;
-
switch (aton) {
-
case 111://"o"
-
if(1==rlen) break;
-
if(ReceiveBuff[1]=='n')
-
{
-
GPIO_Write(GPIOA,PIN8,GPIO_RESET);
-
ee_printf("灯开了!rn");
-
}
-
else if((ReceiveBuff[1]=='f')&&(ReceiveBuff[2]=='f'))
-
{
-
GPIO_Write(GPIOA,PIN8,GPIO_SET);
-
ee_printf("关灯了!rn");
-
}
-
else
-
{
-
ee_printf("请输入:on 或者off (开灯/关灯)rn");
-
}
-
break;
-
-
-
-
default:
-
break;
-
}
-
-
-
-
-
-
-
uart_dev.frameok=0;
-
uart_dev.rxlen=0;
-
}
-
if( rt_tick_get()%1000==0) ee_printf("time is %u s n",rt_tick_get()/1000);
-
if(!( rt_tick_get()- rt_tick1< 10000)){
-
rt_tick1 = rt_tick_get() ;
-
GPIO_Toggle(GPIOB,PIN8);
-
GPIO_Toggle(GPIOA,PIN10); //GPIO 翻转
-
// ee_printf("mcycle:%u n",read_csr(mcycle));
-
ee_printf("rt_tick_get:%u n", rt_tick_get());
-
ee_printf("RTC_MTIME->mtime:%lu ",RTC_MTIME->mtime);
-
// ee_printf("type?RTC_MTIME->mtime:%lu n",type(RTC_MTIME->mtime));
-
ee_printf("RTC_MTIME->mtime0-7B:");
-
for (uint8_t i = 0; i < 8; i++)
-
{
-
ee_printf("%x ",_REG8(0x0200bff8UL,i));
-
}
-
-
ee_printf("nRTC_MTIME->mtime:%u n",_REG32(0x0200bff8UL,4));
-
-
ee_printf("RTC_MTIMECMP->mtimecmp:%lu n",RTC_MTIMECMP->mtimecmp);
-
// ee_printf("type?RTC_MTIME->mtime:%lu n",type(RTC_MTIMECMP->mtimecmp));
-
ee_printf("->?RTC_MTIME->mtime:%p n",RTC_MTIMECMP->mtimecmp);
-
ee_printf("RTC_MTIMECMP->mtimecmp0-7B:");
-
for (uint8_t i = 0; i < 8; i++)
-
{
-
ee_printf("%x ",_REG8(0x02004000UL,i));
-
}
-
-
ee_printf(" n");
-
}
-
// Delay32M_ms(500);
-
//Delay16M_ms(500);
-
//Delay16M_us(500000);
-
//GPIO_Toggle(GPIOA,PIN15);
-
-
//printf("main:rn");
-
-
///---- Chapter 6 EXIT test ---------------------------------------------------------------------------------
-
//delay16M_ms(500);
-
//GPIO_Toggle(GPIOA,PIN15);
-
-
-
///---- Chapter 8 IWDG test ---------------------------------------------------------------------------------
-
//IWDG_Refresh();
-
//delay16M_ms(500);
-
//GPIO_Toggle(GPIOA,PIN15);
-
-
///---- Chapter 9 Timer test --------------------------------------------------------------------------------
-
//---- soft break --------------------------------------------------------------------------------------
-
//delay16M_ms(100);
-
//TIMER2->BDTR |= 1 <<15;//BDTR[15]-MOE-主输出使能:0-关闭,1-使能
-
//delay16M_ms(100);
-
//TIMER2->EGR |= 1 <<7;//EGR[7]-BG-产生刹车事件
-
//---- soft COM ----------------------------------------------------------------------------------------
-
//delay16M_ms(100);
-
//TIMER2->EGR = 1 <<5;//EGR[5]-COMG-捕获/比较事件,产生控制更新
-
//---- generate oxr ------------------------------------------------------------------------------------
-
/*
-
Delay16M_ms(10);//1
-
GPIO_Write(GPIOA,PIN9,GPIO_SET);
-
GPIO_Write(GPIOA,PIN11,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN13,GPIO_SET);
-
Delay16M_ms(10);//2
-
GPIO_Write(GPIOA,PIN9,GPIO_SET);
-
GPIO_Write(GPIOA,PIN11,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN13,GPIO_RESET);
-
Delay16M_ms(10);//3
-
GPIO_Write(GPIOA,PIN9,GPIO_SET);
-
GPIO_Write(GPIOA,PIN11,GPIO_SET);
-
GPIO_Write(GPIOA,PIN13,GPIO_RESET);
-
Delay16M_ms(10);//4
-
GPIO_Write(GPIOA,PIN9,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN11,GPIO_SET);
-
GPIO_Write(GPIOA,PIN13,GPIO_RESET);
-
Delay16M_ms(10);//5
-
GPIO_Write(GPIOA,PIN9,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN11,GPIO_SET);
-
GPIO_Write(GPIOA,PIN13,GPIO_SET);
-
Delay16M_ms(10);//6
-
GPIO_Write(GPIOA,PIN9,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN11,GPIO_RESET);
-
GPIO_Write(GPIOA,PIN13,GPIO_SET);
-
*/
-
-
///---- Chapter 11 ADC test ---------------------------------------------------------------------------------
-
-
///---- Chapter 12 I2C test ---------------------------------------------------------------------------------
-
//I2C_Write(0x2d,0x55);//适用于非中断模式
-
//i2c_data = I2C_Read(0x2d);//适用于非中断模式
-
//printf("data:%xrn",i2c_data);
-
//I2C_Write(0x2d,0xaa);//适用于非中断模式
-
//i2c_data = I2C_Read(0x2d);//适用于非中断模式
-
//printf("data:%xrn",i2c_data);
-
//I2C_Write_IT(0x2d,0x55);//适用于中断模式
-
-
///---- Chapter 13 SPI test --------------------------------------------------------------------------------
-
//SPI1 Test
-
//SPI_Transceive(SPI1,sTxpack,sRxpack,10);//非中断模式
-
//SPI1_RW_reg(WRITE_REG+0x05,0x53);//读写Si24R1寄存器
-
//REG_Data = SPI1_RW_reg(READ_REG+0x05,0);//读写Si24R1寄存器
-
//printf("rnREG5:%02x",REG_Data);
-
//delay16M_ms(500);
-
-
//SPI2 Test
-
//SPI_Transceive(SPI2,sTxpack,sRxpack,10);//非中断模式
-
//SPI2_RW_reg(WRITE_REG+0x05,0x53);//读写Si24R1寄存器
-
//REG_Data = SPI2_RW_reg(READ_REG+0x05,0);//读写Si24R1寄存器
-
//printf("rnREG5:%02x",REG_Data);
-
//delay16M_ms(500);
-
-
///---- Chapter 15 UART Test ------------------------------------------------------------------------------------
-
//---- 非中断模式数据回环测试 -------------------------------------------------------------------------------------
-
//Uart_Reveive(UART1,upack1,10);//适用于非中断发送模式
-
//Uart_Send(UART1,upack1,10);//适用于非中断发送模式
-
//Uart_Reveive(UART2,upack2,10);//适用于非中断发送模式
-
//Uart_Send(UART2,upack2,10);//适用于非中断发送模式
-
//Uart_Reveive(UART3,upack3,10);//适用于非中断发送模式
-
//Uart_Send(UART3,upack3,10);//适用于非中断发送模式
-
//Uart_Reveive(UART4,upack4,10);//适用于非中断发送模式
-
//Uart_Send(UART4,upack4,10);//适用于非中断发送模式
-
-
//---- 中断模式数据回环测试 --------------------------------------------------------------------------------------
-
//UART1_putbuf(UART1_getbuf());
-
-
//---- printf测试 ----------------------------------------------------------------------------------------
-
//printf("Hellow-01234568789abcdefghijklmnopqrstuvwxyzrn");
-
-
-
///---- Chapter 17 RANDGEN test -----------------------------------------------------------------------------
-
//rand_data = RAND_Get();//生成随机数
-
//printf("rand:0x%08x,%urn",rand_data,rand_data);
-
//delay16M_ms(500);
-
-
-
///---- Chapter 18 COMPARE test -----------------------------------------------------------------------------
-
//if(COMP1->irq&0x1)
-
//{
-
//GPIO_Toggle(GPIOA,PIN15);
-
//COMP1->irq = 1;
-
//}
-
//delay16M_ms(10);
-
-
}
-
-
return 0;
-
}
-
-
-
-
-
-
复制代码
com:
Hello CSM32RV20:
mcycle:112549883
read_csr(mcycle):2
CMU->OSC_SR:d2
CMU->OSC_SR:210,OSC 时钟已稳定,RCOSC 时钟已稳定,:OSC 在为 MCU 提供时钟;OSC 在为外设提供时钟;
请输入:on 或者off (开灯/关灯)
收到数据:
rt_tick_get:11529
RTC_MTIME->mtime:36899472 RTC_MTIME->mtime0-7B:4a 4c 33 2 0 0 0 0
RTC_MTIME->mtime:0
RTC_MTIMECMP->mtimecmp:36934400
->?RTC_MTIME->mtime:0233b880
RTC_MTIMECMP->mtimecmp0-7B:0 3 34 2 0 0 0 0
val:6700 avr:14062513 981.4mV 2108.0mV
time:0 day 0 hour' 0:16
rt_tick_get:21537
RTC_MTIME->mtime:68926545 RTC_MTIME->mtime0-7B:c fd 1c 4 0 0 0 0
RTC_MTIME->mtime:0
RTC_MTIMECMP->mtimecmp:68960000
->?RTC_MTIME->mtime:041c6480
RTC_MTIMECMP->mtimecmp0-7B:0 af 1c 4 0 0 0 0
收到数据:on
灯开了!
rt_tick_get:61655
RTC_MTIME->mtime:197302775 RTC_MTIME->mtime0-7B:c8 dd c2 b 0 0 0 0
RTC_MTIME->mtime:0
RTC_MTIMECMP->mtimecmp:197337600
->?RTC_MTIME->mtime:0bc34780
RTC_MTIMECMP->mtimecmp0-7B:0 92 c3 b 0 0 0 0
time is 63 s
收到数据:off
关灯了!
打开APP阅读更多精彩内容