# HG changeset patch # User Mychaela Falconia # Date 1611989024 0 # Node ID 2e4afc93045d6dbf200b8e77301a0989d518cc07 # Parent b37e6c916df1f2dd271b7820a19e1fb128272a62 ../drv_app/sim/sim.h: white space fixes diff -r b37e6c916df1 -r 2e4afc93045d src/cs/drivers/drv_app/sim/sim.h --- a/src/cs/drivers/drv_app/sim/sim.h Sat Jan 30 06:34:22 2021 +0000 +++ b/src/cs/drivers/drv_app/sim/sim.h Sat Jan 30 06:43:44 2021 +0000 @@ -22,8 +22,8 @@ #include "nucleus.h" /* Flags activation section */ -// #define SIM_RETRY /* by default : NOT ACTIVE */ -//#define SIM_DEBUG_TRACE /* by default : NOT ACTIVE */ +//#define SIM_RETRY /* by default : NOT ACTIVE */ +//#define SIM_DEBUG_TRACE /* by default : NOT ACTIVE */ //#define SIM_UWORD16_MASK 0x00ff //when using SIM entity not maped to length on 16 bits #define SIM_UWORD16_MASK 0xffff //when using SIM entity maped to length on 16 bits //#define SIM_APDU_TEST @@ -39,7 +39,6 @@ #define SIM_MASK (MEM_SIM + 0x0E) - /* * Bit definitions */ @@ -62,8 +61,8 @@ #define SIM_CONF1_TXRX 0x0004 // SIO line direction #define SIM_CONF1_SCLKEN 0x0008 // enable SIM clock #define SIM_CONF1_RSVD 0x0010 // reserved -#define SIM_CONF1_SCLKDIV 0x0020 // SIM clock frquency -#define SIM_CONF1_SCLKLEV 0x0040 // SIM clock idle level +#define SIM_CONF1_SCLKDIV 0x0020 // SIM clock frquency +#define SIM_CONF1_SCLKLEV 0x0040 // SIM clock idle level #define SIM_CONF1_ETU 0x0080 // ETU period #define SIM_CONF1_BYPASS 0x0100 // bypass hardware timers #define SIM_CONF1_SVCCLEV 0x0200 @@ -120,15 +119,15 @@ #define SIM_SLEEP_DESACT 1 // The Driver is NOT currently in sleep mode (clock is off) #define SIM_SLEEP_ACT 2 // The Driver is currently in sleep mode (clock is on) #define SIM_SLEEP_NOT_ALLOWED 3 // The Driver cannot stop the clock : - // The card don't want or the interface is not able - // to do it. + // The card don't want or the interface is not able + // to do it. #define SIM_SLEEP_WAITING_TIME 500 //represent 2.3s of period before entering in sleep mode -#define SIM_CLK_STOP_MASK 0x0D // Clock Stop mask defined by ETSI 11.11 +#define SIM_CLK_STOP_MASK 0x0D // Clock Stop mask defined by ETSI 11.11 #define SIM_CLK_STOP_NOT_ALLWD 0x00 // see ETSI 11.11 : Clock Stop never allowed -#define SIM_CLK_STOP_ALLWD 0x01 // see ETSI 11.11 : No prefered level -#define SIM_CLK_STOP_HIGH 0x04 // see ETSI 11.11 : High level only -#define SIM_CLK_STOP_LOW 0x08 // see ETSI 11.11 : Low level only +#define SIM_CLK_STOP_ALLWD 0x01 // see ETSI 11.11 : No prefered level +#define SIM_CLK_STOP_HIGH 0x04 // see ETSI 11.11 : High level only +#define SIM_CLK_STOP_LOW 0x08 // see ETSI 11.11 : Low level only #if(ANLG_FAM == 1) //OMEGA specific definitions @@ -227,10 +226,9 @@ #define SIM_RUN_GSM_ALGO 0x88 #define SIM_GET_RESPONSE 0xC0 #define SIM_TERMINAL_PROFILE 0x10 -#define SIM_FETCH 0x12 +#define SIM_FETCH 0x12 #define SIM_TERMINAL_RESPONSE 0x14 -#define SIM_ENVELOPE 0xC2 - +#define SIM_ENVELOPE 0xC2 // SIM file identifiers @@ -279,8 +277,6 @@ #define XSIMBUFSIZE 270 - - // Structures typedef struct { @@ -309,20 +305,20 @@ typedef struct { SIM_CONTROLLER *c; - SYS_UWORD8 *xIn; // xmit input pointer - SYS_UWORD8 *xOut; // xmit output pointer - unsigned errorSIM; // code return in case of error detectd + SYS_UWORD8 *xIn; // xmit input pointer + SYS_UWORD8 *xOut; // xmit output pointer + unsigned errorSIM; // code return in case of error detectd unsigned short conf1; // image of the configuration register - avoids read/mod/write cycles volatile unsigned short txParityErr; - unsigned short rxParityErr; // if 0 no parity error on receipt, 1 if... - SYS_UWORD8 Freq_Algo; //use to determine which sim clk freq to choose for running GSM algo - SYS_UWORD8 PTS_Try; //use to calculate how many PTS try were already done - SYS_UWORD8 FileC; //value of File Characteristic + unsigned short rxParityErr; // if 0 no parity error on receipt, 1 if... + SYS_UWORD8 Freq_Algo; //use to determine which sim clk freq to choose for running GSM algo + SYS_UWORD8 PTS_Try; //use to calculate how many PTS try were already done + SYS_UWORD8 FileC; //value of File Characteristic SYS_UWORD16 etu9600; SYS_UWORD16 etu400; - SYS_UWORD16 startclock; //744 clock cycle translated in ETU - SYS_UWORD16 stopclock; //1860 clock cycle translated in ETU - SYS_UWORD8 moderx; //inform that we are in receive mode + SYS_UWORD16 startclock; //744 clock cycle translated in ETU + SYS_UWORD16 stopclock; //1860 clock cycle translated in ETU + SYS_UWORD8 moderx; //inform that we are in receive mode // 0 : mode of normal reception without procedure // 1 : mode of wait for acknowledge during reception of char // 2 : mode of reception of data by bloc @@ -330,34 +326,30 @@ // 4 : mode of reception of data char by char (data) // 5 : mode of reception of procedure char SW1/SW2 // 6 : mode of wait for acknowledge char after transmission of char - SYS_UWORD16 expected_data; //number of expected char in receive mode proc char - SYS_UWORD8 ack; //acknowledge char - SYS_UWORD8 null_received; //indicates if a NULL char was received - SYS_UWORD8 hw_mask; //mask used because of pole112 hw prb + SYS_UWORD16 expected_data; //number of expected char in receive mode proc char + SYS_UWORD8 ack; //acknowledge char + SYS_UWORD8 null_received; //indicates if a NULL char was received + SYS_UWORD8 hw_mask; //mask used because of pole112 hw prb SYS_UWORD8 rbuf[RSIMBUFSIZE]; - SYS_UWORD8 rx_index; // receive index on rbuf buffer + SYS_UWORD8 rx_index; // receive index on rbuf buffer SYS_UWORD8 xbuf[XSIMBUFSIZE]; SYS_UWORD8 rSW12[RSIZESW1SW2]; //buffer to store SW1 and SW2 SYS_UWORD8 SWcount; //static counter void (*InsertFunc)(SIM_CARD *); void (*RemoveFunc)(void); - SYS_UWORD16 apdu_ans_length; + SYS_UWORD16 apdu_ans_length; } SIM_PORT; - void SIM_IntHandler(void); #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) void SIM_CD_IntHandler(void); #endif - - - /* * Prototypes */ @@ -400,7 +392,7 @@ SYS_UWORD16 SIM_Envelope(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); // power off -void SIM_PowerOff(void); +void SIM_PowerOff(void); // WIM SYS_UWORD16 SIM_XchTPDU(SYS_UWORD8 *dat, SYS_UWORD16 trxLen, SYS_UWORD8 *result, @@ -409,7 +401,6 @@ void SIM_lock_cr17689(void); - /* * Internal Prototypes */ @@ -421,26 +412,26 @@ void SIM_InitLog(void); SYS_UWORD16 SIM_TxParityErrors(); -SYS_UWORD16 SIM_WaitReception(SIM_PORT *p); -void SIM_Interpret_FileCharacteristics(SIM_PORT *p); -SYS_UWORD16 SIM_PTSprocedure(SIM_CARD *cP, SIM_PORT *p); -void SIM_WARMReset (SIM_PORT *p); -void SIM_SleepMode_In(SYS_UWORD32 param); -void SIM_SleepMode_Out(SIM_PORT *p); -SYS_UWORD8 SIM_GetFileCharacteristics(SIM_PORT *p); -SYS_UWORD16 SIM_ATRdynamictreatement (SIM_PORT *p, SIM_CARD *cP); -SYS_UWORD16 SIM_Waitforchars (SIM_PORT *p, SYS_UWORD16 max_wait); -void SIM_Calcetu (SIM_PORT *p); -SYS_UWORD8 SIM_Translate_atr_char (SYS_UWORD8 input, SIM_CARD *cP); +SYS_UWORD16 SIM_WaitReception(SIM_PORT *p); +void SIM_Interpret_FileCharacteristics(SIM_PORT *p); +SYS_UWORD16 SIM_PTSprocedure(SIM_CARD *cP, SIM_PORT *p); +void SIM_WARMReset (SIM_PORT *p); +void SIM_SleepMode_In(SYS_UWORD32 param); +void SIM_SleepMode_Out(SIM_PORT *p); +SYS_UWORD8 SIM_GetFileCharacteristics(SIM_PORT *p); +SYS_UWORD16 SIM_ATRdynamictreatement (SIM_PORT *p, SIM_CARD *cP); +SYS_UWORD16 SIM_Waitforchars (SIM_PORT *p, SYS_UWORD16 max_wait); +void SIM_Calcetu (SIM_PORT *p); +SYS_UWORD8 SIM_Translate_atr_char (SYS_UWORD8 input, SIM_CARD *cP); -SYS_UWORD8 SIM_StartVolt (SYS_UWORD8 ResetFlag); -SYS_UWORD8 SIM_SwitchVolt (SYS_UWORD8 ResetFlag); +SYS_UWORD8 SIM_StartVolt (SYS_UWORD8 ResetFlag); +SYS_UWORD8 SIM_SwitchVolt (SYS_UWORD8 ResetFlag); -SYS_UWORD16 SIM_ManualStart (SIM_PORT *p); -SYS_UWORD8 SIM_Memcpy(SYS_UWORD8 *Buff_target, SYS_UWORD8 Buff_source[], SYS_UWORD16 len); -SYS_BOOL SIM_SleepStatus(void); -SYS_UWORD16 SIM_Reset_Restart_Internal(SIM_CARD *cP, SYS_UWORD8 ResetFlag); +SYS_UWORD16 SIM_ManualStart (SIM_PORT *p); +SYS_UWORD8 SIM_Memcpy(SYS_UWORD8 *Buff_target, SYS_UWORD8 Buff_source[], SYS_UWORD16 len); +SYS_BOOL SIM_SleepStatus(void); +SYS_UWORD16 SIM_Reset_Restart_Internal(SIM_CARD *cP, SYS_UWORD8 ResetFlag); /* * Global variables @@ -456,4 +447,3 @@ SI_GLOBAL NU_TIMER SIM_timer; SI_GLOBAL STATUS status_os_sim; SI_GLOBAL SYS_UWORD8 SIM_sleep_status; -