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: FreescaleIAP SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by
Diff: FMS_all.h
- Revision:
- 229:42624b9a08b4
- Parent:
- 224:3ac1f91e0ebc
- Child:
- 230:3d52da8826d3
diff -r 335da5b0d3e4 -r 42624b9a08b4 FMS_all.h
--- a/FMS_all.h Mon Jul 04 23:13:24 2016 +0000
+++ b/FMS_all.h Tue Jul 05 09:35:50 2016 +0000
@@ -1,12 +1,17 @@
+//Run processes
void P_PL_INIT();
void P_PL_MAIN();
void P_COM_INIT();
void P_CDMS_HK_MAIN();
void P_PL_RCV_SC_DATA();
void P_CDMS_INIT_SD();
+
+// Switch ON/OFF functions
void CDMS_SD_SW_ON();
void CDMS_SD_SW_OFF();
+void CDMS_RTC_ON();
+void CDMS_RTC_OFF();
void SW_ON_BAE();
void SW_OFF_BAE();
void SW_ON_PL_BEE();
@@ -15,13 +20,24 @@
void SW_OFF_PL_EPS();
void SW_ON_V_A_EN();
void SW_OFF_V_A_EN();
+
+// RST functions
void RST_SD();
+void SW_RST_BAE();
+void SW_RST_PL_BEE();
void RST_BAE();
void RST_PL_BEE();
+void CDMS_INTERNAL_RESET();
+void SYS_PWR_RESET(); // Have to be decided with EPS team.
+void EPS_V_A_EN();
+void EPS_V_C_EN();
+
void RST_HK_COUNTER();
uint8_t CDMS_RD_SD_HK(uint8_t *);
+uint8_t CDMS_RD_RTC(uint64_t *);
+void CDMS_CALIB_RTC();
void CDMS_RESET();
-void CDMS_INTERNAL_RESET();
+
void P_PL_INIT()
{
@@ -30,22 +46,22 @@
void P_PL_MAIN()
{
-
+ FCTN_CDMS_PL_MAIN((void *)NULL);
}
void P_COM_INIT()
{
-
+ P_COM_INIT;
}
void P_CDMS_HK_MAIN()
{
- //FCTN_CDMS_HK_MAIN();
+ FCTN_CDMS_HK_MAIN((void *)NULL);
}
void P_PL_RCV_SC_DATA()
{
-
+
}
void P_CDMS_INIT_SD()
@@ -55,74 +71,149 @@
void CDMS_SD_SW_ON()
{
- SD_SW_EN_DS = 0; //powering on SD
+ SD_SW_EN_DS = 0;
}
void CDMS_SD_SW_OFF()
{
- SD_SW_EN_DS = 0; //powering on SD
-}
-
-void SW_ON_BAE()
-{
- BAE_SW_EN_DS = 0; //Power ON BAE
+ SD_SW_EN_DS = 1;
}
-void SW_OFF_BAE()
+void CDMS_RTC_ON()
{
- BAE_SW_EN_DS = 1; //Switch OFF BAE
+
}
-void SW_ON_PL_BEE()
-{
- PL_SW_EN_DS = 0; //Power ON PL
-}
-
-void SW_OFF_PL_BEE()
-{
- PL_SW_EN_DS = 1; // switching OFF PL
-}
-
-void SW_ON_PL_EPS()
+void CDMS_RTC_OFF()
{
}
+void SW_ON_BAE()
+{
+ BAE_SW_EN_DS = 0;
+}
+
+void SW_OFF_BAE()
+{
+ BAE_SW_EN_DS = 1;
+}
+
+void SW_ON_PL_BEE()
+{
+ PYLD_DFF_CLK = 0;\
+ PYLD_DFF = 1;\
+ wait_us(1);\
+ PYLD_DFF_CLK = 1;\
+ wait_us(1);\
+ PYLD_DFF_CLK = 0;\
+ wait_us(1);\
+}
+
+void SW_OFF_PL_BEE()
+{
+ PYLD_DFF_CLK = 0;
+ PYLD_DFF = 0;
+ wait_us(1);
+ PYLD_DFF_CLK = 1;
+ wait_us(1);
+ PYLD_DFF_CLK = 0;
+ wait_us(1);
+}
+
+void SW_ON_PL_EPS()
+{
+ PYLD_EPS_DFF_PWR_CLK = 0;\
+ PYLD_EPS_DFF_PWR = 1;\
+ wait_us(1);\
+ PYLD_EPS_DFF_PWR_CLK = 1;\
+ wait_us(1);\
+ PYLD_EPS_DFF_PWR_CLK = 0;\
+ wait_us(1);\
+}
+
void SW_OFF_PL_EPS()
{
-
+ PYLD_EPS_DFF_PWR_CLK = 0;\
+ PYLD_EPS_DFF_PWR = 0;\
+ wait_us(1);\
+ PYLD_EPS_DFF_PWR_CLK = 1;\
+ wait_us(1);\
+ PYLD_EPS_DFF_PWR_CLK = 0;\
+ wait_us(1);\
}
void SW_ON_V_A_EN()
{
-
+ TRXY_PWR_CNTRL = 1;
+ TRZ_PWR_CNTRL = 1;
}
void SW_OFF_V_A_EN()
{
-
+ TRXY_PWR_CNTRL = 0;
+ TRZ_PWR_CNTRL = 0;
}
void RST_SD()
{
- SD_SW_EN_DS = 1; //switching off SD card
+ SD_SW_EN_DS = 1;
wait_ms(10);
SD_SW_EN_DS = 0;
- FCTN_CDMS_SD_INIT();
+}
+
+void SW_RST_BAE()
+{
+ BAE_SW_EN_DS = 1;
+ wait_ms(10);
+ BAE_SW_EN_DS = 0;
+}
+
+void SW_RST_PL_BEE()
+{
+ PYLD_DFF = 1;
+ wait_ms(10);
+ PYLD_DFF = 0;
}
void RST_BAE()
{
- BAE_SW_EN_DS = 1; //Switch OFF BAE
+ RESET_TO_BAE = 1;
wait_ms(10);
- BAE_SW_EN_DS = 0; //Switch ON BAE
+ RESET_TO_BAE = 0;
}
void RST_PL_BEE()
{
- PL_SW_EN_DS = 1; // switching OFF PL
+ RESET_TO_PYLD = 1;
wait_ms(10);
- PL_SW_EN_DS = 0; // Switch ON PL
+ RESET_TO_PYLD = 0;
+}
+
+void CDMS_INTERNAL_RESET()
+{
+ NVIC_SystemReset();
+}
+
+void SYS_PWR_RESET() // Have to be decided with EPS team.
+{
+
+}
+
+void EPS_V_A_EN() // This is a reset function
+{
+ TRXY_PWR_CNTRL = 0;
+ TRZ_PWR_CNTRL = 0;
+ wait_ms(10);
+ TRXY_PWR_CNTRL = 1;
+ TRZ_PWR_CNTRL = 1;
+}
+
+void EPS_V_C_EN() // This is a reset function
+{
+ COM_RX_CNTRL = 0;
+ wait_ms(10);
+ COM_RX_CNTRL = 1;
}
void RST_HK_COUNTER()
