publishing to check changes in cdms code
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE_samp_23SEP_DMA_flag by
RESET_functions.h@214:6848a51af734, 2016-07-03 (annotated)
- Committer:
- chaithanyarss
- Date:
- Sun Jul 03 09:33:33 2016 +0000
- Revision:
- 214:6848a51af734
- Parent:
- 209:63e9c8f8b5d2
- Child:
- 223:7c802e1ccd30
Reset CDMS added;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ee12b079 | 209:63e9c8f8b5d2 | 1 | DigitalOut pwr_comrx (PIN72); |
ee12b079 | 209:63e9c8f8b5d2 | 2 | |
ee12b079 | 209:63e9c8f8b5d2 | 3 | void RESET_COMRX(); |
ee12b079 | 209:63e9c8f8b5d2 | 4 | void RESET_RTC(); |
ee12b079 | 209:63e9c8f8b5d2 | 5 | |
ee12b079 | 209:63e9c8f8b5d2 | 6 | void RESET_COMRX() |
ee12b079 | 209:63e9c8f8b5d2 | 7 | { |
ee12b079 | 209:63e9c8f8b5d2 | 8 | pwr_comrx = 0; |
ee12b079 | 209:63e9c8f8b5d2 | 9 | wait_ms(10); |
ee12b079 | 209:63e9c8f8b5d2 | 10 | pwr_comrx =1; |
chaithanyarss | 214:6848a51af734 | 11 | COMRX_RESET_COUNTER++; |
ee12b079 | 209:63e9c8f8b5d2 | 12 | } |
ee12b079 | 209:63e9c8f8b5d2 | 13 | |
ee12b079 | 209:63e9c8f8b5d2 | 14 | void RESET_RTC() |
ee12b079 | 209:63e9c8f8b5d2 | 15 | { |
ee12b079 | 209:63e9c8f8b5d2 | 16 | gCS_RTC=1; |
ee12b079 | 209:63e9c8f8b5d2 | 17 | gCS_RTC=0; |
ee12b079 | 209:63e9c8f8b5d2 | 18 | spi.write(0x81); //register address with write flag |
ee12b079 | 209:63e9c8f8b5d2 | 19 | spi.write(0x80);//enabling stop bit in the seconds register |
ee12b079 | 209:63e9c8f8b5d2 | 20 | |
ee12b079 | 209:63e9c8f8b5d2 | 21 | gCS_RTC=1; |
ee12b079 | 209:63e9c8f8b5d2 | 22 | gCS_RTC=0; |
ee12b079 | 209:63e9c8f8b5d2 | 23 | spi.write(0x81); |
ee12b079 | 209:63e9c8f8b5d2 | 24 | spi.write(0x00);//disabling the stop bit to restart the oscillator |
ee12b079 | 209:63e9c8f8b5d2 | 25 | |
ee12b079 | 209:63e9c8f8b5d2 | 26 | wait(4000); |
ee12b079 | 209:63e9c8f8b5d2 | 27 | //clearing the halt bit |
ee12b079 | 209:63e9c8f8b5d2 | 28 | gCS_RTC=1; |
ee12b079 | 209:63e9c8f8b5d2 | 29 | gCS_RTC=0; |
ee12b079 | 209:63e9c8f8b5d2 | 30 | spi.write(0x8C); |
ee12b079 | 209:63e9c8f8b5d2 | 31 | spi.write(0x00); |
ee12b079 | 209:63e9c8f8b5d2 | 32 | |
ee12b079 | 209:63e9c8f8b5d2 | 33 | //clearing the OF bit |
ee12b079 | 209:63e9c8f8b5d2 | 34 | gCS_RTC=1; |
ee12b079 | 209:63e9c8f8b5d2 | 35 | gCS_RTC=0; |
ee12b079 | 209:63e9c8f8b5d2 | 36 | spi.write(0x8F); |
ee12b079 | 209:63e9c8f8b5d2 | 37 | spi.write(0x00); |
ee12b079 | 209:63e9c8f8b5d2 | 38 | } |
ee12b079 | 209:63e9c8f8b5d2 | 39 | |
ee12b079 | 209:63e9c8f8b5d2 | 40 |