91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9.15MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-21
  • 語言: 其他
  • 標簽: STM32L152??RTC??

資源簡介

STM32L152 RTC 讀取時間和日期,用串口將時間發送出來,測試了年月日進位都正常。

資源截圖

代碼片段和文件信息

/********************?(C)?COPYRIGHT?2016?ZhouJun?******************************
*?File?Name??????????:?main.c
?hardware ?:?STM32L152
*?Author?????????????:?ZhouJun
*?Version????????????:?V1.0
*?Date???????????????:?20161120
*?Description????????:?藥品追溯項目主函數
********************************************************************************/
?/*---------------------------?頭文件包含?--------------------------------------*/

#include?“main.h“

/*?Private?typedef?-----------------------------------------------------------*/
/*?Private?define?------------------------------------------------------------*/


/*?Private?macro?-------------------------------------------------------------*/
/*?Private?variables?---------------------------------------------------------*/


/*?Private?function?prototypes?-----------------------------------------------*/
void?SysTickConfig(void);


//毫秒級的延時??
static?void?Delay_ms(u16?time)?
{????????
u16?i=0;??????
while(time--)????
{????????
// i=12000*4/9;??//自己定義72M時為10,32M時為4/9???
// i=12000*10/27;
i=4576; //用秒表調試出來10s為10.03,要更準確就用示波器測
while(i--);?????????
}?
}
/*?Private?functions?---------------------------------------------------------*/

/**
??*?@brief??Main?program
??*?@param??None
??*?@retval?None
??*/
int?main(void)
{
RTC_TimeTypeDef? tempRTC_TimeStructure; //RTC時間臨時變量
??/*!???????this?is?done?through?SystemInit()?function?which?is?called?from?startup
???????file?(startup_stm32l1xx_xx.s)?before?to?branch?to?application?main.
???????To?reconfigure?the?default?setting?of?SystemInit()?function?refer?to
???????system_stm32l1xx.c?file
?????*/?????
???????
??/*?RTC?configuration?-------------------------------------------------------*/
??RTC_Config();

InitKeyGpio();
//SX1278
//? RFInit(); ?//射頻模塊初始化
//? //RFRxMode(); ?//進入接收模式
//? RFM96_Config(0); //處于待機模式待機模式1.8mA
//? RFM96_Sleep();
USART_Config(); //串口設置
/*?Set?the?time?to?01h?00mn?00s?AM?*/
SetDateTime(); //設置日期時間

RTC_GetTime(RTC_Format_BIN?&RTC_TimeStructure); //得先讀時間,再讀日期
RTC_GetDate(RTC_Format_BIN?&RTC_DateStructure);
USART3_SendChar(RTC_DateStructure.RTC_Year); //年
USART3_SendChar(RTC_DateStructure.RTC_Month); //月
USART3_SendChar(RTC_DateStructure.RTC_Date); //日

USART3_SendChar(RTC_TimeStructure.RTC_Hours); //時
USART3_SendChar(RTC_TimeStructure.RTC_Minutes); //分
USART3_SendChar(RTC_TimeStructure.RTC_Seconds); //秒
USART3_SendChar(‘\r‘);
USART3_SendChar(‘\n‘);
while(1)
{
Delay_ms(1000);

RTC_GetTime(RTC_Format_BIN?&RTC_TimeStructure); //得先讀時間,再讀日期
RTC_GetDate(RTC_Format_BIN?&RTC_DateStructure);
USART3_SendChar(RTC_DateStructure.RTC_Year); //年
USART3_SendChar(RTC_DateStructure.RTC_Month); //月
USART3_SendChar(RTC_DateStructure.RTC_Date); //日

USART3_SendChar(RTC_TimeStructure.RTC_Hours); //時
USART3_SendChar(RTC_TimeStructure.RTC_Minutes); //分

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????24914??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\CMSIS?END?USER?LICENCE?AGREEMENT.pdf

?????文件?????505206??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Include\stm32l1xx.h

?????文件???????2220??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Include\system_stm32l1xx.h

?????文件??????33403??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Release_Notes.html

?????文件??????14803??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_hd.s

?????文件??????13020??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_md.s

?????文件??????14559??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_mdp.s

?????文件??????14729??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_xl.s

?????文件??????11998??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_hd.s

?????文件??????10669??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_md.s

?????文件??????11745??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_mdp.s

?????文件??????11909??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_xl.s

?????文件??????17100??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_hd.s

?????文件??????14563??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_md.s

?????文件??????16502??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_mdp.s

?????文件??????16918??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_xl.s

?????文件??????20175??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c

?????文件???????3686??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\TASKING\cstart_thumb2.asm

?????文件??????12064??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_hd.s

?????文件??????10737??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_md.s

?????文件??????11806??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_mdp.s

?????文件??????11975??2015-04-20?18:56??10-PWR-RTC-年月日時分秒正常\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_xl.s

?????文件??????11118??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\annotated.html

?????文件???????1082??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\annotated.js

?????文件????????671??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\bc_s.png

?????文件????????147??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\bdwn.png

?????文件????????922??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\check.png

?????文件??????11104??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\classes.html

?????文件????????132??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\closed.png

?????文件??????20532??2015-04-20?14:15??10-PWR-RTC-年月日時分秒正常\CMSIS\Documentation\Core\html\cmsis.css

............此處省略1036個文件信息

評論

共有 條評論