; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_spi.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_spi.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\stm32f4xx_spi.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_spi.c]
                          THUMB

                          AREA ||i.I2S_Cmd||, CODE, READONLY, ALIGN=1

                  I2S_Cmd PROC
;;;568      */
;;;569    void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
000000  b121              CBZ      r1,|L1.12|
;;;570    {
;;;571      /* Check the parameters */
;;;572      assert_param(IS_SPI_23_PERIPH_EXT(SPIx));
;;;573      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;574      
;;;575      if (NewState != DISABLE)
;;;576      {
;;;577        /* Enable the selected SPI peripheral (in I2S mode) */
;;;578        SPIx->I2SCFGR |= SPI_I2SCFGR_I2SE;
000002  8b82              LDRH     r2,[r0,#0x1c]
000004  f4426280          ORR      r2,r2,#0x400
000008  8382              STRH     r2,[r0,#0x1c]
00000a  e004              B        |L1.22|
                  |L1.12|
;;;579      }
;;;580      else
;;;581      {
;;;582        /* Disable the selected SPI peripheral in I2S mode */
;;;583        SPIx->I2SCFGR &= (uint16_t)~((uint16_t)SPI_I2SCFGR_I2SE);
00000c  8b82              LDRH     r2,[r0,#0x1c]
00000e  f64f33ff          MOV      r3,#0xfbff
000012  401a              ANDS     r2,r2,r3
000014  8382              STRH     r2,[r0,#0x1c]
                  |L1.22|
;;;584      }
;;;585    }
000016  4770              BX       lr
;;;586    
                          ENDP


                          AREA ||i.I2S_FullDuplexConfig||, CODE, READONLY, ALIGN=1

                  I2S_FullDuplexConfig PROC
;;;733      */
;;;734    void I2S_FullDuplexConfig(SPI_TypeDef* I2Sxext, I2S_InitTypeDef* I2S_InitStruct)
000000  b530              PUSH     {r4,r5,lr}
;;;735    {
;;;736      uint16_t tmpreg = 0, tmp = 0;
000002  2200              MOVS     r2,#0
000004  2300              MOVS     r3,#0
;;;737      
;;;738      /* Check the I2S parameters */
;;;739      assert_param(IS_I2S_EXT_PERIPH(I2Sxext));
;;;740      assert_param(IS_I2S_MODE(I2S_InitStruct->I2S_Mode));
;;;741      assert_param(IS_I2S_STANDARD(I2S_InitStruct->I2S_Standard));
;;;742      assert_param(IS_I2S_DATA_FORMAT(I2S_InitStruct->I2S_DataFormat));
;;;743      assert_param(IS_I2S_CPOL(I2S_InitStruct->I2S_CPOL));  
;;;744    
;;;745    /*----------------------- SPIx I2SCFGR & I2SPR Configuration -----------------*/
;;;746      /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */
;;;747      I2Sxext->I2SCFGR &= I2SCFGR_CLEAR_MASK; 
000006  8b84              LDRH     r4,[r0,#0x1c]
000008  f24f0540          MOV      r5,#0xf040
00000c  402c              ANDS     r4,r4,r5
00000e  8384              STRH     r4,[r0,#0x1c]
;;;748      I2Sxext->I2SPR = 0x0002;
000010  2402              MOVS     r4,#2
000012  8404              STRH     r4,[r0,#0x20]
;;;749      
;;;750      /* Get the I2SCFGR register value */
;;;751      tmpreg = I2Sxext->I2SCFGR;
000014  8b82              LDRH     r2,[r0,#0x1c]
;;;752      
;;;753      /* Get the mode to be configured for the extended I2S */
;;;754      if ((I2S_InitStruct->I2S_Mode == I2S_Mode_MasterTx) || (I2S_InitStruct->I2S_Mode == I2S_Mode_SlaveTx))
000016  880c              LDRH     r4,[r1,#0]
000018  f5b47f00          CMP      r4,#0x200
00001c  d001              BEQ      |L2.34|
00001e  880c              LDRH     r4,[r1,#0]
000020  b914              CBNZ     r4,|L2.40|
                  |L2.34|
;;;755      {
;;;756        tmp = I2S_Mode_SlaveRx;
000022  f44f7380          MOV      r3,#0x100
000026  e008              B        |L2.58|
                  |L2.40|
;;;757      }
;;;758      else
;;;759      {
;;;760        if ((I2S_InitStruct->I2S_Mode == I2S_Mode_MasterRx) || (I2S_InitStruct->I2S_Mode == I2S_Mode_SlaveRx))
000028  880c              LDRH     r4,[r1,#0]
00002a  f5b47f40          CMP      r4,#0x300
00002e  d003              BEQ      |L2.56|
000030  880c              LDRH     r4,[r1,#0]
000032  f5b47f80          CMP      r4,#0x100
000036  d100              BNE      |L2.58|
                  |L2.56|
;;;761        {
;;;762          tmp = I2S_Mode_SlaveTx;
000038  2300              MOVS     r3,#0
                  |L2.58|
;;;763        }
;;;764      }
;;;765    
;;;766     
;;;767      /* Configure the I2S with the SPI_InitStruct values */
;;;768      tmpreg |= (uint16_t)((uint16_t)SPI_I2SCFGR_I2SMOD | (uint16_t)(tmp | \
00003a  888c              LDRH     r4,[r1,#4]
00003c  898d              LDRH     r5,[r1,#0xc]
00003e  432c              ORRS     r4,r4,r5
000040  884d              LDRH     r5,[r1,#2]
000042  432c              ORRS     r4,r4,r5
000044  431c              ORRS     r4,r4,r3
000046  f4446400          ORR      r4,r4,#0x800
00004a  4322              ORRS     r2,r2,r4
;;;769                      (uint16_t)(I2S_InitStruct->I2S_Standard | (uint16_t)(I2S_InitStruct->I2S_DataFormat | \
;;;770                      (uint16_t)I2S_InitStruct->I2S_CPOL))));
;;;771     
;;;772      /* Write to SPIx I2SCFGR */  
;;;773      I2Sxext->I2SCFGR = tmpreg;
00004c  8382              STRH     r2,[r0,#0x1c]
;;;774    }
00004e  bd30              POP      {r4,r5,pc}
;;;775    
                          ENDP


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

                  I2S_Init PROC
;;;347      */
;;;348    void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct)
000000  e92d4ff0          PUSH     {r4-r11,lr}
;;;349    {
;;;350      uint16_t tmpreg = 0, i2sdiv = 2, i2sodd = 0, packetlength = 1;
000004  2500              MOVS     r5,#0
000006  2302              MOVS     r3,#2
000008  2400              MOVS     r4,#0
00000a  f04f0901          MOV      r9,#1
;;;351      uint32_t tmp = 0, i2sclk = 0;
00000e  2200              MOVS     r2,#0
000010  2600              MOVS     r6,#0
;;;352    #ifndef I2S_EXTERNAL_CLOCK_VAL
;;;353      uint32_t pllm = 0, plln = 0, pllr = 0;
000012  2700              MOVS     r7,#0
000014  4694              MOV      r12,r2
000016  4690              MOV      r8,r2
;;;354    #endif /* I2S_EXTERNAL_CLOCK_VAL */
;;;355      
;;;356      /* Check the I2S parameters */
;;;357      assert_param(IS_SPI_23_PERIPH(SPIx));
;;;358      assert_param(IS_I2S_MODE(I2S_InitStruct->I2S_Mode));
;;;359      assert_param(IS_I2S_STANDARD(I2S_InitStruct->I2S_Standard));
;;;360      assert_param(IS_I2S_DATA_FORMAT(I2S_InitStruct->I2S_DataFormat));
;;;361      assert_param(IS_I2S_MCLK_OUTPUT(I2S_InitStruct->I2S_MCLKOutput));
;;;362      assert_param(IS_I2S_AUDIO_FREQ(I2S_InitStruct->I2S_AudioFreq));
;;;363      assert_param(IS_I2S_CPOL(I2S_InitStruct->I2S_CPOL));  
;;;364    
;;;365    /*----------------------- SPIx I2SCFGR & I2SPR Configuration -----------------*/
;;;366      /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */
;;;367      SPIx->I2SCFGR &= I2SCFGR_CLEAR_MASK; 
000018  f8b0a01c          LDRH     r10,[r0,#0x1c]
00001c  f24f0b40          MOV      r11,#0xf040
000020  ea0a0a0b          AND      r10,r10,r11
000024  f8a0a01c          STRH     r10,[r0,#0x1c]
;;;368      SPIx->I2SPR = 0x0002;
000028  f04f0a02          MOV      r10,#2
00002c  f8a0a020          STRH     r10,[r0,#0x20]
;;;369      
;;;370      /* Get the I2SCFGR register value */
;;;371      tmpreg = SPIx->I2SCFGR;
000030  8b85              LDRH     r5,[r0,#0x1c]
;;;372      
;;;373      /* If the default value has to be written, reinitialize i2sdiv and i2sodd*/
;;;374      if(I2S_InitStruct->I2S_AudioFreq == I2S_AudioFreq_Default)
000032  f8d1a008          LDR      r10,[r1,#8]
000036  f1ba0f02          CMP      r10,#2
00003a  d101              BNE      |L3.64|
;;;375      {
;;;376        i2sodd = (uint16_t)0;
00003c  bf00              NOP      
;;;377        i2sdiv = (uint16_t)2;   
00003e  e082              B        |L3.326|
                  |L3.64|
;;;378      }
;;;379      /* If the requested audio frequency is not the default, compute the prescaler */
;;;380      else
;;;381      {
;;;382        /* Check the frame length (For the Prescaler computing) *******************/
;;;383        if(I2S_InitStruct->I2S_DataFormat == I2S_DataFormat_16b)
000040  f8b1a004          LDRH     r10,[r1,#4]
000044  f1ba0f00          CMP      r10,#0
000048  d102              BNE      |L3.80|
;;;384        {
;;;385          /* Packet length is 16 bits */
;;;386          packetlength = 1;
00004a  f04f0901          MOV      r9,#1
00004e  e001              B        |L3.84|
                  |L3.80|
;;;387        }
;;;388        else
;;;389        {
;;;390          /* Packet length is 32 bits */
;;;391          packetlength = 2;
000050  f04f0902          MOV      r9,#2
                  |L3.84|
;;;392        }
;;;393    
;;;394        /* Get I2S source Clock frequency  ****************************************/
;;;395          
;;;396        /* If an external I2S clock has to be used, this define should be set  
;;;397           in the project configuration or in the stm32f4xx_conf.h file */
;;;398      #ifdef I2S_EXTERNAL_CLOCK_VAL     
;;;399        /* Set external clock as I2S clock source */
;;;400        if ((RCC->CFGR & RCC_CFGR_I2SSRC) == 0)
;;;401        {
;;;402          RCC->CFGR |= (uint32_t)RCC_CFGR_I2SSRC;
;;;403        }
;;;404        
;;;405        /* Set the I2S clock to the external clock  value */
;;;406        i2sclk = I2S_EXTERNAL_CLOCK_VAL;
;;;407    
;;;408      #else /* There is no define for External I2S clock source */
;;;409        /* Set PLLI2S as I2S clock source */
;;;410        if ((RCC->CFGR & RCC_CFGR_I2SSRC) != 0)
000054  f8dfa134          LDR      r10,|L3.396|
000058  f8daa000          LDR      r10,[r10,#0]
00005c  f40a0a00          AND      r10,r10,#0x800000
000060  f1ba0f00          CMP      r10,#0
000064  d009              BEQ      |L3.122|
;;;411        {
;;;412          RCC->CFGR &= ~(uint32_t)RCC_CFGR_I2SSRC;
000066  f8dfa124          LDR      r10,|L3.396|
00006a  f8daa000          LDR      r10,[r10,#0]
00006e  f42a0a00          BIC      r10,r10,#0x800000
000072  f8dfb118          LDR      r11,|L3.396|
000076  f8cba000          STR      r10,[r11,#0]
                  |L3.122|
;;;413        }    
;;;414        
;;;415        /* Get the PLLI2SN value */
;;;416        plln = (uint32_t)(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6) & \
00007a  f8dfa110          LDR      r10,|L3.396|
00007e  f10a0a7c          ADD      r10,r10,#0x7c
000082  f8daa000          LDR      r10,[r10,#0]
000086  f3ca1c88          UBFX     r12,r10,#6,#9
;;;417                          (RCC_PLLI2SCFGR_PLLI2SN >> 6));
;;;418        
;;;419        /* Get the PLLI2SR value */
;;;420        pllr = (uint32_t)(((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28) & \
00008a  f8dfa100          LDR      r10,|L3.396|
00008e  f10a0a7c          ADD      r10,r10,#0x7c
000092  f8daa000          LDR      r10,[r10,#0]
000096  f3ca7802          UBFX     r8,r10,#28,#3
;;;421                          (RCC_PLLI2SCFGR_PLLI2SR >> 28));
;;;422        
;;;423        /* Get the PLLM value */
;;;424        pllm = (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM);
00009a  f8dfa0f0          LDR      r10,|L3.396|
00009e  f1aa0a04          SUB      r10,r10,#4
0000a2  f8daa000          LDR      r10,[r10,#0]
0000a6  f00a073f          AND      r7,r10,#0x3f
;;;425    
;;;426        if((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE)
0000aa  f8dfa0e0          LDR      r10,|L3.396|
0000ae  f1aa0a04          SUB      r10,r10,#4
0000b2  f8daa000          LDR      r10,[r10,#0]
0000b6  f40a0a80          AND      r10,r10,#0x400000
0000ba  f5ba0f80          CMP      r10,#0x400000
0000be  d108              BNE      |L3.210|
;;;427        {
;;;428          /* Get the I2S source clock value */
;;;429          i2sclk = (uint32_t)(((HSE_VALUE / pllm) * plln) / pllr);
0000c0  f8dfa0cc          LDR      r10,|L3.400|
0000c4  fbbafaf7          UDIV     r10,r10,r7
0000c8  fb0afa0c          MUL      r10,r10,r12
0000cc  fbbaf6f8          UDIV     r6,r10,r8
0000d0  e007              B        |L3.226|
                  |L3.210|
;;;430        }
;;;431        else
;;;432        { /* Get the I2S source clock value */
;;;433          i2sclk = (uint32_t)(((HSI_VALUE / pllm) * plln) / pllr);
0000d2  f8dfa0c0          LDR      r10,|L3.404|
0000d6  fbbafaf7          UDIV     r10,r10,r7
0000da  fb0afa0c          MUL      r10,r10,r12
0000de  fbbaf6f8          UDIV     r6,r10,r8
                  |L3.226|
;;;434        }
;;;435      #endif /* I2S_EXTERNAL_CLOCK_VAL */
;;;436        
;;;437        /* Compute the Real divider depending on the MCLK output state, with a floating point */
;;;438        if(I2S_InitStruct->I2S_MCLKOutput == I2S_MCLKOutput_Enable)
0000e2  f8b1a006          LDRH     r10,[r1,#6]
0000e6  f5ba7f00          CMP      r10,#0x200
0000ea  d10e              BNE      |L3.266|
;;;439        {
;;;440          /* MCLK output is enabled */
;;;441          tmp = (uint16_t)(((((i2sclk / 256) * 10) / I2S_InitStruct->I2S_AudioFreq)) + 5);
0000ec  ea4f2a16          LSR      r10,r6,#8
0000f0  eb0a0a8a          ADD      r10,r10,r10,LSL #2
0000f4  ea4f0a4a          LSL      r10,r10,#1
0000f8  f8d1b008          LDR      r11,[r1,#8]
0000fc  fbbafafb          UDIV     r10,r10,r11
000100  f10a0a05          ADD      r10,r10,#5
000104  fa1ff28a          UXTH     r2,r10
000108  e00f              B        |L3.298|
                  |L3.266|
;;;442        }
;;;443        else
;;;444        {
;;;445          /* MCLK output is disabled */
;;;446          tmp = (uint16_t)(((((i2sclk / (32 * packetlength)) *10 ) / I2S_InitStruct->I2S_AudioFreq)) + 5);
00010a  ea4f1a49          LSL      r10,r9,#5
00010e  fbb6fafa          UDIV     r10,r6,r10
000112  eb0a0a8a          ADD      r10,r10,r10,LSL #2
000116  ea4f0a4a          LSL      r10,r10,#1
00011a  f8d1b008          LDR      r11,[r1,#8]
00011e  fbbafafb          UDIV     r10,r10,r11
000122  f10a0a05          ADD      r10,r10,#5
000126  fa1ff28a          UXTH     r2,r10
                  |L3.298|
;;;447        }
;;;448        
;;;449        /* Remove the flatting point */
;;;450        tmp = tmp / 10;  
00012a  f04f0a0a          MOV      r10,#0xa
00012e  fbb2f2fa          UDIV     r2,r2,r10
;;;451          
;;;452        /* Check the parity of the divider */
;;;453        i2sodd = (uint16_t)(tmp & (uint16_t)0x0001);
000132  f0020401          AND      r4,r2,#1
;;;454       
;;;455        /* Compute the i2sdiv prescaler */
;;;456        i2sdiv = (uint16_t)((tmp - i2sodd) / 2);
000136  eba20a04          SUB      r10,r2,r4
00013a  f3ca034f          UBFX     r3,r10,#1,#16
;;;457       
;;;458        /* Get the Mask for the Odd bit (SPI_I2SPR[8]) register */
;;;459        i2sodd = (uint16_t) (i2sodd << 8);
00013e  f64f7aff          MOV      r10,#0xffff
000142  ea0a2404          AND      r4,r10,r4,LSL #8
                  |L3.326|
;;;460      }
;;;461    
;;;462      /* Test if the divider is 1 or 0 or greater than 0xFF */
;;;463      if ((i2sdiv < 2) || (i2sdiv > 0xFF))
000146  2b02              CMP      r3,#2
000148  db01              BLT      |L3.334|
00014a  2bff              CMP      r3,#0xff
00014c  dd01              BLE      |L3.338|
                  |L3.334|
;;;464      {
;;;465        /* Set the default values */
;;;466        i2sdiv = 2;
00014e  2302              MOVS     r3,#2
;;;467        i2sodd = 0;
000150  2400              MOVS     r4,#0
                  |L3.338|
;;;468      }
;;;469    
;;;470      /* Write to SPIx I2SPR register the computed value */
;;;471      SPIx->I2SPR = (uint16_t)((uint16_t)i2sdiv | (uint16_t)(i2sodd | (uint16_t)I2S_InitStruct->I2S_MCLKOutput));
000152  f8b1a006          LDRH     r10,[r1,#6]
000156  ea4a0a04          ORR      r10,r10,r4
00015a  ea4a0a03          ORR      r10,r10,r3
00015e  f8a0a020          STRH     r10,[r0,#0x20]
;;;472     
;;;473      /* Configure the I2S with the SPI_InitStruct values */
;;;474      tmpreg |= (uint16_t)((uint16_t)SPI_I2SCFGR_I2SMOD | (uint16_t)(I2S_InitStruct->I2S_Mode | \
000162  f8b1a004          LDRH     r10,[r1,#4]
000166  f8b1b00c          LDRH     r11,[r1,#0xc]
00016a  ea4a0a0b          ORR      r10,r10,r11
00016e  f8b1b002          LDRH     r11,[r1,#2]
000172  ea4a0a0b          ORR      r10,r10,r11
000176  f8b1b000          LDRH     r11,[r1,#0]
00017a  ea4a0a0b          ORR      r10,r10,r11
00017e  f44a6a00          ORR      r10,r10,#0x800
000182  ea4a0505          ORR      r5,r10,r5
;;;475                      (uint16_t)(I2S_InitStruct->I2S_Standard | (uint16_t)(I2S_InitStruct->I2S_DataFormat | \
;;;476                      (uint16_t)I2S_InitStruct->I2S_CPOL))));
;;;477     
;;;478      /* Write to SPIx I2SCFGR */  
;;;479      SPIx->I2SCFGR = tmpreg;
000186  8385              STRH     r5,[r0,#0x1c]
;;;480    }
000188  e8bd8ff0          POP      {r4-r11,pc}
;;;481    
                          ENDP

                  |L3.396|
                          DCD      0x40023808
                  |L3.400|
                          DCD      0x017d7840
                  |L3.404|
                          DCD      0x00f42400

                          AREA ||i.I2S_StructInit||, CODE, READONLY, ALIGN=1

                  I2S_StructInit PROC
;;;514      */
;;;515    void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct)
000000  2100              MOVS     r1,#0
;;;516    {
;;;517    /*--------------- Reset I2S init structure parameters values -----------------*/
;;;518      /* Initialize the I2S_Mode member */
;;;519      I2S_InitStruct->I2S_Mode = I2S_Mode_SlaveTx;
000002  8001              STRH     r1,[r0,#0]
;;;520      
;;;521      /* Initialize the I2S_Standard member */
;;;522      I2S_InitStruct->I2S_Standard = I2S_Standard_Phillips;
000004  8041              STRH     r1,[r0,#2]
;;;523      
;;;524      /* Initialize the I2S_DataFormat member */
;;;525      I2S_InitStruct->I2S_DataFormat = I2S_DataFormat_16b;
000006  8081              STRH     r1,[r0,#4]
;;;526      
;;;527      /* Initialize the I2S_MCLKOutput member */
;;;528      I2S_InitStruct->I2S_MCLKOutput = I2S_MCLKOutput_Disable;
000008  80c1              STRH     r1,[r0,#6]
;;;529      
;;;530      /* Initialize the I2S_AudioFreq member */
;;;531      I2S_InitStruct->I2S_AudioFreq = I2S_AudioFreq_Default;
00000a  2102              MOVS     r1,#2
00000c  6081              STR      r1,[r0,#8]
;;;532      
;;;533      /* Initialize the I2S_CPOL member */
;;;534      I2S_InitStruct->I2S_CPOL = I2S_CPOL_Low;
00000e  2100              MOVS     r1,#0
000010  8181              STRH     r1,[r0,#0xc]
;;;535    }
000012  4770              BX       lr
;;;536    
                          ENDP


                          AREA ||i.SPI_BiDirectionalLineConfig||, CODE, READONLY, ALIGN=1

                  SPI_BiDirectionalLineConfig PROC
;;;615      */
;;;616    void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction)
000000  f5b14f80          CMP      r1,#0x4000
;;;617    {
;;;618      /* Check the parameters */
;;;619      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;620      assert_param(IS_SPI_DIRECTION(SPI_Direction));
;;;621      if (SPI_Direction == SPI_Direction_Tx)
000004  d104              BNE      |L5.16|
;;;622      {
;;;623        /* Set the Tx only mode */
;;;624        SPIx->CR1 |= SPI_Direction_Tx;
000006  8802              LDRH     r2,[r0,#0]
000008  f4424280          ORR      r2,r2,#0x4000
00000c  8002              STRH     r2,[r0,#0]
00000e  e004              B        |L5.26|
                  |L5.16|
;;;625      }
;;;626      else
;;;627      {
;;;628        /* Set the Rx only mode */
;;;629        SPIx->CR1 &= SPI_Direction_Rx;
000010  8802              LDRH     r2,[r0,#0]
000012  f64b73ff          MOV      r3,#0xbfff
000016  401a              ANDS     r2,r2,r3
000018  8002              STRH     r2,[r0,#0]
                  |L5.26|
;;;630      }
;;;631    }
00001a  4770              BX       lr
;;;632    
                          ENDP


                          AREA ||i.SPI_CalculateCRC||, CODE, READONLY, ALIGN=1

                  SPI_CalculateCRC PROC
;;;913      */
;;;914    void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState)
000000  b121              CBZ      r1,|L6.12|
;;;915    {
;;;916      /* Check the parameters */
;;;917      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;918      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;919      if (NewState != DISABLE)
;;;920      {
;;;921        /* Enable the selected SPI CRC calculation */
;;;922        SPIx->CR1 |= SPI_CR1_CRCEN;
000002  8802              LDRH     r2,[r0,#0]
000004  f4425200          ORR      r2,r2,#0x2000
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L6.22|
                  |L6.12|
;;;923      }
;;;924      else
;;;925      {
;;;926        /* Disable the selected SPI CRC calculation */
;;;927        SPIx->CR1 &= (uint16_t)~((uint16_t)SPI_CR1_CRCEN);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64d73ff          MOV      r3,#0xdfff
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L6.22|
;;;928      }
;;;929    }
000016  4770              BX       lr
;;;930    
                          ENDP


                          AREA ||i.SPI_Cmd||, CODE, READONLY, ALIGN=1

                  SPI_Cmd PROC
;;;543      */
;;;544    void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
000000  b121              CBZ      r1,|L7.12|
;;;545    {
;;;546      /* Check the parameters */
;;;547      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;548      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;549      if (NewState != DISABLE)
;;;550      {
;;;551        /* Enable the selected SPI peripheral */
;;;552        SPIx->CR1 |= SPI_CR1_SPE;
000002  8802              LDRH     r2,[r0,#0]
000004  f0420240          ORR      r2,r2,#0x40
000008  8002              STRH     r2,[r0,#0]
00000a  e004              B        |L7.22|
                  |L7.12|
;;;553      }
;;;554      else
;;;555      {
;;;556        /* Disable the selected SPI peripheral */
;;;557        SPIx->CR1 &= (uint16_t)~((uint16_t)SPI_CR1_SPE);
00000c  8802              LDRH     r2,[r0,#0]
00000e  f64f73bf          MOV      r3,#0xffbf
000012  401a              ANDS     r2,r2,r3
000014  8002              STRH     r2,[r0,#0]
                  |L7.22|
;;;558      }
;;;559    }
000016  4770              BX       lr
;;;560    
                          ENDP


                          AREA ||i.SPI_DataSizeConfig||, CODE, READONLY, ALIGN=1

                  SPI_DataSizeConfig PROC
;;;595      */
;;;596    void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize)
000000  8802              LDRH     r2,[r0,#0]
;;;597    {
;;;598      /* Check the parameters */
;;;599      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;600      assert_param(IS_SPI_DATASIZE(SPI_DataSize));
;;;601      /* Clear DFF bit */
;;;602      SPIx->CR1 &= (uint16_t)~SPI_DataSize_16b;
000002  f24f73ff          MOV      r3,#0xf7ff
000006  401a              ANDS     r2,r2,r3
000008  8002              STRH     r2,[r0,#0]
;;;603      /* Set new DFF bit value */
;;;604      SPIx->CR1 |= SPI_DataSize;
00000a  8802              LDRH     r2,[r0,#0]
00000c  430a              ORRS     r2,r2,r1
00000e  8002              STRH     r2,[r0,#0]
;;;605    }
000010  4770              BX       lr
;;;606    
                          ENDP


                          AREA ||i.SPI_GetCRC||, CODE, READONLY, ALIGN=1

                  SPI_GetCRC PROC
;;;953      */
;;;954    uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC)
000000  4602              MOV      r2,r0
;;;955    {
;;;956      uint16_t crcreg = 0;
000002  2000              MOVS     r0,#0
;;;957      /* Check the parameters */
;;;958      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;959      assert_param(IS_SPI_CRC(SPI_CRC));
;;;960      if (SPI_CRC != SPI_CRC_Rx)
000004  2901              CMP      r1,#1
000006  d001              BEQ      |L9.12|
;;;961      {
;;;962        /* Get the Tx CRC register */
;;;963        crcreg = SPIx->TXCRCR;
000008  8b10              LDRH     r0,[r2,#0x18]
00000a  e000              B        |L9.14|
                  |L9.12|
;;;964      }
;;;965      else
;;;966      {
;;;967        /* Get the Rx CRC register */
;;;968        crcreg = SPIx->RXCRCR;
00000c  8a90              LDRH     r0,[r2,#0x14]
                  |L9.14|
;;;969      }
;;;970      /* Return the selected CRC register */
;;;971      return crcreg;
;;;972    }
00000e  4770              BX       lr
;;;973    
                          ENDP


                          AREA ||i.SPI_GetCRCPolynomial||, CODE, READONLY, ALIGN=1

                  SPI_GetCRCPolynomial PROC
;;;978      */
;;;979    uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx)
000000  4601              MOV      r1,r0
;;;980    {
;;;981      /* Check the parameters */
;;;982      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;983      
;;;984      /* Return the CRC polynomial register */
;;;985      return SPIx->CRCPR;
000002  8a08              LDRH     r0,[r1,#0x10]
;;;986    }
000004  4770              BX       lr
;;;987    
                          ENDP


                          AREA ||i.SPI_I2S_ClearFlag||, CODE, READONLY, ALIGN=1

                  SPI_I2S_ClearFlag PROC
;;;1208     */
;;;1209   void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
000000  43ca              MVNS     r2,r1
;;;1210   {
;;;1211     /* Check the parameters */
;;;1212     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1213     assert_param(IS_SPI_I2S_CLEAR_FLAG(SPI_I2S_FLAG));
;;;1214       
;;;1215     /* Clear the selected SPI CRC Error (CRCERR) flag */
;;;1216     SPIx->SR = (uint16_t)~SPI_I2S_FLAG;
000002  8102              STRH     r2,[r0,#8]
;;;1217   }
000004  4770              BX       lr
;;;1218   
                          ENDP


                          AREA ||i.SPI_I2S_ClearITPendingBit||, CODE, READONLY, ALIGN=1

                  SPI_I2S_ClearITPendingBit PROC
;;;1288     */
;;;1289   void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
000000  b510              PUSH     {r4,lr}
;;;1290   {
;;;1291     uint16_t itpos = 0;
000002  2200              MOVS     r2,#0
;;;1292     /* Check the parameters */
;;;1293     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1294     assert_param(IS_SPI_I2S_CLEAR_IT(SPI_I2S_IT));
;;;1295   
;;;1296     /* Get the SPI_I2S IT index */
;;;1297     itpos = 0x01 << (SPI_I2S_IT & 0x0F);
000004  f001040f          AND      r4,r1,#0xf
000008  2301              MOVS     r3,#1
00000a  40a3              LSLS     r3,r3,r4
00000c  b29a              UXTH     r2,r3
;;;1298   
;;;1299     /* Clear the selected SPI CRC Error (CRCERR) interrupt pending bit */
;;;1300     SPIx->SR = (uint16_t)~itpos;
00000e  43d3              MVNS     r3,r2
000010  8103              STRH     r3,[r0,#8]
;;;1301   }
000012  bd10              POP      {r4,pc}
;;;1302   
                          ENDP


                          AREA ||i.SPI_I2S_DMACmd||, CODE, READONLY, ALIGN=1

                  SPI_I2S_DMACmd PROC
;;;1015     */
;;;1016   void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState)
000000  b11a              CBZ      r2,|L13.10|
;;;1017   {
;;;1018     /* Check the parameters */
;;;1019     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1020     assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;1021     assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));
;;;1022   
;;;1023     if (NewState != DISABLE)
;;;1024     {
;;;1025       /* Enable the selected SPI DMA requests */
;;;1026       SPIx->CR2 |= SPI_I2S_DMAReq;
000002  8883              LDRH     r3,[r0,#4]
000004  430b              ORRS     r3,r3,r1
000006  8083              STRH     r3,[r0,#4]
000008  e002              B        |L13.16|
                  |L13.10|
;;;1027     }
;;;1028     else
;;;1029     {
;;;1030       /* Disable the selected SPI DMA requests */
;;;1031       SPIx->CR2 &= (uint16_t)~SPI_I2S_DMAReq;
00000a  8883              LDRH     r3,[r0,#4]
00000c  438b              BICS     r3,r3,r1
00000e  8083              STRH     r3,[r0,#4]
                  |L13.16|
;;;1032     }
;;;1033   }
000010  4770              BX       lr
;;;1034   
                          ENDP


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

                  SPI_I2S_DeInit PROC
;;;223      */
;;;224    void SPI_I2S_DeInit(SPI_TypeDef* SPIx)
000000  b510              PUSH     {r4,lr}
;;;225    {
000002  4604              MOV      r4,r0
;;;226      /* Check the parameters */
;;;227      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;228    
;;;229      if (SPIx == SPI1)
000004  4824              LDR      r0,|L14.152|
000006  4284              CMP      r4,r0
000008  d108              BNE      |L14.28|
;;;230      {
;;;231        /* Enable SPI1 reset state */
;;;232        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, ENABLE);
00000a  2101              MOVS     r1,#1
00000c  1480              ASRS     r0,r0,#18
00000e  f7fffffe          BL       RCC_APB2PeriphResetCmd
;;;233        /* Release SPI1 from reset state */
;;;234        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, DISABLE);
000012  2100              MOVS     r1,#0
000014  14a0              ASRS     r0,r4,#18
000016  f7fffffe          BL       RCC_APB2PeriphResetCmd
00001a  e03c              B        |L14.150|
                  |L14.28|
;;;235      }
;;;236      else if (SPIx == SPI2)
00001c  481f              LDR      r0,|L14.156|
00001e  4284              CMP      r4,r0
000020  d108              BNE      |L14.52|
;;;237      {
;;;238        /* Enable SPI2 reset state */
;;;239        RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, ENABLE);
000022  2101              MOVS     r1,#1
000024  1400              ASRS     r0,r0,#16
000026  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;240        /* Release SPI2 from reset state */
;;;241        RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, DISABLE);
00002a  2100              MOVS     r1,#0
00002c  1420              ASRS     r0,r4,#16
00002e  f7fffffe          BL       RCC_APB1PeriphResetCmd
000032  e030              B        |L14.150|
                  |L14.52|
;;;242      }
;;;243      else if (SPIx == SPI3)
000034  481a              LDR      r0,|L14.160|
000036  4284              CMP      r4,r0
000038  d108              BNE      |L14.76|
;;;244      {
;;;245        /* Enable SPI3 reset state */
;;;246        RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI3, ENABLE);
00003a  2101              MOVS     r1,#1
00003c  13c0              ASRS     r0,r0,#15
00003e  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;247        /* Release SPI3 from reset state */
;;;248        RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI3, DISABLE);
000042  2100              MOVS     r1,#0
000044  13e0              ASRS     r0,r4,#15
000046  f7fffffe          BL       RCC_APB1PeriphResetCmd
00004a  e024              B        |L14.150|
                  |L14.76|
;;;249      }
;;;250      else if (SPIx == SPI4)
00004c  4815              LDR      r0,|L14.164|
00004e  4284              CMP      r4,r0
000050  d108              BNE      |L14.100|
;;;251      {
;;;252        /* Enable SPI4 reset state */
;;;253        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI4, ENABLE);
000052  2101              MOVS     r1,#1
000054  1440              ASRS     r0,r0,#17
000056  f7fffffe          BL       RCC_APB2PeriphResetCmd
;;;254        /* Release SPI4 from reset state */
;;;255        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI4, DISABLE);
00005a  2100              MOVS     r1,#0
00005c  1460              ASRS     r0,r4,#17
00005e  f7fffffe          BL       RCC_APB2PeriphResetCmd
000062  e018              B        |L14.150|
                  |L14.100|
;;;256      }
;;;257      else if (SPIx == SPI5)
000064  4810              LDR      r0,|L14.168|
000066  4284              CMP      r4,r0
000068  d109              BNE      |L14.126|
;;;258      {
;;;259        /* Enable SPI5 reset state */
;;;260        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI5, ENABLE);
00006a  2101              MOVS     r1,#1
00006c  0508              LSLS     r0,r1,#20
00006e  f7fffffe          BL       RCC_APB2PeriphResetCmd
;;;261        /* Release SPI5 from reset state */
;;;262        RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI5, DISABLE);
000072  2100              MOVS     r1,#0
000074  f44f1080          MOV      r0,#0x100000
000078  f7fffffe          BL       RCC_APB2PeriphResetCmd
00007c  e00b              B        |L14.150|
                  |L14.126|
;;;263      }
;;;264      else 
;;;265      {
;;;266        if (SPIx == SPI6)
00007e  480b              LDR      r0,|L14.172|
000080  4284              CMP      r4,r0
000082  d108              BNE      |L14.150|
;;;267        {
;;;268          /* Enable SPI6 reset state */
;;;269          RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI6, ENABLE);
000084  2101              MOVS     r1,#1
000086  0548              LSLS     r0,r1,#21
000088  f7fffffe          BL       RCC_APB2PeriphResetCmd
;;;270          /* Release SPI6 from reset state */
;;;271          RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI6, DISABLE);
00008c  2100              MOVS     r1,#0
00008e  f44f1000          MOV      r0,#0x200000
000092  f7fffffe          BL       RCC_APB2PeriphResetCmd
                  |L14.150|
;;;272        }
;;;273      }
;;;274    }
000096  bd10              POP      {r4,pc}
;;;275    
                          ENDP

                  |L14.152|
                          DCD      0x40013000
                  |L14.156|
                          DCD      0x40003800
                  |L14.160|
                          DCD      0x40003c00
                  |L14.164|
                          DCD      0x40013400
                  |L14.168|
                          DCD      0x40015000
                  |L14.172|
                          DCD      0x40015400

                          AREA ||i.SPI_I2S_GetFlagStatus||, CODE, READONLY, ALIGN=1

                  SPI_I2S_GetFlagStatus PROC
;;;1167     */
;;;1168   FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
000000  4602              MOV      r2,r0
;;;1169   {
;;;1170     FlagStatus bitstatus = RESET;
000002  2000              MOVS     r0,#0
;;;1171     /* Check the parameters */
;;;1172     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1173     assert_param(IS_SPI_I2S_GET_FLAG(SPI_I2S_FLAG));
;;;1174     
;;;1175     /* Check the status of the specified SPI flag */
;;;1176     if ((SPIx->SR & SPI_I2S_FLAG) != (uint16_t)RESET)
000004  8913              LDRH     r3,[r2,#8]
000006  400b              ANDS     r3,r3,r1
000008  b10b              CBZ      r3,|L15.14|
;;;1177     {
;;;1178       /* SPI_I2S_FLAG is set */
;;;1179       bitstatus = SET;
00000a  2001              MOVS     r0,#1
00000c  e000              B        |L15.16|
                  |L15.14|
;;;1180     }
;;;1181     else
;;;1182     {
;;;1183       /* SPI_I2S_FLAG is reset */
;;;1184       bitstatus = RESET;
00000e  2000              MOVS     r0,#0
                  |L15.16|
;;;1185     }
;;;1186     /* Return the SPI_I2S_FLAG status */
;;;1187     return  bitstatus;
;;;1188   }
000010  4770              BX       lr
;;;1189   
                          ENDP


                          AREA ||i.SPI_I2S_GetITStatus||, CODE, READONLY, ALIGN=1

                  SPI_I2S_GetITStatus PROC
;;;1233     */
;;;1234   ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
000000  b5f0              PUSH     {r4-r7,lr}
;;;1235   {
000002  4602              MOV      r2,r0
;;;1236     ITStatus bitstatus = RESET;
000004  2000              MOVS     r0,#0
;;;1237     uint16_t itpos = 0, itmask = 0, enablestatus = 0;
000006  2400              MOVS     r4,#0
000008  2300              MOVS     r3,#0
00000a  2500              MOVS     r5,#0
;;;1238   
;;;1239     /* Check the parameters */
;;;1240     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1241     assert_param(IS_SPI_I2S_GET_IT(SPI_I2S_IT));
;;;1242   
;;;1243     /* Get the SPI_I2S_IT index */
;;;1244     itpos = 0x01 << (SPI_I2S_IT & 0x0F);
00000c  f001070f          AND      r7,r1,#0xf
000010  2601              MOVS     r6,#1
000012  40be              LSLS     r6,r6,r7
000014  b2b4              UXTH     r4,r6
;;;1245   
;;;1246     /* Get the SPI_I2S_IT IT mask */
;;;1247     itmask = SPI_I2S_IT >> 4;
000016  110b              ASRS     r3,r1,#4
;;;1248   
;;;1249     /* Set the IT mask */
;;;1250     itmask = 0x01 << itmask;
000018  2601              MOVS     r6,#1
00001a  409e              LSLS     r6,r6,r3
00001c  b2b3              UXTH     r3,r6
;;;1251   
;;;1252     /* Get the SPI_I2S_IT enable bit status */
;;;1253     enablestatus = (SPIx->CR2 & itmask) ;
00001e  8896              LDRH     r6,[r2,#4]
000020  ea060503          AND      r5,r6,r3
;;;1254   
;;;1255     /* Check the status of the specified SPI interrupt */
;;;1256     if (((SPIx->SR & itpos) != (uint16_t)RESET) && enablestatus)
000024  8916              LDRH     r6,[r2,#8]
000026  4026              ANDS     r6,r6,r4
000028  b116              CBZ      r6,|L16.48|
00002a  b10d              CBZ      r5,|L16.48|
;;;1257     {
;;;1258       /* SPI_I2S_IT is set */
;;;1259       bitstatus = SET;
00002c  2001              MOVS     r0,#1
00002e  e000              B        |L16.50|
                  |L16.48|
;;;1260     }
;;;1261     else
;;;1262     {
;;;1263       /* SPI_I2S_IT is reset */
;;;1264       bitstatus = RESET;
000030  2000              MOVS     r0,#0
                  |L16.50|
;;;1265     }
;;;1266     /* Return the SPI_I2S_IT status */
;;;1267     return bitstatus;
;;;1268   }
000032  bdf0              POP      {r4-r7,pc}
;;;1269   
                          ENDP


                          AREA ||i.SPI_I2S_ITConfig||, CODE, READONLY, ALIGN=1

                  SPI_I2S_ITConfig PROC
;;;1123     */
;;;1124   void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState)
000000  b530              PUSH     {r4,r5,lr}
;;;1125   {
;;;1126     uint16_t itpos = 0, itmask = 0 ;
000002  2400              MOVS     r4,#0
000004  2300              MOVS     r3,#0
;;;1127     
;;;1128     /* Check the parameters */
;;;1129     assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;1130     assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;1131     assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT));
;;;1132   
;;;1133     /* Get the SPI IT index */
;;;1134     itpos = SPI_I2S_IT >> 4;
000006  110c              ASRS     r4,r1,#4
;;;1135   
;;;1136     /* Set the IT mask */
;;;1137     itmask = (uint16_t)1 << (uint16_t)itpos;
000008  2501              MOVS     r5,#1
00000a  40a5              LSLS     r5,r5,r4
00000c  b2ab              UXTH     r3,r5
;;;1138   
;;;1139     if (NewState != DISABLE)
00000e  b11a              CBZ      r2,|L17.24|
;;;1140     {
;;;1141       /* Enable the selected SPI interrupt */
;;;1142       SPIx->CR2 |= itmask;
000010  8885              LDRH     r5,[r0,#4]
000012  431d              ORRS     r5,r5,r3
000014  8085              STRH     r5,[r0,#4]
000016  e002              B        |L17.30|
                  |L17.24|
;;;1143     }
;;;1144     else
;;;1145     {
;;;1146       /* Disable the selected SPI interrupt */
;;;1147       SPIx->CR2 &= (uint16_t)~itmask;
000018  8885              LDRH     r5,[r0,#4]
00001a  439d              BICS     r5,r5,r3
00001c  8085              STRH     r5,[r0,#4]
                  |L17.30|
;;;1148     }
;;;1149   }
00001e  bd30              POP      {r4,r5,pc}
;;;1150   
                          ENDP


                          AREA ||i.SPI_I2S_ReceiveData||, CODE, READONLY, ALIGN=1

                  SPI_I2S_ReceiveData PROC
;;;807      */
;;;808    uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
000000  4601              MOV      r1,r0
;;;809    {
;;;810      /* Check the parameters */
;;;811      assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;812      
;;;813      /* Return the data in the DR register */
;;;814      return SPIx->DR;
000002  8988              LDRH     r0,[r1,#0xc]
;;;815    }
000004  4770              BX       lr
;;;816    
                          ENDP


                          AREA ||i.SPI_I2S_SendData||, CODE, READONLY, ALIGN=1

                  SPI_I2S_SendData PROC
;;;823      */
;;;824    void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data)
000000  8181              STRH     r1,[r0,#0xc]
;;;825    {
;;;826      /* Check the parameters */
;;;827      assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
;;;828      
;;;829      /* Write in the DR register the data to be sent */
;;;830      SPIx->DR = Data;
;;;831    }
000002  4770              BX       lr
;;;832    
                          ENDP


                          AREA ||i.SPI_Init||, CODE, READONLY, ALIGN=1

                  SPI_Init PROC
;;;283      */
;;;284    void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct)
000000  b510              PUSH     {r4,lr}
;;;285    {
;;;286      uint16_t tmpreg = 0;
000002  2200              MOVS     r2,#0
;;;287      
;;;288      /* check the parameters */
;;;289      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;290      
;;;291      /* Check the SPI parameters */
;;;292      assert_param(IS_SPI_DIRECTION_MODE(SPI_InitStruct->SPI_Direction));
;;;293      assert_param(IS_SPI_MODE(SPI_InitStruct->SPI_Mode));
;;;294      assert_param(IS_SPI_DATASIZE(SPI_InitStruct->SPI_DataSize));
;;;295      assert_param(IS_SPI_CPOL(SPI_InitStruct->SPI_CPOL));
;;;296      assert_param(IS_SPI_CPHA(SPI_InitStruct->SPI_CPHA));
;;;297      assert_param(IS_SPI_NSS(SPI_InitStruct->SPI_NSS));
;;;298      assert_param(IS_SPI_BAUDRATE_PRESCALER(SPI_InitStruct->SPI_BaudRatePrescaler));
;;;299      assert_param(IS_SPI_FIRST_BIT(SPI_InitStruct->SPI_FirstBit));
;;;300      assert_param(IS_SPI_CRC_POLYNOMIAL(SPI_InitStruct->SPI_CRCPolynomial));
;;;301    
;;;302    /*---------------------------- SPIx CR1 Configuration ------------------------*/
;;;303      /* Get the SPIx CR1 value */
;;;304      tmpreg = SPIx->CR1;
000004  8802              LDRH     r2,[r0,#0]
;;;305      /* Clear BIDIMode, BIDIOE, RxONLY, SSM, SSI, LSBFirst, BR, MSTR, CPOL and CPHA bits */
;;;306      tmpreg &= CR1_CLEAR_MASK;
000006  f4025241          AND      r2,r2,#0x3040
;;;307      /* Configure SPIx: direction, NSS management, first transmitted bit, BaudRate prescaler
;;;308         master/salve mode, CPOL and CPHA */
;;;309      /* Set BIDImode, BIDIOE and RxONLY bits according to SPI_Direction value */
;;;310      /* Set SSM, SSI and MSTR bits according to SPI_Mode and SPI_NSS values */
;;;311      /* Set LSBFirst bit according to SPI_FirstBit value */
;;;312      /* Set BR bits according to SPI_BaudRatePrescaler value */
;;;313      /* Set CPOL bit according to SPI_CPOL value */
;;;314      /* Set CPHA bit according to SPI_CPHA value */
;;;315      tmpreg |= (uint16_t)((uint32_t)SPI_InitStruct->SPI_Direction | SPI_InitStruct->SPI_Mode |
00000a  880b              LDRH     r3,[r1,#0]
00000c  884c              LDRH     r4,[r1,#2]
00000e  4323              ORRS     r3,r3,r4
000010  888c              LDRH     r4,[r1,#4]
000012  4323              ORRS     r3,r3,r4
000014  88cc              LDRH     r4,[r1,#6]
000016  4323              ORRS     r3,r3,r4
000018  890c              LDRH     r4,[r1,#8]
00001a  4323              ORRS     r3,r3,r4
00001c  894c              LDRH     r4,[r1,#0xa]
00001e  4323              ORRS     r3,r3,r4
000020  898c              LDRH     r4,[r1,#0xc]
000022  4323              ORRS     r3,r3,r4
000024  89cc              LDRH     r4,[r1,#0xe]
000026  4323              ORRS     r3,r3,r4
000028  431a              ORRS     r2,r2,r3
;;;316                      SPI_InitStruct->SPI_DataSize | SPI_InitStruct->SPI_CPOL |  
;;;317                      SPI_InitStruct->SPI_CPHA | SPI_InitStruct->SPI_NSS |  
;;;318                      SPI_InitStruct->SPI_BaudRatePrescaler | SPI_InitStruct->SPI_FirstBit);
;;;319      /* Write to SPIx CR1 */
;;;320      SPIx->CR1 = tmpreg;
00002a  8002              STRH     r2,[r0,#0]
;;;321    
;;;322      /* Activate the SPI mode (Reset I2SMOD bit in I2SCFGR register) */
;;;323      SPIx->I2SCFGR &= (uint16_t)~((uint16_t)SPI_I2SCFGR_I2SMOD);
00002c  8b83              LDRH     r3,[r0,#0x1c]
00002e  f24f74ff          MOV      r4,#0xf7ff
000032  4023              ANDS     r3,r3,r4
000034  8383              STRH     r3,[r0,#0x1c]
;;;324    /*---------------------------- SPIx CRCPOLY Configuration --------------------*/
;;;325      /* Write to SPIx CRCPOLY */
;;;326      SPIx->CRCPR = SPI_InitStruct->SPI_CRCPolynomial;
000036  8a0b              LDRH     r3,[r1,#0x10]
000038  8203              STRH     r3,[r0,#0x10]
;;;327    }
00003a  bd10              POP      {r4,pc}
;;;328    
                          ENDP


                          AREA ||i.SPI_NSSInternalSoftwareConfig||, CODE, READONLY, ALIGN=1

                  SPI_NSSInternalSoftwareConfig PROC
;;;641      */
;;;642    void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSInternalSoft)
000000  f64f62ff          MOV      r2,#0xfeff
;;;643    {
;;;644      /* Check the parameters */
;;;645      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;646      assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft));
;;;647      if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset)
000004  4291              CMP      r1,r2
000006  d004              BEQ      |L21.18|
;;;648      {
;;;649        /* Set NSS pin internally by software */
;;;650        SPIx->CR1 |= SPI_NSSInternalSoft_Set;
000008  8802              LDRH     r2,[r0,#0]
00000a  f4427280          ORR      r2,r2,#0x100
00000e  8002              STRH     r2,[r0,#0]
000010  e004              B        |L21.28|
                  |L21.18|
;;;651      }
;;;652      else
;;;653      {
;;;654        /* Reset NSS pin internally by software */
;;;655        SPIx->CR1 &= SPI_NSSInternalSoft_Reset;
000012  8802              LDRH     r2,[r0,#0]
000014  f64f63ff          MOV      r3,#0xfeff
000018  401a              ANDS     r2,r2,r3
00001a  8002              STRH     r2,[r0,#0]
                  |L21.28|
;;;656      }
;;;657    }
00001c  4770              BX       lr
;;;658    
                          ENDP


                          AREA ||i.SPI_SSOutputCmd||, CODE, READONLY, ALIGN=1

                  SPI_SSOutputCmd PROC
;;;665      */
;;;666    void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
000000  b121              CBZ      r1,|L22.12|
;;;667    {
;;;668      /* Check the parameters */
;;;669      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;670      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;671      if (NewState != DISABLE)
;;;672      {
;;;673        /* Enable the selected SPI SS output */
;;;674        SPIx->CR2 |= (uint16_t)SPI_CR2_SSOE;
000002  8882              LDRH     r2,[r0,#4]
000004  f0420204          ORR      r2,r2,#4
000008  8082              STRH     r2,[r0,#4]
00000a  e004              B        |L22.22|
                  |L22.12|
;;;675      }
;;;676      else
;;;677      {
;;;678        /* Disable the selected SPI SS output */
;;;679        SPIx->CR2 &= (uint16_t)~((uint16_t)SPI_CR2_SSOE);
00000c  8882              LDRH     r2,[r0,#4]
00000e  f64f73fb          MOV      r3,#0xfffb
000012  401a              ANDS     r2,r2,r3
000014  8082              STRH     r2,[r0,#4]
                  |L22.22|
;;;680      }
;;;681    }
000016  4770              BX       lr
;;;682    
                          ENDP


                          AREA ||i.SPI_StructInit||, CODE, READONLY, ALIGN=1

                  SPI_StructInit PROC
;;;486      */
;;;487    void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct)
000000  2100              MOVS     r1,#0
;;;488    {
;;;489    /*--------------- Reset SPI init structure parameters values -----------------*/
;;;490      /* Initialize the SPI_Direction member */
;;;491      SPI_InitStruct->SPI_Direction = SPI_Direction_2Lines_FullDuplex;
000002  8001              STRH     r1,[r0,#0]
;;;492      /* initialize the SPI_Mode member */
;;;493      SPI_InitStruct->SPI_Mode = SPI_Mode_Slave;
000004  8041              STRH     r1,[r0,#2]
;;;494      /* initialize the SPI_DataSize member */
;;;495      SPI_InitStruct->SPI_DataSize = SPI_DataSize_8b;
000006  8081              STRH     r1,[r0,#4]
;;;496      /* Initialize the SPI_CPOL member */
;;;497      SPI_InitStruct->SPI_CPOL = SPI_CPOL_Low;
000008  80c1              STRH     r1,[r0,#6]
;;;498      /* Initialize the SPI_CPHA member */
;;;499      SPI_InitStruct->SPI_CPHA = SPI_CPHA_1Edge;
00000a  8101              STRH     r1,[r0,#8]
;;;500      /* Initialize the SPI_NSS member */
;;;501      SPI_InitStruct->SPI_NSS = SPI_NSS_Hard;
00000c  8141              STRH     r1,[r0,#0xa]
;;;502      /* Initialize the SPI_BaudRatePrescaler member */
;;;503      SPI_InitStruct->SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
00000e  8181              STRH     r1,[r0,#0xc]
;;;504      /* Initialize the SPI_FirstBit member */
;;;505      SPI_InitStruct->SPI_FirstBit = SPI_FirstBit_MSB;
000010  81c1              STRH     r1,[r0,#0xe]
;;;506      /* Initialize the SPI_CRCPolynomial member */
;;;507      SPI_InitStruct->SPI_CRCPolynomial = 7;
000012  2107              MOVS     r1,#7
000014  8201              STRH     r1,[r0,#0x10]
;;;508    }
000016  4770              BX       lr
;;;509    
                          ENDP


                          AREA ||i.SPI_TIModeCmd||, CODE, READONLY, ALIGN=1

                  SPI_TIModeCmd PROC
;;;696      */
;;;697    void SPI_TIModeCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
000000  b121              CBZ      r1,|L24.12|
;;;698    {
;;;699      /* Check the parameters */
;;;700      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;701      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;702    
;;;703      if (NewState != DISABLE)
;;;704      {
;;;705        /* Enable the TI mode for the selected SPI peripheral */
;;;706        SPIx->CR2 |= SPI_CR2_FRF;
000002  8882              LDRH     r2,[r0,#4]
000004  f0420210          ORR      r2,r2,#0x10
000008  8082              STRH     r2,[r0,#4]
00000a  e004              B        |L24.22|
                  |L24.12|
;;;707      }
;;;708      else
;;;709      {
;;;710        /* Disable the TI mode for the selected SPI peripheral */
;;;711        SPIx->CR2 &= (uint16_t)~SPI_CR2_FRF;
00000c  8882              LDRH     r2,[r0,#4]
00000e  f64f73ef          MOV      r3,#0xffef
000012  401a              ANDS     r2,r2,r3
000014  8082              STRH     r2,[r0,#4]
                  |L24.22|
;;;712      }
;;;713    }
000016  4770              BX       lr
;;;714    
                          ENDP


                          AREA ||i.SPI_TransmitCRC||, CODE, READONLY, ALIGN=1

                  SPI_TransmitCRC PROC
;;;935      */
;;;936    void SPI_TransmitCRC(SPI_TypeDef* SPIx)
000000  8801              LDRH     r1,[r0,#0]
;;;937    {
;;;938      /* Check the parameters */
;;;939      assert_param(IS_SPI_ALL_PERIPH(SPIx));
;;;940      
;;;941      /* Enable the selected SPI CRC transmission */
;;;942      SPIx->CR1 |= SPI_CR1_CRCNEXT;
000002  f4415180          ORR      r1,r1,#0x1000
000006  8001              STRH     r1,[r0,#0]
;;;943    }
000008  4770              BX       lr
;;;944    
                          ENDP


;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\Platform\\MCU\\STM32F4xx\\peripherals\\Libraries\\STM32F4xx_StdPeriph_Driver\\src\\stm32f4xx_spi.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___15_stm32f4xx_spi_c_2b928927____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___15_stm32f4xx_spi_c_2b928927____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___15_stm32f4xx_spi_c_2b928927____REVSH|
#line 128
|__asm___15_stm32f4xx_spi_c_2b928927____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
