CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Committer:
ee12b079
Date:
Sun Jul 10 13:47:26 2016 +0000
Revision:
245:da9d1bd999da
Parent:
209:63e9c8f8b5d2
Child:
248:407ab7e337cd
Child:
253:fd6696d91e74
Making integrated code of CDMS

Who changed what in which revision?

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