; generated by ARM C/C++ Compiler, 4.1 [Build 894]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\obj\nano1xx_tk.o --asm_dir=.\lst\ --list_dir=.\lst\ --depend=.\obj\nano1xx_tk.d --cpu=Cortex-M0 --apcs=interwork -I..\inc -I..\drv -I..\bsp -I..\bsp\Cmsis -I..\bsp\Driver -I..\bsp\system -I..\lib -I..\lib\libtk -IC:\Keil\ARM\RV31\Inc -IC:\Keil\ARM\CMSIS\Include -D__MICROLIB -D__LCDDISPLAY_BTL001_H --omf_browse=.\obj\nano1xx_tk.crf ..\bsp\Driver\nano1xx_tk.c]
                          THUMB

                          AREA ||i.TK_CheckBusyComplete||, CODE, READONLY, ALIGN=2

                  TK_CheckBusyComplete PROC
;;;188      */
;;;189    void TK_CheckBusyComplete(uint8_t *pu8Busy, uint8_t *pu8Complete)
000000  4a06              LDR      r2,|L1.28|
;;;190    {
;;;191            assert_param(!(pu8Busy == NULL && pu8Complete == NULL));
;;;192    
;;;193            if(pu8Busy != NULL)
000002  2800              CMP      r0,#0
000004  d003              BEQ      |L1.14|
;;;194                    *pu8Busy = (uint8_t)(TK->STAT & 1);
000006  68d3              LDR      r3,[r2,#0xc]
000008  07db              LSLS     r3,r3,#31
00000a  0fdb              LSRS     r3,r3,#31
00000c  7003              STRB     r3,[r0,#0]
                  |L1.14|
;;;195            if(pu8Complete != NULL)
00000e  2900              CMP      r1,#0
000010  d003              BEQ      |L1.26|
;;;196                    *pu8Complete = (uint8_t)(TK->STAT & 0x2) >> 1;
000012  68d0              LDR      r0,[r2,#0xc]
000014  0780              LSLS     r0,r0,#30
000016  0fc0              LSRS     r0,r0,#31
000018  7008              STRB     r0,[r1,#0]
                  |L1.26|
;;;197    
;;;198    }
00001a  4770              BX       lr
;;;199    
                          ENDP

                  |L1.28|
                          DCD      0x400c0000

                          AREA ||i.TK_ConfigChannel||, CODE, READONLY, ALIGN=2

                  TK_ConfigChannel PROC
;;;54       */
;;;55     void TK_ConfigChannel(uint8_t u8Ch, S_TK_CH_CFG *cfg)
000000  b5f8              PUSH     {r3-r7,lr}
;;;56     {
;;;57             uint32_t i;
;;;58     
;;;59             assert_param(cfg != NULL);
;;;60             assert_param(u8Ch < TK_CH_NUM);
;;;61     	assert_param((cfg->u8Level <= TK_MAX_CURRENT_LEVEL) && (cfg->u8Level >= TK_MIN_CURRENT_LEVEL));
;;;62     	assert_param(cfg->u8Div <= TK_MAX_CLOCK_DIVIDER);
;;;63     	assert_param(cfg->u16HighThld > cfg->u16LowThld);
;;;64     
;;;65             u8Ch = u8Ch & 0x7;
000002  0744              LSLS     r4,r0,#29
000004  0f64              LSRS     r4,r4,#29
;;;66     
;;;67             i = *(unsigned int volatile *)(TK_BASE + 0x4 + 4 * (u8Ch >> 2));
000006  08a0              LSRS     r0,r4,#2
000008  4d0c              LDR      r5,|L2.60|
00000a  0080              LSLS     r0,r0,#2
00000c  1943              ADDS     r3,r0,r5
00000e  685a              LDR      r2,[r3,#4]
;;;68             i &= ~(0xff << (8 *(u8Ch & 0x3)));
000010  07a0              LSLS     r0,r4,#30
000012  0ec0              LSRS     r0,r0,#27
000014  26ff              MOVS     r6,#0xff
000016  4086              LSLS     r6,r6,r0
000018  43b2              BICS     r2,r2,r6
;;;69             i |= ((cfg->u8Level << 4) | (cfg->u8Div)) << (8 *(u8Ch & 0x3));
00001a  780e              LDRB     r6,[r1,#0]
00001c  784f              LDRB     r7,[r1,#1]
00001e  0136              LSLS     r6,r6,#4
000020  433e              ORRS     r6,r6,r7
000022  4086              LSLS     r6,r6,r0
000024  4316              ORRS     r6,r6,r2
;;;70             *(unsigned int volatile *)(TK_BASE + 0x4 + 4 * (u8Ch >> 2)) = i;
000026  605e              STR      r6,[r3,#4]
;;;71     
;;;72             *(unsigned int volatile *)(TK_BASE + 0x24 + 4 * u8Ch) = (cfg->u16HighThld << 16) | (cfg->u16LowThld);
000028  1c88              ADDS     r0,r1,#2
00002a  f7fffffe          BL       __aeabi_uread4
00002e  2110              MOVS     r1,#0x10
000030  41c8              RORS     r0,r0,r1
000032  00a1              LSLS     r1,r4,#2
000034  1949              ADDS     r1,r1,r5
000036  6248              STR      r0,[r1,#0x24]
;;;73     
;;;74     }
000038  bdf8              POP      {r3-r7,pc}
;;;75     
                          ENDP

00003a  0000              DCW      0x0000
                  |L2.60|
                          DCD      0x400c0000

                          AREA ||i.TK_DeInit||, CODE, READONLY, ALIGN=2

                  TK_DeInit PROC
;;;39       */
;;;40     void TK_DeInit(void)
000000  4805              LDR      r0,|L3.24|
;;;41     {
;;;42     	CLK->APBCLK &= ~CLK_APBCLK_TK_EN;
000002  6881              LDR      r1,[r0,#8]
000004  03c2              LSLS     r2,r0,#15
000006  4391              BICS     r1,r1,r2
000008  6081              STR      r1,[r0,#8]
;;;43             TK->CTL1 &= ~TK_CTL1_EN;
00000a  4804              LDR      r0,|L3.28|
00000c  6801              LDR      r1,[r0,#0]
00000e  0049              LSLS     r1,r1,#1
000010  0849              LSRS     r1,r1,#1
000012  6001              STR      r1,[r0,#0]
;;;44     
;;;45     }
000014  4770              BX       lr
;;;46     
                          ENDP

000016  0000              DCW      0x0000
                  |L3.24|
                          DCD      0x50000200
                  |L3.28|
                          DCD      0x400c0000

                          AREA ||i.TK_DisableInterrupt||, CODE, READONLY, ALIGN=2

                  TK_DisableInterrupt PROC
;;;122      */
;;;123    void TK_DisableInterrupt(uint32_t u32Mask)
000000  4906              LDR      r1,|L4.28|
;;;124    {
;;;125    
;;;126            assert_param(u32Mask & TK_INT_ALL != 0);
;;;127    
;;;128    
;;;129            TK->INTEN &= ~(u32Mask & TK_INT_ALL);
000002  6a0a              LDR      r2,[r1,#0x20]
000004  0740              LSLS     r0,r0,#29
000006  0f40              LSRS     r0,r0,#29
000008  4382              BICS     r2,r2,r0
00000a  620a              STR      r2,[r1,#0x20]
;;;130    
;;;131            if(TK->INTEN == 0) {
00000c  6a08              LDR      r0,[r1,#0x20]
00000e  2800              CMP      r0,#0
000010  d103              BNE      |L4.26|
000012  2001              MOVS     r0,#1
000014  4902              LDR      r1,|L4.32|
000016  0600              LSLS     r0,r0,#24
000018  6008              STR      r0,[r1,#0]
                  |L4.26|
;;;132                    NVIC_DisableIRQ(TK_IRQn);
;;;133            }
;;;134    
;;;135    }
00001a  4770              BX       lr
;;;136    
                          ENDP

                  |L4.28|
                          DCD      0x400c0000
                  |L4.32|
                          DCD      0xe000e180

                          AREA ||i.TK_EnableInterrupt||, CODE, READONLY, ALIGN=2

                  TK_EnableInterrupt PROC
;;;105      */
;;;106    void TK_EnableInterrupt(uint32_t u32Mask)
000000  4905              LDR      r1,|L5.24|
;;;107    {
;;;108            assert_param(u32Mask & TK_INT_ALL != 0);
;;;109    
;;;110    
;;;111            TK_CLEAR_INTERRUPT;
000002  68ca              LDR      r2,[r1,#0xc]
000004  60ca              STR      r2,[r1,#0xc]
;;;112            TK->INTEN = u32Mask & TK_INT_ALL;
000006  0740              LSLS     r0,r0,#29
000008  0f40              LSRS     r0,r0,#29
00000a  6208              STR      r0,[r1,#0x20]
00000c  2001              MOVS     r0,#1
00000e  4903              LDR      r1,|L5.28|
000010  0600              LSLS     r0,r0,#24
000012  6008              STR      r0,[r1,#0]
;;;113    
;;;114            NVIC_EnableIRQ(TK_IRQn);
;;;115    
;;;116    }
000014  4770              BX       lr
;;;117    
                          ENDP

000016  0000              DCW      0x0000
                  |L5.24|
                          DCD      0x400c0000
                  |L5.28|
                          DCD      0xe000e100

                          AREA ||i.TK_Init||, CODE, READONLY, ALIGN=2

                  TK_Init PROC
;;;21       */
;;;22     void TK_Init(uint32_t u32Width)
000000  4906              LDR      r1,|L6.28|
;;;23     {
;;;24             assert_param((u32Width == TK_CTL1_SEN_SEL_10BIT) ||
;;;25     		(u32Width == TK_CTL1_SEN_SEL_12BIT) ||
;;;26     		(u32Width == TK_CTL1_SEN_SEL_14BIT) ||
;;;27     		(u32Width == TK_CTL1_SEN_SEL_16BIT));
;;;28     
;;;29             CLK->APBCLK |= CLK_APBCLK_TK_EN;
000002  688a              LDR      r2,[r1,#8]
000004  03cb              LSLS     r3,r1,#15
000006  431a              ORRS     r2,r2,r3
000008  608a              STR      r2,[r1,#8]
;;;30     
;;;31             TK->CTL1 = (TK->CTL1 & ~TK_CTL1_SEN_SEL_MASK) | u32Width | TK_CTL1_EN;
00000a  4a05              LDR      r2,|L6.32|
00000c  6811              LDR      r1,[r2,#0]
00000e  02d3              LSLS     r3,r2,#11
000010  4399              BICS     r1,r1,r3
000012  4301              ORRS     r1,r1,r0
000014  0350              LSLS     r0,r2,#13
000016  4301              ORRS     r1,r1,r0
000018  6011              STR      r1,[r2,#0]
;;;32     
;;;33     }
00001a  4770              BX       lr
;;;34     
                          ENDP

                  |L6.28|
                          DCD      0x50000200
                  |L6.32|
                          DCD      0x400c0000

                          AREA ||i.TK_ReadData||, CODE, READONLY, ALIGN=2

                  TK_ReadData PROC
;;;144      */
;;;145    int16_t TK_ReadData(uint8_t u8Ch)
000000  07c1              LSLS     r1,r0,#31
;;;146    {
;;;147            assert_param(u8Ch < TK_CH_NUM);
;;;148    
;;;149            if(u8Ch & 1) {
;;;150                    return((uint16_t)(*(unsigned int volatile *)(TK_BASE + 0x10 + 4 * ((u8Ch & 0x7) >> 1))  >> 16));
000002  0740              LSLS     r0,r0,#29
000004  0f80              LSRS     r0,r0,#30
000006  4a05              LDR      r2,|L7.28|
000008  0080              LSLS     r0,r0,#2
00000a  1880              ADDS     r0,r0,r2
;;;151            } else {
;;;152                    return((uint16_t)(*(unsigned int volatile *)(TK_BASE + 0x10 + 4 * ((u8Ch & 0x7) >> 1)) & 0xffff));
00000c  6900              LDR      r0,[r0,#0x10]
00000e  2900              CMP      r1,#0                 ;149
000010  d001              BEQ      |L7.22|
000012  1400              ASRS     r0,r0,#16             ;150
;;;153            }
;;;154    
;;;155    }
000014  4770              BX       lr
                  |L7.22|
000016  b200              SXTH     r0,r0                 ;152
000018  4770              BX       lr
;;;156    
                          ENDP

00001a  0000              DCW      0x0000
                  |L7.28|
                          DCD      0x400c0000

                          AREA ||i.TK_ReadStatus||, CODE, READONLY, ALIGN=2

                  TK_ReadStatus PROC
;;;166      */
;;;167    void TK_ReadStatus(uint8_t *pu8Level, uint8_t *pu8State, uint8_t *pu8Thld)
000000  b510              PUSH     {r4,lr}
;;;168    {
;;;169            assert_param(!(pu8Level == NULL && pu8State == NULL && pu8Thld == NULL));
;;;170    
;;;171            if(pu8Level != NULL)
;;;172                    *pu8Level = (uint8_t)((TK->STAT & 0xFF) >> 4);
000002  4b09              LDR      r3,|L8.40|
000004  2800              CMP      r0,#0                 ;171
000006  d003              BEQ      |L8.16|
000008  68dc              LDR      r4,[r3,#0xc]
00000a  0624              LSLS     r4,r4,#24
00000c  0f24              LSRS     r4,r4,#28
00000e  7004              STRB     r4,[r0,#0]
                  |L8.16|
;;;173            if(pu8State != NULL)
000010  2900              CMP      r1,#0
000012  d002              BEQ      |L8.26|
;;;174                    *pu8State = (uint8_t)((TK->STAT & 0xFF00) >> 8);
000014  68d8              LDR      r0,[r3,#0xc]
000016  0a00              LSRS     r0,r0,#8
000018  7008              STRB     r0,[r1,#0]
                  |L8.26|
;;;175            if(pu8Thld != NULL)
00001a  2a00              CMP      r2,#0
00001c  d002              BEQ      |L8.36|
;;;176                    *pu8Thld = (uint8_t)((TK->STAT & 0xFF0000) >> 16);
00001e  68d8              LDR      r0,[r3,#0xc]
000020  0c00              LSRS     r0,r0,#16
000022  7010              STRB     r0,[r2,#0]
                  |L8.36|
;;;177    
;;;178    }
000024  bd10              POP      {r4,pc}
;;;179    
                          ENDP

000026  0000              DCW      0x0000
                  |L8.40|
                          DCD      0x400c0000

                          AREA ||i.TK_Start||, CODE, READONLY, ALIGN=2

                  TK_Start PROC
;;;81       */
;;;82     void TK_Start(uint16_t u16Mask)
000000  b510              PUSH     {r4,lr}
;;;83     {
;;;84     	uint32_t reg;
;;;85     
;;;86             assert_param(u16Mask != 0);
;;;87             assert_param(((u16Mask & 0xff) & (u16Mask >> 8)) == 0);	// check mutual exclusive
;;;88     
;;;89     	reg = TK->CTL1;
000002  4b0a              LDR      r3,|L9.44|
000004  681a              LDR      r2,[r3,#0]
;;;90     
;;;91             reg = (reg & ~0xff00) | ((u16Mask & 0xff00) | ((u16Mask & 0xFF) << 8)); // en
000006  0a01              LSRS     r1,r0,#8
000008  0604              LSLS     r4,r0,#24
00000a  0209              LSLS     r1,r1,#8
00000c  0c24              LSRS     r4,r4,#16
00000e  4321              ORRS     r1,r1,r4
000010  24ff              MOVS     r4,#0xff
000012  0224              LSLS     r4,r4,#8
000014  43a2              BICS     r2,r2,r4
000016  4311              ORRS     r1,r1,r2
;;;92             reg = (reg & ~0xff) | (((u16Mask & 0xff00) >> 8) & ~(u16Mask & 0xff)); // sel, 0~7 has higher priority
000018  0a02              LSRS     r2,r0,#8
00001a  0a09              LSRS     r1,r1,#8
00001c  4382              BICS     r2,r2,r0
00001e  0209              LSLS     r1,r1,#8
;;;93     
;;;94             TK->CTL1 = reg | TK_CTL1_START_BY_SW;
000020  2001              MOVS     r0,#1
000022  4311              ORRS     r1,r1,r2              ;92
000024  0400              LSLS     r0,r0,#16
000026  4301              ORRS     r1,r1,r0
000028  6019              STR      r1,[r3,#0]
;;;95     
;;;96     
;;;97     }
00002a  bd10              POP      {r4,pc}
;;;98     
                          ENDP

                  |L9.44|
                          DCD      0x400c0000

;*** Start embedded assembler ***

#line 1 "..\\bsp\\Driver\\nano1xx_tk.c"
	AREA ||.rev16_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___12_nano1xx_tk_c_TK_Init____REV16|
#line 115 "C:\\Keil\\ARM\\CMSIS\\Include\\core_cmInstr.h"
|__asm___12_nano1xx_tk_c_TK_Init____REV16| PROC
#line 116

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE, READONLY
	THUMB
	EXPORT |__asm___12_nano1xx_tk_c_TK_Init____REVSH|
#line 130
|__asm___12_nano1xx_tk_c_TK_Init____REVSH| PROC
#line 131

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
