├── .mxproject ├── LICENSE ├── README.md ├── bluepill_neoemu_clk.hex ├── bluepill_neoemu_clk.ioc ├── ledmatrix.yaml ├── ledstrip.yaml ├── main.c ├── stripsim.py ├── usbd_cdc_if.c └── usbd_cdc_if.h /.mxproject: -------------------------------------------------------------------------------- 1 | [PreviousLibFiles] 2 | LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usb.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pcd_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usb.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_exti.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_spi.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; 3 | 4 | [PreviousUsedKeilFiles] 5 | SourceFiles=..\Core\Src\main.c;..\USB_DEVICE\App\usb_device.c;..\USB_DEVICE\Target\usbd_conf.c;..\USB_DEVICE\App\usbd_desc.c;..\USB_DEVICE\App\usbd_cdc_if.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;..\Core\Src/system_stm32f1xx.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;..\Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;..\Core\Src/system_stm32f1xx.c;..\Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;..\Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c; 6 | HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Middlewares\ST\STM32_USB_Device_Library\Core\Inc;..\Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\USB_DEVICE\App;..\USB_DEVICE\Target;..\Core\Inc; 7 | CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER; 8 | 9 | [PreviousGenFiles] 10 | AdvancedFolderStructure=true 11 | HeaderFileListSize=7 12 | HeaderFiles#0=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usb_device.h 13 | HeaderFiles#1=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/Target/usbd_conf.h 14 | HeaderFiles#2=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usbd_desc.h 15 | HeaderFiles#3=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usbd_cdc_if.h 16 | HeaderFiles#4=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Inc/stm32f1xx_it.h 17 | HeaderFiles#5=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Inc/stm32f1xx_hal_conf.h 18 | HeaderFiles#6=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Inc/main.h 19 | HeaderFolderListSize=3 20 | HeaderPath#0=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App 21 | HeaderPath#1=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/Target 22 | HeaderPath#2=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Inc 23 | HeaderFiles=; 24 | SourceFileListSize=7 25 | SourceFiles#0=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usb_device.c 26 | SourceFiles#1=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/Target/usbd_conf.c 27 | SourceFiles#2=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usbd_desc.c 28 | SourceFiles#3=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App/usbd_cdc_if.c 29 | SourceFiles#4=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Src/stm32f1xx_it.c 30 | SourceFiles#5=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Src/stm32f1xx_hal_msp.c 31 | SourceFiles#6=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Src/main.c 32 | SourceFolderListSize=3 33 | SourcePath#0=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/App 34 | SourcePath#1=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/USB_DEVICE/Target 35 | SourcePath#2=C:/Users/joe user/Documents/STM_bluepill/bluepill_neoemu_clk/Core/Src 36 | SourceFiles=; 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NeoPill 2 | a Blue Pill Neopixel Emulator, firmware for STM32F103C8T6. 3 | 4 | To build with STM32CubeMX (6.1.1), open bluepill_neoemu_clk.ioc, generate code in a selected folder. 5 | Locate and copy over the 3 files main.c, usbd_cdc_if.c, usbd_cdc_if.h . 6 | Build with selected environment (originally used Keil uVision 5.26.) 7 | Flash into a Blue Pill. 8 | Follow instructions at https://hackaday.io/project/179916-neopill 9 | 10 | Or use STM32CubeProgrammer v2.6.0 to flash the Hex file. 11 | 12 | 13 | Python code for the PC side is 'stripsym.py', and two YAML config files ledstrip.yaml, ledmatrix.yaml. 14 | 15 | Command Line: 16 | python stripsim.py ledstrip.yaml 17 | or 18 | python stripsim.py ledmatrix.yaml 19 | -------------------------------------------------------------------------------- /bluepill_neoemu_clk.hex: -------------------------------------------------------------------------------- 1 | :020000040800F2 2 | :100000008031002001010008432F0008FF2B000869 3 | :10001000412F00084F070008574E0008000000005D 4 | :100020000000000000000000000000007134000823 5 | :100030003F08000800000000413200087334000847 6 | :100040001B0100081B0100081B0100081B01000820 7 | :100050001B0100081B0100081B0100081B01000810 8 | :100060001B0100081B0100081B0100081B01000800 9 | :100070001B0100081B010008090800081B010008FB 10 | :100080001B0100081B0100081B0100081B010008E0 11 | :10009000E14D00081B0100081B0100081B010008BE 12 | :1000A0001B0100081B0100081B0100081B010008C0 13 | :1000B000F1340008FD340008093500081B01000870 14 | :1000C0001B0100081B0100081B0100081B010008A0 15 | :1000D0001B0100081B0100081B0100081B01000890 16 | :1000E0001B0100081B0100081B010008DFF80CD0F1 17 | :1000F00000F040F900480047A94E00088031002078 18 | :100100000648804706480047FEE7FEE7FEE7FEE7B1 19 | :10011000FEE7FEE7FEE7FEE7FEE7FEE7ED34000858 20 | :10012000ED00000840EA01039B0703D009E008C97D 21 | :10013000121F08C0042AFAD203E011F8013B00F8AC 22 | :10014000013B521EF9D27047D2B201E000F8012BF8 23 | :10015000491EFBD270470022F6E710B513460A4647 24 | :1001600004461946FFF7F0FF204610BD0FB400B556 25 | :100170008DB010A909900B9000914FF0FF300A90BC 26 | :1001800000200C9005480690054807906A4609A88B 27 | :100190000F9900F0C1F80DB05DF814FB35030008AD 28 | :1001A000530300082DE9FF5F1D464FF0FF3BD5E9E3 29 | :1001B000014691465F464FF00008A9697F1C0198EF 30 | :1001C0008847296A824688470028F6D1BAF1FF3F5E 31 | :1001D0000CD024F4C064002E19DD600614D5BAF1E9 32 | :1001E0002B0F09D0BAF12D0F0ED103E0584604B001 33 | :1001F000BDE8F09F44F48064A9697F1C019888479A 34 | :10020000761E8246002E02DDBAF1300F03D0B9F11E 35 | :10021000000F26D032E0A969761E44F400747F1CDA 36 | :10022000019888478246002E05DDBAF1780F06D086 37 | :10023000BAF1580F03D0B9F1000F10D01EE0B9F198 38 | :10024000000F02D0B9F1100F18D1A969761E24F45D 39 | :1002500000747F1C019888478246102002E0082025 40 | :1002600000E00A20814609E008FB0908A969761E1A 41 | :1002700044F400747F1C019888478246002E05DDF7 42 | :100280004946504600F034F80028EDDAE969019853 43 | :100290008847A00502D46FF00100A8E7E00725D148 44 | :1002A000600613D5600502D5C8F1000000E04046A5 45 | :1002B00029680A1D2A600968220501D5087015E021 46 | :1002C000220701D5088011E008600FE02868011DB1 47 | :1002D00029600068210502D580F8008006E021072A 48 | :1002E00002D5A0F8008001E0C0F8008038467EE723 49 | :1002F0003A2800D2303820F02002412A01D3A2F15E 50 | :100300003700884201D34FF0FF3070470268114434 51 | :100310001378016018467047D1600449516104495F 52 | :10032000116200211161114600F03CB80D03000874 53 | :1003300099030008426842B1016811F8013B23B1FA 54 | :10034000521EC0E90012184670470121C160881E84 55 | :10035000704742685AB1C368016843B983688B42E9 56 | :1003600005D0491E521CC0E90012002070474FF012 57 | :10037000FF307047064C074D06E0E06840F001038F 58 | :1003800094E8070098471034AC42F6D3FFF7B2FE6A 59 | :1003900088510008A8510008C0B24FF4F05100F095 60 | :1003A00097B900002DE9F34F8BB04FF0000801F131 61 | :1003B0000C000C464FF0010B46460DF1080A019067 62 | :1003C0006269012101989047051E2DD0252D2CD062 63 | :1003D000216A8847C0B16269012101989047216A6A 64 | :1003E00088470028F7D1411E62690198904700E0D4 65 | :1003F000761CA1690B988847216A88470028F7D1A5 66 | :10040000E1690B988847DBE7A1690B9888470746A5 67 | :10041000A84201D1761CD3E7E1690B9888477F1C7D 68 | :1004200002D1B8F1000F6FD046E1002762693D4666 69 | :100430003946019890472A2804D162690121019820 70 | :1004400090470125DFF88492626901210198904765 71 | :10045000A0F130010A290AD24F45E5DC07EB8701FC 72 | :1004600000EB4107303FDFD445F01005ECE7E9062B 73 | :1004700001D46FF000476C280AD04C2814D06828AB 74 | :1004800015D06A280DD074281CD07A281AD01DE007 75 | :1004900062690121019890476C2802D045F004055B 76 | :1004A00014E045F002050DE045F020050AE0626920 77 | :1004B000012101989047682802D045F0080505E021 78 | :1004C00045F400656269012101989047C4E901572C 79 | :1004D00065283DD019DC58287AD00CDC452837D067 80 | :1004E00004DC252826D0412831D131E046282FD000 81 | :1004F00047282CD12CE05B2877D0612828D06328AE 82 | :100500007CD0642823D15AE0D0E06F2848D008DCA2 83 | :1005100066281DD067281BD0692821D06E2816D1E7 84 | :1005200027E0702845D0732868D0752847D07828F0 85 | :100530000DD14DE0A1690B988847054625283FF469 86 | :1005400069AFE1690B9888476D1C3FF46AAFB3E06F 87 | :1005500023466A466FF001000B99AFF300809EE0DE 88 | :1005600045F040006060A80723464FF0000236D4F3 89 | :100570003EE0E8077FF447AF2068011D2160006876 90 | :10058000290501D506701BE7290701D5068017E765 91 | :10059000A90703D5F117C0E9006111E706600FE76D 92 | :1005A00045F040006060A80723464FF0080216D4CB 93 | :1005B0001EE040F60E0125EA0100606016E045F0FD 94 | :1005C00040006060A80723464FF00A0207D40FE0FE 95 | :1005D00045F040006060A80708D5234610226FF060 96 | :1005E00001000B99AFF3008059E007E02346102289 97 | :1005F0006FF001000B99FFF7D5FD50E04FF00009B7 98 | :100600004F464B46632802D05B2806D040E0E80600 99 | :1006100001D40120A06001273AE06269012101981C 100 | :1006200090475E2805D14FF001096269494601985B 101 | :100630009047216939B900210A46534643F82120E1 102 | :10064000491C0829FADBB0B3216969B9C11700EB6D 103 | :10065000D16253110AEB830122F01F02821A01209A 104 | :100660000B68904003430B60626901210198904739 105 | :100670005D28E8D1B9F1000F09D00020514651F8AA 106 | :100680002020D24341F82020401C0828F7DB02AB91 107 | :10069000224600976FF001000B99AFF3008000280D 108 | :1006A0000CDA401C08D1BBF1000F05D04FF0FF3031 109 | :1006B0000DB0BDE8F08FFFE74046F9E7E90701D14B 110 | :1006C00008F1010806444FF0000B79E6CCCCCC0CC5 111 | :1006D0007F2801D9002208E0064A02EB5002C00739 112 | :1006E000127800D1120902F00F0201209040084058 113 | :1006F000704700004851000870B58C1810F8015B75 114 | :1007000015F0070301D110F8013B2A1106D110F8AA 115 | :10071000012B03E010F8016B01F8016B5B1EF9D1AE 116 | :100720002B0705D40023521E0DD401F8013BFAE734 117 | :1007300010F8013BCB1A921C03E013F8015B01F89F 118 | :10074000015B521EF9D5A142D8D3002070BDFEE74F 119 | :1007500000207047002070478121014803F0D3BB7F 120 | :100760003023002010B500220449054803F01AF98F 121 | :100770000449034803F010F9002010BD9400002044 122 | :1007800030230020F427002070B50D4604460146B2 123 | :100790000F4803F001F90E4803F0E2F82968A1B10F 124 | :1007A0002078532804D0462807D054280AD00CE0DB 125 | :1007B00008490878401C087007E007480178491C80 126 | :1007C000017002E0204604F08FFC002070BD0000A4 127 | :1007D000302300200000002001000020094A10B54D 128 | :1007E000D2F8B822D2F814220AB1012010BD0A466C 129 | :1007F0000146044803F0D6F8BDE81040014803F074 130 | :100800002FB9000030230020014800F049B8000053 131 | :100810001402002030B590F840500124AC40C56B64 132 | :100820006C60046863604368102B036803D09960B0 133 | :100830000068C26030BD9A600068C16030BD70471A 134 | :1008400072B6FEE710B528B301680A6822F001020B 135 | :100850000A600268002111600268516002689160BC 136 | :100860000268D1600C4B026801241A441423B2FBC5 137 | :10087000F3F29300094AC0E90F239C40546081625F 138 | :10088000C16201634163816380F8211080F8201008 139 | :10089000002010BD012010BDF8FFFDBF0000024088 140 | :1008A0002DE9F05FC16B0C6801680B68D0F840C09F 141 | :1008B000042202FA0CF2494DDFF824A1494E4A4FB6 142 | :1008C000DFF828B1DFF828E122422CD05A072AD5D8 143 | :1008D0000A68920603D40A6822F004020A600168DA 144 | :1008E000A94201D1042219E0514501D1402215E06D 145 | :1008F000B14202D14FF4806210E0B94202D14FF40C 146 | :1009000080420BE0594502D14FF4802206E0714548 147 | :1009100002D14FF4800201E04FF080622F49083984 148 | :100920004A60C16A3BE04FF0020808FA0CF818EA86 149 | :10093000040F4FF000094FF0010235D05FEA8378D1 150 | :1009400032D50B689B0605D40B6823F00A030B60B5 151 | :1009500080F821200168A94201D1022219E0514505 152 | :1009600001D1202215E0B14202D14FF4007210E013 153 | :10097000B94202D14FF400520BE0594502D14FF475 154 | :10098000003206E0714502D14FF4001201E04FF051 155 | :100990000072124908394A6080F82090816A002963 156 | :1009A0001AD0BDE8F05F0847082505FA0CF5254286 157 | :1009B00012D01B0710D50B6823F00E030B6090F8C4 158 | :1009C0004010C36B02FA01F15960826380F8212064 159 | :1009D00080F82090016BE2E7BDE8F09F080002403C 160 | :1009E0001C00024030000240440002405800024017 161 | :1009F0006C00024030B528B308C8134914221944CA 162 | :100A0000B1FBF2F18900C163104981630221417792 163 | :100A10001A6843F6F0718A43D0E900142143D0E903 164 | :100A200002452C43214304692143446921438469DD 165 | :100A3000214311431960002141630122427701776C 166 | :100A4000084630BD012030BDF8FFFDBF0000024068 167 | :100A500070B5044690F82000002501280CD0012034 168 | :100A600084F8200094F821600020012E06D084F83C 169 | :100A700020000225284670BD022070BD022684F8A1 170 | :100A80002160A0632068066826F001060660204603 171 | :100A9000FFF7C0FEE06A00282068016802D041F03C 172 | :100AA0000E0106E021F0040101602068016841F0B8 173 | :100AB0000A0101602068016841F001010160D9E785 174 | :100AC0002DE9F0430023374F0F2566E001229A40BD 175 | :100AD0000A4060D023F00304E619D6F808809C078A 176 | :100AE0004FEA147C05FA0CF909EA0804DFF8B8802B 177 | :100AF000404502D14FF0000816E0DFF8B0804045D5 178 | :100B000002D14FF001080FE0DFF8A480404502D188 179 | :100B10004FF0020808E0DFF89C80404502D14FF01A 180 | :100B2000030801E04FF0040808FA0CF8A04515D1BD 181 | :100B3000D6F808C02CEA090CC6F808C01E4E346866 182 | :100B400094433460341D266896432660241D26682D 183 | :100B500096432660241D266896432660FF2A01D806 184 | :100B6000064601E000F104064FEA830401D9A4F12E 185 | :100B70002004D6F800C005FA04F82CEA080C4FF05F 186 | :100B8000040808FA04F84CEA080CC6F800C0C46867 187 | :100B900024EA0204C46003F1010331FA03F295D19F 188 | :100BA000BDE8F0830000014000080140000C014056 189 | :100BB0000010014000140140000401402DE9F84FED 190 | :100BC000DFF8B891002409F1040A0AF1040B234666 191 | :100BD0000F270BF1040EC9E00125A5402A40AA42C7 192 | :100BE0007DD1674ED1F804C0ACEB0608B44532D0D5 193 | :100BF00014DCBCF1030F3AD009DCBCF1000F2AD0A1 194 | :100C0000BCF1010F1CD0BCF1020F31D11DE0BCF1D1 195 | :100C1000110F17D0BCF1120F2AD119E0B8F5881FB7 196 | :100C200019D006DCB8F5803F15D0B8F5801F1FD16C 197 | :100C300011E0B8F5001F0ED0B8F5041F18D10AE076 198 | :100C4000CB6815E0CB681B1D12E0CB6808330FE0C2 199 | :100C5000CB680C330CE08B682BB1012B4FF00803F1 200 | :100C600003D0456104E0042302E0056100E00023B5 201 | :100C7000FF2A01D8064601E000F104064FEA840588 202 | :100C800001D9A5F12005D6F8008007FA05FC28EA6D 203 | :100C90000C0803FA05F548EA0508C6F800804D6817 204 | :100CA000ED0062D5374DAE6946F00106AE61AD6923 205 | :100CB00024F0030605F001050095334D06EB050C05 206 | :100CC000DCF80850A607360F07FA06F825EA0805EB 207 | :100CD000DFF8B880404503D14FF0000817E044E04A 208 | :100CE000DFF8AC80404502D14FF001080FE0DFF89B 209 | :100CF000A480404502D14FF0020808E0DFF8988058 210 | :100D0000404502D14FF0030801E04FF0040808FA13 211 | :100D100006F848EA0508CCF808804D68D9F8006064 212 | :100D2000ED034D4601D5164300E096432E604D6815 213 | :100D3000DAF80060AD03554601D5164300E096434E 214 | :100D40002E604D68DBF80060ED025D4601D516436C 215 | :100D500000E096432E604D68DEF80060AD027546F7 216 | :100D600001D5164300E096432E60641C0D682A46A8 217 | :100D7000E5407FF431AFBDE8F88F0000000401408A 218 | :100D80000000111000100240000001400008014066 219 | :100D9000000C01400010014000140140C26821EA2B 220 | :100DA00002030A4043EA0241016170470AB101614E 221 | :100DB00070470904FBE700000148806870470000A5 222 | :100DC00098000020024881680278114481607047D1 223 | :100DD00098000020074810B5016841F0100101603B 224 | :100DE000032000F075F8002000F006F800F024F869 225 | :100DF000002010BD0020024070B50D4D04464FF498 226 | :100E00007A712878B1FBF0F00A490968B1FBF0F07B 227 | :100E100001F0A0F948B9102C07D200222146501E3B 228 | :100E200000F036F800206C6070BD012070BD00003D 229 | :100E300098000020A40000200C4808B5816941F00A 230 | :100E400001018161816901F001010091C16941F0F5 231 | :100E50008051C161C06900F0805000900448416831 232 | :100E600021F0E06141F00071416008BD00100240D6 233 | :100E700000000140002809DB00F01F020121914021 234 | :100E80004009800000F1E020C0F800117047000028 235 | :100E9000F0B40E4B1B680C46C3F30223C3F10705E5 236 | :100EA000042D00D90425191D072901D2002300E0D3 237 | :100EB000DB1E012606FA05F1491E214099409E409D 238 | :100EC000761E16403143F0BC03F0C6BF0CED00E0C7 239 | :100ED000064900F0070208684FF6FF03184040EA91 240 | :100EE0000220034A10430860704700000CED00E048 241 | :100EF0000000FA0510B50C0607D501F0070101EB5B 242 | :100F0000810100EBC100283005E001EB810100EB1D 243 | :100F1000C10000F5B47099B232B1012202730181AF 244 | :100F2000190C4181002010BD00220273C180F9E735 245 | :100F3000704701EB810200EBC202D0F8E802D26BED 246 | :100F400002F03DBF01EB810200EBC202D0F8E802E3 247 | :100F5000D2F87C2102F096BF70B504460B0601F072 248 | :100F6000070000EB800104EBC1014FF001024FF0DC 249 | :100F7000000503D581F82920283103E081F8695163 250 | :100F800001F5B471087094F8A802012808D084F81B 251 | :100F9000A822206803F0BEFB84F8A852002070BD90 252 | :100FA000022070BD70B5044601F00F0062689042E7 253 | :100FB00001D9012070BD0B0601F0070000EB800194 254 | :100FC00004EBC1014FF001024FF0000503D581F899 255 | :100FD0002920283103E081F8695101F5B4718D7041 256 | :100FE000087094F8A802012808D084F8A822206884 257 | :100FF00003F02DFC84F8A852002070BD022070BDC3 258 | :101000002DE9F05F04685FEA424C0B788D69B4F813 259 | :1010100050C04FF000064BF68F7948F2800A48F630 260 | :101020008F7B48F2C00E4FF480672AD54FF002083C 261 | :1010300008EBC308C44407EB4C07E45BC4F30904A2 262 | :10104000A54203D32D1B8D6101D00BE08E61066894 263 | :1010500036F8235005EA090585F4005545EA0A05E6 264 | :1010600026F82350520609D50D78036833F8252059 265 | :1010700002EA0B0242EA0E0223F8252084B30A8911 266 | :1010800029E04FF0060808EBC308C44407EB4C07FF 267 | :10109000E45BC4F30904A54203D32D1B8D6101D089 268 | :1010A0000BE08E61066836F8235005EA090585F4E1 269 | :1010B000005545EA0A0526F82350520609D40B7854 270 | :1010C000056835F8232002EA0B0242EA0E0225F8F1 271 | :1010D00023202CB14A8949690068234603F08AFE1F 272 | :1010E0002046BDE8F09F2DE9F05F05460C460068FC 273 | :1010F0005FEA426C16462278A369B0F850C04FF000 274 | :10110000000148F68F774CF280094FF6FF7B4FF4D1 275 | :10111000004E4FF4806A6CD54FF0020808EBC2080D 276 | :10112000E0440AEB480C30F80C00C0F3090083429D 277 | :1011300011D91B1AA3610FD0730407D52E6836F896 278 | :1011400022303B4043EA090326F8223094F8242059 279 | :10115000012A08D0C6E0A16111462846FFF7E9FE42 280 | :1011600070046CD4BEE0626902446261E2690244C8 281 | :10117000E2612369226A9A4202D31846111A03E0F7 282 | :1011800084F824100AB110462162617811B1012956 283 | :1011900023D02BE02968B1F850201144227801EBCC 284 | :1011A000021101F2044148B13E280FD84208C3079A 285 | :1011B00000D0521C0BEA82220A8017E00A8822F42F 286 | :1011C000F8420A800A8842F40042F5E74209C30661 287 | :1011D00000D1521E4EEA8222EEE72968B1F8502073 288 | :1011E0001144227801EB0211A1F8040483B2228990 289 | :1011F00074E04FF0060808EBC208E0440AEB480C24 290 | :1012000030F80C00C0F30900834211D31B1AA3610C 291 | :101210000FD0730407D42E6836F822303B4043EADF 292 | :10122000090326F8223094F82420012A11D059E02D 293 | :10123000A16111462846FFF77CFE700452D4227843 294 | :10124000296831F82200384040EA090021F82200DC 295 | :1012500048E0626902446261E2690244E261236932 296 | :10126000226A9A4203D31846111A216204E00AB195 297 | :101270001046216284F824106278296812B1012A8C 298 | :1012800022D029E0B1F850201144227801EB02115C 299 | :1012900001F20C4148B13E280FD84208C30700D0E4 300 | :1012A000521C0BEA82220A8016E00A8822F4F842D5 301 | :1012B0000A800A8842F40042F5E74209C30600D1D9 302 | :1012C000521E4EEA8222EEE7B1F8502011442278F5 303 | :1012D00001EB0211A1F80C04628983B261692868EC 304 | :1012E00003F0A6FD2278296831F8220048F6BF7382 305 | :1012F000184080F0300048F28003184321F82200A3 306 | :101300000020BDE8F09F10B5044690F8A80201281F 307 | :101310000AD0012084F8A802080607D501F00701C9 308 | :10132000206803F05BFD04E0022010BD206803F09C 309 | :1013300053FD002084F8A80210BD01F0070101EB65 310 | :10134000810100EBC100D0F8840170472DE9F04124 311 | :1013500004460F0601F0070000EB800104EBC10119 312 | :101360004FF001064FF0000503D581F829602831C0 313 | :1013700003E081F8695101F5B47108700A61CB701E 314 | :101380004A7802B1C881022B00D10D7194F8A802ED 315 | :10139000012809D084F8A862206803F08DF8284657 316 | :1013A00084F8A852BDE8F0810220FBE770B50C4636 317 | :1013B00001F0070505EB850100EBC101C1E95F23E1 318 | :1013C0000022C1F8842181F8692181F8685101F572 319 | :1013D000B4716207006803F08FFA002070BD70B529 320 | :1013E00004460D4601F007006168884201D90120DA 321 | :1013F00070BD29064FF000064FF0010207D500EB43 322 | :10140000800104EBC10181F82920283107E005EBB8 323 | :10141000850104EBC10181F8696101F5B4718A703D 324 | :10142000087094F8A802012807D084F8A822206840 325 | :1014300003F049FA680702D006E0022070BD04F507 326 | :101440002C71206803F001FA84F8A862002070BDB6 327 | :1014500070B50C4601F0070505EB850100EBC101F5 328 | :10146000C1E90F23012281F84C208B6400234B64D7 329 | :1014700081F8292001F8285F6207006803F03CFA30 330 | :10148000002070BD1FB50446006803F0AFFC0004E7 331 | :1014900002D5204601F056FD206803F0A7FC400568 332 | :1014A0000CD5206830F8441F21F48061018020466B 333 | :1014B00000F01EF90021204600F035F9206803F005 334 | :1014C00095FC400405D5206830F8441F21F4804184 335 | :1014D0000180206803F08AFC800405D5206830F87C 336 | :1014E000441F21F400510180206803F07FFCC004F8 337 | :1014F00014D5206830F8401F21F0040101802068D5 338 | :1015000030F8401F21F008010180204600F003F967 339 | :10151000206830F8441F21F480510180206803F0D6 340 | :1015200065FC00053ED522680020694632F820306F 341 | :1015300021F81030401CC0B20828F7D332F8400F11 342 | :1015400040F001001080206830F8402F22F00102A6 343 | :1015500002802068B0F844205205FBD530F8442FB3 344 | :1015600022F4806202800020236831F8102023F8E2 345 | :101570002020401CC0B20828F6D3206830F8401F55 346 | :1015800041F008010180206830F8441F21F4006117 347 | :101590000180206830F8401F41F00401018020469E 348 | :1015A00000F0F6F8206803F021FC800508D52068DB 349 | :1015B00030F8441F21F400710180204600F0AFF89C 350 | :1015C000206803F013FCC00505D5206830F8441FDF 351 | :1015D00021F4807101801FBD2DE9F04186B0040027 352 | :1015E00004D094F8A902002520B108E0012006B03B 353 | :1015F000BDE8F08184F8A852204600F05BF8032093 354 | :1016000084F8A902206803F019F904F110011422EA 355 | :1016100088466846FEF786FD94E80F0003F078F8E8 356 | :101620000226D0BB0021206803F0FAFB002001272E 357 | :101630000FE000BF00EB800104EBC10181F82970CD 358 | :1016400001F8280FC881CD700D614D61401CC0B2FA 359 | :101650008D6161688142EDD8002011E000EB8001CE 360 | :1016600004EBC10181F8695181F8680181F86B517F 361 | :10167000C1F87851C1F87C51401CC0B2C1F880510A 362 | :1016800061688142EAD8142241466846FEF74AFD65 363 | :1016900094E80F0003F0C9F810B184F8A962A5E737 364 | :1016A00084F8245084F8A972206803F0BCF8002064 365 | :1016B0009DE7000008B500680B49884212D10B482D 366 | :1016C000C16941F40001C161C069002200F4000059 367 | :1016D000009011461420FFF7DBFBBDE80840142002 368 | :1016E000FFF7C8BB08BD0000005C004000100240CE 369 | :1016F00070B5044680680125022801D0FFF7A0F8E4 370 | :101700002946D4F8E80202F0AEFCD4F8E802BDE8BD 371 | :10171000704002F06ABCD0F8E80202F08EBCD0F84B 372 | :10172000E80202F094BC10B5044690F8A802012823 373 | :101730000BD0012084F8A80284F82410206803F05C 374 | :1017400071FB002084F8A80210BD022010BDD0F863 375 | :10175000E82200F52C71104602F091BC10B5044649 376 | :1017600090F8A802012810D0012084F8A80220686F 377 | :1017700003F029FB01212046FFF7DAFB206803F084 378 | :1017800050F8002084F8A80210BD022010BD00000F 379 | :1017900010B50446D0F8E80202F0B0FCA0690028B9 380 | :1017A00004D00348016841F00601016010BD00004B 381 | :1017B00010ED00E02DE9F84305460078354CC007F0 382 | :1017C00054D0E0690026C00008D4E06940F08050A1 383 | :1017D000E061E069012600F0805000902E48016829 384 | :1017E000C90512D40168804641F480710160FFF799 385 | :1017F000E3FA074605E000BFFFF7DEFAC01B6428E6 386 | :1018000023D8D8F80000C005F6D5206A10F440703F 387 | :1018100021D0A98801F4407181421CD0206A1F495F 388 | :10182000012220F440700A6000220A602062C00792 389 | :1018300011D0FFF7C1FA074641F2883808E000BF2F 390 | :10184000FFF7BAFAC11B414502D90320BDE8F8836E 391 | :10185000206A8007F4D5206A696820F44070084344 392 | :1018600020621EB1E06920F08050E0612878800796 393 | :1018700005D56068A96820F4404008436060287876 394 | :10188000C00605D56068E96820F480000843606000 395 | :101890000020DBE70010024000700040400442429C 396 | :1018A0002DE9F0470F46050061D0434E306800F047 397 | :1018B0000700B84209D2306820F007003843306092 398 | :1018C000306800F00700B84251D128683B4C8107CE 399 | :1018D00012D5400703D5606840F4E0606060287866 400 | :1018E000000703D5606840F4605060606068A968D4 401 | :1018F00020F0F000084360602878C00728D06868AE 402 | :10190000012810D02168022810D0890700292EDA7A 403 | :10191000616821F0030101436160FFF74DFA8046E1 404 | :1019200041F288390DE021688903EFE78901EDE78D 405 | :10193000FFF742FAA0EB0801494502D90320BDE8B0 406 | :10194000F0876068696800F00C00B0EB810FEFD1A0 407 | :10195000306800F00700B8420BD9306820F007006B 408 | :1019600038433060306800F00700B84201D00120F1 409 | :10197000E5E72878400705D56068E96820F4E0606D 410 | :10198000084360602878000706D56068296920F45C 411 | :10199000605040EAC100606000F018F86168084AD1 412 | :1019A000C1F30311515CC84006490860064800684D 413 | :1019B000FFF722FA0020C2E7002002400010024098 414 | :1019C00038510008A40000209C00002012A185B01E 415 | :1019D0000FC98DE80F0014A0144A006804905168E4 416 | :1019E000134801F00C03042B10D0082B0ED1C1F3C7 417 | :1019F0008343C9031DF803000AD5516804AAC1F343 418 | :101A00004041515C0A4A5043B0FBF1F005B07047C9 419 | :101A100008494843FAE700000203040506070809DD 420 | :101A20000A0B0C0D0E0F10100102000000100240F6 421 | :101A300000127A0000093D002DE9F84F040070D033 422 | :101A40002078C04DC00749D06868C0F381000128E4 423 | :101A500007D06868C0F38100022809D16868C00314 424 | :101A600006D52868800339D560680028E7D035E0BE 425 | :101A70006068B0F5803F0BD010B1B0F5A02F11D049 426 | :101A8000286820F480302860286820F4802002E054 427 | :101A9000286840F480302860606890B1FFF78CF9C6 428 | :101AA00006460AE0286840F480202860F0E700BF7E 429 | :101AB000FFF782F9801B642873D828688003F7D564 430 | :101AC0000CE0FFF779F9064605E000BFFFF774F96F 431 | :101AD000801B6428F0D828688003F7D420789A4EB9 432 | :101AE00080074FF001094FF0000839D5686810F001 433 | :101AF0000C0F07D06868C0F38100022809D168681C 434 | :101B0000C00306D42868800714D52069012808D1AD 435 | :101B100010E02069B0B1C6F80090FFF74DF9074614 436 | :101B200005E00AE1FFF748F9C01B0228C4D828687D 437 | :101B30008007F7D52868616920F0F80040EAC10005 438 | :101B400028600DE0C6F80080FFF736F9074604E08C 439 | :101B5000FFF732F9C01B022823D828688007F7D482 440 | :101B6000207800072CD57948A169D9B1C0F8009038 441 | :101B7000FFF722F9074604E0FFF71EF9C01B022811 442 | :101B80000FD8686A8007F7D571484FF4FA5100689A 443 | :101B9000B0FBF1F0009000BF0098411E0091FAD216 444 | :101BA0000EE080E0C0F80080FFF706F9074604E089 445 | :101BB000FFF702F9C01B022875D8686A8007F7D4BE 446 | :101BC0002078400760D5E8690027C00008D4E8699C 447 | :101BD00040F08050E861E869012700F080500090F3 448 | :101BE0005C480168C90513D40168834641F48071DB 449 | :101BF0000160FFF7E1F8824606E000BFFFF7DCF87E 450 | :101C0000A0EB0A0064284ED8DBF80000C005F5D52B 451 | :101C1000E06801280AD008B1052813D0286A20F00E 452 | :101C200001002862286A20F0040002E0286A40F0DF 453 | :101C300001002862E06841F2883B98B1FFF7BCF8E8 454 | :101C400082460BE0286A40F004002862EEE700BFFD 455 | :101C5000FFF7B2F8A0EB0A0159455AD8286A800765 456 | :101C6000F6D50CE0FFF7A8F8824605E0FFF7A4F8E8 457 | :101C7000A0EB0A0159454CD8286A8007F6D41FB159 458 | :101C8000E86920F08050E861E06988B36968C1F3D1 459 | :101C90008101022944D00228C6F8608004D0FFF7F1 460 | :101CA0008BF8044638E034E0FFF786F8074604E096 461 | :101CB000FFF782F8C01B02282BD828688001F7D4D0 462 | :101CC000206AB0F5803F05D16868A16820F4003033 463 | :101CD00008436860D4E908010843696821F4741175 464 | :101CE00008436860C6F86090FFF766F8044606E0AF 465 | :101CF00025E000BFFFF760F8001B022809D828681C 466 | :101D00008001F7D51BE000BFFFF756F8001B022843 467 | :101D100002D90320BDE8F88F28688001F4D40EE0D2 468 | :101D20000128F7D06868226A00F48031914204D11A 469 | :101D3000616A00F47010884201D00120EAE70020B7 470 | :101D4000E8E70000001002400000424280044242E6 471 | :101D5000A40000200070004010B5040011D0022043 472 | :101D600084F851002068016821F04001016020469C 473 | :101D700000F076F80020606584F8510084F8500087 474 | :101D800010BD012010BD000070B5054600F00AF836 475 | :101D9000034C6061284600F007F8A06170BD0000A8 476 | :101DA00000000020406D704790F85100704770B5FA 477 | :101DB000040009D0606A002540B125616561A56213 478 | :101DC00094F8510040B10CE0012070BD6068B0F59E 479 | :101DD000827FF4D0E561F2E784F85050204600F0AD 480 | :101DE0005BF8022084F851002068016821F040016E 481 | :101DF0000160A088218900F4827001F40441084345 482 | :101E0000A18901F400610843217C01F0020108432B 483 | :101E1000217D01F001010843218B01F40071084389 484 | :101E2000217F01F03801084394F8201001F080016F 485 | :101E30000843218D01F40051084321680860A0691E 486 | :101E4000042101EA1040216848602068C16921F43A 487 | :101E50000061C1616565012084F85100002070BDFA 488 | :101E600010B504460068094988420ED10848C16986 489 | :101E700021F48041C1614FF420410648FEF720FE65 490 | :101E8000E06CBDE81040FEF7DDBC10BD003800403E 491 | :101E900000100240000C014070B586B000250646D7 492 | :101EA00000950195029503950068194988422CD147 493 | :101EB0001849C86940F48040C861C86900F480408E 494 | :101EC0000490886940F0080088618869694600F0DC 495 | :101ED000080004904FF4204000900F48FEF76EFE7B 496 | :101EE0000F4C0E48C4E900058020C4E902502020B0 497 | :101EF0002561C4E90550C001E0612046FEF77AFD86 498 | :101F000008B1FEF79DFCF464666206B070BD000087 499 | :101F10000038004000100240000C01404400024024 500 | :101F2000140200202DE9F0410446002680680423B5 501 | :101F300018B96568B5F5827F0ED094F85050012D20 502 | :101F400013D0012784F8507094F851C00025BCF1DB 503 | :101F5000010F0DD0022654E084F851302046BDE830 504 | :101F6000F04113460A4600F061B80220BDE8F08156 505 | :101F700071B16AB184F851306565A163A287E287C7 506 | :101F800025646564A586E586B0F5004F02D00BE0B8 507 | :101F9000012636E02068016821F0400101602068D8 508 | :101FA000016821F480410160E16C1848C862E16C6D 509 | :101FB00017488862E16C17480863E06C4563E38F5B 510 | :101FC0002168A26B0C31E06CFEF742FD38B1606D08 511 | :101FD00040F010006065012684F8517011E020681F 512 | :101FE0000168490603D4016841F04001016020689E 513 | :101FF000416841F0200141602068416841F00101E1 514 | :10200000416084F850503046B0E700006532000867 515 | :1020100079320008433200080248816801F5005116 516 | :102020008160704700000020704700002DE9F041FA 517 | :10203000044690F85000002601280DD0012784F8AE 518 | :10204000507094F851000025D4F804C001280FD036 519 | :10205000BCF5827F0AD102E00220BDE8F081D4F80D 520 | :1020600008C0BCF1000F01D1042801D0022660E0B5 521 | :1020700049B342B33BB394F85100042802D0052081 522 | :1020800084F8510065652163A386E386A263A38774 523 | :10209000E3872564656494F85100042815D0E16C49 524 | :1020A0002648C8622648E16C8862E16C25480863CE 525 | :1020B000E06C4563E38F2168A26B0C31E06CFEF7A6 526 | :1020C000C7FCE0B906E0012633E0E16C1E48C862B7 527 | :1020D0001E48E8E72068416841F001014160A06CBA 528 | :1020E000C562A06C8562A06C0563A06C4563E38E3D 529 | :1020F0002268216B0C32A06CFEF7AAFC38B1606D2F 530 | :1021000040F010006065012684F8517011E02068ED 531 | :102110000168490603D4016841F04001016020686C 532 | :10212000416841F0200141602068416841F00201AE 533 | :10213000416084F8505030468FE700006F3200084D 534 | :10214000E3320008433200086532000879320008A3 535 | :102150007047704710B5401EB0F1807F01D3012059 536 | :1021600010BD4FF0E02460610F21601702F074FE93 537 | :102170000020A06107202061002010BD704770473B 538 | :1021800070B590F83C20012A26D0012480F83C400C 539 | :10219000022280F83D2003685A689D6822F070068C 540 | :1021A0000A6832435A600D4B02689A4208D0B2F175 541 | :1021B000804F05D00A4B9A4202D00A4B9A4204D172 542 | :1021C000496825F080031943916080F83D40002163 543 | :1021D00080F83C10084670BD022070BD002C014004 544 | :1021E000000400400008004010B5040003D094F83B 545 | :1021F0003D0010B107E0012010BD002084F83C0034 546 | :10220000204600F01FF8022084F83D00211D2068C0 547 | :1022100001F080F9012084F8460084F83E0084F83B 548 | :102220003F0084F8400084F8410084F8420084F8BC 549 | :10223000430084F8440084F8450084F83D00002001 550 | :1022400010BD000000B585B0002100910191029100 551 | :10225000039101682B48B1F1804F15D02A4A914271 552 | :102260002FD1C16941F00201C161C069002200F0B3 553 | :102270000200049011461D20FEF70AFE5FF01D00CB 554 | :10228000FEF7F8FD05B000BDC16941F00101C16173 555 | :10229000C16901F001010491816941F0040181618A 556 | :1022A0008069694600F004000490012000901748FE 557 | :1022B000FEF784FC002211461C20FEF7E9FD1C20DD 558 | :1022C000DEE7134A9142DDD1C16941F00401C161E9 559 | :1022D000C16901F004010491816941F00801816143 560 | :1022E0008069694600F00800049080200090094849 561 | :1022F000FEF764FC002211461E20FEF7C9FD1E20D9 562 | :10230000BEE7000000100240000400400008014049 563 | :1023100000080040000C0140704710B50446022040 564 | :1023200084F83D002068016A41F21112114207D180 565 | :10233000016A9210114203D1016821F0010101608C 566 | :10234000204600F018F8002084F8460084F83E008B 567 | :1023500084F83F0084F8400084F8410084F842008B 568 | :1023600084F8430084F8440084F8450084F83D0074 569 | :1023700084F83C0010BD704710B5044651B10429E3 570 | :102380000DD0082910D094F8410094F84520012878 571 | :1023900011D10EE094F83E0094F84220F7E794F84B 572 | :1023A0003F0094F84320F2E794F8400094F844206A 573 | :1023B000EDE7012A01D0012010BD022051B104290E 574 | :1023C00011D0082918D084F8410084F845000C2960 575 | :1023D0001BD136E084F83E0084F842002068C268D1 576 | :1023E00042F0020210E084F83F0084F843002068C5 577 | :1023F000C26842F0040207E084F8400084F8440018 578 | :102400002068C26842F00802C2600122206801F020 579 | :10241000B7F80E492068884208D0B0F1804F05D047 580 | :102420000B49884202D00B49884204D1816801F0EF 581 | :102430000701062903D0016841F001010160002075 582 | :1024400010BD2068C26842F01002DDE7002C014098 583 | :10245000000400400008004030B5044600680D004C 584 | :1024600006D0042D08D0082D28D00C2D08D129E045 585 | :10247000C16821F0020102E0C16821F00401C160DD 586 | :1024800000222946206801F07BF82068016A41F2A9 587 | :102490001112114207D1016A9210114203D1016851 588 | :1024A00021F001010160012085B1042D11D0082D1A 589 | :1024B00012D004F8410F2071002030BDC16821F016 590 | :1024C0000801DCE7C16821F01001D8E704F83E0FED 591 | :1024D000F1E704F83F0FEEE704F8400FEBE770B5C3 592 | :1024E0000446006801694FF00005C943890715D407 593 | :1024F000C168C943890711D4E91E01610120207711 594 | :10250000206880698007204602D0FFF705FF04E0BD 595 | :1025100000F008F9204600F0F9FA257720680169F3 596 | :10252000C943490717D4C168C943490713D46FF099 597 | :1025300004010161022020772068806910F4407F47 598 | :10254000204602D0FFF7E8FE04E000F0EBF820465A 599 | :1025500000F0DCFA257720680169C943090716D421 600 | :10256000C168C943090712D46FF008010161042052 601 | :1025700020772068C0698007204602D0FFF7CCFE94 602 | :1025800004E000F0CFF8204600F0C0FA257720687C 603 | :102590000169C943C90617D4C168C943C90613D420 604 | :1025A0006FF010010161082020772068C06910F4E5 605 | :1025B000407F204602D0FFF7AFFE04E000F0B2F803 606 | :1025C000204600F0A3FA257720680169C943C907AE 607 | :1025D00008D1C168C943C90704D1891E01612046D9 608 | :1025E00000F0E0FA20680169C943090609D4C1680E 609 | :1025F000C943090605D46FF0800101612046FFF749 610 | :10260000BDFD20680169C943490609D4C168C943B1 611 | :10261000490605D46FF040010161204600F0EEFA52 612 | :1026200020680169C94389060BD4C168C94389067A 613 | :1026300007D46FF0200101612046BDE87040FFF72C 614 | :102640009EBD70BD30B585B0002100910191029111 615 | :10265000039103681B4A02211B48B3F1804F15D038 616 | :102660001A4D4024AB421BD1936943F0040393619C 617 | :102670009269CDE9004102F0040200BFCDE90312E6 618 | :102680004FEA0D01FEF79AFA05B030BD936943F0A9 619 | :10269000040393619269009102F004020191EDE755 620 | :1026A0000B488342F0D1906940F008009061906936 621 | :1026B000CDE9004100F00800CDE903106946054866 622 | :1026C000E0E7000000100240000801400004004064 623 | :1026D00000080040000C014010B5044690F83C0092 624 | :1026E00001280AD0012084F83C0042B1042A0AD013 625 | :1026F000082A0CD00C2A11D10DE0022010BD206850 626 | :1027000000F056FF0AE0206800F07AFF06E020683B 627 | :1027100000F0A2FF02E0206800F0CAFF002084F869 628 | :102720003C0010BD704710B5040003D094F83D0084 629 | :1027300010B107E0012010BD002084F83C002046C5 630 | :1027400000F01EF8022084F83D00211D206800F0F2 631 | :10275000E1FE012084F8460084F83E0084F83F0042 632 | :1027600084F8400084F8410084F8420084F8430073 633 | :1027700084F8440084F8450084F83D00002010BD32 634 | :10278000704710B50446022084F83D002068016AB5 635 | :1027900041F21112114207D1016A9210114203D184 636 | :1027A000016821F001010160204600F03BF80020A3 637 | :1027B00084F8460084F83E0084F83F0084F8420024 638 | :1027C00084F8430084F83D0084F83C0010BD70B5E7 639 | :1027D0000D46040003D094F83D0010B107E001203D 640 | :1027E00070BD002084F83C00204600F01CF8022058 641 | :1027F00084F83D00211D206800F08CFE20680168EF 642 | :1028000021F00801016054F8460B0168294301607A 643 | :10281000012004F81F09E0752076E0762077A07586 644 | :10282000002070BD7047704710B590F83E300446E8 645 | :1028300090F83F2090F8421090F84300012B05D10A 646 | :10284000012A03D1012901D1012801D0012010BDA5 647 | :10285000022084F83E0084F83F0084F8420084F8A7 648 | :10286000430001220021206800F08AFE0122042199 649 | :10287000206800F085FE05492068884203D1416C3C 650 | :1028800041F400414164002010BD0000002C0140D3 651 | :1028900010B590F83E30044690F83F2090F8421072 652 | :1028A00090F84300012B05D1012A03D1012901D160 653 | :1028B000012801D0012010BD022084F83E0084F8D8 654 | :1028C0003F0084F8420084F843002068C16841F06A 655 | :1028D0000201C1602068C16841F00401C1600122A9 656 | :1028E0000021206800F04CFE01220421206800F045 657 | :1028F00047FE05492068884203D1416C41F40041FC 658 | :102900004164002010BD0000002C014010B50446B9 659 | :1029100000220068114600F033FE002204212068E6 660 | :1029200000F02EFE114B41F2111120688A109842DE 661 | :1029300009D1036A0B4206D1036A134203D1436CE7 662 | :1029400023F4004343642068036A0B4206D1016A02 663 | :10295000114203D1016821F001010160012004F856 664 | :102960003E0F607020716071002010BD002C01408E 665 | :1029700010B504460068C16821F00201C1602068FA 666 | :10298000C16821F00401C16000221146206800F0F6 667 | :10299000F7FD00220421206800F0F2FD114B41F206 668 | :1029A000111120688A10984209D1036A0B4206D19E 669 | :1029B000036A134203D1436C23F400434364206849 670 | :1029C000036A0B4206D1016A114203D1016821F06A 671 | :1029D00001010160012004F83E0F607020716071F8 672 | :1029E000002010BD002C014070B5044690F83C005A 673 | :1029F0000D4601280AD0012084F83C0042B1042A87 674 | :102A000018D0082A2AD00C2A4DD139E0022070BDF6 675 | :102A1000206800F0CDFD2068816941F008018161E6 676 | :102A20002068816921F004018161206881692A6937 677 | :102A3000114311E0206800F0E3FD2068816941F452 678 | :102A4000006181612068816921F480618161206871 679 | :102A500081692A6941EA0221816124E0206800F04D 680 | :102A6000FBFD2068C16941F00801C1612068C169AE 681 | :102A700021F00401C1612068C1692A69114311E094 682 | :102A8000206800F015FE2068C16941F40061C16151 683 | :102A90002068C16921F48061C1612068C1692A6927 684 | :102AA00041EA0221C161002084F83C0070BD10B5EC 685 | :102AB000040003D094F83D0010B107E0012010BDE0 686 | :102AC000002084F83C00204600F01EF8022084F824 687 | :102AD0003D00211D206800F01DFD012084F8460006 688 | :102AE00084F83E0084F83F0084F8400084F84100F8 689 | :102AF00084F8420084F8430084F8440084F84500D8 690 | :102B000084F83D00002010BD70470000234B24498D 691 | :102B1000A3F14802834210D1007F01280CD1C8697B 692 | :102B2000401CC8611068416941F0010141611068B1 693 | :102B3000016841F00101016070478242FCD1007FD1 694 | :102B40000228F9D11868426A4B6A1A444A624269FB 695 | :102B500042F001024261114848300068426942F087 696 | :102B600001024261C868401CC860886808610B485F 697 | :102B70008C38006840680004000C04D00A69C0F575 698 | :102B80000050104408610A69086B00F50050824249 699 | :102B9000D2D3086A401C086270470000A0020020DF 700 | :102BA00000000020704770B5044690F83C000128F2 701 | :102BB00012D0012584F83C50022084F83D002046C4 702 | :102BC00000F098FD01004FF0000007D084F83D5060 703 | :102BD00084F83C00012070BD022070BD2168CA68E5 704 | :102BE00022F04002CA602168CA6822F48042CA60AA 705 | :102BF00084F83D5084F83C00002070BD7047FEE72B 706 | :102C0000F0B500230A24302537261F4611E000BF07 707 | :102C1000B4EB107F02D905EB107C01E006EB107CD1 708 | :102C200001F813C001EB430C00015B1C8CF8017030 709 | :102C3000DBB29342ECD3F0BD70B586B000241C48E3 710 | :102C40000094019402940394816941F01001816120 711 | :102C5000816901F010010491816941F020018161D5 712 | :102C6000816901F020010491816941F004018161D1 713 | :102C7000816901F004010491816941F008018161D9 714 | :102C800080690C4E00F008004FF4005504900022BB 715 | :102C900029463046FEF78AF801200095CDE9010467 716 | :102CA0000220039069463046FDF788FF06B070BDEC 717 | :102CB00000100240001001400E4810B50C490160A0 718 | :102CC00000214FF48062C0E901120122C160C0E915 719 | :102CD00004125202C0E906210162416281620A21A6 720 | :102CE000C162FFF764F8002801D072B6FEE710BD9C 721 | :102CF00000380040BC01002010B58EB0142107A898 722 | :102D0000FDF729FA00240C941C2168460D94FDF768 723 | :102D100022FA23484FF08041C0E9001440F6426196 724 | :102D2000C0E9024104618461FFF75EFA08B172B63E 725 | :102D3000FEE71B48FFF7BBFE08B172B6FEE70821AD 726 | :102D40001748FFF744FD08B172B6FEE7062007906A 727 | :102D50005020CDE9080407A911480B94FFF723FF81 728 | :102D600008B172B6FEE70C940CA90D480D94FFF75C 729 | :102D700007FA08B172B6FEE77020009040F61260C4 730 | :102D8000CDE901040422694605480494FFF72CFEAE 731 | :102D900008B172B6FEE70248FFF754FC0EB010BD52 732 | :102DA0005802002030B58FB0142107A8FDF7D3F9E1 733 | :102DB00000240C941C2168460D94FDF7CCF91E48A4 734 | :102DC0001C490725C0E90014C0E90245046184617B 735 | :102DD000FFF70AFA08B172B6FEE71748FFF7A3FC3F 736 | :102DE00008B172B6FEE73020CDE9075007A91248B6 737 | :102DF000FFF7D9FE08B172B6FEE70C940CA90E4895 738 | :102E00000D94FFF7BDF908B172B6FEE710200090EF 739 | :102E10000120CDE901040022694607480494FFF728 740 | :102E20005BFC08B172B6FEE70348FFF70BFC0FB07E 741 | :102E300030BD000000040040A002002010B58EB09C 742 | :102E4000142107A8FDF787F900240C941C2168467B 743 | :102E50000D94FDF780F924482249C0E9001425218A 744 | :102E6000C0E9024104618461FFF7BEF908B172B69E 745 | :102E7000FEE71D48FFF71BFE08B172B6FEE708210A 746 | :102E80001948FFF7A4FC08B172B6FEE706200790C8 747 | :102E90006020CDE9080407A913480B94FFF783FECF 748 | :102EA00008B172B6FEE73020CDE90C040CA90E483B 749 | :102EB000FFF766F908B172B6FEE7702000900120B6 750 | :102EC000CDE9010404200490002269460648FFF77A 751 | :102ED0008BFD08B172B6FEE70348FFF7B3FB0EB0F7 752 | :102EE00010BD000000080040E802002010B50022DC 753 | :102EF0000F49104800F03CFF08B1FDF7A1FC0E4956 754 | :102F00000C4801F021F908B1FDF79AFC0B4909487A 755 | :102F100000F03AFD08B1FDF793FC064801F06AF9AC 756 | :102F2000002803D0BDE81040FDF78ABC10BD0000AA 757 | :102F30003400002030230020840100208400002081 758 | :102F4000FEE7FEE72DE9F84F044640F68F7B48F692 759 | :102F50000F7A4FF002094FF4806868E1B0F844102E 760 | :102F600011F00F0638D030F8267039047ED530F8CD 761 | :102F7000261001EA0B0141F0800120F8261006EB33 762 | :102F8000860004EBC00595F8740105F5B4750028BA 763 | :102F90006DD0E87802286BD02A78216831F82200B9 764 | :102FA00048F68F73184048F2C003184321F82200F6 765 | :102FB0002978206830F82120B0F8503052047DD5AF 766 | :102FC00009EBC1015A1808EB4201415A8905890DE4 767 | :102FD000009174D02A89D2E0C9062DD4018801EA73 768 | :102FE0000A0141F400410180206804F12805B0F88D 769 | :102FF00050302A7809EBC2015A1808EB4201405AB6 770 | :10300000C0F309006064E16B0844E06300212046DE 771 | :10301000FDF78FFF94F8240000289ED0A8690028AF 772 | :103020009BD194F8240040F080012068A0F84C1057 773 | :10303000002084F82400FAE0018804F5B4750A053C 774 | :1030400021D5B0F850302A78062101EBC2015A1878 775 | :1030500008EB4201405A04F52C71C0F30903EB61FF 776 | :10306000EA88206801F0C6FE216802E0A2E062E082 777 | :1030700072E0088800EA0B0040F0800008802046DB 778 | :10308000FEF765FBD3E00904D5D5018801EA0B0101 779 | :1030900041F0800101802068B0F850202B78062193 780 | :1030A00001EBC3010A4408EB4201405A83059B0D22 781 | :1030B000EB6110D0696971B1EA8801E053E051E039 782 | :1030C000206801F097FEE969686908446861002199 783 | :1030D0002046FDF737FF2068B0F8501008442969F2 784 | :1030E00000F20C4051B13E2910D84A08C90700D05F 785 | :1030F000521C4FF6FF7101EA82210FE0018821F492 786 | :10310000F8410180018841F4004107E04A09C906FD 787 | :1031100000D1521E4FF4004141EA82210180206813 788 | :1031200001884BF68F72114081F4405148F28002C1 789 | :10313000114301807BE02068B0F850102A78062304 790 | :1031400003EBC2020A4408EB4201415A8905890D8A 791 | :10315000009118D0EA8812E03A4629462046FDF749 792 | :103160004FFF00900FE0062202EBC1015A1808EB56 793 | :103170004201415A8905890D009104D06A89696923 794 | :10318000009B01F037FEE96900980844E86169692D 795 | :10319000009808446861A86918B1296900988142BB 796 | :1031A00004D929782046FDF7CDFE03E029462068A2 797 | :1031B00001F0A2FB38063AD5226806EB860004EB44 798 | :1031C000C00132F8260000EA0A0040F4004022F86C 799 | :1031D000260091F82B002831022801D1F80522D4CD 800 | :1031E0002268B2F850300D7809EBC500034408EBB3 801 | :1031F0004300105A8A69C0F3090082420CD9121A9E 802 | :103200008A610BD04A6902444A61CA691044C861A4 803 | :10321000206801F071FB0AE000208861E9B22046D5 804 | :10322000FDF787FE03E03A462046FDF75CFF206885 805 | :10323000B0F8441009043FF591AE0020BDE8F88FC6 806 | :10324000704710B5406A01684A6822F003024A607C 807 | :10325000416D41F010014165012180F85110FEF7E8 808 | :1032600093FD10BD10B5406AFEF7DEFE10BD10B52F 809 | :10327000406AFEF76EFF10BD70B50546446AFDF763 810 | :103280009BFD024628680068800626D420684168B5 811 | :1032900021F020014160A06818B96068B0F5827F14 812 | :1032A00016D02068416821F0010141606421204668 813 | :1032B00000F044F808B1202060650020E08701207C 814 | :1032C00084F85100606D40B12046FEF75DFD70BD91 815 | :1032D0002068416821F00301E7E72046FEF79CFEE5 816 | :1032E00070BD70B50546446AFDF766FD0246286864 817 | :1032F000006880061ED42068416821F020014160EA 818 | :103300006421204600F048F818B1606D40F02000BC 819 | :1033100060652068416821F0030141600020E0867B 820 | :10332000E087012084F85100606D18B12046FEF757 821 | :103330002BFD70BD2046FEF70BFF70BDF8B50446AF 822 | :1033400040684FF48273984217D1A0684FF48065AB 823 | :10335000B0F5004F01D0A8420FD12068066826F0D2 824 | :10336000400606606068984207D1A068A84204D170 825 | :1033700000920B460022012103E000920B4600223E 826 | :103380008021204600F018F8002804D0606D40F03D 827 | :10339000200060650320F8BD38B50B460092044656 828 | :1033A0000022802100F008F8002804D0606D40F071 829 | :1033B00020006065032038BD2DE9F8431E46914684 830 | :1033C00088460446089DFDF7F7FC401B351AFDF7BB 831 | :1033D000F3FC074625480068C0F3CB30684338E06B 832 | :1033E000701C37D0FDF7E8FCC01BA84203D215B112 833 | :1033F000009860B32CE02068416821F0E001416052 834 | :103400006068B0F5827F0BD1A068B0F5004F02D0A4 835 | :10341000B0F5806F04D12068016821F0400101609F 836 | :10342000A06AB0F5005F09D12068016821F400515D 837 | :1034300001602068016841F400510160012084F8B6 838 | :103440005100002084F850000320BDE8F8830025D7 839 | :10345000401E00902068816838EA010004D00021F5 840 | :103460004945BDD10020F0E70121F9E7A400002083 841 | :103470007047FDF7A7BC30B593B028216846FCF72C 842 | :103480006AFE14210AA8FCF766FE002401200F94AE 843 | :1034900010941194010412948DE8130004904FF4D9 844 | :1034A000E010CDE90810022507956846FEF7C4FA3A 845 | :1034B00008B172B6FEE70F20CDE90A054FF480602F 846 | :1034C000CDE90C4002210AA80E94FEF7E9F908B1F3 847 | :1034D00072B6FEE710200F9012940FA8FEF76AF95B 848 | :1034E000002801D072B6FEE713B030BD704700006F 849 | :1034F0000148FEF7F4BF0000580200200148FEF723 850 | :10350000EEBF0000A00200200148FEF7E8BF000067 851 | :10351000E8020020F0B50268164B174C174D4FF02B 852 | :103520008047984205D0B84203D0A04201D0A842BB 853 | :1035300003D122F070064A683243984205D0B8425F 854 | :1035400003D0A04201D0A84203D122F44074CA683B 855 | :1035500022434C6922F08002224302608A68C262E0 856 | :103560000A688262984201D10969016301214161BF 857 | :10357000F0BD0000002C01400004004000080040A5 858 | :1035800010B501F01F030121046A99408C430462C5 859 | :10359000016A9A401143016210BD10B5846842EA85 860 | :1035A000032224F47F440A432243826010BD0000BA 861 | :1035B00030B5026A22F001020262026A436884693D 862 | :1035C00024F073050C682C4322F002058A682A4314 863 | :1035D0000A4DA8420BD122F00805CA6823F44073B3 864 | :1035E0002A434D6922F004021D438B692B4343603B 865 | :1035F000846149684163026230BD0000002C0140D3 866 | :1036000030B5026A22F010020262026A43688469DD 867 | :103610000D6824F4E64444EA05248D6822F0200273 868 | :1036200042EA05120B4DA8420ED1CD6822F080026D 869 | :1036300042EA05124D6923F4406343EA85038D692C 870 | :1036400022F0400243EA8503436084614968816354 871 | :10365000026230BD002C014030B5026A22F4807253 872 | :103660000262036A4268C46923F4007324F073059C 873 | :103670000C682C438D6843EA05230C4DA8420ED1FB 874 | :10368000CD6823F4006343EA05234D6922F44052D8 875 | :1036900042EA05128D6923F4806342EA0512426012 876 | :1036A000C4614968C163036230BD0000002C014061 877 | :1036B00030B5026A22F480520262046A4268C36929 878 | :1036C0000D6823F4E64343EA05238D6824F400548F 879 | :1036D00044EA0534064DA84204D14D6922F48042E3 880 | :1036E00042EA85124260C36149680164046230BDE8 881 | :1036F000002C014010B503689A6822F070044A68F3 882 | :10370000224322F007040A6822439A604A6812F0B2 883 | :103710000F0F30D11211082A2DD2DFE802F02C2C25 884 | :103720002C2C0B2127040B69D1E902210068FFF73B 885 | :1037300034FF20E00A68052A10D00268136A146A70 886 | :1037400024F00104146202689469096924F0F00409 887 | :1037500044EA01119161006803620CE0012010BD90 888 | :103760000A698968006800F008F804E00A69896855 889 | :10377000006800F013F8002010BD10B5036A046A59 890 | :1037800024F001040462846924F0F00444EA021481 891 | :1037900023F00A020A438461026210BD10B5036A75 892 | :1037A00023F0100303628369046A23F4704343EA3D 893 | :1037B000023224F0A00343EA01118261016210BDCC 894 | :1037C0002DE9F041D0F8C032D0F8B822CAB101EBEF 895 | :1037D000810500EB85040026E7693FB103EBC503D3 896 | :1037E0009B6BB7FBF3F503FB157323B1C2F81462AF 897 | :1037F0000020BDE8F08100231A46E66100F087FC56 898 | :10380000F6E70220F5E770B50546D0F8B84200F0BB 899 | :1038100083FBC4F80C02D5F8B80248B1D5F8BC1245 900 | :10382000D4F80402CA6804F503719047002070BD03 901 | :10383000022070BD70B504460026812100F0B6FA62 902 | :10384000002501212046E56200F0B0FA82212046E1 903 | :10385000C4F86C5100F0AAFA2564D4F8B80248B153 904 | :10386000D4F8BC0204F52E7440688047206800F04C 905 | :103870001EFE2560304670BD10B5D0E9AE4159B18D 906 | :1038800094F80002FF2807D08B6894F801222146A3 907 | :103890009847FF2084F80002002010BD0A21018013 908 | :1038A00000487047AC000020432101800048704769 909 | :1038B000FC0000204321018000487047B800002030 910 | :1038C0004321018000487047400100202DE9F0416C 911 | :1038D00004460026007C4FF40077012590B3402376 912 | :1038E00002228121204600F06BFB4023E562022288 913 | :1038F0000121204600F064FB082303228221204698 914 | :10390000C4F86C5100F05CFB4FF40770256400F0C4 915 | :10391000CFFDC4F8B802F8B10546D4F8BC0200687F 916 | :1039200080470020C5F81402C5F81802207CD5F89D 917 | :10393000042298B140230121204600F04DFB30467F 918 | :10394000BDE8F081FFE73B4602228121204600F0DE 919 | :1039500037FB3B46E562CAE70126F0E73B46EAE76C 920 | :1039600010B5D0F8B81269B1027C002AD1F804224F 921 | :1039700005D04023012100F02FFB002010BD4FF4A3 922 | :103980000073F7E7022010BD02460220002902D092 923 | :103990000020C2F8BC127047D0F8B802C0F8041278 924 | :1039A00000207047D0F8B802C0F81022C0F8081202 925 | :1039B000002070472DE9FC410546D0F8B872002080 926 | :1039C0008DF80000ADF80400064608780C4610F0AB 927 | :1039D000600121D020293BD1E288AAB1000660789D 928 | :1039E00007D5D5F8BC128B6839469847E288394626 929 | :1039F00026E087F80002A07987F80102E2883946BC 930 | :103A0000284600F06AF828E0D5F8BC126078002259 931 | :103A10008B682146984720E0607820B10A2809D0B9 932 | :103A20000B2815D110E095F89C02032810D1022232 933 | :103A300001A905E095F89C02032809D101226946F5 934 | :103A4000284600F064F808E095F89C02032804D0AA 935 | :103A50002146284600F036F802263046BDE8FC81B3 936 | :103A600010B5D0F8B812A1B1D1F814220AB10120D2 937 | :103A700010BD0122C1F81422D1F810220263B1F85E 938 | :103A8000102293B2D1F80822812100F040FB0020DF 939 | :103A900010BD022010BD10B5D0F8B4225268904776 940 | :103AA000002010BD134610B50A46002100F094FA1C 941 | :103AB000002010BD134610B50A46002100F027FB78 942 | :103AC000002010BD10B50446802100F005FB204603 943 | :103AD000BDE81040002100F0FFBA10B50323C0F884 944 | :103AE0005C21C0F89432C0F8602113460A460021D8 945 | :103AF00000F072FA002010BD10B505210023C0F8B7 946 | :103B000094121A46194600F067FA002010BD10B54D 947 | :103B10000223C261C0F89432026213460A460021B1 948 | :103B200000F0F5FA002010BD10B504210023C0F804 949 | :103B300094121A46194600F0EAFA002010BD00005F 950 | :103B400010B50A46024903A000F0E2F8004810BD93 951 | :103B5000F425002043444320436F6E6669670000EC 952 | :103B600012200880004870475400002010B50A4613 953 | :103B7000024903A000F0CCF8004810BDF425002055 954 | :103B800043444320496E74657266616365000000BA 955 | :103B900004200880004870475000002010B50A46F5 956 | :103BA000024903A000F0B4F8004810BDF42500203D 957 | :103BB00053544D6963726F656C656374726F6E699F 958 | :103BC0006373000010B50A46024903A000F0A0F894 959 | :103BD000004810BDF425002053544D33322056695F 960 | :103BE000727475616C20436F6D506F7274000000C9 961 | :103BF00010B51A2008800A480168001D0468001DDD 962 | :103C00000068081809D008220649FEF7F9FF05499F 963 | :103C1000042210312046FEF7F3FF0248801E10BD3B 964 | :103C2000E8F7FF1F6A000020F8B504460020ADF851 965 | :103C3000000048880D46010A082948D2DFE801F053 966 | :103C40004704091747473C45D4F8B012207C0A685E 967 | :103C500019E0207C02260028D4F8B40205D0C16AFD 968 | :103C600068468847014646703EE0816AF8E7C0B280 969 | :103C700006282CD2DFE800F0030A1014181CD4F830 970 | :103C8000B002426805E0694690471CE0D4F8B002F3 971 | :103C90008268E2B1207CF6E7D4F8B002C268F8E7A7 972 | :103CA000D4F8B0020269F4E7D4F8B0024269F0E750 973 | :103CB000D4F8B0028269ECE7207C40B9D4F8B402B1 974 | :103CC000416B6846884701460EE0207C20B12946BA 975 | :103CD0002046FFF7F7FEF8BDD4F8B402016B684642 976 | :103CE0008847014607204870BDF8000048B1EA88BF 977 | :103CF00052B1824200D90246ADF800202046FFF7BB 978 | :103D000006FFE8880028E6D12046FFF70DFFF8BD42 979 | :103D100070B5002300281ED00446002502E06D1C6B 980 | :103D2000EDB2641C2678002EF9D1022404EB450480 981 | :103D300014801278CA545B1C0322CA5400245B1CF2 982 | :103D400006E0CA545B1CDAB28C54521CD3B2401C3D 983 | :103D50000278002AF5D170BD01004FF0000004D0B8 984 | :103D6000012901D0022901D00220704701207047AB 985 | :103D700010B580B1D0F8B43213B10023C0F8B4321A 986 | :103D800009B1C0F8B012012180F89C12027000F055 987 | :103D9000C7F8002010BD022010BD10B5D0F8C00239 988 | :103DA000FDF700F9BDE81040FFF7D6BF10B5D0F819 989 | :103DB000C002FDF7D1F8BDE81040FFF7CDBF2DE9F7 990 | :103DC000F0411746044651B1D4F8B40242691AB121 991 | :103DD00094F89C02032851D00220BDE8F081D4F869 992 | :103DE0009432002504F11400022B03D0042B3AD0A6 993 | :103DF000C3B33CE0D0E903639E4207D9F11AC16026 994 | :103E00008AB239462046FFF755FE12E08068B0FBC3 995 | :103E1000F3F103FB110199B9984211D3D4F8981228 996 | :103E200088420DD2002211462046FFF743FEC4F817 997 | :103E3000985200231A461946204600F0CDF816E0A5 998 | :103E4000D4F8B402C16829B194F89C02032801D1C6 999 | :103E5000204688478021204600F03EF92046FFF7A3 1000 | :103E60004BFE04E0FFE78021204600F035F994F88E 1001 | :103E7000A002012804D184F8A05201E02046904716 1002 | :103E80000020AAE770B51546044649B1D4F8B4023B 1003 | :103E900082691AB194F89C02032830D0022070BDC8 1004 | :103EA000D4F8941204F5AA70032902D005291ED073 1005 | :103EB00027E0D0E903218A420BD9531AC360084690 1006 | :103EC000834200D303469AB229462046FFF7EAFD13 1007 | :103ED00017E0D4F8B402016929B194F89C020328D0 1008 | :103EE00001D1204688472046FFF71EFE09E000204A 1009 | :103EF0000146C4F89402204600F0EEF801E02046A6 1010 | :103F00009047002070BD10B5D0F8C002FDF7FBF956 1011 | :103F1000BDE81040FFF720BFD0F8C002FDF70DBA92 1012 | :103F200010B504461C481D49C0F8E842C4F8C00258 1013 | :103F30000160082141600221816000218161C1612D 1014 | :103F40000162FDF749FB08B1FCF77AFC0022D4F8C6 1015 | :103F5000C0021823114604F53074FCF7CBFF582338 1016 | :103F6000002280212068FCF7C5FFC02300228121A8 1017 | :103F70002068FCF7BFFF4FF48873002201212068FE 1018 | :103F8000FCF7B8FF4FF48073002282212068FCF711 1019 | :103F9000B1FF002010BD0000942A0020005C00400A 1020 | :103FA0000A0601F07F01D0F8C00201EB810100EBAD 1021 | :103FB000C10002D590F82A00704790F86A01704756 1022 | :103FC00010B51C461346D0F8C0022246FDF7BEF9D4 1023 | :103FD000BDE81040FFF7C0BE10B5D0F8C002FDF735 1024 | :103FE000E5F9BDE81040FFF7B7BE70B50022044602 1025 | :103FF00040231146FFF7E4FF40260125C4F8646121 1026 | :104000003346002280212046C4F85851FFF7D8FFDC 1027 | :104010006662A56184F89C520020C4F89402606036 1028 | :10402000C4F8A402D4F8B80228B1D4F8B40200212C 1029 | :10403000426820469047002070BD90F89C120429E9 1030 | :1040400003D190F89D1280F89C120020704710B5A3 1031 | :1040500090F89C12032904D1D0F8B412C96901B1B7 1032 | :104060008847002010BD01740020704710B5D0F8BB 1033 | :10407000C002FDF758FBBDE81040FFF76DBE70B5FC 1034 | :10408000044600F52A70054600F04AF80120C4F8FD 1035 | :104090009402B4F8AE02C4F8980294F8A80210F0A2 1036 | :1040A0001F010AD001290DD0022910D000F0800193 1037 | :1040B000204600F011F8002070BD2946204600F08F 1038 | :1040C0009EF8F8E72946204600F0CAF9F3E72946AA 1039 | :1040D000204600F01DF9EEE710B5D0F8C002FDF75C 1040 | :1040E0007EF9BDE81040FFF737BE10B5D0F8C0022A 1041 | :1040F000FDF734FBBDE81040FFF72EBE90F89C1290 1042 | :1041000080F89D12042180F89C120020704710B5A1 1043 | :10411000D0F8C002FDF79CF9BDE81040FFF71CBEC7 1044 | :104120000A7802704A7842708A78CB7802EB0322D0 1045 | :1041300042800A794B7902EB032282808A79C9791D 1046 | :1041400002EB0121C18070470246002011B1C2F884 1047 | :10415000B41270470220704710B5D0F8B422022480 1048 | :104160001AB11268904700B90024204610BD000023 1049 | :1041700070B50E461E4D897804462970012931D844 1050 | :1041800094F89C0202280BD003280FD03146204619 1051 | :10419000FFF798FC29782046BDE87040FFF77BBC0C 1052 | :1041A000D9B10320616084F89C0209E071B16068B4 1053 | :1041B000884212D0C1B22046FFF76DFC29786160B9 1054 | :1041C0002046FFF7C9FF02280CD006E0022084F841 1055 | :1041D0009C0220466160FFF75EFC2046BDE870400F 1056 | :1041E000FFF7A2BC31462046BDE87040FFF76ABC2D 1057 | :1041F000A800002010B5FFF778FF002010BD2DE9C2 1058 | :10420000F0410A78002612F0600208D0202A01D07E 1059 | :10421000402A70D1D0F8B422926890476DE04B7874 1060 | :10422000002201250A2B66D2DFE803F0405D6557C6 1061 | :10423000650805652C29FFF7F7FC5EE004468888D1 1062 | :10424000D8B9C888C8B94888802816D200F07F0736 1063 | :1042500094F89C02032810D084F89E7239462046B8 1064 | :10426000FFF704FF2046FFF75FFC1FB1022084F830 1065 | :104270009C0242E084F89C523FE020463BE0FFF77E 1066 | :1042800077FF3AE0CB88012B35D190F89C32012B97 1067 | :1042900004D0022B02D0032B2DD104E08260012236 1068 | :1042A00000F1080116E00122011D13E090F89C22A4 1069 | :1042B000012A03D0022A01D0032A1CD1CA88022A6B 1070 | :1042C00019D1C560D0F8A41209B10321C16002223E 1071 | :1042D00000F10C01FFF71BFC0FE0498801290CD10C 1072 | :1042E000C0F8A45211E090F89C32012B08D0022BA8 1073 | :1042F00006D0032B04D0FFF7E5FB3046BDE8F08184 1074 | :1043000049880129F9D1C0F8A422FFF70DFCF4E790 1075 | :104310002DE9F0410A46044610780027097910F08B 1076 | :1043200060030AD0202B01D0402B50D1D4F8B40226 1077 | :1043300011468368204698478FE0C0F3411001285A 1078 | :1043400006D05078D0B301282AD003283FD107E007 1079 | :10435000D4F8B402114683682046BDE8F0411847FE 1080 | :1043600094F89C02022802D0032872D10AE071B3AB 1081 | :1043700080296ED02046FFF7AFFE80212046FFF750 1082 | :10438000ABFE6AE0508838B931B1802904D0D088BA 1083 | :1043900010B92046FFF7A0FE2046FFF7C5FB5CE002 1084 | :1043A00094F89C020228E2D0032852D1508898BB8E 1085 | :1043B0004806F1D02046FFF7F0FCEDE7FFE794F860 1086 | :1043C0009C020026022803D0032842D112E040E0DC 1087 | :1043D00009B180293DD1080601F07F0000EB800083 1088 | :1043E00004EB800101D5143101E001F5AA7102222C 1089 | :1043F0000E602AE0080601F00F0000EB800004EBDD 1090 | :1044000080000AD5806920B301F07F0000EB8000B6 1091 | :1044100004EB800514350BE01FE0D0F85801C0B163 1092 | :1044200001F07F0000EB800004EB800505F5AA7524 1093 | :1044300041B1802906D02046FFF7B2FD10B101201E 1094 | :10444000286000E02E60022229462046FFF75FFB2D 1095 | :1044500003E011462046FFF735FB3846BDE8F08102 1096 | :1044600070B5054608780C4610F0600003D020288F 1097 | :1044700001D0402816D195F89C02012803D00228CB 1098 | :1044800001D003280ED1207901280BD8D5F8B40229 1099 | :10449000826828469047E188014306D12846FFF705 1100 | :1044A00043FB02E02846FFF70DFB002070BD70477C 1101 | :1044B00000487047742800202DE9F0470C7800264A 1102 | :1044C00030F8243048F68F121340CA78002A7DD085 1103 | :1044D000012A7CD0022A02D0032A7FD0012648F28A 1104 | :1044E0008002134320F824300D7830F8254048F638 1105 | :1044F0008F731C402C43144320F825400D7B48F259 1106 | :10450000C00C48F6BF744CF280074BF68F79EDB3C0 1107 | :1045100091F80080C24630F8285048F280181D40BB 1108 | :1045200045EA080520F82A50B0F8505091F800806C 1109 | :10453000054405EB0815B1F8088028F00108A5F836 1110 | :104540000084B0F8505091F80080054405EB081540 1111 | :10455000B1F80A8028F00108A5F808844D78002DEC 1112 | :104560000D7830F825804FEA48487DD0B8F1000F2B 1113 | :1045700007DA30F8258008EA030848EA070820F837 1114 | :1045800025800F7830F827506D0600E02CE006D526 1115 | :1045900030F827501D4045EA0C0520F82750CB780D 1116 | :1045A0000D78012B30F8253003EA040301D083F0A5 1117 | :1045B0002003134320F825300B7830F8231001EA4C 1118 | :1045C0000901114320F82310304602E003E008E01F 1119 | :1045D00004E0BDE8F08743F4007380E743F4C06370 1120 | :1045E0007DE743F480637AE74D782DB3B0F85050FF 1121 | :1045F0000F78054405EB0715CF8827F00107A5F8CC 1122 | :1046000000740F7830F827506D0606D530F8275023 1123 | :104610001D4045EA0C0520F82750CB78012B06D029 1124 | :104620000B7830F82310214081F02001C9E70B7886 1125 | :1046300030F823102140C4E7B0F850400D7804440E 1126 | :1046400004EB0514CD8825F00105A4F80854B0F852 1127 | :1046500050400D78044404EB05140D6904F20C4439 1128 | :1046600075B13E2D14D800E030E04FEA550CED074F 1129 | :1046700001D00CF1010C4FF6FF7505EA8C2511E015 1130 | :10468000258825F4F8452580258845F4004509E06E 1131 | :104690004FEA551CED0601D1ACF1010C4FF4004579 1132 | :1046A00045EA8C2525800D7830F82540640405D531 1133 | :1046B00030F825401C403C4320F825400B7830F86A 1134 | :1046C000231001EA090181F440517AE7B8F1000FA3 1135 | :1046D00007DA30F8258008EA030848EA070820F8D6 1136 | :1046E00025800F7830F827506D0606D530F8275012 1137 | :1046F0001D4045EA0C0520F827500D7830F825308C 1138 | :1047000003EA090383F44053134320F825308EE76E 1139 | :10471000002070472DE9F04391F80C804F780A781B 1140 | :1047200048F6BF7C4BF68F7948F2800348F2C0050B 1141 | :104730004CF2800648F68F74B8F1000F28D0002F95 1142 | :1047400030F822704FEA474748D0002F05DA30F89A 1143 | :1047500022702740374320F822700A7830F8227000 1144 | :104760007F0605D530F8227027402F4320F82270AD 1145 | :104770000D7830F825202240324320F825200C788F 1146 | :1047800030F8242002EA0C021A4320F824201AE010 1147 | :104790007FB130F82260760605D530F822602640D9 1148 | :1047A0002E4320F822600A7830F8221001EA0C012A 1149 | :1047B0000EE030F822506D0405D530F82250254027 1150 | :1047C000354320F822500A7830F8221001EA090116 1151 | :1047D000194320F822100020BDE8F083002F05DAED 1152 | :1047E00030F822702740374320F822700A7830F8DA 1153 | :1047F0002260760605D530F8226026402E4320F848 1154 | :1048000022600E7830F8262022402A4320F8262005 1155 | :104810000C7830F8242002EA09021A4320F82420F8 1156 | :10482000C1E70020704700207047012120F8401F99 1157 | :1048300000210180818001820846704730F8401FC6 1158 | :1048400021F43F410180002070470020704730B5BF 1159 | :104850000A7BB2BB4A7848F68F7548F28004C2B131 1160 | :104860000B7830F82320520607D530F823202A4051 1161 | :1048700048F2C0052A4320F82320CA78012A20D014 1162 | :104880000A7830F8221048F6BF73194081F02001F1 1163 | :1048900014E00A7830F822305B0407D530F8223073 1164 | :1048A0002B404CF280052B4320F822300A7830F858 1165 | :1048B00022104BF68F73194081F44051214320F8A8 1166 | :1048C0002210002030BD10B54A780978002A48F23D 1167 | :1048D000800330F8212005D048F6BF74224082F0D2 1168 | :1048E000100204E04BF68F74224082F480521A4387 1169 | :1048F00020F82120002010BD2DE9F04F0D464A7808 1170 | :10490000097B04464FF0000948F68F7A48F2800B85 1171 | :104910004FF6FF774FF40048012A09D000297DD0D7 1172 | :10492000E87802287BD001287AD00120BDE8F08FFA 1173 | :10493000AE692869864200D9064681B1E978022924 1174 | :104940001CD0287834F820104906B4F850102144BF 1175 | :1049500001EB001070D5A0F80C646A8928E1B3B2AD 1176 | :10496000EA882046696900F063FAB4F850002978B3 1177 | :10497000204400EB0110A0F8046435E1296A81426B 1178 | :1049800076D9297834F8210048F2801200EA0A002A 1179 | :10499000104324F82100286A801B2862287834F804 1180 | :1049A00020104906697876D511B1012921D027E078 1181 | :1049B000B4F85010214401EB001000F20C404EB14D 1182 | :1049C0003E2E0FD87108F20700D0491C07EA81215A 1183 | :1049D000018015E0018821F4F8410180018841F44B 1184 | :1049E0000041F5E77109F20600D1491E48EA81212C 1185 | :1049F000EEE7B4F85020111901EB0010A0F80C6498 1186 | :104A00006A89B3B22046696900F012FA68693044D5 1187 | :104A100068612969286A884206D902E0EDE00DE163 1188 | :104A200078E1801B286202E00646C5F8209068788D 1189 | :104A300018B1012824D02BE0B7E0B4F85000297851 1190 | :104A4000204400EB011000F204404EB13E2E10D87D 1191 | :104A50007108F20700D0491C07EA8121018017E0A4 1192 | :104A6000018821F4F8410180018841F40041F5E713 1193 | :104A700086E07109F20600D1491E48EA8121EDE77E 1194 | :104A8000B4F850002978204400EB0110A0F8046429 1195 | :104A90002A896FE0FFE711B1012921D027E0B4F89E 1196 | :104AA0005010214401EB001000F204404EB13E2EA4 1197 | :104AB0000FD87108F20700D0491C07EA8121018054 1198 | :104AC00015E0018821F4F8410180018841F400419A 1199 | :104AD000F5E77109F20600D1491E48EA8121EEE7A7 1200 | :104AE000B4F85010214401EB0010A0F804642A89A6 1201 | :104AF000B3B22046696900F09BF968693044686187 1202 | :104B00002969286A884202D9801B286202E0064689 1203 | :104B1000C5F82090687810B1012822D029E0B4F8B7 1204 | :104B200050002978204400EB011000F20C404EB1F7 1205 | :104B30003E2E0FD87108F20700D0491C07EA8121E8 1206 | :104B4000018016E0018821F4F8410180018841F4D8 1207 | :104B50000041F5E77109F20600D1491E48EA8121BA 1208 | :104B6000EEE7B4F850100819297800EB0110A0F80E 1209 | :104B70000C646A89B3B22046696900F059F933E0E0 1210 | :104B80002A7834F8220048F68F63184040EA0B0078 1211 | :104B900024F82200B4F850002A78204400EB0210D8 1212 | :104BA0008BB2A0F804342A89E5E7A0F804642A89C6 1213 | :104BB000B3B22046696900F03BF9687810B101286A 1214 | :104BC00008D011E0297834F8210048F2C00200EA48 1215 | :104BD0000A0006E0297834F821004CF2800200EA4D 1216 | :104BE0000A00104324F82100297834F8210048F6FF 1217 | :104BF000BF72104080F03000DFE0A969286981426F 1218 | :104C000002D9091AA961B6E00846C5F81890B2E0C1 1219 | :104C1000088820F4F8400880088840F400400BE041 1220 | :104C20003E2876D84208C00700D0521C07EA8220EE 1221 | :104C300002E000BF48EA82200880B6E092B9B4F8EA 1222 | :104C400050002978204400EB0110296900F204404B 1223 | :104C500069B13E2913D84A08C90700D0521C07EA97 1224 | :104C600082210180687888B1012832D03AE0018839 1225 | :104C700021F4F8410180018841F40041F1E74A093B 1226 | :104C8000C90600D1521E48EA8221EAE7B4F8500072 1227 | :104C90002978204400EB0110296900F20C4049B149 1228 | :104CA0003E290FD84A08C90700D0521C07EA8221C2 1229 | :104CB000018017E0018821F4F8410180018841F466 1230 | :104CC0000041F5E74A09C90600D1521E48EA82218F 1231 | :104CD000EEE7B4F850100819297800EB0110298A82 1232 | :104CE000A0F80C14E869B0B3297834F82100420424 1233 | :104CF00001D5420603D444F24002104255D134F8A3 1234 | :104D0000210048F2C00200EA0A00104324F8210002 1235 | :104D10004BE03CE0A9692869814202D9091AA961DE 1236 | :104D200002E00846C5F818908AB9B4F850102A78FD 1237 | :104D3000214401EB021101F2044168B13E2813D86D 1238 | :104D40004208C30700D0521C07EA82220A80697811 1239 | :104D500089B1012921D028E00A8822F4F8420A808A 1240 | :104D60000A8842F40042F1E74209C30600D1521E0C 1241 | :104D700048EA8222EAE7B4F850102A78214401EB8D 1242 | :104D8000021101F20C4100287FF44AAF40E74209CA 1243 | :104D9000C0067FF44FAF521E4CE7B4F850201119F3 1244 | :104DA0002A7801EB0211A1F80C04297834F82100CB 1245 | :104DB0004BF68F72104080F4405040EA0B0024F80C 1246 | :104DC00021000020B2E50021A0F844104FF43F413B 1247 | :104DD000A0F8401000207047002070470020704766 1248 | :104DE0000148FCF74FBB0000942A0020B0F84400B3 1249 | :104DF0007047000010B500EB42005C0800F58060D1 1250 | :104E000009D000BF30F8042B01F8012B120A01F879 1251 | :104E1000012B641EF6D1DA0701D00088087010BD9E 1252 | :104E20000020704711B98021A0F84C100020704775 1253 | :104E300010B55B1C00EB42005B0800F5806009D0F8 1254 | :104E400011F8012B11F8014B42EA042220F8042B3F 1255 | :104E50005B1EF5D110BDFEE70907090E002804DB33 1256 | :104E600000F1E02080F80014704700F00F0000F11E 1257 | :104E7000E02080F8141D704702E008C8121F08C126 1258 | :104E8000002AFAD170477047002001E001C1121FCB 1259 | :104E9000002AFBD17047884201D3401A7047C943AA 1260 | :104EA000401A401C704700001CB500200090FBF722 1261 | :104EB00091FFFEF7E0FAFDF7BFFE8648416941F039 1262 | :104EC000010141614069002200F00100019011469A 1263 | :104ED0000E20FBF7DDFF0E20FBF7CCFFFDF7ECFE0D 1264 | :104EE000FDF70AFFFDF75EFFFDF7A8FFFDF7FEFFE8 1265 | :104EF00079480778DFF8E4B1DFF8E4918246DBF81F 1266 | :104F000000005D46016821F00201016073485838D5 1267 | :104F1000FCF722FFFDF7D0FE70480021D430FDF7EA 1268 | :104F2000F5FC6E4804214430FDF722FD6B4800215A 1269 | :104F30008C30FDF791FA69484430FDF722FC674850 1270 | :104F40008C30FDF71EFC6548D430FDF7E6F9FDF71F 1271 | :104F5000D3FEFDF727FFFDF771FF54464FF40056CF 1272 | :104F60000EE000BFFBF728FF0099FFF794FF6428CD 1273 | :104F700006D331464846FBF711FFFBF71DFF0090B3 1274 | :104F800020788742EED0277894F80180608818B1A5 1275 | :104F90005249D4310968C862A08830B14F494431C0 1276 | :104FA0000A68506309683230C8624C480021D43026 1277 | :104FB000FDF73AFC494804214430FDF769FC4748B5 1278 | :104FC000443001684A6942F001024A610068C168E0 1279 | :104FD00021F00201C1600021E16040488C30FDF702 1280 | :104FE000CBF93E488C300068016841F00401016053 1281 | :104FF0000EE000BFFBF7E0FE0099FFF74CFFC8286A 1282 | :1050000006D331464846FBF7C9FEFBF7D5FE0090B4 1283 | :10501000E0680028EED072B60020A2462061A060B1 1284 | :105020004FF400522063144662B62E49A1F5BA70BF 1285 | :10503000FCF778FF2868016841F002010160AB4687 1286 | :105040004FEA0A06DBF8000040680004000C26D096 1287 | :10505000A04224D0844203D9211A89B2019102E0EE 1288 | :105060004FF4005001940022C4F50051F2621D4A31 1289 | :1050700089B20446551808E072783146904511D13E 1290 | :10508000012812D0886A401CB06228460199FBF7BB 1291 | :10509000A5FB0028F0D1326B01991144316370787F 1292 | :1050A000804506D0FBF758FB29E7C86A401CF06230 1293 | :1050B000EBE7FBF781FE0099FFF7EDFEB0F5FA7F15 1294 | :1050C000C0D34FF400514846FBF768FEFBF774FE6F 1295 | :1050D0000090B7E7001002400000002014020020FA 1296 | :1050E000001001403003002030B587B000220123BA 1297 | :1050F0006C4603E0C55CA554521C5B1C8B4201D27C 1298 | :105100000F2AF7D30020A05405AB04AA07A120461C 1299 | :10511000FBF72CF8022806D10648BDF81010418094 1300 | :10512000BDF81410818007B030BD000025687520DF 1301 | :10513000256875000000002000000000000000004D 1302 | :105140000102030406070809DDDDDDDDDCBBBBDD94 1303 | :10515000DDDDDDDDDDDDDDDD988888888888888817 1304 | :105160007777777777888888855555566666666637 1305 | :105170006666666666688888833333322222222216 1306 | :10518000222222222228888DA85100080000002017 1307 | :10519000BC010000F806000868520008BC010020AD 1308 | :1051A000C42F0000884E0008013413613B1B089196 1309 | :1051B000041A9D041AC5041AF1041A41041A6D0454 1310 | :1051C000170403090412011402020216408304406A 1311 | :1051D00057260201020301031A1A031365071B086D 1312 | :1051E00055041A51041A89044119331182105324A9 1313 | :1051F000F4130A0632022A401C1C0902435B111DEB 1314 | :10520000C03209042D1A020B1305241610010524BF 1315 | :105210000110090104240202052406170107058272 1316 | :1052200003081C10090491320A1D07050102432CD2 1317 | :10523000070581070938442A40072A8107112B09ED 1318 | :1052400007440A3B044413CD381B0835044BB539D9 1319 | :10525000FC1A790C13C1371B080708C11AB5102AAC 1320 | :08526000A91C19041A9D0400A9 1321 | :04000005080000ED02 1322 | :00000001FF 1323 | -------------------------------------------------------------------------------- /bluepill_neoemu_clk.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | Mcu.Family=STM32F1 3 | Dma.SPI2_RX.0.Instance=DMA1_Channel4 4 | ProjectManager.MainLocation=Core/Src 5 | RCC.MCOFreq_Value=72000000 6 | SH.S_TIM4_CH2.ConfNb=1 7 | VP_TIM2_VS_OPM.Mode=OPM_bit 8 | USB_DEVICE.CLASS_NAME_FS=CDC 9 | Dma.SPI2_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority 10 | ProjectManager.KeepUserCode=true 11 | Mcu.UserName=STM32F103C8Tx 12 | SPI2.VirtualType=VM_SLAVE 13 | VP_TIM4_VS_OPM.Mode=OPM_bit 14 | RCC.PLLCLKFreq_Value=72000000 15 | PC13-TAMPER-RTC.GPIOParameters=GPIO_Label 16 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_TIM2_Init-TIM2-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_TIM4_Init-TIM4-false-HAL-true,8-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false 17 | PA11.Mode=Device 18 | RCC.ADCFreqValue=36000000 19 | TIM3.Pulse-Output\ Compare1\ CH1=1 20 | TIM2.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2 21 | PB13.Signal=SPI2_SCK 22 | PB15.Signal=SPI2_MOSI 23 | PinOutPanel.RotationAngle=0 24 | TIM4.TIM_MasterOutputTrigger=TIM_TRGO_OC1 25 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 26 | ProjectManager.StackSize=0x400 27 | PD1-OSC_OUT.Signal=RCC_OSC_OUT 28 | Mcu.IP4=SYS 29 | RCC.FCLKCortexFreq_Value=72000000 30 | Mcu.IP5=TIM2 31 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false 32 | Mcu.IP2=RCC 33 | Mcu.IP3=SPI2 34 | Mcu.IP0=DMA 35 | Mcu.IP1=NVIC 36 | PA12.Signal=USB_DP 37 | Mcu.UserConstants= 38 | TIM4.OCFastMode_PWM-PWM\ Generation1\ CH1=TIM_OCFAST_ENABLE 39 | Mcu.ThirdPartyNb=0 40 | RCC.HCLKFreq_Value=72000000 41 | Mcu.IPNb=10 42 | TIM2.IPParameters=Channel-PWM Generation2 CH2,Period,TIM_MasterOutputTrigger,OCMode_PWM-PWM Generation2 CH2,Pulse-PWM Generation2 CH2,OCFastMode_PWM-PWM Generation2 CH2 43 | ProjectManager.PreviousToolchain= 44 | RCC.APB2TimFreq_Value=72000000 45 | TIM3.Period=7 46 | TIM4.Pulse-PWM\ Generation1\ CH1=1 47 | TIM4.OCMode_PWM-PWM\ Generation1\ CH1=TIM_OCMODE_PWM2 48 | PB6.Signal=S_TIM4_CH1 49 | Mcu.Pin6=PB13 50 | Mcu.Pin7=PB15 51 | VP_TIM3_VS_ControllerModeClock.Mode=Clock Mode 52 | Mcu.Pin8=PA11 53 | Mcu.Pin9=PA12 54 | VP_TIM3_VS_ClockSourceITR.Signal=TIM3_VS_ClockSourceITR 55 | RCC.AHBFreq_Value=72000000 56 | SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2 57 | Mcu.Pin0=PC13-TAMPER-RTC 58 | Mcu.Pin1=PD0-OSC_IN 59 | GPIO.groupedBy=Show All 60 | Mcu.Pin2=PD1-OSC_OUT 61 | Mcu.Pin3=PA0-WKUP 62 | VP_TIM4_VS_ControllerModeTrigger.Mode=Trigger Mode 63 | Mcu.Pin4=PA1 64 | Mcu.Pin5=PA6 65 | ProjectManager.ProjectBuild=false 66 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 67 | VP_TIM2_VS_ControllerModeTrigger.Signal=TIM2_VS_ControllerModeTrigger 68 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false 69 | NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true 70 | RCC.PLLMUL=RCC_PLL_MUL9 71 | ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.3 72 | MxDb.Version=DB.6.0.10 73 | ProjectManager.BackupPrevious=false 74 | PA14.Mode=Serial_Wire 75 | NVIC.TIM2_IRQn=true\:0\:0\:false\:false\:true\:true\:true 76 | File.Version=6 77 | SPI2.CalculateBaudRate=18.0 MBits/s 78 | SH.S_TIM4_CH2.0=TIM4_CH2,TriggerSource_TI2FP2 79 | Dma.SPI2_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE 80 | PB7.Signal=S_TIM4_CH2 81 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false 82 | SH.S_TIM3_CH1.0=TIM3_CH1,Output Compare1 CH1 83 | TIM4.Period=37 84 | VP_TIM3_VS_ClockSourceITR.Mode=TriggerSource_ITR3 85 | Dma.RequestsNb=1 86 | ProjectManager.HalAssertFull=false 87 | Dma.SPI2_RX.0.MemInc=DMA_MINC_ENABLE 88 | ProjectManager.ProjectName=bluepill_neoemu_clk 89 | RCC.PLLMCOFreq_Value=36000000 90 | VP_TIM3_VS_ControllerModeClock.Signal=TIM3_VS_ControllerModeClock 91 | Mcu.Package=LQFP48 92 | PA6.Signal=S_TIM3_CH1 93 | SPI2.Mode=SPI_MODE_SLAVE 94 | ProjectManager.ToolChainLocation= 95 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 96 | VP_TIM2_VS_OPM.Signal=TIM2_VS_OPM 97 | VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Signal=USB_DEVICE_VS_USB_DEVICE_CDC_FS 98 | SPI2.CLKPhase=SPI_PHASE_2EDGE 99 | TIM2.Pulse-PWM\ Generation2\ CH2=3602 100 | TIM2.TIM_MasterOutputTrigger=TIM_TRGO_RESET 101 | SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1 102 | RCC.APB1TimFreq_Value=72000000 103 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 104 | SPI2.Direction=SPI_DIRECTION_2LINES_RXONLY 105 | Dma.SPI2_RX.0.Direction=DMA_PERIPH_TO_MEMORY 106 | PB13.Mode=RX_Only_Simplex_Unidirect_Slave 107 | NVIC.DMA1_Channel4_IRQn=true\:0\:0\:false\:false\:true\:false\:true 108 | Dma.Request0=SPI2_RX 109 | ProjectManager.CustomerFirmwarePackage= 110 | VP_TIM4_VS_OPM.Signal=TIM4_VS_OPM 111 | TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1 112 | SH.S_TIM4_CH1.ConfNb=1 113 | ProjectManager.ProjectFileName=bluepill_neoemu_clk.ioc 114 | PD1-OSC_OUT.Mode=HSE-External-Oscillator 115 | Mcu.PinsNb=22 116 | ProjectManager.NoMain=false 117 | USB_DEVICE.VirtualModeFS=Cdc_FS 118 | Dma.SPI2_RX.0.Mode=DMA_CIRCULAR 119 | PC13-TAMPER-RTC.Signal=GPIO_Output 120 | RCC.USBPrescaler=RCC_USBCLKSOURCE_PLL_DIV1_5 121 | ProjectManager.DefaultFWLocation=true 122 | PD0-OSC_IN.Signal=RCC_OSC_IN 123 | ProjectManager.DeletePrevious=true 124 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 125 | USB_DEVICE.IPParameters=VirtualMode,VirtualModeFS,CLASS_NAME_FS 126 | SH.S_TIM2_CH1_ETR.ConfNb=1 127 | RCC.FamilyName=M 128 | PA0-WKUP.Signal=S_TIM2_CH1_ETR 129 | PA13.Signal=SYS_JTMS-SWDIO 130 | SH.S_TIM2_CH2.0=TIM2_CH2,PWM Generation2 CH2 131 | Dma.SPI2_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE 132 | ProjectManager.TargetToolchain=MDK-ARM V5.27 133 | TIM4.IPParameters=Period,Channel-PWM Generation1 CH1,TIM_MasterOutputTrigger,OCMode_PWM-PWM Generation1 CH1,Pulse-PWM Generation1 CH1,OCFastMode_PWM-PWM Generation1 CH1 134 | VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Mode=CDC_FS 135 | SH.S_TIM2_CH2.ConfNb=1 136 | SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,CLKPhase,BaudRatePrescaler 137 | ProjectManager.RegisterCallBack= 138 | PC13-TAMPER-RTC.Locked=true 139 | RCC.USBFreq_Value=48000000 140 | PA1.Signal=S_TIM2_CH2 141 | TIM3.Channel-Output\ Compare1\ CH1=TIM_CHANNEL_1 142 | PD0-OSC_IN.Mode=HSE-External-Oscillator 143 | board=custom 144 | ProjectManager.LastFirmware=true 145 | PC13-TAMPER-RTC.GPIO_Label=LED 146 | PB15.Mode=RX_Only_Simplex_Unidirect_Slave 147 | NVIC.TIM3_IRQn=true\:0\:0\:false\:false\:true\:true\:true 148 | RCC.VCOOutput2Freq_Value=8000000 149 | RCC.APB2Freq_Value=72000000 150 | TIM2.OCMode_PWM-PWM\ Generation2\ CH2=TIM_OCMODE_PWM2 151 | MxCube.Version=6.1.2 152 | TIM3.OCMode_1=TIM_OCMODE_ACTIVE 153 | NVIC.USB_LP_CAN1_RX0_IRQn=true\:0\:0\:false\:false\:true\:false\:true 154 | VP_SYS_VS_Systick.Mode=SysTick 155 | TIM3.IPParameters=Period,OCMode_1,Channel-Output Compare1 CH1,Pulse-Output Compare1 CH1 156 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false 157 | TIM2.Period=3650 158 | PA13.Mode=Serial_Wire 159 | Dma.SPI2_RX.0.Priority=DMA_PRIORITY_MEDIUM 160 | ProjectManager.FreePins=false 161 | RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,USBPrescaler,VCOOutput2Freq_Value 162 | ProjectManager.AskForMigrate=true 163 | Mcu.Name=STM32F103C(8-B)Tx 164 | ProjectManager.UnderRoot=false 165 | VP_TIM4_VS_ControllerModeTrigger.Signal=TIM4_VS_ControllerModeTrigger 166 | Mcu.IP8=USB 167 | Mcu.IP9=USB_DEVICE 168 | Mcu.IP6=TIM3 169 | Mcu.IP7=TIM4 170 | ProjectManager.CoupleFile=false 171 | RCC.SYSCLKFreq_VALUE=72000000 172 | RCC.TimSysFreq_Value=72000000 173 | Mcu.Pin20=VP_TIM4_VS_OPM 174 | Mcu.Pin21=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS 175 | PA12.Mode=Device 176 | VP_TIM2_VS_ControllerModeTrigger.Mode=Trigger Mode 177 | NVIC.ForceEnableDMAVector=true 178 | KeepUserPlacement=false 179 | Dma.SPI2_RX.0.PeriphInc=DMA_PINC_DISABLE 180 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false 181 | ProjectManager.CompilerOptimize=6 182 | PA11.Signal=USB_DM 183 | SH.S_TIM2_CH1_ETR.0=TIM2_CH1,TriggerSource_TI1FP1 184 | PA14.Signal=SYS_JTCK-SWCLK 185 | ProjectManager.HeapSize=0x200 186 | Mcu.Pin15=VP_TIM2_VS_ControllerModeTrigger 187 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 188 | Mcu.Pin16=VP_TIM2_VS_OPM 189 | Mcu.Pin13=PB7 190 | Mcu.Pin14=VP_SYS_VS_Systick 191 | Mcu.Pin19=VP_TIM4_VS_ControllerModeTrigger 192 | SH.S_TIM3_CH1.ConfNb=1 193 | ProjectManager.ComputerToolchain=false 194 | Mcu.Pin17=VP_TIM3_VS_ControllerModeClock 195 | Mcu.Pin18=VP_TIM3_VS_ClockSourceITR 196 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 197 | Mcu.Pin11=PA14 198 | Mcu.Pin12=PB6 199 | Mcu.Pin10=PA13 200 | TIM2.OCFastMode_PWM-PWM\ Generation2\ CH2=TIM_OCFAST_DISABLE 201 | NVIC.TIM4_IRQn=true\:0\:0\:false\:false\:true\:true\:true 202 | RCC.APB1Freq_Value=36000000 203 | USB_DEVICE.VirtualMode=Cdc 204 | ProjectManager.DeviceId=STM32F103C8Tx 205 | ProjectManager.LibraryCopy=0 206 | -------------------------------------------------------------------------------- /ledmatrix.yaml: -------------------------------------------------------------------------------- 1 | # NeoPill LED matrix onfig yaml 2 | 3 | serial_port: COM9 # which serial port is NeoPill 4 | #timing_T1H: 550 # optionally adjust bitstream timing, T1H, RES, in ns 5 | #timing_RES: 48000 6 | fps_limit: 60 #limit displayed frame rate 7 | 8 | # FastLED: SerpentineLayout = false 9 | # Adafruit: NEO_MATRIX_TOP+NEO_MATRIX_LEFT+NEO_MATRIX_ROWS+NEO_MATRIX_PROGRESSIVE 10 | 11 | matrix: 12 | - ledcolor: GRB # GRB, GRBW. must match target device 13 | #number of LEDs total = matrix_w*matrix_h, and must match target device 14 | matrix_w: 16 # number of LEDs across in matrix 15 | matrix_h: 16 # number of LEDs high in matrix 16 | length: 1024 # display size in pix 17 | height: 1024 #in pix 18 | gap: 2 #in pix 0..n, some small inter-pixel gap 19 | style: circle # circle or rect. If many LEDs circles turn into dots! 20 | wposx: 20 #x,y window position 21 | wposy: 40 22 | wname: "NeoPill Matrix Demo" 23 | 24 | 25 | -------------------------------------------------------------------------------- /ledstrip.yaml: -------------------------------------------------------------------------------- 1 | # NeoPill LED strip onfig yaml 2 | 3 | serial_port: COM9 # which serial port is NeoPill 4 | #timing_T1H: 550 # optionally adjust bitstream timing, T1H, RES, in ns 5 | #timing_RES: 48000 6 | fps_limit: 60 #limit displayed frame rate 7 | 8 | 9 | strip: 10 | - ledcolor: GRB # GRB, GRBW. must match target device 11 | num: 576 #number of LEDs must match target device 12 | length: 1920 #in pix 13 | height: 200 #in pix 14 | gap: 0 #in pix 0..n, some small inter-pixel gap 15 | style: rect # circle or rect. If many LEDs circles turn into dots! 16 | wposx: 20 #x,y window position 17 | wposy: 40 18 | wname: "NeoPill Strip Demo" 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.c 5 | * @brief : Main program body 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2021 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | This code supports NeoPill, a Neopixel Emulator, where connecting the Neopixel serial data from a device (an Arduino dev board, for example) 19 | to a STM32 dev board converts the Neopixel serial data to USB serial data (a Neopixel->USB bridge.) 20 | A PC runs python code that takes this USB data and converts it to colored objects on the screen. 21 | 22 | This code is specific for the STM32F103C8T6 BluePill. 23 | 24 | Lower level: 25 | Read Neopixel serial data using SPI, where the pixel bitstream is fed into both MOSI and TIM4. 26 | TIM4 then generates a one-shot pulse (CH1 out) wired to SCK. 27 | The pulse is configured to match the bitstream timing T0H, T1H of <500ns = 0, >550ns = 1. 28 | CH2 in delay is 3 clks (Output compare fast enable), and CH1 out has resolution of 13.88ns (72MHz sys clock, Prescaler = 0) per count. 29 | So each data bit generates a SCK pulse about 550ns duration. 30 | 31 | For 72MHz clock (13.88ns): 32 | TIM4 ARR for one pulse mode: 33 | 550ns - (3*13.88) = 508.33ns 34 | 508.33ns/13.88 = 36.6 counts min. Make this 37 (555ns) for TIM4 ARR. 35 | 36 | 37 | SPI data bytes are DMA'd to a buffer, and sent out USB. 38 | Input rate testing never got higher than 64kbytes/s, using Arduino Nano target. Max rate should be around 100kbytes/s. 39 | 40 | Neopixel End of Data frame (EoF) (causing each pixel to latch) is 6us or longer of low level, typically stated as >50us. 41 | TIM3 is clocked from TIM4 ITR3, divided by 8, and is essentially a byte counter of the data going into the SPI. 42 | Every 8 bits of Neopixel data TIM3's ISR starts/restarts TIM2 one-pulse delay. Upon TIM2 one-pulse timeout an EoF ISR triggers. 43 | 44 | TIM2 Pulse delay: 45 | 50us/13.88ns = 3602 counts. 46 | 47 | The EoF ISR is used to initially sync the SPI data out the USB, assuming the PC side is ready to accept the data. Once sync'd 48 | and running there is no further syncing. 49 | 50 | For the PC to sync/re-sync with the Neopixel data frames: 51 | 1) send a one character 'F' to flush the USB (in case re-syncing) and reset the SPI interface. 52 | 2) the PC flushes its USB data as well. 53 | 3) send a one character 'S' to start the data stream after the last EoF. 54 | 55 | For tweaking TIM2, TIM4 timer values a simple text string from the PC is supported: 56 | 'T nnn mmm' 57 | see pc_host_timing_req() below. 58 | 59 | Environment: 60 | CubeMX 6.1.1 61 | Keil uVision 5.26 62 | BluePill STM32F103C8T6, 16kRAM,64kFlash, 72MHz clk. 63 | All code in main.c, with small mods in usbd_cdc_if.c, usbd_cdc_if.h 64 | 65 | 66 | 67 | BluePill pinout/timers: 68 | 69 | PB7 TIM4 CH2 input <-serial Neopixel data from external dev bd. 70 | 71 | PB6 TIM4 CH1 output -> generates SPI2_SCK (to PB13), use jumper. 72 | TIM3 CH1 SPI2 input byte counter (no pins used) 73 | TIM2 CH1 -> frame end ITR (no pins used) 74 | 75 | PB15 SPI2 MOSI input, Rx DMA1 CH4, <-serial Neopixel data from external dev bd. 76 | PB13 SPI2 SCK input <- TIM4 CH1 (from PB6) 77 | 78 | LEDs 79 | PC13 LED_Pin (built-in): red heartbeat, various speeds. 80 | 81 | On PC side, set COM baud rate to max 12,000,000 . 82 | 83 | R. Elwin 5/2021 84 | 85 | */ 86 | 87 | /* USER CODE END Header */ 88 | /* Includes ------------------------------------------------------------------*/ 89 | #include "main.h" 90 | #include "usb_device.h" 91 | 92 | /* Private includes ----------------------------------------------------------*/ 93 | /* USER CODE BEGIN Includes */ 94 | #include "usbd_cdc_if.h" 95 | #include 96 | /* USER CODE END Includes */ 97 | 98 | /* Private typedef -----------------------------------------------------------*/ 99 | /* USER CODE BEGIN PTD */ 100 | 101 | /* USER CODE END PTD */ 102 | 103 | /* Private define ------------------------------------------------------------*/ 104 | /* USER CODE BEGIN PD */ 105 | /* USER CODE END PD */ 106 | 107 | /* Private macro -------------------------------------------------------------*/ 108 | /* USER CODE BEGIN PM */ 109 | 110 | /* USER CODE END PM */ 111 | 112 | /* Private variables ---------------------------------------------------------*/ 113 | SPI_HandleTypeDef hspi2; 114 | DMA_HandleTypeDef hdma_spi2_rx; 115 | 116 | TIM_HandleTypeDef htim2; 117 | TIM_HandleTypeDef htim3; 118 | TIM_HandleTypeDef htim4; 119 | 120 | /* USER CODE BEGIN PV */ 121 | extern uint8_t CDC_Flush_FS(void); 122 | 123 | #define SPI_BSIZE 8192 // also look at USB's APP_TX_DATA_SIZE 124 | uint8_t spi_rx_buffer[SPI_BSIZE]; 125 | 126 | //items used in an ISR 127 | volatile uint32_t spi_rx_ctr; 128 | volatile uint32_t tim2_ch1_isr_ctr; //EoF ISR counter 129 | volatile uint32_t frame_byte_ctr; 130 | volatile uint8_t usb_sync_flag,usb_flush_flag; 131 | 132 | //helpful debugging aids 133 | uint32_t dbg_spi_isr, dbg_rx_rate; 134 | uint32_t dbg_spi_err, dbg_spi_state; 135 | uint32_t dbg_tim3_ch1_isr; 136 | uint32_t dbg_dma_ctr; 137 | uint32_t dbg_frame_overflow; 138 | uint32_t dbg_tim3_cnt; 139 | 140 | //PC host changes default input timings if >0 141 | uint16_t pchost_tim4_Period; 142 | uint16_t pchost_tim2_Pulse; 143 | 144 | //USB counters, also helpful for debugging 145 | uint32_t usb_fail; 146 | uint32_t usb_busy; 147 | uint32_t usb_bytes_tx_ctr; 148 | 149 | /* USER CODE END PV */ 150 | 151 | /* Private function prototypes -----------------------------------------------*/ 152 | void SystemClock_Config(void); 153 | static void MX_GPIO_Init(void); 154 | static void MX_DMA_Init(void); 155 | static void MX_SPI2_Init(void); 156 | static void MX_TIM2_Init(void); 157 | static void MX_TIM3_Init(void); 158 | static void MX_TIM4_Init(void); 159 | /* USER CODE BEGIN PFP */ 160 | 161 | /* USER CODE END PFP */ 162 | 163 | /* Private user code ---------------------------------------------------------*/ 164 | /* USER CODE BEGIN 0 */ 165 | //calcs difference between 2 timestamps -- just uint w/rollover. 166 | // ts > last_ts 167 | uint32_t calc_ts_et(uint32_t ts, uint32_t last_ts) 168 | { 169 | if ( ts >= last_ts ) 170 | { 171 | return ( ts - last_ts ); 172 | } 173 | else 174 | { 175 | return ( 1 + ts - (ULONG_MAX - last_ts) ); 176 | } 177 | } 178 | 179 | /* 180 | Timing change request from PC, in text, 'T nnn mmm' 181 | where: 182 | nnn= T1H bit timing in clks. 183 | mmm= TLL (or reset latch) End of Frame timeout pulse in counts. 184 | 185 | (see notes at top) 186 | For 72MHz clock (13.88ns) 187 | ETR -> CH2 delay is 3 clks 188 | TIM2 ARR for one-shot pulse for T1H of 550ns: 189 | 550ns - (3*13.88) = 508.33ns 190 | 508.33ns/13.88 = 36.6 counts min. Make this 38 for TIM4 Period. 191 | 192 | TLL's TIM2 Pulse defaults to 3602 counts (50us). TIM2 Period > Pulse (I made this arbitrarily 50.) 193 | 194 | */ 195 | void pc_host_timing_req(uint8_t* Buf, uint32_t Len) 196 | { 197 | char in_str[16]; 198 | int i,j,n; 199 | uint16_t t1h, tll; 200 | 201 | //strip leading 'T', then '\0-terminate 202 | for( i=0, j=1; jChannel == HAL_TIM_ACTIVE_CHANNEL_1) // we're using TIM3 channel 1 249 | { 250 | //input SPI byte counter triggers this intr, resets TIM2 one-shot 251 | dbg_tim3_ch1_isr++; 252 | 253 | htim2.Instance->EGR |= TIM_EGR_UG; // UG=1, clears counter, CEN =0 254 | htim2.Instance->CR1 |= TIM_CR1_CEN; // CEN =1, now running , or use macro __HAL_TIM_ENABLE(&htim4); 255 | } 256 | } 257 | else if( &htim2 == htim ) 258 | { 259 | // TIM2 one-shot expires indicating End of Frame (EoF) 260 | if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_2) // we're using TIM2 channel 2 261 | { 262 | uint16_t d; 263 | 264 | dbg_tim3_cnt+=htim3.Instance->CNT; //test, see if TIM3 clocked during last delay. This indicates we're out of sync. 265 | 266 | //htim3.Instance->CR1 |= TIM_CR1_UDIS; //URS=1, so no UG INT 267 | htim3.Instance->EGR |= TIM_EGR_UG; // UG=1, clears TIM3 counter, in case we started out of sync with bitstream 268 | htim4.Instance->EGR |= TIM_EGR_UG; //clear TIM4 too 269 | 270 | 271 | tim2_ch1_isr_ctr++; 272 | 273 | //this checks if we're overflowing SPI buffer -- for debug only 274 | frame_byte_ctr = spi_rx_ctr; 275 | d = __HAL_DMA_GET_COUNTER( &hdma_spi2_rx ); 276 | if( d > 0 ) 277 | frame_byte_ctr += (SPI_BSIZE - d); // convert to byte counter with DMA register CNDTR, this is our latest EoF 278 | 279 | if( frame_byte_ctr >= (usb_bytes_tx_ctr + SPI_BSIZE) ) //check if overflowing SPI buffer 280 | dbg_frame_overflow++; //debug counter 281 | 282 | } 283 | } 284 | } 285 | 286 | /* USER CODE END 0 */ 287 | 288 | /** 289 | * @brief The application entry point. 290 | * @retval int 291 | */ 292 | int main(void) 293 | { 294 | /* USER CODE BEGIN 1 */ 295 | uint32_t led_heartbeat = 0; 296 | uint16_t dmaout_idx; 297 | uint16_t dmain_ctr, dmaout_ctr; 298 | uint16_t n, next_ctr; 299 | int e; 300 | uint8_t usb_sync_flag2, usb_flush_flag2; 301 | /* USER CODE END 1 */ 302 | 303 | /* MCU Configuration--------------------------------------------------------*/ 304 | 305 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ 306 | HAL_Init(); 307 | 308 | /* USER CODE BEGIN Init */ 309 | 310 | /* USER CODE END Init */ 311 | 312 | /* Configure the system clock */ 313 | SystemClock_Config(); 314 | 315 | /* USER CODE BEGIN SysInit */ 316 | 317 | /* USER CODE END SysInit */ 318 | 319 | /* Initialize all configured peripherals */ 320 | MX_GPIO_Init(); 321 | MX_DMA_Init(); 322 | MX_SPI2_Init(); 323 | MX_TIM2_Init(); 324 | MX_TIM3_Init(); 325 | MX_TIM4_Init(); 326 | MX_USB_DEVICE_Init(); 327 | /* USER CODE BEGIN 2 */ 328 | 329 | 330 | usb_sync_flag2 = usb_sync_flag; //init flags 331 | 332 | 333 | /****** resync ************/ 334 | //In case PC re-syncs, re-init TIMers, SPI. Don't Touch USB as this causes COM port grief! 335 | label_resync: 336 | 337 | //undo/redo SPI 338 | __HAL_DMA_DISABLE_IT( &hdma_spi2_rx, DMA_IT_TC ); 339 | HAL_SPI_DeInit (&hspi2); 340 | MX_SPI2_Init(); 341 | 342 | //turn off TIM 2,3,4 343 | HAL_TIM_OnePulse_Stop(&htim4,TIM_CHANNEL_1); 344 | HAL_TIM_OnePulse_Stop_IT (&htim2, TIM_CHANNEL_2); 345 | HAL_TIM_IC_Stop_IT(&htim3, TIM_CHANNEL_1); 346 | 347 | //de-init'em 348 | HAL_TIM_OnePulse_DeInit(&htim2); 349 | HAL_TIM_OnePulse_DeInit(&htim3); 350 | HAL_TIM_IC_DeInit(&htim4); 351 | 352 | //re-do'em 353 | MX_TIM2_Init(); 354 | MX_TIM3_Init(); 355 | MX_TIM4_Init(); 356 | 357 | 358 | /******** end resync ***********/ 359 | 360 | //wait for PC sync command 361 | while( usb_sync_flag2 == usb_sync_flag ) 362 | { 363 | if( calc_ts_et( HAL_GetTick(), led_heartbeat ) >= 100 ) //fast pulse 364 | { 365 | HAL_GPIO_TogglePin(LED_GPIO_Port , LED_Pin ); 366 | led_heartbeat = HAL_GetTick(); 367 | } 368 | } 369 | 370 | usb_sync_flag2 = usb_sync_flag; //done w/resync 371 | usb_flush_flag2 = usb_flush_flag; //in case flushed 372 | 373 | //'manually' change timings if requested 374 | if( pchost_tim4_Period ) 375 | { 376 | htim4.Instance->ARR = pchost_tim4_Period; 377 | } 378 | if( pchost_tim2_Pulse ) 379 | { 380 | htim2.Instance->CCR1 = pchost_tim2_Pulse; 381 | htim2.Instance->ARR = pchost_tim2_Pulse + 50; //ARR > CCR1 382 | } 383 | 384 | 385 | // start TIM 2,3,4 386 | HAL_TIM_OnePulse_Start (&htim4, TIM_CHANNEL_1); //SCK generator 387 | HAL_TIM_OnePulse_Start_IT (&htim2, TIM_CHANNEL_2); //Frame timer, ARR is duration of TMO (CCR1+1), CCR1 = TMO delay 388 | htim2.Instance->EGR |= TIM_EGR_UG; // UG=1, clears counter, CEN =0, let TIM3 ISR restart TIM2 to sync properly 389 | __HAL_TIM_DISABLE_IT(&htim2, TIM_IT_CC1); //HAL turns on both CH1,2, turn off CH1 intr 390 | tim2_ch1_isr_ctr = 0; //reset before enabling TIM2 ISR 391 | 392 | HAL_TIM_IC_Start_IT (&htim3, TIM_CHANNEL_1); //start SPI byte counter 393 | htim3.Instance->CR1 |= TIM_CR1_URS; //only CNT generates INT 394 | 395 | 396 | //wait for Eof to sync to Neopixel bitstream 397 | while( tim2_ch1_isr_ctr == 0 ) 398 | { 399 | if( calc_ts_et( HAL_GetTick(), led_heartbeat ) >= 200 ) //less fast pulse, in case SPI bitstream stopped. 400 | { 401 | HAL_GPIO_TogglePin(LED_GPIO_Port , LED_Pin ); 402 | led_heartbeat = HAL_GetTick(); 403 | } 404 | } 405 | 406 | //Will begin a new frame, reset input counters before next frame starts. 407 | __disable_irq(); 408 | frame_byte_ctr = 0; 409 | spi_rx_ctr = 0; 410 | usb_bytes_tx_ctr = 0; 411 | dmaout_ctr = SPI_BSIZE; 412 | __enable_irq(); 413 | 414 | //start SPI Rx 415 | HAL_SPI_Receive_DMA ( &hspi2, spi_rx_buffer, SPI_BSIZE); 416 | __HAL_DMA_ENABLE_IT( &hdma_spi2_rx, DMA_IT_TC ); 417 | 418 | 419 | /* USER CODE END 2 */ 420 | 421 | /* Infinite loop */ 422 | /* USER CODE BEGIN WHILE */ 423 | while (1) 424 | { 425 | /* USER CODE END WHILE */ 426 | 427 | /* USER CODE BEGIN 3 */ 428 | /* 429 | Read SPI DMA downcounter, if changed convert to index, determine bytes to send to USB. 430 | Assumes did not wrap from the last read, otherwise buffer overrun (dbg_frame_overflow). 431 | Ignore CNDTR=0 as this means counter reload in progress -- not sure if our code ever sees this. 432 | */ 433 | 434 | dmain_ctr = __HAL_DMA_GET_COUNTER( &hdma_spi2_rx ); // DMA register CNDTR is decremented 435 | 436 | if( (dmain_ctr > 0) && (dmain_ctr != dmaout_ctr) ) 437 | { 438 | if( dmaout_ctr > dmain_ctr ) 439 | { 440 | n = dmaout_ctr - dmain_ctr; 441 | next_ctr = dmain_ctr; 442 | } 443 | else // dmain_ctr > dmaout_ctr, circular wrap occured, in_cnt =>0 then reloads to SPI_BSIZE 444 | { 445 | //do 2 transfers, 1st empties remaining buffer, then wraps, then perform this loop again next poll 446 | n = dmaout_ctr; //remaining bytes 447 | next_ctr = SPI_BSIZE; //reload out ctr 448 | } 449 | dmaout_idx = SPI_BSIZE - dmaout_ctr; //convert to index 0..SPI_BSIZE-1 450 | dmaout_ctr = next_ctr; 451 | 452 | //blocking write to USB if waiting for previous transfer, if PC not connected/disconnects we'll overflow and stay in this loop. 453 | usb_busy = 0; 454 | while( (e = CDC_Transmit_FS( &spi_rx_buffer[dmaout_idx], n) ) != USBD_OK) 455 | { 456 | if( usb_flush_flag2 != usb_flush_flag ) 457 | { 458 | //PC wants to re-sync, while we're waiting 459 | CDC_Flush_FS(); 460 | goto label_resync; 461 | } 462 | 463 | if(e == USBD_BUSY) 464 | { 465 | usb_busy++; //in case waiting for last packet 466 | } 467 | else 468 | usb_fail++; //some low-level failure, fairly rare. 469 | } 470 | 471 | 472 | if( e == USBD_OK ) 473 | { 474 | usb_bytes_tx_ctr += n; //this may wrap 475 | } 476 | } 477 | 478 | if( usb_flush_flag2 != usb_flush_flag ) 479 | { 480 | //PC wants to re-sync 481 | CDC_Flush_FS(); 482 | goto label_resync; 483 | } 484 | 485 | //normal heartbeat LED 486 | if( calc_ts_et( HAL_GetTick(), led_heartbeat ) >= 500 ) 487 | { 488 | HAL_GPIO_TogglePin(LED_GPIO_Port , LED_Pin ); 489 | led_heartbeat = HAL_GetTick(); 490 | } 491 | } 492 | /* USER CODE END 3 */ 493 | } 494 | 495 | /** 496 | * @brief System Clock Configuration 497 | * @retval None 498 | */ 499 | void SystemClock_Config(void) 500 | { 501 | RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 502 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 503 | RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; 504 | 505 | /** Initializes the RCC Oscillators according to the specified parameters 506 | * in the RCC_OscInitTypeDef structure. 507 | */ 508 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; 509 | RCC_OscInitStruct.HSEState = RCC_HSE_ON; 510 | RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; 511 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; 512 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 513 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; 514 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; 515 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 516 | { 517 | Error_Handler(); 518 | } 519 | /** Initializes the CPU, AHB and APB buses clocks 520 | */ 521 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 522 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; 523 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 524 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 525 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; 526 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 527 | 528 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) 529 | { 530 | Error_Handler(); 531 | } 532 | PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; 533 | PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; 534 | if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) 535 | { 536 | Error_Handler(); 537 | } 538 | } 539 | 540 | /** 541 | * @brief SPI2 Initialization Function 542 | * @param None 543 | * @retval None 544 | */ 545 | static void MX_SPI2_Init(void) 546 | { 547 | 548 | /* USER CODE BEGIN SPI2_Init 0 */ 549 | 550 | /* USER CODE END SPI2_Init 0 */ 551 | 552 | /* USER CODE BEGIN SPI2_Init 1 */ 553 | 554 | /* USER CODE END SPI2_Init 1 */ 555 | /* SPI2 parameter configuration*/ 556 | hspi2.Instance = SPI2; 557 | hspi2.Init.Mode = SPI_MODE_SLAVE; 558 | hspi2.Init.Direction = SPI_DIRECTION_2LINES_RXONLY; 559 | hspi2.Init.DataSize = SPI_DATASIZE_8BIT; 560 | hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; 561 | hspi2.Init.CLKPhase = SPI_PHASE_2EDGE; 562 | hspi2.Init.NSS = SPI_NSS_SOFT; 563 | hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; 564 | hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; 565 | hspi2.Init.TIMode = SPI_TIMODE_DISABLE; 566 | hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; 567 | hspi2.Init.CRCPolynomial = 10; 568 | if (HAL_SPI_Init(&hspi2) != HAL_OK) 569 | { 570 | Error_Handler(); 571 | } 572 | /* USER CODE BEGIN SPI2_Init 2 */ 573 | 574 | /* USER CODE END SPI2_Init 2 */ 575 | 576 | } 577 | 578 | /** 579 | * @brief TIM2 Initialization Function 580 | * @param None 581 | * @retval None 582 | */ 583 | static void MX_TIM2_Init(void) 584 | { 585 | 586 | /* USER CODE BEGIN TIM2_Init 0 */ 587 | 588 | /* USER CODE END TIM2_Init 0 */ 589 | 590 | TIM_SlaveConfigTypeDef sSlaveConfig = {0}; 591 | TIM_MasterConfigTypeDef sMasterConfig = {0}; 592 | TIM_OC_InitTypeDef sConfigOC = {0}; 593 | 594 | /* USER CODE BEGIN TIM2_Init 1 */ 595 | 596 | /* USER CODE END TIM2_Init 1 */ 597 | htim2.Instance = TIM2; 598 | htim2.Init.Prescaler = 0; 599 | htim2.Init.CounterMode = TIM_COUNTERMODE_UP; 600 | htim2.Init.Period = 3650; 601 | htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; 602 | htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; 603 | if (HAL_TIM_Base_Init(&htim2) != HAL_OK) 604 | { 605 | Error_Handler(); 606 | } 607 | if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) 608 | { 609 | Error_Handler(); 610 | } 611 | if (HAL_TIM_OnePulse_Init(&htim2, TIM_OPMODE_SINGLE) != HAL_OK) 612 | { 613 | Error_Handler(); 614 | } 615 | sSlaveConfig.SlaveMode = TIM_SLAVEMODE_TRIGGER; 616 | sSlaveConfig.InputTrigger = TIM_TS_TI1FP1; 617 | sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_RISING; 618 | sSlaveConfig.TriggerFilter = 0; 619 | if (HAL_TIM_SlaveConfigSynchro(&htim2, &sSlaveConfig) != HAL_OK) 620 | { 621 | Error_Handler(); 622 | } 623 | sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; 624 | sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; 625 | if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) 626 | { 627 | Error_Handler(); 628 | } 629 | sConfigOC.OCMode = TIM_OCMODE_PWM2; 630 | sConfigOC.Pulse = 3602; 631 | sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; 632 | sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; 633 | if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) 634 | { 635 | Error_Handler(); 636 | } 637 | /* USER CODE BEGIN TIM2_Init 2 */ 638 | 639 | /* USER CODE END TIM2_Init 2 */ 640 | HAL_TIM_MspPostInit(&htim2); 641 | 642 | } 643 | 644 | /** 645 | * @brief TIM3 Initialization Function 646 | * @param None 647 | * @retval None 648 | */ 649 | static void MX_TIM3_Init(void) 650 | { 651 | 652 | /* USER CODE BEGIN TIM3_Init 0 */ 653 | 654 | /* USER CODE END TIM3_Init 0 */ 655 | 656 | TIM_SlaveConfigTypeDef sSlaveConfig = {0}; 657 | TIM_MasterConfigTypeDef sMasterConfig = {0}; 658 | TIM_OC_InitTypeDef sConfigOC = {0}; 659 | 660 | /* USER CODE BEGIN TIM3_Init 1 */ 661 | 662 | /* USER CODE END TIM3_Init 1 */ 663 | htim3.Instance = TIM3; 664 | htim3.Init.Prescaler = 0; 665 | htim3.Init.CounterMode = TIM_COUNTERMODE_UP; 666 | htim3.Init.Period = 7; 667 | htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; 668 | htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; 669 | if (HAL_TIM_Base_Init(&htim3) != HAL_OK) 670 | { 671 | Error_Handler(); 672 | } 673 | if (HAL_TIM_OC_Init(&htim3) != HAL_OK) 674 | { 675 | Error_Handler(); 676 | } 677 | sSlaveConfig.SlaveMode = TIM_SLAVEMODE_EXTERNAL1; 678 | sSlaveConfig.InputTrigger = TIM_TS_ITR3; 679 | if (HAL_TIM_SlaveConfigSynchro(&htim3, &sSlaveConfig) != HAL_OK) 680 | { 681 | Error_Handler(); 682 | } 683 | sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; 684 | sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; 685 | if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK) 686 | { 687 | Error_Handler(); 688 | } 689 | sConfigOC.OCMode = TIM_OCMODE_ACTIVE; 690 | sConfigOC.Pulse = 1; 691 | sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; 692 | sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; 693 | if (HAL_TIM_OC_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) 694 | { 695 | Error_Handler(); 696 | } 697 | /* USER CODE BEGIN TIM3_Init 2 */ 698 | 699 | /* USER CODE END TIM3_Init 2 */ 700 | HAL_TIM_MspPostInit(&htim3); 701 | 702 | } 703 | 704 | /** 705 | * @brief TIM4 Initialization Function 706 | * @param None 707 | * @retval None 708 | */ 709 | static void MX_TIM4_Init(void) 710 | { 711 | 712 | /* USER CODE BEGIN TIM4_Init 0 */ 713 | 714 | /* USER CODE END TIM4_Init 0 */ 715 | 716 | TIM_SlaveConfigTypeDef sSlaveConfig = {0}; 717 | TIM_MasterConfigTypeDef sMasterConfig = {0}; 718 | TIM_OC_InitTypeDef sConfigOC = {0}; 719 | 720 | /* USER CODE BEGIN TIM4_Init 1 */ 721 | 722 | /* USER CODE END TIM4_Init 1 */ 723 | htim4.Instance = TIM4; 724 | htim4.Init.Prescaler = 0; 725 | htim4.Init.CounterMode = TIM_COUNTERMODE_UP; 726 | htim4.Init.Period = 37; 727 | htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; 728 | htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; 729 | if (HAL_TIM_Base_Init(&htim4) != HAL_OK) 730 | { 731 | Error_Handler(); 732 | } 733 | if (HAL_TIM_PWM_Init(&htim4) != HAL_OK) 734 | { 735 | Error_Handler(); 736 | } 737 | if (HAL_TIM_OnePulse_Init(&htim4, TIM_OPMODE_SINGLE) != HAL_OK) 738 | { 739 | Error_Handler(); 740 | } 741 | sSlaveConfig.SlaveMode = TIM_SLAVEMODE_TRIGGER; 742 | sSlaveConfig.InputTrigger = TIM_TS_TI2FP2; 743 | sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_RISING; 744 | sSlaveConfig.TriggerFilter = 0; 745 | if (HAL_TIM_SlaveConfigSynchro(&htim4, &sSlaveConfig) != HAL_OK) 746 | { 747 | Error_Handler(); 748 | } 749 | sMasterConfig.MasterOutputTrigger = TIM_TRGO_OC1; 750 | sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; 751 | if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK) 752 | { 753 | Error_Handler(); 754 | } 755 | sConfigOC.OCMode = TIM_OCMODE_PWM2; 756 | sConfigOC.Pulse = 1; 757 | sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; 758 | sConfigOC.OCFastMode = TIM_OCFAST_ENABLE; 759 | if (HAL_TIM_PWM_ConfigChannel(&htim4, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) 760 | { 761 | Error_Handler(); 762 | } 763 | /* USER CODE BEGIN TIM4_Init 2 */ 764 | 765 | /* USER CODE END TIM4_Init 2 */ 766 | HAL_TIM_MspPostInit(&htim4); 767 | 768 | } 769 | 770 | /** 771 | * Enable DMA controller clock 772 | */ 773 | static void MX_DMA_Init(void) 774 | { 775 | 776 | /* DMA controller clock enable */ 777 | __HAL_RCC_DMA1_CLK_ENABLE(); 778 | 779 | /* DMA interrupt init */ 780 | /* DMA1_Channel4_IRQn interrupt configuration */ 781 | HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0); 782 | HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn); 783 | 784 | } 785 | 786 | /** 787 | * @brief GPIO Initialization Function 788 | * @param None 789 | * @retval None 790 | */ 791 | static void MX_GPIO_Init(void) 792 | { 793 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 794 | 795 | /* GPIO Ports Clock Enable */ 796 | __HAL_RCC_GPIOC_CLK_ENABLE(); 797 | __HAL_RCC_GPIOD_CLK_ENABLE(); 798 | __HAL_RCC_GPIOA_CLK_ENABLE(); 799 | __HAL_RCC_GPIOB_CLK_ENABLE(); 800 | 801 | /*Configure GPIO pin Output Level */ 802 | HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); 803 | 804 | /*Configure GPIO pin : LED_Pin */ 805 | GPIO_InitStruct.Pin = LED_Pin; 806 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 807 | GPIO_InitStruct.Pull = GPIO_NOPULL; 808 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 809 | HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); 810 | 811 | } 812 | 813 | /* USER CODE BEGIN 4 */ 814 | 815 | /* USER CODE END 4 */ 816 | 817 | /** 818 | * @brief This function is executed in case of error occurrence. 819 | * @retval None 820 | */ 821 | void Error_Handler(void) 822 | { 823 | /* USER CODE BEGIN Error_Handler_Debug */ 824 | /* User can add his own implementation to report the HAL error return state */ 825 | __disable_irq(); 826 | while (1) 827 | { 828 | } 829 | /* USER CODE END Error_Handler_Debug */ 830 | } 831 | 832 | #ifdef USE_FULL_ASSERT 833 | /** 834 | * @brief Reports the name of the source file and the source line number 835 | * where the assert_param error has occurred. 836 | * @param file: pointer to the source file name 837 | * @param line: assert_param error line source number 838 | * @retval None 839 | */ 840 | void assert_failed(uint8_t *file, uint32_t line) 841 | { 842 | /* USER CODE BEGIN 6 */ 843 | /* User can add his own implementation to report the file name and line number, 844 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 845 | /* USER CODE END 6 */ 846 | } 847 | #endif /* USE_FULL_ASSERT */ 848 | 849 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 850 | -------------------------------------------------------------------------------- /stripsim.py: -------------------------------------------------------------------------------- 1 | """ 2 | stripsim.py 3 | 4 | Graphical NeoPixel LED strip emulator. 5 | Connect target's Neopixel output to NeoPill's (STM32 Bluepill) inputs. 6 | Connect PC via USB to NeoPill for Neopixel->USB serial bridge. Find the appropriate COM port to use. 7 | 8 | This code reads a yaml file for configuration. 9 | Each LED is a simple rectangle or circle, with an optional small gap in-between. 10 | 11 | Using a COM port, we sync to the pixel bitstream. Once sync'd each frame of pixel data is gamma-corrected and displayed as fast as possible. 12 | Display frame rate dictated by the target device and config item 'fps_limit'. However, many LCD monitors only go to 60Hz. 13 | 14 | Simple runtime controls (window active): 15 | mouseclick : shows runtime stats 16 | Up/Dn arrow: adjust gamma 17 | 's': re-sync to the bitstream 18 | 19 | COM port not connecting? Go into Windows DM and "disable/enable" the port. 20 | This may be required after Bluepill reset. 21 | 22 | Need to emulate with different bitstream timing? 23 | timing_T1H, timing_RES config items. 24 | 25 | For python 3.8.1 26 | 27 | R. Elwin 5/2021 28 | """ 29 | import threading 30 | import queue 31 | from typing import List, Any 32 | import yaml # 5.4.1 33 | import pygame # 2.0! 34 | # from pygame.locals import * # doing this floods debug with symbols so specify ones we actually use 35 | from pygame.locals import QUIT, MOUSEBUTTONDOWN, KEYDOWN, K_UP, K_DOWN, K_s 36 | import os 37 | import time 38 | import sys 39 | import serial # 3.5 40 | 41 | os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (20, 20) # default window position 42 | 43 | 44 | # Init USB serial port, send optional timing string 45 | def serial_init(com_port, timing_mod=None): 46 | try: 47 | ser = serial.Serial(com_port, baudrate=12000000, timeout=None) # max USB speed, read timeout adjusted for debugging, timeout = None waits forever 48 | if timing_mod is not None: 49 | ser.write(bytearray(timing_mod.encode('utf-8'))) # send timing mod 50 | # ser.write(bytearray("T 38 3601".encode('utf-8'))) # test timing mod 51 | time.sleep(0.25) # can't use flushInput() so delay instead 52 | return ser 53 | 54 | except serial.SerialException: 55 | print("SerialException: Can't Open", com_port) 56 | return None 57 | 58 | 59 | # sync with NeoPill, may fail occasionally... 60 | def serial_sync(ser): 61 | ser.write(bytearray("F".encode('utf-8'))) # send 'Flush' byte 62 | ser.reset_input_buffer() # having issues with USB data not clearing (on Windows10) so loop a few times 63 | for d in range(0, 3): 64 | time.sleep(0.25) # wait for USB drain 65 | ser.reset_input_buffer() # in case frame data in the pipe 66 | ser.write(bytearray("S".encode('utf-8'))) # send sync start byte 67 | 68 | 69 | class LEDStrip(object): 70 | """ 71 | reads YAML config 72 | configures pygame window display 73 | generates LED display 74 | formats LED frames to window 75 | """ 76 | # indicies for LED array surf_obj[0], rect[1], color[2] 77 | IDX_surf_obj = 0 78 | IDX_rect = 1 79 | IDX_color = 2 80 | 81 | def __init__(self, config_path): 82 | self.ledarray: List[Any] = [] # LED graphics elements 83 | self.led_display_format = None 84 | self.led_show = None 85 | self.screen = None 86 | self.ser = None 87 | self.serial_port = None 88 | self.timing_mod_T1H = None 89 | self.timing_mod_RES = None 90 | self.timing_mod = None 91 | self.strip_type = {} # data from yaml file 92 | self.matrix_type = {} # data from yaml file 93 | self.led_count = 0 94 | self.led_width = 1 95 | self.led_height = 1 96 | self.radius = 0 97 | self.center = 0 98 | self.gamma = 0.25 # LEDs are much brighter than LCD, smaller gamma=brighter. HW gamma not supported. 99 | self.frame_size = 0 100 | self.display_rate_limit = 1 / 120 # 120Hz display rate limit default, might be too fast still 101 | self.led_create = None 102 | self.generate_display = None 103 | self.read_config(config_path) 104 | self.format_timing_mod() 105 | self.generate_display() 106 | self.led_create(self.led_count) # only using 1 strip/matrix at a time so far 107 | 108 | # load the yaml file into ledlist{} 109 | def read_config(self, config_path): 110 | with open(config_path) as f: 111 | data = yaml.load(f, Loader=yaml.FullLoader) 112 | # print("Key: Value") 113 | for key, value in data.items(): 114 | if key == "strip": 115 | self.strip_type = value 116 | self.generate_display = self.generate_display_strip 117 | # print(self.strip_type) 118 | elif key == "matrix": 119 | self.matrix_type = value 120 | self.generate_display = self.generate_display_matrix 121 | elif key == "timing_T1H": 122 | self.timing_mod_T1H = value # modified timing string 123 | print("Using Modified T1H timing", f"{value}") 124 | elif key == "timing_RES": 125 | self.timing_mod_RES = value # modified timing string 126 | print("Using Modified RES timing", f"{value}") 127 | elif key == "serial_port": 128 | self.serial_port = value 129 | elif key == "fps_limit": 130 | self.display_rate_limit = 1 / (value * 1.1) # use time per frame, plus 10% slop 131 | 132 | # format timing mod msg, specific to NeoPill timing. Calcs TIM2,4 delay, in clock counts (not ns). 133 | def format_timing_mod(self): 134 | cpu_clk = 13.88 # 13.88ns clk cycle, 1/72MHz 135 | T1H = 0 136 | if self.timing_mod_T1H is not None: 137 | T1H = int((int(self.timing_mod_T1H) - 3 * cpu_clk) / cpu_clk) # TIM4 ARR has 3 clk delay 138 | RES = 0 139 | if self.timing_mod_RES is not None: 140 | RES = int(int(self.timing_mod_RES) / cpu_clk) # TIM2 CCR1 count 141 | # format a timing mod if using either 142 | if self.timing_mod_T1H is not None or self.timing_mod_RES is not None: 143 | self.timing_mod = "T " + str(T1H) + " " + str(RES) 144 | 145 | # generate pygame display window filled with LED strip 146 | def generate_display_strip(self): 147 | self.led_create = self.led_create_strip 148 | os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (self.strip_type[0]['wposx'], self.strip_type[0]['wposy']) # window position 149 | self.led_count = self.strip_type[0]['num'] 150 | self.led_width = int(self.strip_type[0]['length'] / self.strip_type[0]['num']) - self.strip_type[0]['gap'] 151 | strip_width = (self.led_width + self.strip_type[0]['gap']) * self.strip_type[0]['num'] 152 | size = (strip_width, self.strip_type[0]['height']) # create a strip 153 | self.screen = pygame.display.set_mode(size, flags=0, display=0) # vsync=0 default 154 | pygame.display.set_caption(self.strip_type[0]['wname']) 155 | print(pygame.display.get_driver()) 156 | print(pygame.display.Info()) 157 | 158 | # populate LED array with LED surface objects, filled circles or plain squares 159 | def led_create_strip(self, num): 160 | for i in range(0, num): 161 | surf = pygame.Surface((self.led_width, self.strip_type[0]['height'])) # surface object 162 | rect = surf.get_rect() 163 | rect.left = i * (self.led_width + self.strip_type[0]['gap']) 164 | rect.top = 0 165 | color = pygame.Color(0, (i * 3) % 256, 10, 255) # initial RGBA color, also fills in Alpha of RGBA 166 | self.ledarray.append((surf, rect, color)) # surf_obj[0], rect[1], color[2] 167 | self.led_format(self.strip_type[0]['style'], self.strip_type[0]['ledcolor'], num) 168 | 169 | # generate pygame display window filled with LED matrix 170 | def generate_display_matrix(self): 171 | self.led_create = self.led_create_matrix 172 | os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (self.matrix_type[0]['wposx'], self.matrix_type[0]['wposy']) # window position 173 | self.led_count = self.matrix_type[0]['matrix_w'] * self.matrix_type[0]['matrix_h'] 174 | self.led_width = int(self.matrix_type[0]['length'] / self.matrix_type[0]['matrix_w']) - self.matrix_type[0]['gap'] # gap is symmetric side & bottom 175 | strip_width = (self.led_width + self.matrix_type[0]['gap']) * self.matrix_type[0]['matrix_w'] - self.matrix_type[0]['gap'] 176 | self.led_height = int(self.matrix_type[0]['height'] / self.matrix_type[0]['matrix_h']) - self.matrix_type[0]['gap'] 177 | strip_height = (self.led_height + self.matrix_type[0]['gap']) * self.matrix_type[0]['matrix_h'] - self.matrix_type[0]['gap'] 178 | size = (strip_width, strip_height) # display (w,h), adjusted width, height 179 | self.screen = pygame.display.set_mode(size, flags=0, display=0) # vsync=0 default 180 | pygame.display.set_caption(self.matrix_type[0]['wname']) 181 | print(pygame.display.get_driver()) 182 | print(pygame.display.Info()) 183 | 184 | # matrix option, populate LED array with LED surface objects, filled circles or plain squares 185 | def led_create_matrix(self, num): 186 | for j in range(0, self.matrix_type[0]['matrix_h']): 187 | for i in range(0, self.matrix_type[0]['matrix_w']): 188 | surf = pygame.Surface((self.led_width, self.led_height)) # surface object 189 | rect = surf.get_rect() 190 | rect.left = i * (self.led_width + self.matrix_type[0]['gap']) 191 | rect.top = j * (self.led_height + self.matrix_type[0]['gap']) 192 | color = pygame.Color(j, (i * 3) % 256, 10, 255) # initial RGBA color, also fills in Alpha of RGBA 193 | self.ledarray.append((surf, rect, color)) # surf_obj[0], rect[1], color[2] 194 | self.led_format(self.matrix_type[0]['style'], self.matrix_type[0]['ledcolor'], num) 195 | 196 | # assign LED style, color order, frame size 197 | def led_format(self, style, ledcolor, num): 198 | if style == 'circle': 199 | self.led_show = self.led_show_circle 200 | # use ledarray[0] to get rect attributes to calc circle radius and center 201 | self.radius = min(self.ledarray[0][LEDStrip.IDX_rect].h, self.ledarray[0][LEDStrip.IDX_rect].w) / 2 202 | self.center = self.ledarray[0][LEDStrip.IDX_rect].w / 2, self.ledarray[0][LEDStrip.IDX_rect].h / 2 203 | else: 204 | self.led_show = self.led_show_rect 205 | if ledcolor == 'GRBW': 206 | self.led_display_format = self.led_frame_copy_GRBW 207 | self.frame_size = 4 * num 208 | elif ledcolor == 'GRB': 209 | self.led_display_format = self.led_frame_copy_GRB 210 | self.frame_size = 3 * num 211 | else: 212 | print("Error! No LED format, ledcolor: not assigned") 213 | 214 | # blit rectangular LEDs, then display 215 | def led_show_rect(self): 216 | for led in self.ledarray: 217 | color = led[LEDStrip.IDX_color].correct_gamma(self.gamma) # adjust gamma for each LED 218 | led[LEDStrip.IDX_surf_obj].fill(color) # color square 219 | self.screen.blit(led[LEDStrip.IDX_surf_obj], led[LEDStrip.IDX_rect]) 220 | pygame.display.flip() 221 | 222 | # blit circular LEDs, then display 223 | def led_show_circle(self): 224 | for led in self.ledarray: 225 | color = led[LEDStrip.IDX_color].correct_gamma(self.gamma) # adjust gamma for each LED 226 | pygame.draw.circle(led[LEDStrip.IDX_surf_obj], color, self.center, self.radius) 227 | self.screen.blit(led[LEDStrip.IDX_surf_obj], led[LEDStrip.IDX_rect]) 228 | pygame.display.flip() 229 | 230 | # copy a frame of GRB LED data to RGBA LED array 231 | def led_frame_copy_GRB(self, led_data_frame): 232 | i = 0 233 | for k in range(0, self.led_count): 234 | self.ledarray[k][LEDStrip.IDX_color][1] = led_data_frame[i] # G 235 | i += 1 236 | self.ledarray[k][LEDStrip.IDX_color][0] = led_data_frame[i] # R 237 | i += 1 238 | self.ledarray[k][LEDStrip.IDX_color][2] = led_data_frame[i] # B 239 | i += 1 240 | 241 | # copy a frame of GRBW LED data to RGBA LED array 242 | def led_frame_copy_GRBW(self, led_data_frame): 243 | i = 0 244 | for k in range(0, self.led_count): 245 | self.ledarray[k][LEDStrip.IDX_color][1] = led_data_frame[i] # G 246 | i += 1 247 | self.ledarray[k][LEDStrip.IDX_color][0] = led_data_frame[i] # R 248 | i += 1 249 | self.ledarray[k][LEDStrip.IDX_color][2] = led_data_frame[i] # B 250 | i += 1 251 | w = led_data_frame[i] 252 | # what to do w/white LED? just saturate add to each color 253 | if w > 0: 254 | for j in range(0, 3): 255 | c = self.ledarray[k][LEDStrip.IDX_color][j] + w 256 | if c > 255: 257 | c = 255 258 | self.ledarray[k][LEDStrip.IDX_color][j] = c 259 | # ledarray[k][5][3] = 255 # alpha already populated 260 | i += 1 261 | 262 | 263 | class SerialReader(object): 264 | """ 265 | from Miniterm Terminal application. 266 | Copy blksize data bytes from serial port to Queue q 267 | """ 268 | 269 | def __init__(self, serial_instance, q, blksize): 270 | self.serial = serial_instance 271 | self.alive = None 272 | self._reader_alive = None 273 | self.receiver_thread = None 274 | self.q = q 275 | self.blksize = blksize 276 | 277 | def _start_reader(self): 278 | """Start reader thread""" 279 | self._reader_alive = True 280 | self.receiver_thread = threading.Thread(target=self.reader, name='rx') 281 | self.receiver_thread.daemon = True 282 | self.receiver_thread.start() 283 | 284 | def _stop_reader(self): 285 | """Stop reader thread only, wait for clean exit of thread""" 286 | self._reader_alive = False 287 | self.receiver_thread.join() 288 | 289 | def start(self): 290 | """start worker threads""" 291 | self.alive = True 292 | self._start_reader() 293 | 294 | def stop(self): 295 | """set flag to stop worker threads""" 296 | self.alive = False 297 | self._stop_reader() 298 | 299 | def join(self, transmit_only=False): 300 | """wait for worker threads to terminate""" 301 | self.receiver_thread.join() 302 | 303 | def close(self): 304 | self.serial.close() 305 | 306 | def reader(self): 307 | """loop and queue serial data frames""" 308 | try: 309 | while self.alive and self._reader_alive: 310 | data = self.serial.read(self.blksize) 311 | self.q.put(data) 312 | 313 | except serial.SerialException: 314 | self.alive = False 315 | raise # XXX handle instead of re-raise 316 | 317 | ##=============================================== 318 | 319 | 320 | if __name__ == '__main__': 321 | if len(sys.argv) < 2: 322 | print("Missing config.yaml") 323 | exit(-2) 324 | print("pyserial ver:", serial.__version__) 325 | print("pyYAML ver:", yaml.__version__) 326 | pygame.init() 327 | strip = LEDStrip(sys.argv[1]) 328 | strip.led_show() 329 | ser = serial_init(strip.serial_port, strip.timing_mod) 330 | if ser is None: 331 | exit(-1) # many reasons to not connect 332 | print("Using COM Port:", ser.name) 333 | 334 | dataQueue = queue.Queue(1024) # input data Q, in frames. Rather large in case you're moving the window. 335 | sr = SerialReader(ser, dataQueue, strip.frame_size) 336 | # initial sync, if this fails press then 's' ... 337 | sr.start() 338 | serial_sync(ser) # resync and flush 339 | 340 | maxqsz = 0 341 | frames_displayed = 0 342 | frames_read = 0 343 | t = time.perf_counter() 344 | fps_t = time.perf_counter() 345 | 346 | while True: 347 | if dataQueue.qsize() > 0: 348 | frame_data = dataQueue.get() 349 | frames_read += 1 350 | # rate limit display 351 | fps_et = time.perf_counter() - fps_t 352 | if fps_et >= strip.display_rate_limit: 353 | fps_t = time.perf_counter() 354 | strip.led_display_format(frame_data) 355 | strip.led_show() 356 | frames_displayed += 1 357 | if dataQueue.qsize() > maxqsz: 358 | maxqsz = dataQueue.qsize() 359 | else: 360 | time.sleep(0.0001) # let input stream dictate FPS, but need a small sleep to keep CPU% lower 361 | 362 | # Cycles through all occurring events 363 | for event in pygame.event.get(): 364 | if event.type == QUIT: 365 | pygame.quit() 366 | sys.exit() 367 | elif event.type == MOUSEBUTTONDOWN: # show some stats 368 | et = time.perf_counter() - t 369 | print("maxQ=", maxqsz, ", fps displayed=", int(frames_displayed / et), ", displayed rate b/s", int(frames_displayed / et) * strip.frame_size, ", input rate b/s=", 370 | int(frames_read / et) * strip.frame_size) 371 | t = time.perf_counter() 372 | frames_displayed = 0 373 | frames_read = 0 374 | maxqsz = 0 375 | elif event.type == KEYDOWN: # change gamma 376 | if event.key == K_UP: 377 | strip.gamma -= 0.01 378 | elif event.key == K_DOWN: 379 | strip.gamma += 0.01 380 | elif event.key == K_s: 381 | print("Sync") 382 | sr.stop() 383 | serial_sync(ser) # try to resync, flush 384 | sr.start() 385 | 386 | if strip.gamma > 1: 387 | strip.gamma = 1 388 | elif strip.gamma < 0: 389 | strip.gamma = 0.1 390 | print('{:.2f}'.format(strip.gamma)) 391 | -------------------------------------------------------------------------------- /usbd_cdc_if.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : usbd_cdc_if.c 5 | * @version : v2.0_Cube 6 | * @brief : Usb device for Virtual Com Port. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© Copyright (c) 2021 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under Ultimate Liberty license 14 | * SLA0044, the "License"; You may not use this file except in compliance with 15 | * the License. You may obtain a copy of the License at: 16 | * www.st.com/SLA0044 17 | * 18 | ****************************************************************************** 19 | */ 20 | /* USER CODE END Header */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "usbd_cdc_if.h" 24 | 25 | /* USER CODE BEGIN INCLUDE */ 26 | 27 | /* USER CODE END INCLUDE */ 28 | 29 | /* Private typedef -----------------------------------------------------------*/ 30 | /* Private define ------------------------------------------------------------*/ 31 | /* Private macro -------------------------------------------------------------*/ 32 | 33 | /* USER CODE BEGIN PV */ 34 | /* Private variables ---------------------------------------------------------*/ 35 | 36 | /* USER CODE END PV */ 37 | 38 | /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY 39 | * @brief Usb device library. 40 | * @{ 41 | */ 42 | 43 | /** @addtogroup USBD_CDC_IF 44 | * @{ 45 | */ 46 | 47 | /** @defgroup USBD_CDC_IF_Private_TypesDefinitions USBD_CDC_IF_Private_TypesDefinitions 48 | * @brief Private types. 49 | * @{ 50 | */ 51 | 52 | /* USER CODE BEGIN PRIVATE_TYPES */ 53 | 54 | /* USER CODE END PRIVATE_TYPES */ 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @defgroup USBD_CDC_IF_Private_Defines USBD_CDC_IF_Private_Defines 61 | * @brief Private defines. 62 | * @{ 63 | */ 64 | 65 | /* USER CODE BEGIN PRIVATE_DEFINES */ 66 | /* USER CODE END PRIVATE_DEFINES */ 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | /** @defgroup USBD_CDC_IF_Private_Macros USBD_CDC_IF_Private_Macros 73 | * @brief Private macros. 74 | * @{ 75 | */ 76 | 77 | /* USER CODE BEGIN PRIVATE_MACRO */ 78 | 79 | /* USER CODE END PRIVATE_MACRO */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /** @defgroup USBD_CDC_IF_Private_Variables USBD_CDC_IF_Private_Variables 86 | * @brief Private variables. 87 | * @{ 88 | */ 89 | /* Create buffer for reception and transmission */ 90 | /* It's up to user to redefine and/or remove those define */ 91 | /** Received data over USB are stored in this buffer */ 92 | uint8_t UserRxBufferFS[APP_RX_DATA_SIZE]; 93 | 94 | /** Data to send over USB CDC are stored in this buffer */ 95 | uint8_t UserTxBufferFS[APP_TX_DATA_SIZE]; 96 | 97 | /* USER CODE BEGIN PRIVATE_VARIABLES */ 98 | 99 | /* USER CODE END PRIVATE_VARIABLES */ 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | /** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables 106 | * @brief Public variables. 107 | * @{ 108 | */ 109 | 110 | extern USBD_HandleTypeDef hUsbDeviceFS; 111 | 112 | /* USER CODE BEGIN EXPORTED_VARIABLES */ 113 | 114 | /* USER CODE END EXPORTED_VARIABLES */ 115 | 116 | /** 117 | * @} 118 | */ 119 | 120 | /** @defgroup USBD_CDC_IF_Private_FunctionPrototypes USBD_CDC_IF_Private_FunctionPrototypes 121 | * @brief Private functions declaration. 122 | * @{ 123 | */ 124 | 125 | static int8_t CDC_Init_FS(void); 126 | static int8_t CDC_DeInit_FS(void); 127 | static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length); 128 | static int8_t CDC_Receive_FS(uint8_t* pbuf, uint32_t *Len); 129 | 130 | /* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */ 131 | 132 | /* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */ 133 | 134 | /** 135 | * @} 136 | */ 137 | 138 | USBD_CDC_ItfTypeDef USBD_Interface_fops_FS = 139 | { 140 | CDC_Init_FS, 141 | CDC_DeInit_FS, 142 | CDC_Control_FS, 143 | CDC_Receive_FS 144 | }; 145 | 146 | /* Private functions ---------------------------------------------------------*/ 147 | /** 148 | * @brief Initializes the CDC media low layer over the FS USB IP 149 | * @retval USBD_OK if all operations are OK else USBD_FAIL 150 | */ 151 | static int8_t CDC_Init_FS(void) 152 | { 153 | /* USER CODE BEGIN 3 */ 154 | /* Set Application Buffers */ 155 | USBD_CDC_SetTxBuffer(&hUsbDeviceFS, UserTxBufferFS, 0); 156 | USBD_CDC_SetRxBuffer(&hUsbDeviceFS, UserRxBufferFS); 157 | return (USBD_OK); 158 | /* USER CODE END 3 */ 159 | } 160 | 161 | /** 162 | * @brief DeInitializes the CDC media low layer 163 | * @retval USBD_OK if all operations are OK else USBD_FAIL 164 | */ 165 | static int8_t CDC_DeInit_FS(void) 166 | { 167 | /* USER CODE BEGIN 4 */ 168 | return (USBD_OK); 169 | /* USER CODE END 4 */ 170 | } 171 | 172 | /** 173 | * @brief Manage the CDC class requests 174 | * @param cmd: Command code 175 | * @param pbuf: Buffer containing command data (request parameters) 176 | * @param length: Number of data to be sent (in bytes) 177 | * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL 178 | */ 179 | static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) 180 | { 181 | /* USER CODE BEGIN 5 */ 182 | switch(cmd) 183 | { 184 | case CDC_SEND_ENCAPSULATED_COMMAND: 185 | 186 | break; 187 | 188 | case CDC_GET_ENCAPSULATED_RESPONSE: 189 | 190 | break; 191 | 192 | case CDC_SET_COMM_FEATURE: 193 | 194 | break; 195 | 196 | case CDC_GET_COMM_FEATURE: 197 | 198 | break; 199 | 200 | case CDC_CLEAR_COMM_FEATURE: 201 | 202 | break; 203 | 204 | /*******************************************************************************/ 205 | /* Line Coding Structure */ 206 | /*-----------------------------------------------------------------------------*/ 207 | /* Offset | Field | Size | Value | Description */ 208 | /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/ 209 | /* 4 | bCharFormat | 1 | Number | Stop bits */ 210 | /* 0 - 1 Stop bit */ 211 | /* 1 - 1.5 Stop bits */ 212 | /* 2 - 2 Stop bits */ 213 | /* 5 | bParityType | 1 | Number | Parity */ 214 | /* 0 - None */ 215 | /* 1 - Odd */ 216 | /* 2 - Even */ 217 | /* 3 - Mark */ 218 | /* 4 - Space */ 219 | /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */ 220 | /*******************************************************************************/ 221 | case CDC_SET_LINE_CODING: 222 | 223 | break; 224 | 225 | case CDC_GET_LINE_CODING: 226 | 227 | break; 228 | 229 | case CDC_SET_CONTROL_LINE_STATE: 230 | 231 | break; 232 | 233 | case CDC_SEND_BREAK: 234 | 235 | break; 236 | 237 | default: 238 | break; 239 | } 240 | 241 | return (USBD_OK); 242 | /* USER CODE END 5 */ 243 | } 244 | 245 | /** 246 | * @brief Data received over USB OUT endpoint are sent over CDC interface 247 | * through this function. 248 | * 249 | * @note 250 | * This function will issue a NAK packet on any OUT packet received on 251 | * USB endpoint until exiting this function. If you exit this function 252 | * before transfer is complete on CDC interface (ie. using DMA controller) 253 | * it will result in receiving more data while previous ones are still 254 | * not sent. 255 | * 256 | * @param Buf: Buffer of data to be received 257 | * @param Len: Number of data received (in bytes) 258 | * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL 259 | */ 260 | static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) 261 | { 262 | /* USER CODE BEGIN 6 */ 263 | extern volatile uint8_t usb_sync_flag; 264 | extern volatile uint8_t usb_flush_flag; 265 | extern void pc_host_timing_req(uint8_t* Buf, uint32_t Len); 266 | 267 | USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); 268 | USBD_CDC_ReceivePacket(&hUsbDeviceFS); 269 | 270 | //simple in-band commands 271 | if( *Len > 0 ) 272 | { 273 | if( Buf[0] == 'S' ) 274 | { 275 | usb_sync_flag++; 276 | } 277 | else if( Buf[0] == 'F' ) 278 | { 279 | usb_flush_flag++; 280 | } 281 | else if( Buf[0] == 'T' ) 282 | { 283 | pc_host_timing_req( Buf, *Len); 284 | } 285 | } 286 | 287 | return (USBD_OK); 288 | /* USER CODE END 6 */ 289 | } 290 | 291 | /** 292 | * @brief CDC_Transmit_FS 293 | * Data to send over USB IN endpoint are sent over CDC interface 294 | * through this function. 295 | * @note 296 | * 297 | * 298 | * @param Buf: Buffer of data to be sent 299 | * @param Len: Number of data to be sent (in bytes) 300 | * @retval USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY 301 | */ 302 | uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) 303 | { 304 | uint8_t result = USBD_OK; 305 | /* USER CODE BEGIN 7 */ 306 | USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; 307 | if (hcdc->TxState != 0){ 308 | return USBD_BUSY; 309 | } 310 | USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); 311 | result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); 312 | /* USER CODE END 7 */ 313 | return result; 314 | } 315 | 316 | /* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */ 317 | 318 | //Flush endpoint test 319 | uint8_t CDC_Flush_FS(void) 320 | { 321 | uint8_t result = USBD_OK; 322 | 323 | result = USBD_LL_FlushEP(&hUsbDeviceFS, CDC_IN_EP); 324 | return result; 325 | } 326 | 327 | 328 | /* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */ 329 | 330 | /** 331 | * @} 332 | */ 333 | 334 | /** 335 | * @} 336 | */ 337 | 338 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 339 | -------------------------------------------------------------------------------- /usbd_cdc_if.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : usbd_cdc_if.h 5 | * @version : v2.0_Cube 6 | * @brief : Header for usbd_cdc_if.c file. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© Copyright (c) 2021 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under Ultimate Liberty license 14 | * SLA0044, the "License"; You may not use this file except in compliance with 15 | * the License. You may obtain a copy of the License at: 16 | * www.st.com/SLA0044 17 | * 18 | ****************************************************************************** 19 | */ 20 | /* USER CODE END Header */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __USBD_CDC_IF_H__ 24 | #define __USBD_CDC_IF_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Includes ------------------------------------------------------------------*/ 31 | #include "usbd_cdc.h" 32 | 33 | /* USER CODE BEGIN INCLUDE */ 34 | 35 | /* USER CODE END INCLUDE */ 36 | 37 | /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY 38 | * @brief For Usb device. 39 | * @{ 40 | */ 41 | 42 | /** @defgroup USBD_CDC_IF USBD_CDC_IF 43 | * @brief Usb VCP device module 44 | * @{ 45 | */ 46 | 47 | /** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines 48 | * @brief Defines. 49 | * @{ 50 | */ 51 | /* USER CODE BEGIN EXPORTED_DEFINES */ 52 | /* Define size for the receive and transmit buffer over CDC */ 53 | /* It's up to user to redefine and/or remove those define */ 54 | #define APP_RX_DATA_SIZE 128 55 | #define APP_TX_DATA_SIZE 1 //Tx packet not used 56 | 57 | /* USER CODE END EXPORTED_DEFINES */ 58 | 59 | /** 60 | * @} 61 | */ 62 | 63 | /** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types 64 | * @brief Types. 65 | * @{ 66 | */ 67 | 68 | /* USER CODE BEGIN EXPORTED_TYPES */ 69 | 70 | /* USER CODE END EXPORTED_TYPES */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros 77 | * @brief Aliases. 78 | * @{ 79 | */ 80 | 81 | /* USER CODE BEGIN EXPORTED_MACRO */ 82 | 83 | /* USER CODE END EXPORTED_MACRO */ 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | /** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables 90 | * @brief Public variables. 91 | * @{ 92 | */ 93 | 94 | /** CDC Interface callback. */ 95 | extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; 96 | 97 | /* USER CODE BEGIN EXPORTED_VARIABLES */ 98 | 99 | /* USER CODE END EXPORTED_VARIABLES */ 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | /** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype 106 | * @brief Public functions declaration. 107 | * @{ 108 | */ 109 | 110 | uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); 111 | 112 | /* USER CODE BEGIN EXPORTED_FUNCTIONS */ 113 | 114 | /* USER CODE END EXPORTED_FUNCTIONS */ 115 | 116 | /** 117 | * @} 118 | */ 119 | 120 | /** 121 | * @} 122 | */ 123 | 124 | /** 125 | * @} 126 | */ 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | 132 | #endif /* __USBD_CDC_IF_H__ */ 133 | 134 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 135 | --------------------------------------------------------------------------------