June 30

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Committer:
chaithanyarss
Date:
Thu Jun 30 14:00:33 2016 +0000
Revision:
189:fba4aeebf004
Child:
190:28a07943dded
For integrating PL_Main with rest of CDMS code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chaithanyarss 189:fba4aeebf004 1 DigitalOut pwr_comrx (PIN72)
chaithanyarss 189:fba4aeebf004 2
chaithanyarss 189:fba4aeebf004 3 void RESET_COMRX()
chaithanyarss 189:fba4aeebf004 4 {
chaithanyarss 189:fba4aeebf004 5 pwr_comrx = 0;
chaithanyarss 189:fba4aeebf004 6 wait_ms(10);
chaithanyarss 189:fba4aeebf004 7 pwr_comrx =1;
chaithanyarss 189:fba4aeebf004 8 }
chaithanyarss 189:fba4aeebf004 9
chaithanyarss 189:fba4aeebf004 10 void RESET_RTC()
chaithanyarss 189:fba4aeebf004 11 {
chaithanyarss 189:fba4aeebf004 12 gCS_RTC=1;
chaithanyarss 189:fba4aeebf004 13 gCS_RTC=0;
chaithanyarss 189:fba4aeebf004 14 spi.write(0x81); //register address with write flag
chaithanyarss 189:fba4aeebf004 15 spi.write(0x80);//enabling stop bit in the seconds register
chaithanyarss 189:fba4aeebf004 16
chaithanyarss 189:fba4aeebf004 17 gCS_RTC=1;
chaithanyarss 189:fba4aeebf004 18 gCS_RTC=0;
chaithanyarss 189:fba4aeebf004 19 spi.write(0x81);
chaithanyarss 189:fba4aeebf004 20 spi.write(0x00);//disabling the stop bit to restart the oscillator
chaithanyarss 189:fba4aeebf004 21
chaithanyarss 189:fba4aeebf004 22 wait(4000);
chaithanyarss 189:fba4aeebf004 23 //clearing the halt bit
chaithanyarss 189:fba4aeebf004 24 gCS_RTC=1;
chaithanyarss 189:fba4aeebf004 25 gCS_RTC=0;
chaithanyarss 189:fba4aeebf004 26 spi.write(0x8C);
chaithanyarss 189:fba4aeebf004 27 spi.write(0x00);
chaithanyarss 189:fba4aeebf004 28
chaithanyarss 189:fba4aeebf004 29 //clearing the OF bit
chaithanyarss 189:fba4aeebf004 30 gCS_RTC=1;
chaithanyarss 189:fba4aeebf004 31 gCS_RTC=0;
chaithanyarss 189:fba4aeebf004 32 spi.write(0x8F);
chaithanyarss 189:fba4aeebf004 33 spi.write(0x00);
chaithanyarss 189:fba4aeebf004 34 }
chaithanyarss 189:fba4aeebf004 35
chaithanyarss 189:fba4aeebf004 36