;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.0.0 #6037 (Oct 31 2010) (Linux) ; This file was generated Mon Jan 30 00:10:44 2012 ;-------------------------------------------------------- .module i2c .optsdcc -mmcs51 --model-medium ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _i2cReadBit .globl _i2cWriteBit .globl _i2cWaitForHighScl .globl _i2cClearSda .globl _i2cClearScl .globl _i2cReadSda .globl _i2cReadScl .globl _i2cReadByte_PARM_1 .globl _i2cWriteBit_PARM_1 .globl _i2cTimeoutOccurred .globl _i2cPinSda .globl _i2cPinScl .globl _i2cSetFrequency .globl _i2cSetTimeout .globl _i2cStop .globl _i2cStart .globl _i2cWriteByte .globl _i2cReadByte ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 Fi2c$P0$0$0 == 0x0080 _P0 = 0x0080 Fi2c$SP$0$0 == 0x0081 _SP = 0x0081 Fi2c$DPL0$0$0 == 0x0082 _DPL0 = 0x0082 Fi2c$DPH0$0$0 == 0x0083 _DPH0 = 0x0083 Fi2c$DPL1$0$0 == 0x0084 _DPL1 = 0x0084 Fi2c$DPH1$0$0 == 0x0085 _DPH1 = 0x0085 Fi2c$U0CSR$0$0 == 0x0086 _U0CSR = 0x0086 Fi2c$PCON$0$0 == 0x0087 _PCON = 0x0087 Fi2c$TCON$0$0 == 0x0088 _TCON = 0x0088 Fi2c$P0IFG$0$0 == 0x0089 _P0IFG = 0x0089 Fi2c$P1IFG$0$0 == 0x008a _P1IFG = 0x008a Fi2c$P2IFG$0$0 == 0x008b _P2IFG = 0x008b Fi2c$PICTL$0$0 == 0x008c _PICTL = 0x008c Fi2c$P1IEN$0$0 == 0x008d _P1IEN = 0x008d Fi2c$P0INP$0$0 == 0x008f _P0INP = 0x008f Fi2c$P1$0$0 == 0x0090 _P1 = 0x0090 Fi2c$RFIM$0$0 == 0x0091 _RFIM = 0x0091 Fi2c$DPS$0$0 == 0x0092 _DPS = 0x0092 Fi2c$MPAGE$0$0 == 0x0093 _MPAGE = 0x0093 Fi2c$ENDIAN$0$0 == 0x0095 _ENDIAN = 0x0095 Fi2c$S0CON$0$0 == 0x0098 _S0CON = 0x0098 Fi2c$IEN2$0$0 == 0x009a _IEN2 = 0x009a Fi2c$S1CON$0$0 == 0x009b _S1CON = 0x009b Fi2c$T2CT$0$0 == 0x009c _T2CT = 0x009c Fi2c$T2PR$0$0 == 0x009d _T2PR = 0x009d Fi2c$T2CTL$0$0 == 0x009e _T2CTL = 0x009e Fi2c$P2$0$0 == 0x00a0 _P2 = 0x00a0 Fi2c$WORIRQ$0$0 == 0x00a1 _WORIRQ = 0x00a1 Fi2c$WORCTRL$0$0 == 0x00a2 _WORCTRL = 0x00a2 Fi2c$WOREVT0$0$0 == 0x00a3 _WOREVT0 = 0x00a3 Fi2c$WOREVT1$0$0 == 0x00a4 _WOREVT1 = 0x00a4 Fi2c$WORTIME0$0$0 == 0x00a5 _WORTIME0 = 0x00a5 Fi2c$WORTIME1$0$0 == 0x00a6 _WORTIME1 = 0x00a6 Fi2c$IEN0$0$0 == 0x00a8 _IEN0 = 0x00a8 Fi2c$IP0$0$0 == 0x00a9 _IP0 = 0x00a9 Fi2c$FWT$0$0 == 0x00ab _FWT = 0x00ab Fi2c$FADDRL$0$0 == 0x00ac _FADDRL = 0x00ac Fi2c$FADDRH$0$0 == 0x00ad _FADDRH = 0x00ad Fi2c$FCTL$0$0 == 0x00ae _FCTL = 0x00ae Fi2c$FWDATA$0$0 == 0x00af _FWDATA = 0x00af Fi2c$ENCDI$0$0 == 0x00b1 _ENCDI = 0x00b1 Fi2c$ENCDO$0$0 == 0x00b2 _ENCDO = 0x00b2 Fi2c$ENCCS$0$0 == 0x00b3 _ENCCS = 0x00b3 Fi2c$ADCCON1$0$0 == 0x00b4 _ADCCON1 = 0x00b4 Fi2c$ADCCON2$0$0 == 0x00b5 _ADCCON2 = 0x00b5 Fi2c$ADCCON3$0$0 == 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$0 == 0x00d5 _DMA0CFGH = 0x00d5 Fi2c$DMAARM$0$0 == 0x00d6 _DMAARM = 0x00d6 Fi2c$DMAREQ$0$0 == 0x00d7 _DMAREQ = 0x00d7 Fi2c$TIMIF$0$0 == 0x00d8 _TIMIF = 0x00d8 Fi2c$RFD$0$0 == 0x00d9 _RFD = 0x00d9 Fi2c$T1CC0L$0$0 == 0x00da _T1CC0L = 0x00da Fi2c$T1CC0H$0$0 == 0x00db _T1CC0H = 0x00db Fi2c$T1CC1L$0$0 == 0x00dc _T1CC1L = 0x00dc Fi2c$T1CC1H$0$0 == 0x00dd _T1CC1H = 0x00dd Fi2c$T1CC2L$0$0 == 0x00de _T1CC2L = 0x00de Fi2c$T1CC2H$0$0 == 0x00df _T1CC2H = 0x00df Fi2c$ACC$0$0 == 0x00e0 _ACC = 0x00e0 Fi2c$RFST$0$0 == 0x00e1 _RFST = 0x00e1 Fi2c$T1CNTL$0$0 == 0x00e2 _T1CNTL = 0x00e2 Fi2c$T1CNTH$0$0 == 0x00e3 _T1CNTH = 0x00e3 Fi2c$T1CTL$0$0 == 0x00e4 _T1CTL = 0x00e4 Fi2c$T1CCTL0$0$0 == 0x00e5 _T1CCTL0 = 0x00e5 Fi2c$T1CCTL1$0$0 == 0x00e6 _T1CCTL1 = 0x00e6 Fi2c$T1CCTL2$0$0 == 0x00e7 _T1CCTL2 = 0x00e7 Fi2c$IRCON2$0$0 == 0x00e8 _IRCON2 = 0x00e8 Fi2c$RFIF$0$0 == 0x00e9 _RFIF = 0x00e9 Fi2c$T4CNT$0$0 == 0x00ea _T4CNT = 0x00ea Fi2c$T4CTL$0$0 == 0x00eb _T4CTL = 0x00eb Fi2c$T4CCTL0$0$0 == 0x00ec _T4CCTL0 = 0x00ec Fi2c$T4CC0$0$0 == 0x00ed _T4CC0 = 0x00ed Fi2c$T4CCTL1$0$0 == 0x00ee _T4CCTL1 = 0x00ee Fi2c$T4CC1$0$0 == 0x00ef _T4CC1 = 0x00ef Fi2c$B$0$0 == 0x00f0 _B = 0x00f0 Fi2c$PERCFG$0$0 == 0x00f1 _PERCFG = 0x00f1 Fi2c$ADCCFG$0$0 == 0x00f2 _ADCCFG = 0x00f2 Fi2c$P0SEL$0$0 == 0x00f3 _P0SEL = 0x00f3 Fi2c$P1SEL$0$0 == 0x00f4 _P1SEL = 0x00f4 Fi2c$P2SEL$0$0 == 0x00f5 _P2SEL = 0x00f5 Fi2c$P1INP$0$0 == 0x00f6 _P1INP = 0x00f6 Fi2c$P2INP$0$0 == 0x00f7 _P2INP = 0x00f7 Fi2c$U1CSR$0$0 == 0x00f8 _U1CSR = 0x00f8 Fi2c$U1DBUF$0$0 == 0x00f9 _U1DBUF = 0x00f9 Fi2c$U1BAUD$0$0 == 0x00fa _U1BAUD = 0x00fa Fi2c$U1UCR$0$0 == 0x00fb _U1UCR = 0x00fb Fi2c$U1GCR$0$0 == 0x00fc _U1GCR = 0x00fc Fi2c$P0DIR$0$0 == 0x00fd _P0DIR = 0x00fd Fi2c$P1DIR$0$0 == 0x00fe _P1DIR = 0x00fe Fi2c$P2DIR$0$0 == 0x00ff _P2DIR = 0x00ff Fi2c$DMA0CFG$0$0 == 0xffffd5d4 _DMA0CFG = 0xffffd5d4 Fi2c$DMA1CFG$0$0 == 0xffffd3d2 _DMA1CFG = 0xffffd3d2 Fi2c$FADDR$0$0 == 0xffffadac _FADDR = 0xffffadac Fi2c$ADC$0$0 == 0xffffbbba _ADC = 0xffffbbba Fi2c$T1CC0$0$0 == 0xffffdbda _T1CC0 = 0xffffdbda Fi2c$T1CC1$0$0 == 0xffffdddc _T1CC1 = 0xffffdddc Fi2c$T1CC2$0$0 == 0xffffdfde _T1CC2 = 0xffffdfde ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 Fi2c$P0_0$0$0 == 0x0080 _P0_0 = 0x0080 Fi2c$P0_1$0$0 == 0x0081 _P0_1 = 0x0081 Fi2c$P0_2$0$0 == 0x0082 _P0_2 = 0x0082 Fi2c$P0_3$0$0 == 0x0083 _P0_3 = 0x0083 Fi2c$P0_4$0$0 == 0x0084 _P0_4 = 0x0084 Fi2c$P0_5$0$0 == 0x0085 _P0_5 = 0x0085 Fi2c$P0_6$0$0 == 0x0086 _P0_6 = 0x0086 Fi2c$P0_7$0$0 == 0x0087 _P0_7 = 0x0087 Fi2c$_TCON_0$0$0 == 0x0088 __TCON_0 = 0x0088 Fi2c$RFTXRXIF$0$0 == 0x0089 _RFTXRXIF = 0x0089 Fi2c$_TCON_2$0$0 == 0x008a __TCON_2 = 0x008a Fi2c$URX0IF$0$0 == 0x008b _URX0IF = 0x008b Fi2c$_TCON_4$0$0 == 0x008c __TCON_4 = 0x008c Fi2c$ADCIF$0$0 == 0x008d _ADCIF = 0x008d Fi2c$_TCON_6$0$0 == 0x008e __TCON_6 = 0x008e Fi2c$URX1IF$0$0 == 0x008f _URX1IF = 0x008f Fi2c$P1_0$0$0 == 0x0090 _P1_0 = 0x0090 Fi2c$P1_1$0$0 == 0x0091 _P1_1 = 0x0091 Fi2c$P1_2$0$0 == 0x0092 _P1_2 = 0x0092 Fi2c$P1_3$0$0 == 0x0093 _P1_3 = 0x0093 Fi2c$P1_4$0$0 == 0x0094 _P1_4 = 0x0094 Fi2c$P1_5$0$0 == 0x0095 _P1_5 = 0x0095 Fi2c$P1_6$0$0 == 0x0096 _P1_6 = 0x0096 Fi2c$P1_7$0$0 == 0x0097 _P1_7 = 0x0097 Fi2c$ENCIF_0$0$0 == 0x0098 _ENCIF_0 = 0x0098 Fi2c$ENCIF_1$0$0 == 0x0099 _ENCIF_1 = 0x0099 Fi2c$_SOCON2$0$0 == 0x009a __SOCON2 = 0x009a Fi2c$_SOCON3$0$0 == 0x009b __SOCON3 = 0x009b Fi2c$_SOCON4$0$0 == 0x009c __SOCON4 = 0x009c Fi2c$_SOCON5$0$0 == 0x009d __SOCON5 = 0x009d Fi2c$_SOCON6$0$0 == 0x009e __SOCON6 = 0x009e Fi2c$_SOCON7$0$0 == 0x009f __SOCON7 = 0x009f Fi2c$P2_0$0$0 == 0x00a0 _P2_0 = 0x00a0 Fi2c$P2_1$0$0 == 0x00a1 _P2_1 = 0x00a1 Fi2c$P2_2$0$0 == 0x00a2 _P2_2 = 0x00a2 Fi2c$P2_3$0$0 == 0x00a3 _P2_3 = 0x00a3 Fi2c$P2_4$0$0 == 0x00a4 _P2_4 = 0x00a4 Fi2c$P2_5$0$0 == 0x00a5 _P2_5 = 0x00a5 Fi2c$P2_6$0$0 == 0x00a6 _P2_6 = 0x00a6 Fi2c$P2_7$0$0 == 0x00a7 _P2_7 = 0x00a7 Fi2c$RFTXRXIE$0$0 == 0x00a8 _RFTXRXIE = 0x00a8 Fi2c$ADCIE$0$0 == 0x00a9 _ADCIE = 0x00a9 Fi2c$URX0IE$0$0 == 0x00aa _URX0IE = 0x00aa Fi2c$URX1IE$0$0 == 0x00ab _URX1IE = 0x00ab Fi2c$ENCIE$0$0 == 0x00ac _ENCIE = 0x00ac Fi2c$STIE$0$0 == 0x00ad _STIE = 0x00ad Fi2c$_IEN06$0$0 == 0x00ae __IEN06 = 0x00ae Fi2c$EA$0$0 == 0x00af _EA = 0x00af Fi2c$DMAIE$0$0 == 0x00b8 _DMAIE = 0x00b8 Fi2c$T1IE$0$0 == 0x00b9 _T1IE = 0x00b9 Fi2c$T2IE$0$0 == 0x00ba _T2IE = 0x00ba Fi2c$T3IE$0$0 == 0x00bb _T3IE = 0x00bb Fi2c$T4IE$0$0 == 0x00bc _T4IE = 0x00bc Fi2c$P0IE$0$0 == 0x00bd _P0IE = 0x00bd Fi2c$_IEN16$0$0 == 0x00be __IEN16 = 0x00be Fi2c$_IEN17$0$0 == 0x00bf __IEN17 = 0x00bf Fi2c$DMAIF$0$0 == 0x00c0 _DMAIF = 0x00c0 Fi2c$T1IF$0$0 == 0x00c1 _T1IF = 0x00c1 Fi2c$T2IF$0$0 == 0x00c2 _T2IF = 0x00c2 Fi2c$T3IF$0$0 == 0x00c3 _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x00e7 _ACC_7 = 0x00e7 Fi2c$P2IF$0$0 == 0x00e8 _P2IF = 0x00e8 Fi2c$UTX0IF$0$0 == 0x00e9 _UTX0IF = 0x00e9 Fi2c$UTX1IF$0$0 == 0x00ea _UTX1IF = 0x00ea Fi2c$P1IF$0$0 == 0x00eb _P1IF = 0x00eb Fi2c$WDTIF$0$0 == 0x00ec _WDTIF = 0x00ec Fi2c$_IRCON25$0$0 == 0x00ed __IRCON25 = 0x00ed Fi2c$_IRCON26$0$0 == 0x00ee __IRCON26 = 0x00ee Fi2c$_IRCON27$0$0 == 0x00ef __IRCON27 = 0x00ef Fi2c$B_0$0$0 == 0x00f0 _B_0 = 0x00f0 Fi2c$B_1$0$0 == 0x00f1 _B_1 = 0x00f1 Fi2c$B_2$0$0 == 0x00f2 _B_2 = 0x00f2 Fi2c$B_3$0$0 == 0x00f3 _B_3 = 0x00f3 Fi2c$B_4$0$0 == 0x00f4 _B_4 = 0x00f4 Fi2c$B_5$0$0 == 0x00f5 _B_5 = 0x00f5 Fi2c$B_6$0$0 == 0x00f6 _B_6 = 0x00f6 Fi2c$B_7$0$0 == 0x00f7 _B_7 = 0x00f7 Fi2c$U1ACTIVE$0$0 == 0x00f8 _U1ACTIVE = 0x00f8 Fi2c$U1TX_BYTE$0$0 == 0x00f9 _U1TX_BYTE = 0x00f9 Fi2c$U1RX_BYTE$0$0 == 0x00fa _U1RX_BYTE = 0x00fa Fi2c$U1ERR$0$0 == 0x00fb _U1ERR = 0x00fb Fi2c$U1FE$0$0 == 0x00fc _U1FE = 0x00fc Fi2c$U1SLAVE$0$0 == 0x00fd _U1SLAVE = 0x00fd Fi2c$U1RE$0$0 == 0x00fe _U1RE = 0x00fe Fi2c$U1MODE$0$0 == 0x00ff _U1MODE = 0x00ff ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- .area REG_BANK_0 (REL,OVR,DATA) .ds 8 ;-------------------------------------------------------- ; overlayable bit register bank ;-------------------------------------------------------- .area BIT_BANK (REL,OVR,DATA) bits: .ds 1 b0 = bits[0] b1 = bits[1] b2 = bits[2] b3 = bits[3] b4 = bits[4] b5 = bits[5] b6 = bits[6] b7 = bits[7] ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area DSEG (DATA) G$i2cPinScl$0$0==. _i2cPinScl:: .ds 1 G$i2cPinSda$0$0==. _i2cPinSda:: .ds 1 Li2cWaitForHighScl$sloc0$1$0==. _i2cWaitForHighScl_sloc0_1_0: .ds 4 ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- .area OSEG (OVR,DATA) ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area ISEG (DATA) ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- .area IABS (ABS,DATA) .area IABS (ABS,DATA) ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area BSEG (BIT) Fi2c$started$0$0==. _started: .ds 1 G$i2cTimeoutOccurred$0$0==. _i2cTimeoutOccurred:: .ds 1 Fi2c$internalTimeoutOccurred$0$0==. _internalTimeoutOccurred: .ds 1 Li2cWriteBit$b$1$1==. _i2cWriteBit_PARM_1: .ds 1 Li2cReadBit$b$1$1==. _i2cReadBit_b_1_1: .ds 1 Li2cWriteByte$nack$1$1==. _i2cWriteByte_nack_1_1: .ds 1 Li2cReadByte$nack$1$1==. _i2cReadByte_PARM_1: .ds 1 Li2cReadByte$b$1$1==. _i2cReadByte_b_1_1: .ds 1 ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- .area PSEG (PAG,XDATA) Li2cWaitForHighScl$time$1$1==. _i2cWaitForHighScl_time_1_1: .ds 4 ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area XSEG (XDATA) Fi2c$SYNC1$0$0 == 0xdf00 _SYNC1 = 0xdf00 Fi2c$SYNC0$0$0 == 0xdf01 _SYNC0 = 0xdf01 Fi2c$PKTLEN$0$0 == 0xdf02 _PKTLEN = 0xdf02 Fi2c$PKTCTR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df46 _I2SCLKF0 = 0xdf46 Fi2c$I2SCLKF1$0$0 == 0xdf47 _I2SCLKF1 = 0xdf47 Fi2c$I2SCLKF2$0$0 == 0xdf48 _I2SCLKF2 = 0xdf48 Fi2c$USBADDR$0$0 == 0xde00 _USBADDR = 0xde00 Fi2c$USBPOW$0$0 == 0xde01 _USBPOW = 0xde01 Fi2c$USBIIF$0$0 == 0xde02 _USBIIF = 0xde02 Fi2c$USBOIF$0$0 == 0xde04 _USBOIF = 0xde04 Fi2c$USBCIF$0$0 == 0xde06 _USBCIF = 0xde06 Fi2c$USBIIE$0$0 == 0xde07 _USBIIE = 0xde07 Fi2c$USBOIE$0$0 == 0xde09 _USBOIE = 0xde09 Fi2c$USBCIE$0$0 == 0xde0b _USBCIE = 0xde0b Fi2c$USBFRML$0$0 == 0xde0c _USBFRML = 0xde0c Fi2c$USBFRMH$0$0 == 0xde0d _USBFRMH = 0xde0d Fi2c$USBINDEX$0$0 == 0xde0e _USBINDEX = 0xde0e Fi2c$USBMAXI$0$0 == 0xde10 _USBMAXI = 0xde10 Fi2c$USBCSIL$0$0 == 0xde11 _USBCSIL = 0xde11 Fi2c$USBCSIH$0$0 == 0xde12 _USBCSIH = 0xde12 Fi2c$USBMAXO$0$0 == 0xde13 _USBMAXO = 0xde13 Fi2c$USBCSOL$0$0 == 0xde14 _USBCSOL = 0xde14 Fi2c$USBCSOH$0$0 == 0xde15 _USBCSOH = 0xde15 Fi2c$USBCNTL$0$0 == 0xde16 _USBCNTL = 0xde16 Fi2c$USBCNTH$0$0 == 0xde17 _USBCNTH = 0xde17 Fi2c$USBF0$0$0 == 0xde20 _USBF0 = 0xde20 Fi2c$USBF1$0$0 == 0xde22 _USBF1 = 0xde22 Fi2c$USBF2$0$0 == 0xde24 _USBF2 = 0xde24 Fi2c$USBF3$0$0 == 0xde26 _USBF3 = 0xde26 Fi2c$USBF4$0$0 == 0xde28 _USBF4 = 0xde28 Fi2c$USBF5$0$0 == 0xde2a _USBF5 = 0xde2a ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area XABS (ABS,XDATA) ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) Fi2c$halfPeriodUs$0$0==. _halfPeriodUs: .ds 2 Fi2c$timeout$0$0==. _timeout: .ds 2 .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) .area GSINIT2 (CODE) .area GSINIT3 (CODE) .area GSINIT4 (CODE) .area GSINIT5 (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area CSEG (CODE) ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area HOME (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area GSINIT (CODE) G$i2cReadByte$0$0 ==. C$i2c.c$16$1$1 ==. ; libraries/src/i2c/i2c.c:16: uint8 DATA i2cPinScl = 10; // P1_0 mov _i2cPinScl,#0x0A G$i2cReadByte$0$0 ==. C$i2c.c$17$1$1 ==. ; libraries/src/i2c/i2c.c:17: uint8 DATA i2cPinSda = 11; // P1_1 mov _i2cPinSda,#0x0B G$i2cReadByte$0$0 ==. C$i2c.c$21$1$1 ==. ; libraries/src/i2c/i2c.c:21: static BIT started = 0; clr _started G$i2cReadByte$0$0 ==. C$i2c.c$29$1$1 ==. ; libraries/src/i2c/i2c.c:29: BIT i2cTimeoutOccurred = 0; clr _i2cTimeoutOccurred G$i2cReadByte$0$0 ==. C$i2c.c$30$1$1 ==. ; libraries/src/i2c/i2c.c:30: static BIT internalTimeoutOccurred = 0; clr _internalTimeoutOccurred ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area HOME (CODE) .area HOME (CODE) ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area CSEG (CODE) ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cSetFrequency' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cSetFrequency$0$0 ==. C$i2c.c$35$0$0 ==. ; libraries/src/i2c/i2c.c:35: void i2cSetFrequency(uint16 freqKHz) ; ----------------------------------------- ; function i2cSetFrequency ; ----------------------------------------- _i2cSetFrequency: ar2 = 0x02 ar3 = 0x03 ar4 = 0x04 ar5 = 0x05 ar6 = 0x06 ar7 = 0x07 ar0 = 0x00 ar1 = 0x01 mov r2,dpl mov r3,dph C$i2c.c$38$1$1 ==. ; libraries/src/i2c/i2c.c:38: if (freqKHz < 2) clr c mov a,r2 subb a,#0x02 mov a,r3 subb a,#0x00 jnc 00102$ C$i2c.c$40$2$2 ==. ; libraries/src/i2c/i2c.c:40: freqKHz = 2; mov r2,#0x02 mov r3,#0x00 00102$: C$i2c.c$45$1$1 ==. ; libraries/src/i2c/i2c.c:45: halfPeriodUs = (500 + freqKHz - 1) / freqKHz; mov a,#0xF3 add a,r2 mov dpl,a mov a,#0x01 addc a,r3 mov dph,a mov r0,#__divuint_PARM_2 mov a,r2 movx @r0,a inc r0 mov a,r3 movx @r0,a lcall __divuint mov a,dpl mov b,dph mov dptr,#_halfPeriodUs movx @dptr,a inc dptr mov a,b movx @dptr,a C$i2c.c$46$1$1 ==. XG$i2cSetFrequency$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cSetTimeout' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cSetTimeout$0$0 ==. C$i2c.c$48$1$1 ==. ; libraries/src/i2c/i2c.c:48: void i2cSetTimeout(uint16 timeoutMs) ; ----------------------------------------- ; function i2cSetTimeout ; ----------------------------------------- _i2cSetTimeout: mov r2,dph mov a,dpl mov dptr,#_timeout movx @dptr,a inc dptr mov a,r2 movx @dptr,a C$i2c.c$50$1$1 ==. ; libraries/src/i2c/i2c.c:50: timeout = timeoutMs; C$i2c.c$51$1$1 ==. XG$i2cSetTimeout$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cReadScl' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cReadScl$0$0 ==. C$i2c.c$53$1$1 ==. ; libraries/src/i2c/i2c.c:53: BIT i2cReadScl(void) ; ----------------------------------------- ; function i2cReadScl ; ----------------------------------------- _i2cReadScl: C$i2c.c$55$1$1 ==. ; libraries/src/i2c/i2c.c:55: setDigitalInput(i2cPinScl, HIGH_IMPEDANCE); clr b[0] mov bits,b mov dpl,_i2cPinScl lcall _setDigitalInput C$i2c.c$56$1$1 ==. ; libraries/src/i2c/i2c.c:56: return isPinHigh(i2cPinScl); mov dpl,_i2cPinScl C$i2c.c$57$1$1 ==. XG$i2cReadScl$0$0 ==. ljmp _isPinHigh ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cReadSda' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cReadSda$0$0 ==. C$i2c.c$59$1$1 ==. ; libraries/src/i2c/i2c.c:59: BIT i2cReadSda(void) ; ----------------------------------------- ; function i2cReadSda ; ----------------------------------------- _i2cReadSda: C$i2c.c$61$1$1 ==. ; libraries/src/i2c/i2c.c:61: setDigitalInput(i2cPinSda, HIGH_IMPEDANCE); clr b[0] mov bits,b mov dpl,_i2cPinSda lcall _setDigitalInput C$i2c.c$62$1$1 ==. ; libraries/src/i2c/i2c.c:62: return isPinHigh(i2cPinSda); mov dpl,_i2cPinSda C$i2c.c$63$1$1 ==. XG$i2cReadSda$0$0 ==. ljmp _isPinHigh ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cClearScl' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cClearScl$0$0 ==. C$i2c.c$65$1$1 ==. ; libraries/src/i2c/i2c.c:65: void i2cClearScl(void) ; ----------------------------------------- ; function i2cClearScl ; ----------------------------------------- _i2cClearScl: C$i2c.c$67$1$1 ==. ; libraries/src/i2c/i2c.c:67: setDigitalOutput(i2cPinScl, LOW); clr b[0] mov bits,b mov dpl,_i2cPinScl C$i2c.c$68$1$1 ==. XG$i2cClearScl$0$0 ==. ljmp _setDigitalOutput ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cClearSda' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cClearSda$0$0 ==. C$i2c.c$70$1$1 ==. ; libraries/src/i2c/i2c.c:70: void i2cClearSda(void) ; ----------------------------------------- ; function i2cClearSda ; ----------------------------------------- _i2cClearSda: C$i2c.c$72$1$1 ==. ; libraries/src/i2c/i2c.c:72: setDigitalOutput(i2cPinSda, LOW); clr b[0] mov bits,b mov dpl,_i2cPinSda C$i2c.c$73$1$1 ==. XG$i2cClearSda$0$0 ==. ljmp _setDigitalOutput ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cWaitForHighScl' ;------------------------------------------------------------ ;sloc0 Allocated with name '_i2cWaitForHighScl_sloc0_1_0' ;------------------------------------------------------------ G$i2cWaitForHighScl$0$0 ==. C$i2c.c$75$1$1 ==. ; libraries/src/i2c/i2c.c:75: void i2cWaitForHighScl(uint16 timeoutMs) ; ----------------------------------------- ; function i2cWaitForHighScl ; ----------------------------------------- _i2cWaitForHighScl: mov r2,dpl mov r3,dph C$i2c.c$77$1$1 ==. ; libraries/src/i2c/i2c.c:77: uint32 time = getMs(); push ar2 push ar3 lcall _getMs mov r0,#_i2cWaitForHighScl_time_1_1 push acc mov a,dpl movx @r0,a inc r0 mov a,dph movx @r0,a inc r0 mov a,b movx @r0,a pop acc inc r0 movx @r0,a pop ar3 pop ar2 C$i2c.c$78$1$1 ==. ; libraries/src/i2c/i2c.c:78: while (i2cReadScl() == 0) 00103$: push ar2 push ar3 lcall _i2cReadScl pop ar3 pop ar2 jc 00106$ C$i2c.c$80$2$2 ==. ; libraries/src/i2c/i2c.c:80: if (getMs() - time > timeoutMs) push ar2 push ar3 lcall _getMs mov _i2cWaitForHighScl_sloc0_1_0,dpl mov (_i2cWaitForHighScl_sloc0_1_0 + 1),dph mov (_i2cWaitForHighScl_sloc0_1_0 + 2),b mov (_i2cWaitForHighScl_sloc0_1_0 + 3),a pop ar3 pop ar2 mov r0,#_i2cWaitForHighScl_time_1_1 setb c movx a,@r0 subb a,_i2cWaitForHighScl_sloc0_1_0 cpl a cpl c mov _i2cWaitForHighScl_sloc0_1_0,a cpl c inc r0 movx a,@r0 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 1) cpl a cpl c mov (_i2cWaitForHighScl_sloc0_1_0 + 1),a cpl c inc r0 movx a,@r0 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 2) cpl a cpl c mov (_i2cWaitForHighScl_sloc0_1_0 + 2),a cpl c inc r0 movx a,@r0 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 3) cpl a mov (_i2cWaitForHighScl_sloc0_1_0 + 3),a mov ar4,r2 mov ar5,r3 mov r6,#0x00 mov r7,#0x00 clr c mov a,r4 subb a,_i2cWaitForHighScl_sloc0_1_0 mov a,r5 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 1) mov a,r6 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 2) mov a,r7 subb a,(_i2cWaitForHighScl_sloc0_1_0 + 3) jnc 00103$ C$i2c.c$82$3$3 ==. ; libraries/src/i2c/i2c.c:82: internalTimeoutOccurred = 1; setb _internalTimeoutOccurred C$i2c.c$83$3$3 ==. ; libraries/src/i2c/i2c.c:83: i2cTimeoutOccurred = 1; setb _i2cTimeoutOccurred C$i2c.c$84$3$3 ==. ; libraries/src/i2c/i2c.c:84: started = 0; clr _started C$i2c.c$85$3$3 ==. ; libraries/src/i2c/i2c.c:85: return; 00106$: C$i2c.c$88$1$1 ==. XG$i2cWaitForHighScl$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cStop' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cStop$0$0 ==. C$i2c.c$93$1$1 ==. ; libraries/src/i2c/i2c.c:93: void i2cStop(void) ; ----------------------------------------- ; function i2cStop ; ----------------------------------------- _i2cStop: C$i2c.c$95$1$1 ==. ; libraries/src/i2c/i2c.c:95: i2cClearSda(); // drive SDA low while SCL is low lcall _i2cClearSda C$i2c.c$96$1$1 ==. ; libraries/src/i2c/i2c.c:96: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$99$1$1 ==. ; libraries/src/i2c/i2c.c:99: i2cWaitForHighScl(timeout); mov dptr,#_timeout movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a mov dpl,r2 mov dph,r3 lcall _i2cWaitForHighScl C$i2c.c$100$1$1 ==. ; libraries/src/i2c/i2c.c:100: if (internalTimeoutOccurred) return; jnb _internalTimeoutOccurred,00102$ ret 00102$: C$i2c.c$103$1$1 ==. ; libraries/src/i2c/i2c.c:103: i2cReadSda(); // let SDA line go high while SCL is high lcall _i2cReadSda C$i2c.c$104$1$1 ==. ; libraries/src/i2c/i2c.c:104: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$105$1$1 ==. ; libraries/src/i2c/i2c.c:105: started = 0; clr _started C$i2c.c$106$1$1 ==. XG$i2cStop$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cStart' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cStart$0$0 ==. C$i2c.c$111$1$1 ==. ; libraries/src/i2c/i2c.c:111: void i2cStart(void) ; ----------------------------------------- ; function i2cStart ; ----------------------------------------- _i2cStart: C$i2c.c$114$1$1 ==. ; libraries/src/i2c/i2c.c:114: if (started) jnb _started,00102$ C$i2c.c$116$2$2 ==. ; libraries/src/i2c/i2c.c:116: i2cReadSda(); // let SDA line go high while SCL is low lcall _i2cReadSda C$i2c.c$117$2$2 ==. ; libraries/src/i2c/i2c.c:117: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds 00102$: C$i2c.c$121$1$1 ==. ; libraries/src/i2c/i2c.c:121: i2cWaitForHighScl(timeout); mov dptr,#_timeout movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a mov dpl,r2 mov dph,r3 lcall _i2cWaitForHighScl C$i2c.c$122$1$1 ==. ; libraries/src/i2c/i2c.c:122: if (internalTimeoutOccurred) return; jnb _internalTimeoutOccurred,00104$ ret 00104$: C$i2c.c$125$1$1 ==. ; libraries/src/i2c/i2c.c:125: i2cClearSda(); // drive SDA low while SCL is high lcall _i2cClearSda C$i2c.c$126$1$1 ==. ; libraries/src/i2c/i2c.c:126: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$127$1$1 ==. ; libraries/src/i2c/i2c.c:127: i2cClearScl(); // drive SCL low lcall _i2cClearScl C$i2c.c$128$1$1 ==. ; libraries/src/i2c/i2c.c:128: started = 1; setb _started C$i2c.c$129$1$1 ==. XG$i2cStart$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cWriteBit' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cWriteBit$0$0 ==. C$i2c.c$139$1$1 ==. ; libraries/src/i2c/i2c.c:139: void i2cWriteBit(BIT b) ; ----------------------------------------- ; function i2cWriteBit ; ----------------------------------------- _i2cWriteBit: C$i2c.c$141$1$1 ==. ; libraries/src/i2c/i2c.c:141: if (b) jnb _i2cWriteBit_PARM_1,00102$ C$i2c.c$143$2$2 ==. ; libraries/src/i2c/i2c.c:143: i2cReadSda(); // let SDA go high lcall _i2cReadSda sjmp 00103$ 00102$: C$i2c.c$147$2$3 ==. ; libraries/src/i2c/i2c.c:147: i2cClearSda(); // drive SDA low lcall _i2cClearSda 00103$: C$i2c.c$149$1$1 ==. ; libraries/src/i2c/i2c.c:149: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$152$1$1 ==. ; libraries/src/i2c/i2c.c:152: i2cWaitForHighScl(timeout); mov dptr,#_timeout movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a mov dpl,r2 mov dph,r3 lcall _i2cWaitForHighScl C$i2c.c$153$1$1 ==. ; libraries/src/i2c/i2c.c:153: if (internalTimeoutOccurred) return; jnb _internalTimeoutOccurred,00105$ ret 00105$: C$i2c.c$156$1$1 ==. ; libraries/src/i2c/i2c.c:156: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$157$1$1 ==. ; libraries/src/i2c/i2c.c:157: i2cClearScl(); // drive SCL low C$i2c.c$158$1$1 ==. XG$i2cWriteBit$0$0 ==. ljmp _i2cClearScl ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cReadBit' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cReadBit$0$0 ==. C$i2c.c$169$1$1 ==. ; libraries/src/i2c/i2c.c:169: BIT i2cReadBit(void) ; ----------------------------------------- ; function i2cReadBit ; ----------------------------------------- _i2cReadBit: C$i2c.c$173$1$1 ==. ; libraries/src/i2c/i2c.c:173: i2cReadSda(); // let slave transmitter control state of SDA line lcall _i2cReadSda C$i2c.c$174$1$1 ==. ; libraries/src/i2c/i2c.c:174: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$177$1$1 ==. ; libraries/src/i2c/i2c.c:177: i2cWaitForHighScl(timeout); mov dptr,#_timeout movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a mov dpl,r2 mov dph,r3 lcall _i2cWaitForHighScl C$i2c.c$178$1$1 ==. ; libraries/src/i2c/i2c.c:178: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00102$ clr c ret 00102$: C$i2c.c$181$1$1 ==. ; libraries/src/i2c/i2c.c:181: b = i2cReadSda(); // store state of SDA line now that SCL is high lcall _i2cReadSda mov _i2cReadBit_b_1_1,c C$i2c.c$182$1$1 ==. ; libraries/src/i2c/i2c.c:182: delayMicroseconds(halfPeriodUs); mov dptr,#_halfPeriodUs movx a,@dptr mov r2,a inc dptr movx a,@dptr mov dpl,r2 lcall _delayMicroseconds C$i2c.c$183$1$1 ==. ; libraries/src/i2c/i2c.c:183: i2cClearScl(); // drive SCL low lcall _i2cClearScl C$i2c.c$184$1$1 ==. ; libraries/src/i2c/i2c.c:184: return b; mov c,_i2cReadBit_b_1_1 C$i2c.c$185$1$1 ==. XG$i2cReadBit$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cWriteByte' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cWriteByte$0$0 ==. C$i2c.c$190$1$1 ==. ; libraries/src/i2c/i2c.c:190: BIT i2cWriteByte(uint8 byte) ; ----------------------------------------- ; function i2cWriteByte ; ----------------------------------------- _i2cWriteByte: mov r2,dpl C$i2c.c$195$1$1 ==. ; libraries/src/i2c/i2c.c:195: internalTimeoutOccurred = 0; clr _internalTimeoutOccurred C$i2c.c$197$1$1 ==. ; libraries/src/i2c/i2c.c:197: for (i = 0; i < 8; i++) mov r3,#0x00 00109$: cjne r3,#0x08,00121$ 00121$: jnc 00112$ C$i2c.c$199$2$2 ==. ; libraries/src/i2c/i2c.c:199: i2cWriteBit(byte & 0x80); mov a,r2 rlc a mov _i2cWriteBit_PARM_1,c push ar2 push ar3 lcall _i2cWriteBit pop ar3 pop ar2 C$i2c.c$200$2$2 ==. ; libraries/src/i2c/i2c.c:200: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00102$ clr c ret 00102$: C$i2c.c$201$2$2 ==. ; libraries/src/i2c/i2c.c:201: byte <<= 1; mov a,r2 add a,r2 mov r2,a C$i2c.c$197$1$1 ==. ; libraries/src/i2c/i2c.c:197: for (i = 0; i < 8; i++) inc r3 sjmp 00109$ 00112$: C$i2c.c$203$1$1 ==. ; libraries/src/i2c/i2c.c:203: nack = i2cReadBit(); lcall _i2cReadBit mov _i2cWriteByte_nack_1_1,c C$i2c.c$204$1$1 ==. ; libraries/src/i2c/i2c.c:204: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00104$ clr c ret 00104$: C$i2c.c$206$1$1 ==. ; libraries/src/i2c/i2c.c:206: if (nack) jnb _i2cWriteByte_nack_1_1,00108$ C$i2c.c$208$2$3 ==. ; libraries/src/i2c/i2c.c:208: i2cStop(); lcall _i2cStop C$i2c.c$209$2$3 ==. ; libraries/src/i2c/i2c.c:209: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00108$ clr c C$i2c.c$211$1$1 ==. ; libraries/src/i2c/i2c.c:211: return nack; C$i2c.c$212$1$1 ==. XG$i2cWriteByte$0$0 ==. ret 00108$: mov c,_i2cWriteByte_nack_1_1 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'i2cReadByte' ;------------------------------------------------------------ ;------------------------------------------------------------ G$i2cReadByte$0$0 ==. C$i2c.c$217$1$1 ==. ; libraries/src/i2c/i2c.c:217: uint8 i2cReadByte(BIT nack) ; ----------------------------------------- ; function i2cReadByte ; ----------------------------------------- _i2cReadByte: C$i2c.c$219$1$1 ==. ; libraries/src/i2c/i2c.c:219: uint16 byte = 0; mov r2,#0x00 mov r3,#0x00 C$i2c.c$223$1$1 ==. ; libraries/src/i2c/i2c.c:223: internalTimeoutOccurred = 0; clr _internalTimeoutOccurred C$i2c.c$225$1$1 ==. ; libraries/src/i2c/i2c.c:225: for (i = 0; i < 8; i++) mov r4,#0x00 00105$: cjne r4,#0x08,00115$ 00115$: jnc 00108$ C$i2c.c$227$2$2 ==. ; libraries/src/i2c/i2c.c:227: b = i2cReadBit(); push ar2 push ar3 push ar4 lcall _i2cReadBit pop ar4 pop ar3 pop ar2 mov _i2cReadByte_b_1_1,c C$i2c.c$228$2$2 ==. ; libraries/src/i2c/i2c.c:228: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00102$ mov dpl,#0x00 ret 00102$: C$i2c.c$229$2$2 ==. ; libraries/src/i2c/i2c.c:229: byte = (byte << 1) | b; mov ar5,r2 mov a,r3 xch a,r5 add a,acc xch a,r5 rlc a mov r6,a mov c,_i2cReadByte_b_1_1 clr a rlc a mov r7,a mov r0,#0x00 orl a,r5 mov r2,a mov a,r0 orl a,r6 mov r3,a C$i2c.c$225$1$1 ==. ; libraries/src/i2c/i2c.c:225: for (i = 0; i < 8; i++) inc r4 sjmp 00105$ 00108$: C$i2c.c$232$1$1 ==. ; libraries/src/i2c/i2c.c:232: i2cWriteBit(nack); mov c,_i2cReadByte_PARM_1 mov _i2cWriteBit_PARM_1,c push ar2 push ar3 lcall _i2cWriteBit pop ar3 pop ar2 C$i2c.c$233$1$1 ==. ; libraries/src/i2c/i2c.c:233: if (internalTimeoutOccurred) return 0; jnb _internalTimeoutOccurred,00104$ mov dpl,#0x00 C$i2c.c$235$1$1 ==. ; libraries/src/i2c/i2c.c:235: return byte; C$i2c.c$236$1$1 ==. XG$i2cReadByte$0$0 ==. ret 00104$: mov dpl,r2 ret .area CSEG (CODE) .area CONST (CODE) .area XINIT (CODE) Fi2c$__xinit_halfPeriodUs$0$0 == . __xinit__halfPeriodUs: .byte #0x05,#0x00 ; 5 Fi2c$__xinit_timeout$0$0 == . __xinit__timeout: .byte #0x0A,#0x00 ; 10 .area CABS (ABS,CODE)