CDMS_CODE_samp_23SEP_DMA_flag

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE_samp_23SEP_DMA by iitm sat

Revision:
215:570251b23c7b
Parent:
213:867de6d350fa
Child:
216:93505a6f8db7
diff -r 867de6d350fa -r 570251b23c7b DefinitionsAndGlobals.h
--- a/DefinitionsAndGlobals.h	Sun Jul 03 09:26:42 2016 +0000
+++ b/DefinitionsAndGlobals.h	Sun Jul 03 09:47:05 2016 +0000
@@ -3,152 +3,150 @@
 #define bypass_adf 1
 
 // COM_RX
-    #define RX_TIMEOUT_LIMIT 0.5
-    //#define COM_RX_UART_TX PTE20    // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_TX USBTX
-    //#define COM_RX_UART_RX PTE21    // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_RX USBRX
-    
-    #define COM_RX_UART_TX USBTX
-    #define COM_RX_UART_RX USBRX
-    
+#define RX_TIMEOUT_LIMIT 0.5
+//#define COM_RX_UART_TX PTE20    // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_TX USBTX
+//#define COM_RX_UART_RX PTE21    // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_RX USBRX
+
+#define COM_RX_UART_TX USBTX
+#define COM_RX_UART_RX USBRX
+
 // COMMON SPI
-    #define SPI_MOSI PTE1
-    #define SPI_MISO PTE3
-    #define SPI_CLK PTE2
-    #define SPI_CS_ADF PTA15
-    #define SPI_CS_SDC PIN20
-    #define SPI_CS_RTC PIN26
-    
+#define SPI_MOSI PTE1
+#define SPI_MISO PTE3
+#define SPI_CLK PTE2
+#define SPI_CS_ADF PTA15
+#define SPI_CS_SDC PIN20
+#define SPI_CS_RTC PIN26
+
 // COM_TX
-    #define COM_TX_CONFIG_LIMIT 3
-    #define COM_TX_TICKER_LIMIT 32
+#define COM_TX_CONFIG_LIMIT 3
+#define COM_TX_TICKER_LIMIT 32
 
 // ADF INTERRUPT
-    #define ADF_IRQ PTA14
-    
+#define ADF_IRQ PTA14
+
 //I2C - Payload to CDMS (need to change while using CDMS hardware);
-    I2C master(PIN32,PIN31);
-    DigitalIn PL_I2C_Intr(PTC13);
-    DigitalOut PL_I2C_GPIO(PTC1);
-            
+I2C master(PIN32,PIN31);
+DigitalIn PL_I2C_Intr(PTC13);
+DigitalOut PL_I2C_GPIO(PTC1);
+
 //I2C - CDMS to BAE
-    DigitalIn BAE_I2C_GPIO(PIN39);
-    DigitalOut CDMS_I2C_GPIO(PIN67);
+DigitalIn BAE_I2C_GPIO(PIN39);
+DigitalOut CDMS_I2C_GPIO(PIN67);
 
 // TC LIST
-    #define TCL_STATE_INCOMPLETE 0x00
-    #define TCL_STATE_ABORTED 0x01
-    #define TCL_STATE_EXECUTING 0x02   
-    #define TCL_STATE_COMPLETED 0x03
+#define TCL_STATE_INCOMPLETE 0x00
+#define TCL_STATE_ABORTED 0x03
+#define TCL_STATE_EXECUTING 0x04
+#define TCL_STATE_COMPLETED 0x05
+#define TCL_STATE_EXCEEDED_LIMIT 0x06
 
 // LIST OF FLAGS
-    #define UART_INT_FLAG 0x0001
-    #define NEW_TC_RECEIVED 0x0002
-    #define COM_SESSION_FLAG 0x0004
-    #define COM_RX_FLAG 0x0008
-    #define COM_MNG_TMTC_RUNNING_FLAG 0x0010
-    #define COM_SESSION_VALIDITY 0x0020
-    #define ALL_CRC_PASS_FLAG 0x0040
-    #define COM_PA_HOT_FLAG 0x0080
-    #define COM_PA_OC_FLAG 0x8000
-    #define COM_TX_FLAG 0x0100
-    #define COM_SESSION_TIMEOUT_FLAG 0x0200
-    #define COM_AUTO_POWER_OFF_BAE_FLAG 0x0400
-    #define BAE_SW_EN_FLAG 0x0800
-    #define RF_SW_STATUS_FLAG 0x1000
-    #define COM_INIT_STATUS_FLAG 0x2000
-    #define COM_TX_STATUS_FLAG 0x4000
+#define UART_INT_FLAG 0x0001
+#define NEW_TC_RECEIVED 0x0002
+#define COM_SESSION_FLAG 0x0004
+#define COM_RX_FLAG 0x0008
+#define COM_MNG_TMTC_RUNNING_FLAG 0x0010
+#define COM_SESSION_VALIDITY 0x0020
+#define ALL_CRC_PASS_FLAG 0x0040
+#define COM_PA_HOT_FLAG 0x0080
+#define COM_TX_FLAG 0x0100
+#define COM_SESSION_TIMEOUT_FLAG 0x0200
+#define COM_AUTO_POWER_OFF_BAE_FLAG 0x0400
+#define BAE_SW_EN_FLAG 0x0800
+#define RF_SW_STATUS_FLAG 0x1000
+#define COM_INIT_STATUS_FLAG 0x2000
+#define COM_TX_STATUS_FLAG 0x4000
 
 //RF relay STATUS
-    #define RF_COM_TX 0
-    #define RF_BCN 1
+#define RF_COM_TX 0
+#define RF_BCN 1
 
 // COM_MNG_TMTC THREAD
-    #define SESSION_TIME_LIMIT 1500
-    #define COM_RX_DISABLE_TIMEOUT 10
-    #define COM_MNG_TMTC_SIGNAL_UART_INT 0x01
-    #define COM_MNG_TMTC_SIGNAL_ADF_NSD 0x02
-    #define COM_MNG_TMTC_SIGNAL_ADF_SD 0x03
-    #define SCIENCE_SIGNAL 0x04
+#define SESSION_TIME_LIMIT 1500
+#define COM_MNG_TMTC_SIGNAL_UART_INT 0x01
+#define COM_MNG_TMTC_SIGNAL_ADF_NSD 0x02
+#define COM_MNG_TMTC_SIGNAL_ADF_SD 0x03
+#define SCIENCE_SIGNAL 0x04
 // COM_MNG_TMTC
-    #define COM_PA_COOLING_TIME_LIMIT 20
-    #define COM_MAX_TC_LIMIT 256
-    #define TM_ACK_CODE_INDEX 2
-    #define CRC_FAIL_NACK_CODE 0x01
-    
-    // call sign
-    #define PSC_CALLSIGN 0x00
-    #define APID_CALLSIGN 0x00
-    
-    // max value of telecommands in a tcl
-    #define TCL_OVERFLOW_CONSTANT 256
-    #define TM_OVERFLOW_CONSTANT 256
-    #define BYTE_OVERFLOW_CONSTANT 35000
+#define COM_PA_COOLING_TIME_LIMIT 20
+#define COM_MAX_TC_LIMIT 200
+#define TM_ACK_CODE_INDEX 2
+#define CRC_FAIL_NACK_CODE 0x01
+
+// call sign
+#define PSC_CALLSIGN 0x00
+#define APID_CALLSIGN 0x00
+
+// max value of telecommands in a tcl
+#define TCL_OVERFLOW_CONSTANT 256
+#define TM_OVERFLOW_CONSTANT 256
+
+// starting value of packet sequence count at each pass
+#define PSC_START_VALUE 1
 
-    // starting value of packet sequence count at each pass 
-    #define PSC_START_VALUE 1
-    
-    // APID list
-    #define APID_COM 0
-    #define APID_BAE 1
-    #define APID_CDMS 2
-    #define APID_SPEED 3
-    
-    //SERVICE
-    #define SERVICE_OBOSC 0xB
-    #define SERVICE_OBSRS 0xF
-    
-    // HIGH PRIORITY TC - priority list
-    // not correct values here
-    #define HPTC1 5
-    #define HPTC2 6
-    // Add more entries above
-    
-    // SIZE of tc in bytes
-    #define TC_SHORT_SIZE 11
-    #define TC_LONG_SIZE 135
-    
-    // TMID list
-    #define TMID_ACK_L1 0xA
-    #define TMID_ACK_L234 0xB
-    #define TMID_TCL 0x7
-    #define TMID_CALL_SIGN 0xE
+// APID list
+#define APID_COM 0
+#define APID_BAE 1
+#define APID_CDMS 2
+#define APID_SPEED 3
+
+//SERVICE
+#define SERVICE_OBOSC 0xB
+#define SERVICE_OBSRS 0xF
+
+// HIGH PRIORITY TC - priority list
+// not correct values here
+#define HPTC1 5
+#define HPTC2 6
+// Add more entries above
+
+// SIZE of tc in bytes
+#define TC_SHORT_SIZE 11
+#define TC_LONG_SIZE 135
+
+// TMID list
+#define TMID_ACK_L1 0xA
+#define TMID_ACK_L234 0xB
+#define TMID_TCL 0x7
+#define TMID_CALL_SIGN 0xE
 
 // OBOSC SERVICE SUBTYPE
-    #define OBOSC_TCL_MAX_SHORT_SIZE 11
-    #define OBOSC_LONG_TC_FIRST_HALF_SIZE 67
-    #define OBOSC_LONG_TC_SECOND_HALF_SIZE 68
-    #define OBOSC_TCL_TAG_LONG_FIRST_HALF 0x10
-    #define OBOSC_TCL_TAG_LONG_SECOND_HALF 0x11
+#define OBOSC_TCL_MAX_SHORT_SIZE 11
+#define OBOSC_LONG_TC_FIRST_HALF_SIZE 67
+#define OBOSC_LONG_TC_SECOND_HALF_SIZE 68
+#define OBOSC_TCL_TAG_LONG_FIRST_HALF 0x10
+#define OBOSC_TCL_TAG_LONG_SECOND_HALF 0x11
 
-    #define OBOSC_SUB_DISABLE 0x01
-    #define OBOSC_SUB_RETRY 0x05
-    #define OBOSC_SUB_REP_TCLD 0x06
-    #define OBOSC_SUB_REP_LE 0x0F
-    #define OBOSC_SUB_RESET 0x07
-    
+#define OBOSC_SUB_DISABLE 0x01
+#define OBOSC_SUB_RETRY 0x05
+#define OBOSC_SUB_REP_TCLD 0x06
+#define OBOSC_SUB_REP_LE 0x0F
+#define OBOSC_SUB_RESET 0x07
+
 // PAYLOAD or SCIENCE
-    #define PAYLOAD_BUFFER_LENGTH 6723
-    #define PAY_SPI_MOSI PTE18
-    #define PAY_SPI_MISO PTE19
-    #define PAY_SPI_CLK PTE17
-    #define PAY_SPI_CS PTE16
+#define PAYLOAD_BUFFER_LENGTH 6723
+#define PAY_SPI_MOSI PTE18
+#define PAY_SPI_MISO PTE19
+#define PAY_SPI_CLK PTE17
+#define PAY_SPI_CS PTE16
 
 //BEACON
-    #define BCN_APID_SOURCE 0x41
-    #define BCN_SERVICE 0x81
-    
+#define BCN_APID_SOURCE 0x41
+#define BCN_SERVICE 0x81
+
 //BAE
-    #define BAE_APID_SOURCE 0x81
-    #define BAE_SERVICE 0x81
-    #define BAE_POWER_ON_PID 0x13
-    #define BAE_POWER_OFF_PID 0x23
-    #define BAE_RESET_PID 0x33
+#define BAE_APID_SOURCE 0x81
+#define BAE_SERVICE 0x81
+#define BAE_POWER_ON_PID 0x13
+#define BAE_POWER_OFF_PID 0x23
+#define BAE_RESET_PID 0x33
 
 //RF RELAY
-    #define RF_RELAY_CNTRL_TX PTA7
-    #define RF_RELAY_CNTRL_BCN PTA12 
+#define RF_RELAY_CNTRL_TX PTA7
+#define RF_RELAY_CNTRL_BCN PTA12
 
-    
+
 // ****************GLOBAL VARIABLES******************
 // DEBUG
 Serial gPC( USBTX, USBRX );
@@ -161,7 +159,6 @@
 COM_RX_DATA_NODE *gRX_CURRENT_DATA_NODE = NULL;
 // uint8_t *gRX_CURRENT_PTR = NULL;
 uint32_t gRX_COUNT = 0;
-uint16_t gTOTAL_RAW_BYTES = 0;
 uint16_t gTOTAL_INCORRECT_SIZE_TC = 0x00;
 uint16_t gTOTAL_CRC_FAIL_TC = 0x00;
 uint16_t gTOTAL_REPEATED_TC = 0x00;
@@ -194,7 +191,6 @@
 Thread* gCOM_MNG_TMTC_THREAD = NULL;
 Timeout gRX_TIMEOUT;
 Timeout gSESSION_TIMEOUT;
-Timeout gCOM_RX_DISABLE;
 
 // COM_MNG_TMTC
 
@@ -226,7 +222,7 @@
 uint8_t CDMS_HEALTH_DATA[128];
 uint8_t CDMS_RAM[59];
 uint16_t GPIO_STATUS;
-uint8_t CDMS_HK_MAIN_STATUS;    
+uint8_t CDMS_HK_MAIN_STATUS;
 uint8_t COMRX_STATUS;
 uint8_t RTC_FAULTCOUNT;
 uint16_t SD_FAULTCOUNT;
@@ -303,4 +299,23 @@
 uint8_t CDMS_STANDBY_PL;
 uint8_t CDMS_INIT_STATUS;
 uint8_t CDMS_HK_STATUS;
-uint8_t CDMS_RTC_BL;
\ No newline at end of file
+uint8_t CDMS_RTC_BL;
+
+//FLASH parameters
+uint8_t EPS_V_A_EN_STATUS;
+uint8_t BAE_SW_STATUS;
+uint8_t CDMS_SD_SW_STATUS;
+uint8_t PL_BEE_SW_STATUS =0 ;
+uint8_t PL_EPS_LATCH_SW_EN;
+uint8_t RTC_INIT_STATUS;
+uint8_t CDMS_RTC_DISABLE;
+uint8_t CDMS_RESET_COUNTER;
+uint8_t TIME_LATEST_CDSMS_RESET;
+uint8_t COM_TC_BYTES_LIMIT;
+uint8_t COM_RX_CURRENT_MAX;
+uint8_t COM_RX_DISABLE_TIMEOUT;
+uint8_t COM_PA_TMP_HIGH;
+uint8_t COM_PA_RECOVERY_TIMEOUT;
+uint8_t COM_SESSION_TIMEOUT;
+uint8_t COM_RSSI_MIN;
+uint8_t SD_LIB_BLK_CURRENT_NMBR;
\ No newline at end of file