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.
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
RESET_functions.h@303:b49b486a7107, 2016-09-05 (annotated)
- Committer:
- chaithanyarss
- Date:
- Mon Sep 05 11:25:33 2016 +0000
- Revision:
- 303:b49b486a7107
- Parent:
- 289:9bd62b69874c
Merged code
Who changed what in which revision?
| User | Revision | Line number | New 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 | 289:9bd62b69874c | 7 | gPC.printf("\r COM RX resetting\n"); |
| ee12b079 | 245:da9d1bd999da | 8 | COM_RX_CNTRL = 0; |
| ee12b079 | 209:63e9c8f8b5d2 | 9 | wait_ms(10); |
| ee12b079 | 245:da9d1bd999da | 10 | COM_RX_CNTRL =1; |
| ee12b079 | 209:63e9c8f8b5d2 | 11 | } |
| ee12b079 | 209:63e9c8f8b5d2 | 12 | |
| ee12b079 | 209:63e9c8f8b5d2 | 13 | void RESET_RTC() |
| chaithanyarss | 257:7d404e9dc9e2 | 14 | { |
| ee12b079 | 289:9bd62b69874c | 15 | gPC.printf("Resetting RTC"); |
| 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 |
| chaithanyarss | 257:7d404e9dc9e2 | 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 | 253:fd6696d91e74 | 26 | wait_ms(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); |
| chaithanyarss | 257:7d404e9dc9e2 | 38 | } |
