![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
vr1.1
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of CDMS_RTOS_v1_1 by
Diff: RTC.cpp
- Revision:
- 2:4c79b3dfef31
- Parent:
- 0:d6e3d1e21484
- Child:
- 3:0c3f7c3fabc9
diff -r f926f14a52d8 -r 4c79b3dfef31 RTC.cpp --- a/RTC.cpp Mon Jun 15 13:03:26 2015 +0000 +++ b/RTC.cpp Mon Jun 15 13:32:28 2015 +0000 @@ -2,11 +2,11 @@ #include "func_head.h" SPI rtc_spi(PTD6,PTD7,PTD5); // MOSI,MISO, CLOCK microcontroller(in order) -DigitalOut rtc_cs(PTA13); //Slave Select pin +DigitalOut rtc_cs(PTD4); //Slave Select pin //Serial pc(USBTX,USBRX); -uint8_t* FUNC_CDMS_RD_RTC() -{ +void FUNC_INIT_RTC() +{ rtc_cs=1; rtc_spi.format(8,0); rtc_spi.frequency(1000000); @@ -80,7 +80,10 @@ rtc_spi.write(0x87); rtc_spi.write(0x01); //set year to 00(2000) rtc_cs=1; - +} + +uint8_t* FUNC_CDMS_RD_RTC() +{ uint8_t response; rtc_cs=1; rtc_cs=0;