FreeCalypso > hg > fc-tourmaline
diff src/cs/drivers/drv_app/sim/sim.h @ 189:b37e6c916df1
../drv_app/sim/*: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 30 Jan 2021 06:34:22 +0000 |
parents | 4e78acac3d88 |
children | 2e4afc93045d |
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/sim/sim.h Tue Jan 19 06:10:27 2021 +0000 +++ b/src/cs/drivers/drv_app/sim/sim.h Sat Jan 30 06:34:22 2021 +0000 @@ -1,5 +1,5 @@ /* - * SIM.H + * SIM.H * * Pole Star SIM * @@ -12,14 +12,14 @@ /* * Device addresses - GCS000 (Gemini / Polestar) * HER207 (Hercules) - */ + */ #ifndef _WINDOWS - #include "l1sw.cfg" - #include "chipset.cfg" + #include "l1sw.cfg" + #include "chipset.cfg" #endif -#include "nucleus.h" +#include "nucleus.h" /* Flags activation section */ // #define SIM_RETRY /* by default : NOT ACTIVE */ @@ -41,14 +41,14 @@ /* - * Bit definitions - */ + * Bit definitions + */ // control regidter #define SIM_CMD_CRST 0x0001 #define SIM_CMD_SWRST 0x0002 #define SIM_CMD_STOP 0x0004 #define SIM_CMD_START 0x0008 -#define SIM_CMD_CLKEN 0x0010 +#define SIM_CMD_CLKEN 0x0010 // status register #define SIM_STAT_CD 0x0001 // card present @@ -68,12 +68,12 @@ #define SIM_CONF1_BYPASS 0x0100 // bypass hardware timers #define SIM_CONF1_SVCCLEV 0x0200 #define SIM_CONF1_SRSTLEV 0x0400 -#define SIM_CONF1_SIOLOW 0x8000 //force SIO to low level +#define SIM_CONF1_SIOLOW 0x8000 //force SIO to low level // interrupt status register #define SIM_IT_NATR 0x0001 // No answer to reset #define SIM_IT_WT 0x0002 -#define SIM_IT_ITOV 0x0004 +#define SIM_IT_ITOV 0x0004 #define SIM_IT_ITTX 0x0008 // Transmit #define SIM_IT_ITRX 0x0010 // Receipt @@ -89,7 +89,7 @@ #define SIM_MASK_OV 0x0004 #define SIM_MASK_TX 0x0008 // Transmit #define SIM_MASK_RX 0x0010 // Receipt -#define SIM_MASK_CD 0x0020 // Card insertion/extraction +#define SIM_MASK_CD 0x0020 // Card insertion/extraction // receveid byte register #define SIM_DRX_STATRXPAR 0x0100 // received byte parity status @@ -116,7 +116,7 @@ // end of JYT modifications #define SIM_ERR_RETRY_FAILURE 14 -#define SIM_SLEEP_NONE 0 // No SIM available +#define SIM_SLEEP_NONE 0 // No SIM available #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 : @@ -124,7 +124,7 @@ // 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 @@ -142,9 +142,9 @@ #define MODE_ENA_SIMEN 0x02 // used in SIM_ManualStart #elif(ANLG_FAM == 2) //IOTA specific definitions - #define MODE1_8V_IOTA 0x00 + #define MODE1_8V_IOTA 0x00 #define MODE_INIT_IOTA_3V 0x03 - #define MODE_INIT_IOTA_1_8V 0x02 + #define MODE_INIT_IOTA_1_8V 0x02 #define MODE3V_IOTA 0x01 #define MODE_DIS_SIMLDOEN 0xFC // SIMSEL + Regulator RSIMEN #define MODE_DIS_SIMEN 0xF7 @@ -152,9 +152,9 @@ #define MODE_ENA_SIMEN 0x08 #elif(ANLG_FAM == 3) //SYREN specific definitions - #define MODE1_8V_SYREN 0x00 + #define MODE1_8V_SYREN 0x00 #define MODE_INIT_SYREN_3V 0x03 - #define MODE_INIT_SYREN_1_8V 0x02 + #define MODE_INIT_SYREN_1_8V 0x02 #define MODE3V_SYREN 0x01 #define MODE_DIS_SIMLDOEN 0x1FC // SIMSEL + Regulator RSIMEN #define MODE_DIS_SIMEN 0x1F7 @@ -180,24 +180,24 @@ #if((ANLG_FAM == 2) || (ANLG_FAM == 3)) // Until now (20/03/2003), it is impossible to test IOTA or SYREN with 1.8V Sim Card, // so SIM drv is configured in 3V only with IOTA.and SYREN -// When 1.8V Sim Card will be delivered and tested on IOTA and SYREN, then Sim driver will pass -// to : #define SIM_TYPE SIM_TYPE_1_8_3V -#define SIM_TYPE SIM_TYPE_1_8_3V // MODIFY BY JENNIFER SIM_TYPE_3V +// When 1.8V Sim Card will be delivered and tested on IOTA and SYREN, then Sim driver will pass +// to : #define SIM_TYPE SIM_TYPE_1_8_3V +#define SIM_TYPE SIM_TYPE_1_8_3V // MODIFY BY JENNIFER SIM_TYPE_3V #else -#define SIM_TYPE SIM_TYPE_3_5V +#define SIM_TYPE SIM_TYPE_3_5V #endif #endif // begin of modifications of JYT #if((ANLG_FAM == 2) || (ANLG_FAM == 3)) -#define SIM_MASK_INFO_VOLT 0x70 +#define SIM_MASK_INFO_VOLT 0x70 #else #define SIM_MASK_INFO_VOLT 0x10 #endif #define SIM_1_8V 0x30 -#define SIM_3V 0x10 +#define SIM_3V 0x10 #define SIM_5V 0x00 // end of modifications of JYT @@ -209,23 +209,23 @@ #define GSM_CLASS 0xA0 // SIM Instruction Codes -#define SIM_SELECT 0xA4 -#define SIM_STATUS 0xF2 -#define SIM_READ_BINARY 0xB0 -#define SIM_UPDATE_BINARY 0xD6 -#define SIM_READ_RECORD 0xB2 -#define SIM_UPDATE_RECORD 0xDC -#define SIM_SEEK 0xA2 -#define SIM_INCREASE 0x32 -#define SIM_VERIFY_CHV 0x20 -#define SIM_CHANGE_CHV 0x24 -#define SIM_DISABLE_CHV 0x26 -#define SIM_ENABLE_CHV 0x28 -#define SIM_UNBLOCK_CHV 0x2C -#define SIM_INVALIDATE 0x04 -#define SIM_REHABILITATE 0x44 -#define SIM_RUN_GSM_ALGO 0x88 -#define SIM_GET_RESPONSE 0xC0 +#define SIM_SELECT 0xA4 +#define SIM_STATUS 0xF2 +#define SIM_READ_BINARY 0xB0 +#define SIM_UPDATE_BINARY 0xD6 +#define SIM_READ_RECORD 0xB2 +#define SIM_UPDATE_RECORD 0xDC +#define SIM_SEEK 0xA2 +#define SIM_INCREASE 0x32 +#define SIM_VERIFY_CHV 0x20 +#define SIM_CHANGE_CHV 0x24 +#define SIM_DISABLE_CHV 0x26 +#define SIM_ENABLE_CHV 0x28 +#define SIM_UNBLOCK_CHV 0x2C +#define SIM_INVALIDATE 0x04 +#define SIM_REHABILITATE 0x44 +#define SIM_RUN_GSM_ALGO 0x88 +#define SIM_GET_RESPONSE 0xC0 #define SIM_TERMINAL_PROFILE 0x10 #define SIM_FETCH 0x12 #define SIM_TERMINAL_RESPONSE 0x14 @@ -270,12 +270,12 @@ #define MASK_INS 0xFE #define MASK_CMD 0x11 -#define MASK_RST 0x10 +#define MASK_RST 0x10 // Buffer sizes #define RSIMBUFSIZE 270 -#define RSIZESW1SW2 2 +#define RSIZESW1SW2 2 #define XSIMBUFSIZE 270 @@ -295,7 +295,7 @@ #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) volatile unsigned short it_cd; #endif -} SIM_CONTROLLER; +} SIM_CONTROLLER; typedef struct @@ -312,7 +312,7 @@ 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 + 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 @@ -327,7 +327,7 @@ // 1 : mode of wait for acknowledge during reception of char // 2 : mode of reception of data by bloc // 3 : mode of reception of data char by char (proc char) - // 4 : mode of reception of data char by char (data) + // 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 @@ -360,11 +360,11 @@ /* * Prototypes - */ + */ // obsolete function void SIM_Init(void (Insert(SIM_CARD *cP)), void (Remove(void))); -// initialization +// initialization void SIM_Initialize(void); SYS_UWORD16 SIM_Register(void (Insert(SIM_CARD *cP)), void (Remove(void))); SYS_UWORD16 SIM_Reset(SIM_CARD *cP); @@ -393,7 +393,7 @@ SYS_UWORD16 SIM_RunGSMAlgo(SYS_UWORD8 *result, SYS_UWORD8 *rand, SYS_UWORD16 *size); SYS_UWORD16 SIM_GetResponse(SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *size); -// STK +// STK SYS_UWORD16 SIM_TerminalProfile(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); SYS_UWORD16 SIM_Fetch(SYS_UWORD8 *result, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); SYS_UWORD16 SIM_TerminalResponse(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); @@ -412,7 +412,7 @@ /* * Internal Prototypes - */ + */ void SIM_WriteBuffer(SIM_PORT *p, SYS_UWORD16 offset, SYS_UWORD16 n); SYS_UWORD16 SIM_Result(SIM_PORT *p, SYS_UWORD8 *rP, SYS_UWORD16 *lenP, SYS_UWORD8 offset); SYS_UWORD16 SIM_Command(SIM_PORT *p, SYS_UWORD16 n, SYS_UWORD8 *rP, SYS_UWORD16 *lP); @@ -444,16 +444,16 @@ /* * Global variables - */ + */ #ifdef SIM_C -#define SI_GLOBAL +#define SI_GLOBAL #else #define SI_GLOBAL extern #endif -SI_GLOBAL SIM_PORT Sim[1]; -SI_GLOBAL NU_TIMER SIM_timer; +SI_GLOBAL SIM_PORT Sim[1]; +SI_GLOBAL NU_TIMER SIM_timer; SI_GLOBAL STATUS status_os_sim; SI_GLOBAL SYS_UWORD8 SIM_sleep_status;