Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TFOX_CDMS_VR_1_0_WORKING by
Diff: RTC.cpp
- Revision:
- 2:4c79b3dfef31
- Parent:
- 0:d6e3d1e21484
- Child:
- 3:0c3f7c3fabc9
--- 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;
