; generated by ARM C/C++ Compiler, 4.1 [Build 894]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\obj\nano1xx_ebi.o --asm_dir=.\lst\ --list_dir=.\lst\ --depend=.\obj\nano1xx_ebi.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_ebi.crf ..\bsp\Driver\nano1xx_ebi.c]
                          THUMB

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

                  EBI_DeInit PROC
;;;73       */
;;;74     void EBI_DeInit(void)
000000  4805              LDR      r0,|L1.24|
;;;75     {
;;;76     	/* EBI disable */
;;;77     	EBI->EBICON &= ~EBI_EBICON_ExtEN;
000002  6801              LDR      r1,[r0,#0]
000004  0849              LSRS     r1,r1,#1
000006  0049              LSLS     r1,r1,#1
000008  6001              STR      r1,[r0,#0]
;;;78     	
;;;79     	/* EBI clock disable */
;;;80         CLK->AHBCLK &= ~CLK_AHBCLK_EBI_EN;
00000a  4804              LDR      r0,|L1.28|
00000c  6841              LDR      r1,[r0,#4]
00000e  2208              MOVS     r2,#8
000010  4391              BICS     r1,r1,r2
000012  6041              STR      r1,[r0,#4]
;;;81     }
000014  4770              BX       lr
;;;82     
                          ENDP

000016  0000              DCW      0x0000
                  |L1.24|
                          DCD      0x50010000
                  |L1.28|
                          DCD      0x50000200

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

                  EBI_GetBusTiming PROC
;;;108      */
;;;109    void EBI_GetBusTiming(EBI_TIMING_T *psEBITiming)
000000  490e              LDR      r1,|L2.60|
;;;110    {
;;;111    	psEBITiming->eMCLKDIV  = (EBI->EBICON & EBI_EBICON_MCLKDIV_MASK) >> 8;
000002  680a              LDR      r2,[r1,#0]
000004  0552              LSLS     r2,r2,#21
000006  0f52              LSRS     r2,r2,#29
000008  7002              STRB     r2,[r0,#0]
;;;112    	psEBITiming->u8ExttALE = (EBI->EBICON & EBI_EBICON_ExtALE_MASK) >> 16;
00000a  680a              LDR      r2,[r1,#0]
00000c  0352              LSLS     r2,r2,#13
00000e  0f52              LSRS     r2,r2,#29
000010  7042              STRB     r2,[r0,#1]
;;;113    	
;;;114    	psEBITiming->u8ExttACC = (EBI->EXTIME & EBI_EXTIME_ExttAAC_MASK);
000012  684a              LDR      r2,[r1,#4]
000014  06d2              LSLS     r2,r2,#27
000016  0ed2              LSRS     r2,r2,#27
000018  7182              STRB     r2,[r0,#6]
;;;115    	psEBITiming->u8ExttAHD = (EBI->EXTIME & EBI_EXTIME_ExttAHD_MASK) >> 8;
00001a  684a              LDR      r2,[r1,#4]
00001c  0552              LSLS     r2,r2,#21
00001e  0f52              LSRS     r2,r2,#29
000020  7142              STRB     r2,[r0,#5]
;;;116    	psEBITiming->u8ExtIW2X = (EBI->EXTIME & EBI_EXTIME_ExtlW2X_MASK) >> 12;
000022  684a              LDR      r2,[r1,#4]
000024  0412              LSLS     r2,r2,#16
000026  0f12              LSRS     r2,r2,#28
000028  7102              STRB     r2,[r0,#4]
;;;117    	psEBITiming->u8ExtIR2W = (EBI->EXTIME & EBI_EXTIME_ExtlR2W_MASK) >> 16;
00002a  684a              LDR      r2,[r1,#4]
00002c  0312              LSLS     r2,r2,#12
00002e  0f12              LSRS     r2,r2,#28
000030  70c2              STRB     r2,[r0,#3]
;;;118    	psEBITiming->u8ExtIR2R = (EBI->EXTIME & EBI_EXTIME_ExtlR2R_MASK) >> 24;
000032  6849              LDR      r1,[r1,#4]
000034  0109              LSLS     r1,r1,#4
000036  0f09              LSRS     r1,r1,#28
000038  7081              STRB     r1,[r0,#2]
;;;119    }
00003a  4770              BX       lr
;;;120    
                          ENDP

                  |L2.60|
                          DCD      0x50010000

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

                  EBI_Init PROC
;;;28       */
;;;29     void EBI_Init(int data_width_is_8_bit)
000000  b5f0              PUSH     {r4-r7,lr}
;;;30     {
000002  4684              MOV      r12,r0
;;;31     	/* Enable EBI clock	 */
;;;32         CLK->AHBCLK |= CLK_AHBCLK_EBI_EN;
000004  4828              LDR      r0,|L3.168|
000006  6841              LDR      r1,[r0,#4]
000008  2208              MOVS     r2,#8
00000a  4311              ORRS     r1,r1,r2
00000c  6041              STR      r1,[r0,#4]
;;;33     
;;;34     	/* EBI function enable */
;;;35     	EBI->EBICON |= EBI_EBICON_ExtEN;
00000e  4c27              LDR      r4,|L3.172|
000010  6820              LDR      r0,[r4,#0]
000012  2101              MOVS     r1,#1
000014  4308              ORRS     r0,r0,r1
000016  6020              STR      r0,[r4,#0]
;;;36     
;;;37     	// Enable EBI_EN and EBI_MCLK_EN
;;;38     	GCR->PC_H_MFP_BITS.PC8 = 0x2;
000018  4a25              LDR      r2,|L3.176|
00001a  6850              LDR      r0,[r2,#4]
00001c  08c0              LSRS     r0,r0,#3
00001e  00c0              LSLS     r0,r0,#3
000020  1c80              ADDS     r0,r0,#2
000022  6050              STR      r0,[r2,#4]
;;;39     
;;;40     	// Enable nRD/nWR/ALE/nCS for EBI
;;;41     	GCR->PA_H_MFP = (GCR->PA_H_MFP & ~0xff00) | 0x2200;
000024  2105              MOVS     r1,#5
000026  0709              LSLS     r1,r1,#28
000028  6b4b              LDR      r3,[r1,#0x34]
00002a  27ff              MOVS     r7,#0xff
00002c  023f              LSLS     r7,r7,#8
00002e  2011              MOVS     r0,#0x11
000030  43bb              BICS     r3,r3,r7
000032  0240              LSLS     r0,r0,#9
000034  181b              ADDS     r3,r3,r0
000036  634b              STR      r3,[r1,#0x34]
;;;42     	GCR->PB_L_MFP = (GCR->PB_L_MFP & ~0xff000000) | 0x22000000;
000038  6b8b              LDR      r3,[r1,#0x38]
00003a  021d              LSLS     r5,r3,#8
00003c  0a2d              LSRS     r5,r5,#8
00003e  0403              LSLS     r3,r0,#16
000040  18ed              ADDS     r5,r5,r3
000042  638d              STR      r5,[r1,#0x38]
;;;43     
;;;44     	// Enable EBI AD Low-byte, bit 7~0
;;;45     	GCR->PA_L_MFP = (GCR->PA_L_MFP & ~0xff000000) | 0x22000000;
000044  6b0d              LDR      r5,[r1,#0x30]
000046  022d              LSLS     r5,r5,#8
000048  0a2d              LSRS     r5,r5,#8
00004a  18ed              ADDS     r5,r5,r3
00004c  630d              STR      r5,[r1,#0x30]
;;;46     	GCR->PB_H_MFP = (GCR->PB_H_MFP & ~0xff0000) | 0x220000;
00004e  6bcd              LDR      r5,[r1,#0x3c]
000050  023e              LSLS     r6,r7,#8
000052  43b5              BICS     r5,r5,r6
000054  0206              LSLS     r6,r0,#8
000056  19ad              ADDS     r5,r5,r6
000058  63cd              STR      r5,[r1,#0x3c]
;;;47     	GCR->PC_H_MFP = (GCR->PC_H_MFP & ~0xff000000) | 0x22000000;
00005a  6855              LDR      r5,[r2,#4]
00005c  022d              LSLS     r5,r5,#8
00005e  0a2d              LSRS     r5,r5,#8
000060  18ed              ADDS     r5,r5,r3
000062  6055              STR      r5,[r2,#4]
;;;48     	GCR->PC_L_MFP = (GCR->PC_L_MFP & ~0xff000000) | 0x22000000;
000064  6815              LDR      r5,[r2,#0]
000066  022d              LSLS     r5,r5,#8
000068  0a2d              LSRS     r5,r5,#8
00006a  18eb              ADDS     r3,r5,r3
00006c  6013              STR      r3,[r2,#0]
;;;49     
;;;50     	if (data_width_is_8_bit)
00006e  4663              MOV      r3,r12
;;;51     	{	
;;;52     		EBI->EBICON &= ~EBI_EBICON_ExtBW16;
000070  2202              MOVS     r2,#2
000072  2b00              CMP      r3,#0                 ;50
000074  d003              BEQ      |L3.126|
000076  6820              LDR      r0,[r4,#0]
000078  4390              BICS     r0,r0,r2
00007a  6020              STR      r0,[r4,#0]
;;;53     	}
;;;54     	else // (sEBIConfig.eBusWidth == E_DRVEBI_BUS_16BIT)
;;;55     	{
;;;56     		EBI->EBICON |= EBI_EBICON_ExtBW16;
;;;57     
;;;58     		// Enable nWRH & nWRL for support Byte-Write in 16bit Data Width Device(SARM)
;;;59     		GCR->PB_L_MFP = (GCR->PB_L_MFP & ~0xff00) | 0x2200;
;;;60     
;;;61     		// Enable EBI AD High-byte, bit 15~8
;;;62     		GCR->PA_L_MFP = (GCR->PA_L_MFP & ~0xfffff0) | 0x222220;
;;;63     		GCR->PA_H_MFP = (GCR->PA_H_MFP & ~0xfff0000) | 0x2220000;
;;;64     	}
;;;65     }
00007c  bdf0              POP      {r4-r7,pc}
                  |L3.126|
00007e  6823              LDR      r3,[r4,#0]            ;56
000080  4313              ORRS     r3,r3,r2              ;56
000082  6023              STR      r3,[r4,#0]            ;56
000084  6b8a              LDR      r2,[r1,#0x38]         ;59
000086  43ba              BICS     r2,r2,r7              ;59
000088  1810              ADDS     r0,r2,r0              ;59
00008a  6388              STR      r0,[r1,#0x38]         ;59
00008c  6b08              LDR      r0,[r1,#0x30]         ;62
00008e  4a09              LDR      r2,|L3.180|
000090  4010              ANDS     r0,r0,r2              ;62
000092  4a09              LDR      r2,|L3.184|
000094  1880              ADDS     r0,r0,r2              ;62
000096  6308              STR      r0,[r1,#0x30]         ;62
000098  6b48              LDR      r0,[r1,#0x34]         ;63
00009a  4a08              LDR      r2,|L3.188|
00009c  4010              ANDS     r0,r0,r2              ;63
00009e  4a08              LDR      r2,|L3.192|
0000a0  1880              ADDS     r0,r0,r2              ;63
0000a2  6348              STR      r0,[r1,#0x34]         ;63
0000a4  bdf0              POP      {r4-r7,pc}
;;;66     
                          ENDP

0000a6  0000              DCW      0x0000
                  |L3.168|
                          DCD      0x50000200
                  |L3.172|
                          DCD      0x50010000
                  |L3.176|
                          DCD      0x50000040
                  |L3.180|
                          DCD      0xff00000f
                  |L3.184|
                          DCD      0x00222220
                  |L3.188|
                          DCD      0xf000ffff
                  |L3.192|
                          DCD      0x02220000

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

                  EBI_SetBusTiming PROC
;;;88       */
;;;89     void EBI_SetBusTiming(EBI_TIMING_T sEBITiming)
000000  b503              PUSH     {r0,r1,lr}
;;;90     {	
;;;91     	uint32_t   tmp;
;;;92     	
;;;93     	tmp = ((sEBITiming.eMCLKDIV & 0x7) << 8) | ((sEBITiming.u8ExttALE & 0x7) << 16);
000002  466a              MOV      r2,sp
000004  7810              LDRB     r0,[r2,#0]
000006  0740              LSLS     r0,r0,#29
000008  0d41              LSRS     r1,r0,#21
00000a  7850              LDRB     r0,[r2,#1]
00000c  0740              LSLS     r0,r0,#29
00000e  0b40              LSRS     r0,r0,#13
000010  4301              ORRS     r1,r1,r0
;;;94     	EBI->EBICON = (EBI->EBICON & 0xfff8f8ff) | tmp;
000012  480f              LDR      r0,|L4.80|
000014  6802              LDR      r2,[r0,#0]
000016  4b0f              LDR      r3,|L4.84|
000018  401a              ANDS     r2,r2,r3
00001a  430a              ORRS     r2,r2,r1
00001c  6002              STR      r2,[r0,#0]
;;;95     	
;;;96     	EBI->EXTIME = (sEBITiming.u8ExttACC & 0x1F) |
00001e  466a              MOV      r2,sp
000020  7991              LDRB     r1,[r2,#6]
000022  7952              LDRB     r2,[r2,#5]
000024  06c9              LSLS     r1,r1,#27
000026  0752              LSLS     r2,r2,#29
000028  0ec9              LSRS     r1,r1,#27
00002a  0d52              LSRS     r2,r2,#21
00002c  4311              ORRS     r1,r1,r2
00002e  466a              MOV      r2,sp
000030  7912              LDRB     r2,[r2,#4]
000032  0712              LSLS     r2,r2,#28
000034  0c12              LSRS     r2,r2,#16
000036  4311              ORRS     r1,r1,r2
000038  466a              MOV      r2,sp
00003a  78d2              LDRB     r2,[r2,#3]
00003c  0712              LSLS     r2,r2,#28
00003e  0b12              LSRS     r2,r2,#12
000040  4311              ORRS     r1,r1,r2
000042  466a              MOV      r2,sp
000044  7892              LDRB     r2,[r2,#2]
000046  0712              LSLS     r2,r2,#28
000048  0912              LSRS     r2,r2,#4
00004a  4311              ORRS     r1,r1,r2
00004c  6041              STR      r1,[r0,#4]
;;;97     				  ((sEBITiming.u8ExttAHD & 0x7) << 8) |
;;;98     				  ((sEBITiming.u8ExtIW2X & 0xf) << 12) |
;;;99     				  ((sEBITiming.u8ExtIR2W & 0xf) << 16) |
;;;100    				  ((sEBITiming.u8ExtIR2R & 0xf) << 24);
;;;101    }
00004e  bd0c              POP      {r2,r3,pc}
;;;102    
                          ENDP

                  |L4.80|
                          DCD      0x50010000
                  |L4.84|
                          DCD      0xfff8f8ff

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
