working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Committer:
ee12b079
Date:
Sat Jul 02 14:54:52 2016 +0000
Revision:
209:63e9c8f8b5d2
Child:
214:6848a51af734
Child:
224:3ac1f91e0ebc
Merging in process

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ee12b079 209:63e9c8f8b5d2 1
ee12b079 209:63e9c8f8b5d2 2 void P_PL_INIT();
ee12b079 209:63e9c8f8b5d2 3 void P_PL_MAIN();
ee12b079 209:63e9c8f8b5d2 4 void P_COM_INIT();
ee12b079 209:63e9c8f8b5d2 5 void P_CDMS_HK_MAIN();
ee12b079 209:63e9c8f8b5d2 6 void P_PL_RCV_SC_DATA();
ee12b079 209:63e9c8f8b5d2 7 void P_CDMS_INIT_SD();
ee12b079 209:63e9c8f8b5d2 8 void CDMS_SD_SW_ON();
ee12b079 209:63e9c8f8b5d2 9 void CDMS_SD_SW_OFF();
ee12b079 209:63e9c8f8b5d2 10 void SW_ON_BAE();
ee12b079 209:63e9c8f8b5d2 11 void SW_OFF_BAE();
ee12b079 209:63e9c8f8b5d2 12 void SW_ON_PL_BEE();
ee12b079 209:63e9c8f8b5d2 13 void SW_OFF_PL_BEE();
ee12b079 209:63e9c8f8b5d2 14 void SW_ON_PL_EPS();
ee12b079 209:63e9c8f8b5d2 15 void SW_OFF_PL_EPS();
ee12b079 209:63e9c8f8b5d2 16 void SW_ON_V_A_EN();
ee12b079 209:63e9c8f8b5d2 17 void SW_OFF_V_A_EN();
ee12b079 209:63e9c8f8b5d2 18 void RST_SD();
ee12b079 209:63e9c8f8b5d2 19 void RST_BAE();
ee12b079 209:63e9c8f8b5d2 20 void RST_PL_BEE();
ee12b079 209:63e9c8f8b5d2 21 void RST_HK_COUNTER();
ee12b079 209:63e9c8f8b5d2 22 uint8_t CDMS_RD_SD_HK(uint8_t *);
ee12b079 209:63e9c8f8b5d2 23 void CDMS_INTERNAL_RESET();
ee12b079 209:63e9c8f8b5d2 24
ee12b079 209:63e9c8f8b5d2 25 void P_PL_INIT()
ee12b079 209:63e9c8f8b5d2 26 {
ee12b079 209:63e9c8f8b5d2 27
ee12b079 209:63e9c8f8b5d2 28 }
ee12b079 209:63e9c8f8b5d2 29
ee12b079 209:63e9c8f8b5d2 30 void P_PL_MAIN()
ee12b079 209:63e9c8f8b5d2 31 {
ee12b079 209:63e9c8f8b5d2 32
ee12b079 209:63e9c8f8b5d2 33 }
ee12b079 209:63e9c8f8b5d2 34
ee12b079 209:63e9c8f8b5d2 35 void P_COM_INIT()
ee12b079 209:63e9c8f8b5d2 36 {
ee12b079 209:63e9c8f8b5d2 37
ee12b079 209:63e9c8f8b5d2 38 }
ee12b079 209:63e9c8f8b5d2 39
ee12b079 209:63e9c8f8b5d2 40 void P_CDMS_HK_MAIN()
ee12b079 209:63e9c8f8b5d2 41 {
ee12b079 209:63e9c8f8b5d2 42 //FCTN_CDMS_HK_MAIN();
ee12b079 209:63e9c8f8b5d2 43 }
ee12b079 209:63e9c8f8b5d2 44
ee12b079 209:63e9c8f8b5d2 45 void P_PL_RCV_SC_DATA()
ee12b079 209:63e9c8f8b5d2 46 {
ee12b079 209:63e9c8f8b5d2 47
ee12b079 209:63e9c8f8b5d2 48 }
ee12b079 209:63e9c8f8b5d2 49
ee12b079 209:63e9c8f8b5d2 50 void P_CDMS_INIT_SD()
ee12b079 209:63e9c8f8b5d2 51 {
ee12b079 209:63e9c8f8b5d2 52 FCTN_CDMS_SD_INIT();
ee12b079 209:63e9c8f8b5d2 53 }
ee12b079 209:63e9c8f8b5d2 54
ee12b079 209:63e9c8f8b5d2 55 void CDMS_SD_SW_ON()
ee12b079 209:63e9c8f8b5d2 56 {
ee12b079 209:63e9c8f8b5d2 57 SD_SW_EN_DS = 0; //powering on SD
ee12b079 209:63e9c8f8b5d2 58 }
ee12b079 209:63e9c8f8b5d2 59
ee12b079 209:63e9c8f8b5d2 60 void CDMS_SD_SW_OFF()
ee12b079 209:63e9c8f8b5d2 61 {
ee12b079 209:63e9c8f8b5d2 62 SD_SW_EN_DS = 0; //powering on SD
ee12b079 209:63e9c8f8b5d2 63 }
ee12b079 209:63e9c8f8b5d2 64
ee12b079 209:63e9c8f8b5d2 65 void SW_ON_BAE()
ee12b079 209:63e9c8f8b5d2 66 {
ee12b079 209:63e9c8f8b5d2 67 BAE_SW_EN_DS = 0; //Power ON BAE
ee12b079 209:63e9c8f8b5d2 68 }
ee12b079 209:63e9c8f8b5d2 69
ee12b079 209:63e9c8f8b5d2 70 void SW_OFF_BAE()
ee12b079 209:63e9c8f8b5d2 71 {
ee12b079 209:63e9c8f8b5d2 72 BAE_SW_EN_DS = 1; //Switch OFF BAE
ee12b079 209:63e9c8f8b5d2 73 }
ee12b079 209:63e9c8f8b5d2 74
ee12b079 209:63e9c8f8b5d2 75 void SW_ON_PL_BEE()
ee12b079 209:63e9c8f8b5d2 76 {
ee12b079 209:63e9c8f8b5d2 77 PL_SW_EN_DS = 0; //Power ON PL
ee12b079 209:63e9c8f8b5d2 78 }
ee12b079 209:63e9c8f8b5d2 79
ee12b079 209:63e9c8f8b5d2 80 void SW_OFF_PL_BEE()
ee12b079 209:63e9c8f8b5d2 81 {
ee12b079 209:63e9c8f8b5d2 82 PL_SW_EN_DS = 1; // switching OFF PL
ee12b079 209:63e9c8f8b5d2 83 }
ee12b079 209:63e9c8f8b5d2 84
ee12b079 209:63e9c8f8b5d2 85 void SW_ON_PL_EPS()
ee12b079 209:63e9c8f8b5d2 86 {
ee12b079 209:63e9c8f8b5d2 87
ee12b079 209:63e9c8f8b5d2 88 }
ee12b079 209:63e9c8f8b5d2 89
ee12b079 209:63e9c8f8b5d2 90 void SW_OFF_PL_EPS()
ee12b079 209:63e9c8f8b5d2 91 {
ee12b079 209:63e9c8f8b5d2 92
ee12b079 209:63e9c8f8b5d2 93 }
ee12b079 209:63e9c8f8b5d2 94
ee12b079 209:63e9c8f8b5d2 95 void SW_ON_V_A_EN()
ee12b079 209:63e9c8f8b5d2 96 {
ee12b079 209:63e9c8f8b5d2 97
ee12b079 209:63e9c8f8b5d2 98 }
ee12b079 209:63e9c8f8b5d2 99
ee12b079 209:63e9c8f8b5d2 100 void SW_OFF_V_A_EN()
ee12b079 209:63e9c8f8b5d2 101 {
ee12b079 209:63e9c8f8b5d2 102
ee12b079 209:63e9c8f8b5d2 103 }
ee12b079 209:63e9c8f8b5d2 104
ee12b079 209:63e9c8f8b5d2 105 void RST_SD()
ee12b079 209:63e9c8f8b5d2 106 {
ee12b079 209:63e9c8f8b5d2 107 SD_SW_EN_DS = 1; //switching off SD card
ee12b079 209:63e9c8f8b5d2 108 wait_ms(10);
ee12b079 209:63e9c8f8b5d2 109 SD_SW_EN_DS = 0;
ee12b079 209:63e9c8f8b5d2 110 FCTN_CDMS_SD_INIT();
ee12b079 209:63e9c8f8b5d2 111 }
ee12b079 209:63e9c8f8b5d2 112
ee12b079 209:63e9c8f8b5d2 113 void RST_BAE()
ee12b079 209:63e9c8f8b5d2 114 {
ee12b079 209:63e9c8f8b5d2 115 BAE_SW_EN_DS = 1; //Switch OFF BAE
ee12b079 209:63e9c8f8b5d2 116 wait_ms(10);
ee12b079 209:63e9c8f8b5d2 117 BAE_SW_EN_DS = 0; //Switch ON BAE
ee12b079 209:63e9c8f8b5d2 118 }
ee12b079 209:63e9c8f8b5d2 119
ee12b079 209:63e9c8f8b5d2 120 void RST_PL_BEE()
ee12b079 209:63e9c8f8b5d2 121 {
ee12b079 209:63e9c8f8b5d2 122 PL_SW_EN_DS = 1; // switching OFF PL
ee12b079 209:63e9c8f8b5d2 123 wait_ms(10);
ee12b079 209:63e9c8f8b5d2 124 PL_SW_EN_DS = 0; // Switch ON PL
ee12b079 209:63e9c8f8b5d2 125 }
ee12b079 209:63e9c8f8b5d2 126
ee12b079 209:63e9c8f8b5d2 127 void RST_HK_COUNTER()
ee12b079 209:63e9c8f8b5d2 128 {
ee12b079 209:63e9c8f8b5d2 129 firstCount = true;
ee12b079 209:63e9c8f8b5d2 130 }
ee12b079 209:63e9c8f8b5d2 131
ee12b079 209:63e9c8f8b5d2 132 uint8_t CDMS_RD_SD_HK(uint8_t *sd_statusbits)
ee12b079 209:63e9c8f8b5d2 133 {
ee12b079 209:63e9c8f8b5d2 134 uint8_t p;
ee12b079 209:63e9c8f8b5d2 135 uint8_t ACK;
ee12b079 209:63e9c8f8b5d2 136 if(SD_SW_EN_DS != DEVICE_POWERED)
ee12b079 209:63e9c8f8b5d2 137 {
ee12b079 209:63e9c8f8b5d2 138 ACK = 0x89;
ee12b079 209:63e9c8f8b5d2 139 SD_RD_ERROR = 1;
ee12b079 209:63e9c8f8b5d2 140 //Generate TM
ee12b079 209:63e9c8f8b5d2 141 }
ee12b079 209:63e9c8f8b5d2 142 else
ee12b079 209:63e9c8f8b5d2 143 {
ee12b079 209:63e9c8f8b5d2 144 p = disk_read_statusbits(sd_statusbits);
ee12b079 209:63e9c8f8b5d2 145 if(p == 0)
ee12b079 209:63e9c8f8b5d2 146 ACK = 0xA0;
ee12b079 209:63e9c8f8b5d2 147 else
ee12b079 209:63e9c8f8b5d2 148 ACK = 0x89;
ee12b079 209:63e9c8f8b5d2 149 }
ee12b079 209:63e9c8f8b5d2 150 return ACK;
ee12b079 209:63e9c8f8b5d2 151 }
ee12b079 209:63e9c8f8b5d2 152
ee12b079 209:63e9c8f8b5d2 153 void CDMS_INTERNAL_RESET()
ee12b079 209:63e9c8f8b5d2 154 {
ee12b079 209:63e9c8f8b5d2 155
ee12b079 209:63e9c8f8b5d2 156 }