| Motore di ricerca datesheet componenti elettronici |
|
AN1780 Scheda tecnica(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1780 Scheda tecnica(HTML) 7 Page - STMicroelectronics |
|
7 / 9 page ![]() 7/9 STR71X REAL TIME CLOCK APPLICATION EXAMPLE time_t TIME; struct tm *ptim; RCCU_ResetSources ResetSources; int main(void) { RTC_FlagClear ( RTC_OWIR ); RTC_FlagClear ( RTC_AIR ); RTC_FlagClear ( RTC_SIR ); RTC_FlagClear ( RTC_GIR ); RTC_PrescalerConfig(RTC_PRESC); ptim=malloc(sizeof(*ptim)); printf("s:"); scanf("%d, ",&ptim->tm_sec); printf("m:"); scanf("%d, ",&ptim->tm_min); printf("h:"); scanf("%d",&ptim->tm_hour); printf("D:"); scanf("%d,",&ptim->tm_mday); printf("M:"); scanf("%d,",&ptim->tm_mon); ptim->tm_mon--; printf("Y:"); scanf("%d",&ptim->tm_year); ptim->tm_year-=1900; TIME = mktime(ptim)-0x3FF36300; RTC_WaitForLastTask(); RTC_EnterCfgMode(); // Enter In Configuration Mode RTC_WaitForLastTask(); // Wait For Last Task Completion RTC->CNTL = TIME & 0x0000FFFF; RTC_WaitForLastTask(); // Wait For Last Task Completion RTC->CNTH = ( TIME & 0xFFFF0000 ) >> 16; RTC_WaitForLastTask(); // Wait For Last Task Completion RTC_ExitCfgMode (); // Exit From Configuration Mode // RTC_AlarmConfig(TIME+15); RTC_AlarmConfig(RTC_CounterValue()+5); EIC_IRQChannelConfig( RTC_IRQChannel, ENABLE );// Enable RTC IRQ channel EIC_IRQChannelPriorityConfig( RTC_IRQChannel, 1); EIC_IRQConfig( ENABLE ); RTC_ITConfig( RTC_AIT|RTC_GIT, ENABLE ); // Enable alarm Interrupt // LCD_UnderlineCursorOff(); gotoxy(1,1); printf(" "); gotoxy(1,2); |
|
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |