diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..e69de29b diff --git a/README.md b/README.md index aee1845e..22476850 100644 --- a/README.md +++ b/README.md @@ -1,114 +1,153 @@ # About -This project is used to develop applications for the STM32 - ST's ARM Cortex-Mx MCUs. It uses cmake and GCC, along with newlib (libc), STM32CubeMX or ChibiOS. +This project is used to develop applications for the STM32 - ST's ARM Cortex-Mx MCUs. +It uses cmake and GCC, along with newlib (libc), STM32Cube. Supports F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 device families. ## Requirements -* cmake >= 3.0 +* cmake >= 3.13 * GCC toolchain with newlib (optional). - -* STM32CubeMX package for STM32F0, STM32F1, STM32F2, STM32F3, STM32F4, STM32F7, STM32G0, STM32H7, STM32L0, STM32L1, STM32L4 families. +* STM32Cube package for appropriate STM32 family. ## Project contains -* CMake common toolchain file, that configures cmake to use the arm toolchain. -* CMake toolchain file that can generate a tunable linker script -* CMake STM32 family-specific toolchain file, that configures family-specific parameters. -* CMake modules to find and configure CMSIS and STM32HAL components. -* CMake modules to find and configure ChibiOS components. -* CMake project template. +* CMake toolchain file, that configures cmake to use the arm toolchain: [cmake/stm32_gcc.cmake](cmake/stm32_gcc.cmake). +* CMake module that contains useful functions: [cmake/stm32/common.cmake](cmake/stm32/common.cmake) +* CMake modules that contains information about each family - RAM/flash sizes, CPU types, device types and device naming (e.g. it can tell that STM32F407VG is F4 family with 1MB flash, 128KB RAM with CMSIS type F407xx) +* CMake toolchain file that can generate a tunable linker script [cmake/stm32/linker_ld.cmake](cmake/stm32/linker_ld.cmake) +* CMake module to find and configure CMSIS library [cmake/FindCMSIS.cmake](cmake/FindCMSIS.cmake) +* CMake module to find and configure STM32 HAL library [cmake/FindHAL.cmake](cmake/FindHAL.cmake) +* CMake modules for various libraries/RTOSes +* CMake project template and [examples](examples) +* Some testing project to check cmake scripts working properly [tests](tests) ## Examples -* `stm32-blinky` - blink LED using timers and PWM. -* `stm32-newlib` - show date using uart and libc functions from newlib. -* `stm32-chibios` - blink led using ChibiOS/NIL. -* `stm32-hal-freertos-uart-tensorflow` - HAL OS (FreeRTOS) example using UART - and TensorFlow Lite Micro to perform sine wave interpolation with - `flash` (`st-flash`) and `debug` (`openocd` + `gdb`) targets. - - Requires `OPENOCD_BOARD` to be set to specify the openocd config required. - These are usually found in `/usr/share/openocd/scripts/`. For example a - STM32F41G_EVAL board using an ST-link would use `OPENOCD_BOARD=board/stm3241g_eval_stlink.cfg`. - If none is given CMake will search the project root for `.cfg` files. - - Can be found in a maintained form [here](https://github.com/alxhoff/STM3240G-EVAL-TensorFlow-Hello-World). +* `template` ([examples/template](examples/template)) - project template, empty source linked compiled with CMSIS. +* `custom-linker-script` ([examples/custom-linker-script](examples/custom-linker-script)) - similiar to `template` but using custom linker script. +* `fetch-cube` ([examples/fetch-cube](examples/fetch-cube)) - example of using FetchContent for fetching STM32Cube from ST's git. +* `fetch-cmsis-hal` ([examples/fetch-cmsis-hal](examples/fetch-cmsis-hal)) - example of using FetchContent for fetching STM32 CMSIS and HAL from ST's git. +* `blinky` ([examples/blinky](examples/blinky)) - blink led using STM32 HAL library and SysTick. +* `freertos` ([examples/freertos](examples/freertos)) - blink led using STM32 HAL library and FreeRTOS. # Usage -First of all you need to configure toolchain and libraries, you can do this by editing `gcc_stm32.cmake` or, preferably, by passing it through the command line. +First of all you need to configure toolchain and library pathes using CMake varibles. +You can do this by passing values through command line during cmake run or by setting variables inside your CMakeLists.txt ## Configuration * `TOOLCHAIN_PREFIX` - where toolchain is located, **default**: `/usr` * `TARGET_TRIPLET` - toolchain target triplet, **default**: `arm-none-eabi` -* `STM32_CHIP` - STM32 device code, e.g. `STM32F407VG` or `STM32F103VG` -* `STM32_FAMILY` - STM32 family (F0, F1, F4, etc.) currently, F0, F1, F2, F4, F7, G0, H7, L0, L1 and L4 families are supported. **Note:** If `STM32_CHIP` variable is set, `STM32_FAMILY` is optional. -* `STM32Cube_DIR` - path to STM32CubeMX directory **default**: `/opt/STM32Cube_FW_F0_V1.4.0 /opt/STM32Cube_FW_F1_V1.1.0 /opt/STM32Cube_FW_F2_V1.1.0 /opt/STM32Cube_FW_F4_V1.6.0` - -To use the toolchain, you'll need to copy contents of the `cmake` folder into cmake's modules path, or use the `CMAKE_MODULE_PATH` variable. +* `STM32_CUBE__PATH` - path to STM32Cube directory, where `` is one of `F0 G0 L0 F1 L1 F2 F3 F4 G4 L4 F7 H7` **default**: `/opt/STM32Cube` ## Common usage - cmake -DSTM32_CHIP= -DCMAKE_TOOLCHAIN_FILE= -DCMAKE_BUILD_TYPE=Debug +First thing that you need to do after toolchain configration in your `CMakeLists.txt` script is to find CMSIS package: +``` +find_package(CMSIS COMPONENTS STM32F4 REQUIRED) +``` +You can specify STM32 family or even specific device (`STM32F407VG`) in `COMPONENTS` or omit `COMPONENTS` totally - in that case stm32-cmake will find ALL sources for ALL families and ALL chips (you'll need ALL STM32Cube packages somewhere). -Where `` is the STM32 chip name (e.g. `STM32F100C8`, `STM32F407IG`). +Each STM32 device can be categorized into family and device type groups, for example STM32F407VG is device from `F4` family, with type `F407xx` -This command will generate Makefile for project. For a `Release` build, change `CMAKE_BUILD_TYPE`. +CMSIS consists of three main components: -The script will try to detect chip parameters automatically from the chip name (type, flash/ram size), or, you can set these directly with these variables: +* Family-specific headers, e.g. `stm32f4xx.h` +* Device type-specific startup sources (e.g. `startup_stm32f407xx.s`) +* Device-specific linker scripts which requires information about memory sizes -* `STM32_CHIP_TYPE` - family-dependent chip type. Global variable `STM32_CHIP_TYPES` contains list of valid types for current family (e.g `207xG`) -* `STM32_FLASH_SIZE` - chip flash size (e.g. 64K) -* `STM32_RAM_SIZE` - chip RAM size (e.g. 4K) +stm32-cmake uses modern CMake features notably imported targets and target properties. +Every CMSIS component is CMake's target (aka library), which defines compiler definitions, compiler flags, include dirs, sources, etc. to build and propagates them as dependencies. So in simple use-case all you need is to link your executable with library `CMSIS::STM32::`: +``` +add_executable(stm32-template main.c) +target_link_libraries(stm32-template CMSIS::STM32::F407VG) +``` +That will add include directories, startup source, linker script and compiler flags to your executable. -### Usage with Eclipse CDT: +CMSIS creates following targets: - cmake -DSTM32_CHIP= -DCMAKE_TOOLCHAIN_FILE= -DCMAKE_BUILD_TYPE=Debug -G "Eclipse CDT4 - Unix Makefiles" +* `CMSIS::STM32::` (e.g. `CMSIS::STM32::F4`) - common includes, compiler flags and defines for family +* `CMSIS::STM32::` (e.g. `CMSIS::STM32::F407xx`) - common startup source for device type, depends on `CMSIS::STM32::` +* `CMSIS::STM32::` (e.g. `CMSIS::STM32::F407VG`) - linker script for device, depends on `CMSIS::STM32::` -## Building +So, if you don't need linker script, you can link only `CMSIS::STM32::` library and provide own script using `stm32_add_linker_script` function -* To build elf file: `make` -* To build .hex: `make .hex` -* To build .bin: `make .bin` +***Note**: Some devices in STM32H7 family has two different cores (Cortex-M7 and Cortex-M4). +To specify core to build, all targets for H7 family also have suffix (::M7 or ::M4). +For example, targets for STM32H747BI will look like `CMSIS::STM32::H7::M7`, `CMSIS::STM32::H7::M4`, `CMSIS::STM32::H747BI::M7`, `CMSIS::STM32::H747BI::M4`, etc.* -## Linker script & variables +Also, there is special library `STM32::NoSys` which adds `--specs=nosys.specs` to compiler flags. + +## HAL + +STM32 HAL can be used similiar to CMSIS. +``` +find_package(HAL COMPONENTS STM32F4 REQUIRED) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) +``` +*`CMAKE_INCLUDE_CURRENT_DIR` here because HAL requires `stm32xx_hal_conf.h` file being in include headers path.* -You can use cmake variables below to tune the generated linker. To specify a custom linker script, set `STM32_LINKER_SCRIPT` (you can still use these variables in your custom script). +HAL module will search all drivers supported by family and create following targets: -* `STM32_FLASH_ORIGIN` - Start address of flash (**default**: 0x08000000) -* `STM32_RAM_ORIGIN` - Start address of RAM (**default**: 0x20000000) -* `STM32_FLASH_SIZE` - Flash size (**default**: from chip name) -* `STM32_RAM_SIZE` - RAM size (**default**: from chip name) -* `STM32_MIN_STACK_SIZE` - Minimum stack size for error detection at link-time (**default**: 512 bytes) -* `STM32_MIN_HEAP_SIZE` - Minimum heap size for error detection at link-time (**default**: 0 bytes) -* `STM32_CCRAM_ORIGIN` - Start address of Core-Coupled RAM (**default**: 0x10000000) -* `STM32_CCRAM_SIZE` - Core-Coupled RAM size (**default**: 64 KiB) +* `HAL::STM32::` (e.g. `HAL::STM32::F4`) - common HAL source, depends on `CMSIS::STM32::` +* `HAL::STM32::::` (e.g. `HAL::STM32::F4::GPIO`) - HAL driver , depends on `HAL::STM32::` +* `HAL::STM32::::Ex` (e.g. `HAL::STM32::F4::ADCEx`) - HAL Extension driver , depends on `HAL::STM32::::` +* `HAL::STM32::::LL_` (e.g. `HAL::STM32::F4::LL_ADC`) - HAL LL (Low-Level) driver , depends on `HAL::STM32::` -## Useful cmake macros +***Note**: Targets for STM32H7 will look like `HAL::STM32::::[M7|M4]`, `HAL::STM32::::[M7|M4]::`, etc.* -* `STM32_GET_CHIP_TYPE(CHIP CHIP_TYPE)` - gets chip type from chip name. -* `STM32_GET_CHIP_PARAMETERS(CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE)` - gets chip ram/flash size from chip name. -* `STM32_SET_FLASH_PARAMS(TARGET ...)` - sets chip flash/ram parameters for target. -* `STM32_SET_CHIP_DEFINITIONS(TARGET CHIP_TYPE)` - sets chip family and type-specific compiler flags for target. -* `STM32_SET_TARGET_PROPERTIES(TARGET)` - sets all needed parameters and compiler flags for target. -* `STM32_GENERATE_LIBRARIES(NAME SOURCES LIBRARIES)` - generates libraries for all chip types in family. Resulting libraries stored in LIBRARIES and have names in ${NAME}_${FAMILY}_${CHIP_TYPE} format. +Here is typical usage: -# ChibiOS Support +``` +add_executable(stm32-blinky-f4 blinky.c stm32f4xx_hal_conf.h) +target_link_libraries(stm32-blinky-f4 + HAL::STM32::F4::RCC + HAL::STM32::F4::GPIO + HAL::STM32::F4::CORTEX + CMSIS::STM32::F407VG + STM32::NoSys +) +``` -This project also supports ChibiOS v3.x.x and ChibiOS v16.x.x (both nil and rt kernels). +### Building + +``` + $ cmake -DCMAKE_TOOLCHAIN_FILE= -DCMAKE_BUILD_TYPE=Debug + $ make +``` + +## Linker script & variables -CMake modules for ChibiOS can find specified ChibiOS components using the COMPONENTS directive. +CMSIS package will generate linker script for your device automatically (target `CMSIS::STM32::`). To specify a custom linker script, use `stm32_add_linker_script` function. -See project `stm32-chibios` for example usage. +## Useful cmake function -# FreeRTOS Support +* `stm32_get_chip_info( [FAMILY ] [TYPE ] [DEVICE ])` - classify device using name, will return device family (into `` variable), type (``) and canonical name (``, uppercase without any package codes) +* `stm32_get_memory_info((CHIP )|(DEVICE TYPE ) [FLASH|RAM|CCRAM|STACK|HEAP] [SIZE ] [ORIGIN ])` - get information about device memories (into `` and ``). Linker script generator uses values from this function +* `stm32_get_devices_by_family(DEVICES [FAMILY ])` - return into `DEVICES` all supported devices by family (or all devices if `` is empty) -FreeRTOS is also supported. To include it in your project you should set a variable named `FREERTOS_HEAP_IMPL` with -a proper number of FreeRTOS heap implementation. You can do this by invoking: +# Additional CMake modules + +stm32-cmake contains additional CMake modules for finding and configuring various libraries and RTOSes used in embedded world. + +## FreeRTOS + +[cmake/FindFreeRTOS](cmake/FindFreeRTOS) - finds FreeRTOS sources in location specified by `FREERTOS_PATH` (*default*: `/opt/FreeRTOS`) variable and format them as `IMPORTED` targets. +Typical usage: ``` -SET(FREERTOS_HEAP_IMPL 4) +find_package(FreeRTOS COMPONENTS ARM_CM4F REQUIRED) +target_link_libraries(... FreeRTOS::ARM_CM4F) ``` -before `FIND_PACKAGE` command. +Following FreeRTOS ports supported: `ARM_CM0`, `ARM_CM3`, `ARM_CM4F`, `ARM_CM7`. + +Other FreeRTOS libraries: + +* `FreeRTOS::Coroutine` - co-routines (`croutines.c`) +* `FreeRTOS::EventGroups` - event groups (`event_groups.c`) +* `FreeRTOS::StreamBuffer` - stream buffer (`stream_buffer.c`) +* `FreeRTOS::Timers` - timers (`timers.c`) +* `FreeRTOS::Heap::` - heap implementation (`heap_.c`), ``: [1-5] + diff --git a/cmake/ChibiOS/18.2/ChibiOS.cmake b/cmake/ChibiOS/18.2/ChibiOS.cmake deleted file mode 100644 index 3bc0899e..00000000 --- a/cmake/ChibiOS/18.2/ChibiOS.cmake +++ /dev/null @@ -1,106 +0,0 @@ -IF(NOT ChibiOS_FIND_COMPONENTS) - SET(ChibiOS_FIND_COMPONENTS nil hal) - MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}") -ENDIF() - -SET (CHIBIOS_COMPONENTS nil rt hal) - -LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil) -LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt) -LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal) - -IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0)) - MESSAGE(STATUS "No kernel component selected, using Nil kernel") - LIST(APPEND ChibiOS_FIND_COMPONENTS nil) - SET(CHIBIOS_KERNEL nil) -ELSE() - IF((NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) AND (NOT (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))) - MESSAGE(FATAL_ERROR "Cannot use RT and Nil kernel at the same time") - ENDIF() - IF(NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) - SET(CHIBIOS_KERNEL nil) - ELSE() - SET(CHIBIOS_KERNEL rt) - ENDIF() -ENDIF() - -IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0) - LIST(APPEND ChibiOS_FIND_COMPONENTS hal) -ENDIF() - -IF(NOT CHIBIOS_HALCONF_FILE) - MESSAGE(STATUS "No ChibiOS halconf.h specified, trying to find it...") - FILE(GLOB CHIBIOS_HALCONF_FILE "halconf.h") - IF (CHIBIOS_HALCONF_FILE STREQUAL "") - MESSAGE(FATAL_ERROR "Cannot find halconf.h, please specify it using CHIBIOS_HALCONF_FILE variable") - ELSE() - MESSAGE(STATUS "Found halconf.h: ${CHIBIOS_HALCONF_FILE}") - ENDIF() -ENDIF() - -IF(NOT CHIBIOS_CHCONF_FILE) - MESSAGE(STATUS "No ChibiOS chconf.h specified, trying to find it...") - FILE(GLOB CHIBIOS_CHCONF_FILE "chconf.h") - IF (CHIBIOS_CHCONF_FILE STREQUAL "") - MESSAGE(FATAL_ERROR "Cannot find chconf.h, please specify it using CHIBIOS_CHCONF_FILE variable") - ELSE() - MESSAGE(STATUS "Found chconf.h: ${CHIBIOS_CHCONF_FILE}") - ENDIF() -ENDIF() - -FILE(STRINGS ${CHIBIOS_CHCONF_FILE} CHCONF_LINES REGEX "#define CH_CFG_USE_([a-zA-Z_0-9]+) +TRUE") -FOREACH(LINE ${CHCONF_LINES}) - STRING(REGEX REPLACE "#define CH_CFG_USE_([a-zA-Z_0-9]+) +TRUE" "\\1" COMP ${LINE}) - LIST(APPEND CHIBIOS_RTOS_COMPONENTS ${COMP}) -ENDFOREACH() - -MESSAGE(STATUS "Detected ChibiOS RTOS components:") -FOREACH(COMP ${CHIBIOS_RTOS_COMPONENTS}) - MESSAGE(STATUS "\t${COMP}") -ENDFOREACH() - -FILE(STRINGS ${CHIBIOS_HALCONF_FILE} HALCONF_LINES REGEX "#define HAL_USE_([a-zA-Z_0-9]+) +TRUE") -FOREACH(LINE ${HALCONF_LINES}) - STRING(REGEX REPLACE "#define HAL_USE_([a-zA-Z_0-9]+) +TRUE" "\\1" COMP ${LINE}) - LIST(APPEND CHIBIOS_HAL_COMPONENTS ${COMP}) -ENDFOREACH() - -MESSAGE(STATUS "Detected ChibiOS HAL components:") -FOREACH(COMP ${CHIBIOS_HAL_COMPONENTS}) - MESSAGE(STATUS "\t${COMP}") -ENDFOREACH() - -INCLUDE(ChibiOS/18.2/ChibiOS_LD) -INCLUDE(ChibiOS/18.2/ChibiOS_RTOS) -INCLUDE(ChibiOS/18.2/ChibiOS_HAL) - -MESSAGE(STATUS "RTOS sources: ") -FOREACH(SOURCE ${CHIBIOS_SOURCES_${CHIBIOS_KERNEL}}) - MESSAGE(STATUS "\t${SOURCE}") -ENDFOREACH() - -MESSAGE(STATUS "HAL sources: ") -FOREACH(SOURCE ${CHIBIOS_SOURCES_hal}) - MESSAGE(STATUS "\t${SOURCE}") -ENDFOREACH() - -IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") -ENDIF() - -FOREACH(comp ${ChibiOS_FIND_COMPONENTS}) - LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}") - ENDIF() - FOREACH(source ${CHIBIOS_SOURCES_${comp}}) - FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_ROOT} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}}) - ENDFOREACH() - FOREACH(incl ${CHIBIOS_INCLUDES_${comp}}) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_ROOT}/${incl}) - ENDFOREACH() -ENDFOREACH() - - - diff --git a/cmake/ChibiOS/18.2/ChibiOS_HAL.cmake b/cmake/ChibiOS/18.2/ChibiOS_HAL.cmake deleted file mode 100644 index 43cea060..00000000 --- a/cmake/ChibiOS/18.2/ChibiOS_HAL.cmake +++ /dev/null @@ -1,490 +0,0 @@ -SET (CHIBIOS_SOURCES_hal - os/hal/src/hal.c - os/hal/src/hal_st.c - os/hal/src/hal_buffers.c - os/hal/src/hal_queues.c - os/hal/src/hal_mmcsd.c - os/hal/ports/common/ARMCMx/nvic.c -) - -SET (CHIBIOS_INCLUDES_hal - os/hal/include - os/hal/ports/common/ARMCMx -) - -SET (CHIBIOS_SOURCES_hal_nil - os/hal/osal/nil/osal.c -) - -SET (CHIBIOS_SOURCES_hal_rt - os/hal/osal/rt/osal.c -) - -SET (CHIBIOS_INCLUDES_hal_nil - os/hal/osal/nil -) - -SET (CHIBIOS_INCLUDES_hal_rt - os/hal/osal/rt -) - -SET (CHIBIOS_SOURCES_hal_ADC os/hal/src/hal_adc.c) -SET (CHIBIOS_SOURCES_hal_CAN os/hal/src/hal_can.c) -SET (CHIBIOS_SOURCES_hal_CRY os/hal/src/hal_crypto.c) -SET (CHIBIOS_SOURCES_hal_DAC os/hal/src/hal_dac.c) -SET (CHIBIOS_SOURCES_hal_EXT os/hal/src/hal_ext.c) -SET (CHIBIOS_SOURCES_hal_GPT os/hal/src/hal_gpt.c) -SET (CHIBIOS_SOURCES_hal_I2C os/hal/src/hal_i2c.c) -SET (CHIBIOS_SOURCES_hal_I2S os/hal/src/hal_i2s.c) -SET (CHIBIOS_SOURCES_hal_ICU os/hal/src/hal_icu.c) -SET (CHIBIOS_SOURCES_hal_MAC os/hal/src/hal_mac.c) -SET (CHIBIOS_SOURCES_hal_MMC_SPI os/hal/src/hal_mmc_spi.c) -SET (CHIBIOS_SOURCES_hal_PAL os/hal/src/hal_pal.c) -SET (CHIBIOS_SOURCES_hal_PWM os/hal/src/hal_pwm.c) -SET (CHIBIOS_SOURCES_hal_QSPI os/hal/src/hal_qspi.c) -SET (CHIBIOS_SOURCES_hal_RTC os/hal/src/hal_rtc.c) -SET (CHIBIOS_SOURCES_hal_SDC os/hal/src/hal_sdc.c) -SET (CHIBIOS_SOURCES_hal_SERIAL os/hal/src/hal_serial.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_USB os/hal/src/hal_serial_usb.c) -SET (CHIBIOS_SOURCES_hal_SPI os/hal/src/hal_spi.c) -SET (CHIBIOS_SOURCES_hal_UART os/hal/src/hal_uart.c) -SET (CHIBIOS_SOURCES_hal_USB os/hal/src/hal_usb.c) -SET (CHIBIOS_SOURCES_hal_WDG os/hal/src/hal_wdg.c) - - - -SET (CHIBIOS_INCLUDES_hal_F0 - os/hal/ports/STM32/STM32F0xx - os/hal/ports/STM32/LLD/DMAv1 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F0 - os/hal/ports/STM32/STM32F0xx/stm32_isr.c - os/hal/ports/STM32/STM32F0xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) -SET (CHIBIOS_SOURCES_hal_ADC_F0 os/hal/ports/STM32/LLD/ADCv1/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F0 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F0 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F0 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F0 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F0 os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F0 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F0 os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F0 os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F0 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F0 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F0 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F0 os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F0 os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F0 os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F0 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F0 os/hal/ports/STM32/LLD/ADCv1) -SET (CHIBIOS_INCLUDES_hal_CAN_F0 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F0 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F0 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F0 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_F0 os/hal/ports/STM32/LLD/I2Cv2) -SET (CHIBIOS_INCLUDES_hal_RTC_F0 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_F0 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SPI_F0 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_GPT_F0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F0 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_UART_F0 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_USB_F0 os/hal/ports/STM32/LLD/USBv1) -SET (CHIBIOS_INCLUDES_hal_WDG_F0 os/hal/ports/STM32/LLD/xWDGv1) - - -SET (CHIBIOS_INCLUDES_hal_F1 - os/hal/ports/STM32/STM32F1xx - os/hal/ports/STM32/LLD/DMAv1 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F1 - os/hal/ports/STM32/STM32F1xx/stm32_isr.c - os/hal/ports/STM32/STM32F1xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) -SET (CHIBIOS_SOURCES_hal_ADC_F1 os/hal/ports/STM32/STM32F1xx/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F1 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F1 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F1 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F1 os/hal/ports/STM32/LLD/GPIOv1/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F1 os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F1 os/hal/ports/STM32/LLD/RTCv1/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F1 os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F1 os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F1 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F1 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F1 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F1 os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F1 os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F1 os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F1 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F1 os/hal/ports/STM32/STM32F1xx) -SET (CHIBIOS_INCLUDES_hal_CAN_F1 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F1 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F1 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F1 os/hal/ports/STM32/LLD/GPIOv1) -SET (CHIBIOS_INCLUDES_hal_I2C_F1 os/hal/ports/STM32/LLD/I2Cv1) -SET (CHIBIOS_INCLUDES_hal_RTC_F1 os/hal/ports/STM32/LLD/RTCv1) -SET (CHIBIOS_INCLUDES_hal_I2S_F1 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SPI_F1 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_GPT_F1 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F1 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F1 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F1 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_UART_F1 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_USB_F1 os/hal/ports/STM32/LLD/USBv1) -SET (CHIBIOS_INCLUDES_hal_WDG_F1 os/hal/ports/STM32/LLD/xWDGv1) - -SET (CHIBIOS_INCLUDES_hal_F2 - os/hal/ports/STM32/STM32F4xx - os/hal/ports/STM32/LLD/DMAv2 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F2 - os/hal/ports/STM32/STM32F4xx/stm32_isr.c - os/hal/ports/STM32/STM32F4xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv2/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_F2 os/hal/ports/STM32/LLD/ADCv2/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F2 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F2 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F2 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F2 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F2 os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_MAC_F2 os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F2 os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_QSPI_F2 os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F2 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F2 os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F2 os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_SDC_F2 os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F2 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F2 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F2 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F2 os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F2 os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F2 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F2 os/hal/ports/STM32/LLD/ADCv2) -SET (CHIBIOS_INCLUDES_hal_CAN_F2 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F2 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F2 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F2 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_F2 os/hal/ports/STM32/LLD/I2Cv1) -SET (CHIBIOS_INCLUDES_hal_MAC_F2 os/hal/ports/STM32/LLD/MACv1) -SET (CHIBIOS_INCLUDES_hal_USB_F2 os/hal/ports/STM32/LLD/OTGv1) -SET (CHIBIOS_INCLUDES_hal_QSPI_F2 os/hal/ports/STM32/LLD/QUADSPIv1) -SET (CHIBIOS_INCLUDES_hal_RTC_F2 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_F2 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SPI_F2 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SDC_F2 os/hal/ports/STM32/LLD/SDIOv1) -SET (CHIBIOS_INCLUDES_hal_GPT_F2 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F2 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F2 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F2 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_UART_F2 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_WDG_F2 os/hal/ports/STM32/LLD/xWDGv1) - - -SET (CHIBIOS_INCLUDES_hal_F3 - os/hal/ports/STM32/STM32F3xx - os/hal/ports/STM32/LLD/DMAv1 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F3 - os/hal/ports/STM32/STM32F3xx/stm32_isr.c - os/hal/ports/STM32/STM32F3xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_F3 os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F3 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F3 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F3 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F3 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F3 os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F3 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F3 os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F3 os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F3 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F3 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F3 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F3 os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F3 os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F3 os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F3 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F3 os/hal/ports/STM32/LLD/ADCv3) -SET (CHIBIOS_INCLUDES_hal_CAN_F3 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F3 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F3 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F3 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_F3 os/hal/ports/STM32/LLD/I2Cv2) -SET (CHIBIOS_INCLUDES_hal_RTC_F3 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_F3 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SPI_F3 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_GPT_F3 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F3 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F3 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F3 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_UART_F3 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_USB_F3 os/hal/ports/STM32/LLD/USBv1) -SET (CHIBIOS_INCLUDES_hal_WDG_F3 os/hal/ports/STM32/LLD/xWDGv1) - - - -SET (CHIBIOS_INCLUDES_hal_F4 - os/hal/ports/STM32/STM32F4xx - os/hal/ports/STM32/LLD/DMAv2 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F4 - os/hal/ports/STM32/STM32F4xx/stm32_isr.c - os/hal/ports/STM32/STM32F4xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv2/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_F4 os/hal/ports/STM32/LLD/ADCv2/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F4 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F4 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F4 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F4 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F4 os/hal/ports/STM32/LLD/I2Cv1/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_MAC_F4 os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F4 os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_QSPI_F4 os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F4 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F4 os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F4 os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_SDC_F4 os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F4 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F4 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F4 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F4 os/hal/ports/STM32/LLD/USARTv1/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F4 os/hal/ports/STM32/LLD/USARTv1/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F4 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F4 os/hal/ports/STM32/LLD/ADCv2) -SET (CHIBIOS_INCLUDES_hal_CAN_F4 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F4 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F4 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F4 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_F4 os/hal/ports/STM32/LLD/I2Cv1) -SET (CHIBIOS_INCLUDES_hal_MAC_F4 os/hal/ports/STM32/LLD/MACv1) -SET (CHIBIOS_INCLUDES_hal_USB_F4 os/hal/ports/STM32/LLD/OTGv1) -SET (CHIBIOS_INCLUDES_hal_QSPI_F4 os/hal/ports/STM32/LLD/QUADSPIv1) -SET (CHIBIOS_INCLUDES_hal_RTC_F4 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_F4 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SPI_F4 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SDC_F4 os/hal/ports/STM32/LLD/SDIOv1) -SET (CHIBIOS_INCLUDES_hal_GPT_F4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F4 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_UART_F4 os/hal/ports/STM32/LLD/USARTv1) -SET (CHIBIOS_INCLUDES_hal_WDG_F4 os/hal/ports/STM32/LLD/xWDGv1) - - - -SET (CHIBIOS_INCLUDES_hal_F7 - os/hal/ports/STM32/STM32F7xx - os/hal/ports/STM32/LLD/DMAv2 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_F7 - os/hal/ports/STM32/STM32F7xx/stm32_isr.c - os/hal/ports/STM32/STM32F7xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv2/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_F7 os/hal/ports/STM32/LLD/ADCv2/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_F7 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_CRY_F7 os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_F7 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_F7 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_F7 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_F7 os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_MAC_F7 os/hal/ports/STM32/LLD/MACv1/hal_mac_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_F7 os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_QSPI_F7 os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_F7 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_F7 os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_F7 os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_SDC_F7 os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_F7 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_F7 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_F7 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_F7 os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_F7 os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_F7 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_F7 os/hal/ports/STM32/LLD/ADCv2) -SET (CHIBIOS_INCLUDES_hal_CAN_F7 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_CRY_F7 os/hal/ports/STM32/LLD/CRYPv1) -SET (CHIBIOS_INCLUDES_hal_DAC_F7 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_F7 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_F7 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_F7 os/hal/ports/STM32/LLD/I2Cv2) -SET (CHIBIOS_INCLUDES_hal_MAC_F7 os/hal/ports/STM32/LLD/MACv1) -SET (CHIBIOS_INCLUDES_hal_USB_F7 os/hal/ports/STM32/LLD/OTGv1) -SET (CHIBIOS_INCLUDES_hal_QSPI_F7 os/hal/ports/STM32/LLD/QUADSPIv1) -SET (CHIBIOS_INCLUDES_hal_RTC_F7 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_F7 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SPI_F7 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SDC_F7 os/hal/ports/STM32/LLD/SDMMCv1) -SET (CHIBIOS_INCLUDES_hal_GPT_F7 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_F7 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_F7 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_F7 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_UART_F7 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_WDG_F7 os/hal/ports/STM32/LLD/xWDGv1) - - - -SET (CHIBIOS_INCLUDES_hal_L0 - os/hal/ports/STM32/STM32L0xx - os/hal/ports/STM32/LLD/DMAv1 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_L0 - os/hal/ports/STM32/STM32L0xx/stm32_isr.c - os/hal/ports/STM32/STM32L0xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_L0 os/hal/ports/STM32/LLD/ADCv1/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_L0 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_L0 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_L0 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_L0 os/hal/ports/STM32/LLD/GPIOv2/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_L0 os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_L0 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_L0 os/hal/ports/STM32/LLD/SPIv1/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_L0 os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_L0 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_L0 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_L0 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_L0 os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_L0 os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_L0 os/hal/ports/STM32/LLD/USBv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_L0 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_L0 os/hal/ports/STM32/LLD/ADCv1) -SET (CHIBIOS_INCLUDES_hal_CAN_L0 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_L0 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_L0 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_L0 os/hal/ports/STM32/LLD/GPIOv2) -SET (CHIBIOS_INCLUDES_hal_I2C_L0 os/hal/ports/STM32/LLD/I2Cv2) -SET (CHIBIOS_INCLUDES_hal_RTC_L0 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_L0 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_SPI_L0 os/hal/ports/STM32/LLD/SPIv1) -SET (CHIBIOS_INCLUDES_hal_GPT_L0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_L0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_L0 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_L0 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_UART_L0 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_USB_L0 os/hal/ports/STM32/LLD/USBv1) -SET (CHIBIOS_INCLUDES_hal_WDG_L0 os/hal/ports/STM32/LLD/xWDGv1) - - - -SET (CHIBIOS_INCLUDES_hal_L4 - os/hal/ports/STM32/STM32L4xx - os/hal/ports/STM32/LLD/DMAv1 - os/hal/ports/STM32/LLD/TIMv1 -) -SET (CHIBIOS_SOURCES_hal_L4 - os/hal/ports/STM32/STM32L4xx/stm32_isr.c - os/hal/ports/STM32/STM32L4xx/hal_lld.c - os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c - os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.c -) - -SET (CHIBIOS_SOURCES_hal_ADC_L4 os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c) -SET (CHIBIOS_SOURCES_hal_CAN_L4 os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c) -SET (CHIBIOS_SOURCES_hal_DAC_L4 os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c) -SET (CHIBIOS_SOURCES_hal_EXT_L4 os/hal/ports/STM32/LLD/EXTIv1/hal_ext_lld.c) -SET (CHIBIOS_SOURCES_hal_PAL_L4 os/hal/ports/STM32/LLD/GPIOv3/hal_pal_lld.c) -SET (CHIBIOS_SOURCES_hal_I2C_L4 os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c) -SET (CHIBIOS_SOURCES_hal_USB_L4 os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c) -SET (CHIBIOS_SOURCES_hal_QSPI_L4 os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.c) -SET (CHIBIOS_SOURCES_hal_RTC_L4 os/hal/ports/STM32/LLD/RTCv2/hal_rtc_lld.c) -SET (CHIBIOS_SOURCES_hal_I2S_L4 os/hal/ports/STM32/LLD/SPIv2/hal_i2s_lld.c) -SET (CHIBIOS_SOURCES_hal_SPI_L4 os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c) -SET (CHIBIOS_SOURCES_hal_SDC_L4 os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c) -SET (CHIBIOS_SOURCES_hal_GPT_L4 os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.c) -SET (CHIBIOS_SOURCES_hal_ICU_L4 os/hal/ports/STM32/LLD/TIMv1/hal_icu_lld.c) -SET (CHIBIOS_SOURCES_hal_PWM_L4 os/hal/ports/STM32/LLD/TIMv1/hal_pwm_lld.c) -SET (CHIBIOS_SOURCES_hal_SERIAL_L4 os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c) -SET (CHIBIOS_SOURCES_hal_UART_L4 os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c) -SET (CHIBIOS_SOURCES_hal_WDG_L4 os/hal/ports/STM32/LLD/xWDGv1/hal_wdg_lld.c) - -SET (CHIBIOS_INCLUDES_hal_ADC_L4 os/hal/ports/STM32/LLD/ADCv3) -SET (CHIBIOS_INCLUDES_hal_CAN_L4 os/hal/ports/STM32/LLD/CANv1) -SET (CHIBIOS_INCLUDES_hal_DAC_L4 os/hal/ports/STM32/LLD/DACv1) -SET (CHIBIOS_INCLUDES_hal_EXT_L4 os/hal/ports/STM32/LLD/EXTIv1) -SET (CHIBIOS_INCLUDES_hal_PAL_L4 os/hal/ports/STM32/LLD/GPIOv3) -SET (CHIBIOS_INCLUDES_hal_I2C_L4 os/hal/ports/STM32/LLD/I2Cv2) -SET (CHIBIOS_INCLUDES_hal_USB_L4 os/hal/ports/STM32/LLD/OTGv1) -SET (CHIBIOS_INCLUDES_hal_QSPI_L4 os/hal/ports/STM32/LLD/QUADSPIv1) -SET (CHIBIOS_INCLUDES_hal_RTC_L4 os/hal/ports/STM32/LLD/RTCv2) -SET (CHIBIOS_INCLUDES_hal_I2S_L4 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SPI_L4 os/hal/ports/STM32/LLD/SPIv2) -SET (CHIBIOS_INCLUDES_hal_SDC_L4 os/hal/ports/STM32/LLD/SDMMCv1) -SET (CHIBIOS_INCLUDES_hal_GPT_L4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_ICU_L4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_PWM_L4 os/hal/ports/STM32/LLD/TIMv1) -SET (CHIBIOS_INCLUDES_hal_SERIAL_L4 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_UART_L4 os/hal/ports/STM32/LLD/USARTv2) -SET (CHIBIOS_INCLUDES_hal_WDG_L4 os/hal/ports/STM32/LLD/xWDGv1) - - - -IF (CHIBIOS_SOURCES_hal_${CHIBIOS_KERNEL}) - LIST(APPEND CHIBIOS_SOURCES_hal ${CHIBIOS_SOURCES_hal_${CHIBIOS_KERNEL}}) -ENDIF() - -IF (CHIBIOS_INCLUDES_hal_${CHIBIOS_KERNEL}) - LIST(APPEND CHIBIOS_INCLUDES_hal ${CHIBIOS_INCLUDES_hal_${CHIBIOS_KERNEL}}) -ENDIF() - -IF (CHIBIOS_SOURCES_hal_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_SOURCES_hal ${CHIBIOS_SOURCES_hal_${STM32_FAMILY}}) -ENDIF() - -IF (CHIBIOS_INCLUDES_hal_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_INCLUDES_hal ${CHIBIOS_INCLUDES_hal_${STM32_FAMILY}}) -ENDIF() - -FOREACH (COMP ${CHIBIOS_HAL_COMPONENTS}) - IF (CHIBIOS_SOURCES_hal_${COMP}) - LIST(APPEND CHIBIOS_SOURCES_hal ${CHIBIOS_SOURCES_hal_${COMP}}) - ENDIF() - IF (CHIBIOS_INCLUDES_hal_${COMP}) - LIST(APPEND CHIBIOS_INCLUDES_hal ${CHIBIOS_INCLUDES_hal_${COMP}}) - ENDIF() - - IF (CHIBIOS_SOURCES_hal_${COMP}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_SOURCES_hal ${CHIBIOS_SOURCES_hal_${COMP}_${STM32_FAMILY}}) - ENDIF() - IF (CHIBIOS_INCLUDES_hal_${COMP}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_INCLUDES_hal ${CHIBIOS_INCLUDES_hal_${COMP}_${STM32_FAMILY}}) - ENDIF() -ENDFOREACH() - - diff --git a/cmake/ChibiOS/18.2/ChibiOS_LD.cmake b/cmake/ChibiOS/18.2/ChibiOS_LD.cmake deleted file mode 100644 index 57087d6e..00000000 --- a/cmake/ChibiOS/18.2/ChibiOS_LD.cmake +++ /dev/null @@ -1,57 +0,0 @@ -IF(NOT CHIBIOS_PROCESS_STACK_SIZE) - SET(CHIBIOS_PROCESS_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_PROCESS_STACK_SIZE specified, using default: ${CHIBIOS_PROCESS_STACK_SIZE}") -ENDIF() - -IF(NOT CHIBIOS_MAIN_STACK_SIZE) - SET(CHIBIOS_MAIN_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_MAIN_STACK_SIZE specified, using default: ${CHIBIOS_MAIN_STACK_SIZE}") -ENDIF() - -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${CHIBIOS_ROOT}/os/common/startup/ARMCMx/compilers/GCC/ld\"") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__process_stack_size__=${CHIBIOS_PROCESS_STACK_SIZE}") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__main_stack_size__=${CHIBIOS_MAIN_STACK_SIZE}") - -# Auto-generate linker script -IF(NOT ChibiOS_LINKER_SCRIPT) - FILE(WRITE ${CMAKE_BINARY_DIR}/chibios_link.ld.in - "MEMORY\n" - "{\n" - "flash0 : org = 0x08000000, len = \${STM32_FLASH_SIZE}\n" - "flash1 : org = 0x00000000, len = 0\n" - "flash2 : org = 0x00000000, len = 0\n" - "flash3 : org = 0x00000000, len = 0\n" - "flash4 : org = 0x00000000, len = 0\n" - "flash5 : org = 0x00000000, len = 0\n" - "flash6 : org = 0x00000000, len = 0\n" - "flash7 : org = 0x00000000, len = 0\n" - "ram0 : org = 0x20000000, len = \${STM32_RAM_SIZE}\n" - "ram1 : org = 0x00000000, len = 0\n" - "ram2 : org = 0x00000000, len = 0\n" - "ram3 : org = 0x00000000, len = 0\n" - "ram4 : org = \${STM32_CCRAM_ORIGIN}, len = \${STM32_CCRAM_SIZE}\n" - "ram5 : org = 0x00000000, len = 0\n" - "ram6 : org = 0x00000000, len = 0\n" - "ram7 : org = 0x00000000, len = 0\n" - "}\n" - "REGION_ALIAS(\"VECTORS_FLASH\", flash0);\n" - "REGION_ALIAS(\"VECTORS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"XTORS_FLASH\", flash0);\n" - "REGION_ALIAS(\"XTORS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"TEXT_FLASH\", flash0);\n" - "REGION_ALIAS(\"TEXT_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"RODATA_FLASH\", flash0);\n" - "REGION_ALIAS(\"RODATA_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"VARIOUS_FLASH\", flash0);\n" - "REGION_ALIAS(\"VARIOUS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"RAM_INIT_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"MAIN_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"PROCESS_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM_LMA\", flash0);\n" - "REGION_ALIAS(\"BSS_RAM\", ram0);\n" - "REGION_ALIAS(\"HEAP_RAM\", ram0);\n" - "INCLUDE rules.ld\n" - ) - SET(ChibiOS_LINKER_SCRIPT ${CMAKE_BINARY_DIR}/chibios_link.ld.in) -ENDIF() diff --git a/cmake/ChibiOS/18.2/ChibiOS_RTOS.cmake b/cmake/ChibiOS/18.2/ChibiOS_RTOS.cmake deleted file mode 100644 index fa8a0228..00000000 --- a/cmake/ChibiOS/18.2/ChibiOS_RTOS.cmake +++ /dev/null @@ -1,92 +0,0 @@ -FOREACH (FAMILY F0 L0 L4) - SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${FAMILY} - os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S - os/common/ports/ARMCMx/chcore.c - os/common/ports/ARMCMx/chcore_v6m.c - os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v6m.S - ) -ENDFOREACH() - -FOREACH (FAMILY F1 F2 F3 F4 F7) - SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${FAMILY} - os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S - os/common/ports/ARMCMx/chcore.c - os/common/ports/ARMCMx/chcore_v7m.c - os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.S - ) -ENDFOREACH() - -FOREACH (FAMILY F0 F1 F2 F3 F4 F7 L0 L1) - SET (CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${FAMILY} - os/common/startup/ARMCMx/devices/STM32${FAMILY}xx - os/common/ext/ST/STM32${FAMILY}xx - os/common/oslib/include - os/common/ports/ARMCMx - os/common/ports/ARMCMx/compilers/GCC - ) -ENDFOREACH() - -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL} - os/common/startup/ARMCMx/compilers/GCC/crt1.c - os/common/startup/ARMCMx/compilers/GCC/vectors.S -) - -SET (CHIBIOS_INCLUDES_${CHIBIOS_KERNEL} - os/license - os/common/portability/GCC - os/common/startup/ARMCMx/compilers/GCC - os/common/ext/ARM/CMSIS/Core/Include -) - -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_MAILBOXES os/common/oslib/src/chmboxes.c) -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_MEMCORE os/common/oslib/src/chmemcore.c) -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_HEAP os/common/oslib/src/chheap.c) -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_MEMPOOLS os/common/oslib/src/chmempools.c) -SET (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_FACTORY os/common/oslib/src/chfactory.c) - -SET (CHIBIOS_SOURCES_rt_TM os/rt/src/chtm.c) -SET (CHIBIOS_SOURCES_rt_REGISTRY os/rt/src/chregistry.c) -SET (CHIBIOS_SOURCES_rt_SEMAPHORES os/rt/src/chsem.c) -SET (CHIBIOS_SOURCES_rt_MUTEXES os/rt/src/chmtx.c) -SET (CHIBIOS_SOURCES_rt_CONDVARS os/rt/src/chcond.c) -SET (CHIBIOS_SOURCES_rt_EVENTS os/rt/src/chevents.c) -SET (CHIBIOS_SOURCES_rt_MESSAGES os/rt/src/chmsg.c) -SET (CHIBIOS_SOURCES_rt_DYNAMIC os/rt/src/chdynamic.c) - -LIST (APPEND CHIBIOS_SOURCES_nil os/nil/src/ch.c) -LIST (APPEND CHIBIOS_INCLUDES_nil os/nil/include) - -LIST (APPEND CHIBIOS_SOURCES_rt - os/rt/src/chsys.c - os/rt/src/chdebug.c - os/rt/src/chtrace.c - os/rt/src/chvt.c - os/rt/src/chschd.c - os/rt/src/chthreads.c -) - -LIST (APPEND CHIBIOS_INCLUDES_rt os/rt/include) - -IF (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_SOURCES_${CHIBIOS_KERNEL} ${CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${STM32_FAMILY}}) -ENDIF() - -IF (CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_INCLUDES_${CHIBIOS_KERNEL} ${CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${STM32_FAMILY}}) -ENDIF() - -FOREACH (COMP ${CHIBIOS_RTOS_COMPONENTS}) - IF (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${COMP}) - LIST(APPEND CHIBIOS_SOURCES_${CHIBIOS_KERNEL} ${CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${COMP}}) - ENDIF() - IF (CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${COMP}) - LIST(APPEND CHIBIOS_INCLUDES_${CHIBIOS_KERNEL} ${CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${COMP}}) - ENDIF() - - IF (CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${COMP}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_SOURCES_${CHIBIOS_KERNEL} ${CHIBIOS_SOURCES_${CHIBIOS_KERNEL}_${COMP}_${STM32_FAMILY}}) - ENDIF() - IF (CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${COMP}_${STM32_FAMILY}) - LIST(APPEND CHIBIOS_INCLUDES_${CHIBIOS_KERNEL} ${CHIBIOS_INCLUDES_${CHIBIOS_KERNEL}_${COMP}_${STM32_FAMILY}}) - ENDIF() -ENDFOREACH() diff --git a/cmake/ChibiOS/ChibiOS16.cmake b/cmake/ChibiOS/ChibiOS16.cmake deleted file mode 100644 index a2ece49d..00000000 --- a/cmake/ChibiOS/ChibiOS16.cmake +++ /dev/null @@ -1,81 +0,0 @@ -IF(NOT ChibiOS_FIND_COMPONENTS) - SET(ChibiOS_FIND_COMPONENTS nil hal st) - MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}") -ENDIF() - - -LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil) -LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt) -LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal) -LIST(FIND ChibiOS_FIND_COMPONENTS st ChibiOS_FIND_COMPONENTS_st) - -IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0)) - MESSAGE(STATUS "No kernel component selected, using Nil kernel") - LIST(APPEND ChibiOS_FIND_COMPONENTS nil) - SET(CHIBIOS_KERNEL nil) -ELSE() - IF((NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) AND (NOT (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))) - MESSAGE(FATAL_ERROR "Cannot use RT and Nil kernel at the same time") - ENDIF() - IF(NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) - SET(CHIBIOS_KERNEL nil) - ELSE() - SET(CHIBIOS_KERNEL rt) - ENDIF() -ENDIF() - -IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0) - LIST(APPEND ChibiOS_FIND_COMPONENTS hal) -ENDIF() - -IF(${ChibiOS_FIND_COMPONENTS_st} LESS 0) - LIST(APPEND ChibiOS_FIND_COMPONENTS st) -ENDIF() - -INCLUDE(ChibiOS/ChibiOS16_LD) -INCLUDE(ChibiOS/ChibiOS16_HAL) -INCLUDE(ChibiOS/ChibiOS16_Community) - - -IF(${CHIBIOS_KERNEL} STREQUAL rt) - INCLUDE(ChibiOS/ChibiOS16_RT) -ELSE() - INCLUDE(ChibiOS/ChibiOS16_NIL) -ENDIF() - -INCLUDE(ChibiOS/ChibiOS16_Various) - -SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES} ${CHIBIOS_HAL_LIB_MODULES} ${CHIBIOS_VARIOUS_MODULES} ${CHIBIOS_COMMUNITY_MODULES}) - -IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") -ENDIF() - -FOREACH(comp ${ChibiOS_FIND_COMPONENTS}) - LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}") - ENDIF() - FOREACH(source ${CHIBIOS_${comp}_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}}) - ENDFOREACH() - IF(CHIBIOS_${comp}_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SOURCES) - FOREACH(source ${CHIBIOS_${comp}_PLATFORM_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_PLATFORM_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_PLATFORM_${source}}) - ENDFOREACH() - ENDIF() -ENDFOREACH() diff --git a/cmake/ChibiOS/ChibiOS16_Community.cmake b/cmake/ChibiOS/ChibiOS16_Community.cmake deleted file mode 100644 index 8d386473..00000000 --- a/cmake/ChibiOS/ChibiOS16_Community.cmake +++ /dev/null @@ -1,29 +0,0 @@ -SET(CHIBIOS_COMMUNITY_MODULES community nand eicu usbh timcap qei onewire crc eeprom usb_hid usb_msd) - -SET(CHIBIOS_community_SEARCH_HEADERS hal_community.h) -SET(CHIBIOS_community_SOURCES hal_community.c) - -FOREACH(module ${CHIBIOS_COMMUNITY_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/community/os/hal/include ${CHIBIOS_ROOT}/community/os/hal/src) - SET(CHIBIOS_${module}_SOURCES hal_${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS hal_${module}.h) -ENDFOREACH() - -SET(CHIBIOS_HAL_PLATFORM_MODULES nand eicu usbh timcap qei crc) -SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/FSMCv1 - LLD/TIMv1 - LLD/USBHv1 - LLD/TIMv1 - LLD/TIMv1 - LLD/CRCv1 -) - -SET(INDEX 0) -FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/community/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS hal_${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES hal_${module}_lld.c) - MATH(EXPR INDEX "${INDEX} + 1") -ENDFOREACH() diff --git a/cmake/ChibiOS/ChibiOS16_HAL.cmake b/cmake/ChibiOS/ChibiOS16_HAL.cmake deleted file mode 100644 index b53b8b82..00000000 --- a/cmake/ChibiOS/ChibiOS16_HAL.cmake +++ /dev/null @@ -1,258 +0,0 @@ -SET(CHIBIOS_HAL_LIB_MODULES chprintf memstreams nullstreams) -SET(CHIBIOS_HAL_MODULES adc can dac ext gpt i2c i2s icu mac mmc_spi mmcsd pal pwm rtc sdc serial serial_usb spi st uart usb wdg) - -IF(${CHIBIOS_KERNEL} STREQUAL nil) - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/nil) -ELSE() - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/rt) -ENDIF() - -SET(CHIBIOS_hal_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src/ ${CHIBIOS_OSAL_PATH}) -SET(CHIBIOS_hal_SEARCH_HEADERS hal.h osal.h) -SET(CHIBIOS_hal_SOURCES hal.c hal_buffers.c hal_queues.c osal.c) - -FOREACH(module ${CHIBIOS_HAL_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src) - SET(CHIBIOS_${module}_SOURCES ${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h) - - IF(${module} STREQUAL mmcsd) - SET(CHIBIOS_${module}_SOURCES hal_mmcsd.c) - ENDIF() - - IF(${module} STREQUAL serial_usb) - SET(CHIBIOS_${module}_SOURCES ${CHIBIOS_${module}_SOURCES} hal_buffers.c) - ENDIF() -ENDFOREACH() - -FOREACH(module ${CHIBIOS_HAL_LIB_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/lib/streams) - SET(CHIBIOS_${module}_SOURCES ${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h) -ENDFOREACH() - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv1 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv2 - LLD/SPIv1 - LLD/TIMv1 - LLD/MACv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/SDMMCv1 - LLD/USARTv2 - LLD/SPIv2 - LLD/TIMv1 - LLD/USARTv2 - LLD/USBv1 - LDD/DMAv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - st_lld.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - st_lld.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - STM32F1xx - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv1 - LLD/TIMv1 - LLD/GPIOv1 - LLD/TIMv1 - LLD/RTCv1 - LLD/SDIOv1 - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/USBv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - st_lld.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - st_lld.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv2 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/MACv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/SDIOv1 - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/OTGv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1 - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv2 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - st_lld.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - st_lld.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu pal pwm rtc serial spi st uart usb wdg) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv1 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv2 - LLD/TIMv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/USARTv2 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv2 - LLD/USBv1 - LLD/xWDGv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32L0xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1 - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - st_lld.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - st_lld.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32L0xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS16_LD.cmake b/cmake/ChibiOS/ChibiOS16_LD.cmake deleted file mode 100644 index 26dd962a..00000000 --- a/cmake/ChibiOS/ChibiOS16_LD.cmake +++ /dev/null @@ -1,38 +0,0 @@ -IF(NOT CHIBIOS_PROCESS_STACK_SIZE) - SET(CHIBIOS_PROCESS_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_PROCESS_STACK_SIZE specified, using default: ${CHIBIOS_PROCESS_STACK_SIZE}") -ENDIF() - -IF(NOT CHIBIOS_MAIN_STACK_SIZE) - SET(CHIBIOS_MAIN_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_MAIN_STACK_SIZE specified, using default: ${CHIBIOS_MAIN_STACK_SIZE}") -ENDIF() - -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC\"") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__process_stack_size__=${CHIBIOS_PROCESS_STACK_SIZE}") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__main_stack_size__=${CHIBIOS_MAIN_STACK_SIZE}") - -# Auto-generate linker script -IF(NOT ChibiOS_LINKER_SCRIPT) - FILE(WRITE ${CMAKE_BINARY_DIR}/chibios_link.ld.in - "MEMORY\n" - "{\n" - " flash : org = 0x08000000, len = \${STM32_FLASH_SIZE}\n" - " ram0 : org = 0x20000000, len = \${STM32_RAM_SIZE}\n" - " ram1 : org = 0x00000000, len = 0\n" - " ram2 : org = 0x00000000, len = 0\n" - " ram3 : org = 0x00000000, len = 0\n" - " ram4 : org = \${STM32_CCRAM_ORIGIN}, len = \${STM32_CCRAM_SIZE}\n" - " ram5 : org = 0x00000000, len = 0\n" - " ram6 : org = 0x00000000, len = 0\n" - " ram7 : org = 0x00000000, len = 0\n" - "}\n" - "REGION_ALIAS(\"MAIN_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"PROCESS_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM\", ram0);\n" - "REGION_ALIAS(\"BSS_RAM\", ram0);\n" - "REGION_ALIAS(\"HEAP_RAM\", ram0);\n" - "INCLUDE rules.ld\n" - ) - SET(ChibiOS_LINKER_SCRIPT ${CMAKE_BINARY_DIR}/chibios_link.ld.in) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS16_NIL.cmake b/cmake/ChibiOS/ChibiOS16_NIL.cmake deleted file mode 100644 index 96ecf8e3..00000000 --- a/cmake/ChibiOS/ChibiOS16_NIL.cmake +++ /dev/null @@ -1,69 +0,0 @@ -SET(CHIBIOS_nil_SEARCH_PATH - ${CHIBIOS_ROOT}/os/nil/src - ${CHIBIOS_ROOT}/os/nil/include - ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx - ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/nil/src -) -SET(CHIBIOS_nil_SEARCH_HEADERS - nil.h - nilcore.h - niltypes.h -) -SET(CHIBIOS_nil_SOURCES - crt1.c - vectors.c - nilcore.c - nil.c -) - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v6m.s nilcore_v6m.c nilcoreasm_v6m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F0xx/ - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm0.h - stm32f0xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F1xx/ - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm3.h - stm32f1xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F4xx/ - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm4.h - stm32f4xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v6m.s nilcore_v6m.c nilcoreasm_v6m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32L0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32L0xx/ - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm0plus.h - stm32l0xx.h - cmparams.h - ) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS16_RT.cmake b/cmake/ChibiOS/ChibiOS16_RT.cmake deleted file mode 100644 index b7b89fac..00000000 --- a/cmake/ChibiOS/ChibiOS16_RT.cmake +++ /dev/null @@ -1,89 +0,0 @@ -SET(CHIBIOS_rt_SEARCH_PATH - ${CHIBIOS_ROOT}/os/rt/src - ${CHIBIOS_ROOT}/os/rt/include - ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx - ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/rt/src -) - -SET(CHIBIOS_rt_SEARCH_HEADERS - ch.h - chcore.h - chtypes.h -) - -SET(CHIBIOS_rt_SOURCES - crt1.c - vectors.c - chcore.c - chsys.c - chdebug.c - chvt.c - chschd.c - chthreads.c - chtm.c - chstats.c - chdynamic.c - chregistry.c - chsem.c - chmtx.c - chcond.c - chevents.c - chmsg.c - chmboxes.c - chqueues.c - chmemcore.c - chheap.c - chmempools.c -) - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v6m.s chcore_v6m.c chcoreasm_v6m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F0xx/ - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm0.h - stm32f0xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F1xx/ - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm3.h - stm32f1xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F4xx/ - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm4.h - stm32f4xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v6m.s chcore_v6m.c chcoreasm_v6m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32L0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32L0xx/ - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm0plus.h - stm32l0xx.h - cmparams.h - ) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS16_Various.cmake b/cmake/ChibiOS/ChibiOS16_Various.cmake deleted file mode 100644 index b71fb29f..00000000 --- a/cmake/ChibiOS/ChibiOS16_Various.cmake +++ /dev/null @@ -1,12 +0,0 @@ -SET(CHIBIOS_VARIOUS_MODULES evtimer shell syscalls) - -SET(CHIBIOS_evtimer_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_evtimer_SOURCES evtimer.c) -SET(CHIBIOS_evtimer_SEARCH_HEADERS evtimer.h) - -SET(CHIBIOS_shell_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_shell_SOURCES shell.c) -SET(CHIBIOS_shell_SEARCH_HEADERS shell.h) - -SET(CHIBIOS_syscalls_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_syscalls_SOURCES syscalls.c) diff --git a/cmake/ChibiOS/ChibiOS17.cmake b/cmake/ChibiOS/ChibiOS17.cmake deleted file mode 100644 index 9b951e08..00000000 --- a/cmake/ChibiOS/ChibiOS17.cmake +++ /dev/null @@ -1,63 +0,0 @@ -IF(NOT ChibiOS_FIND_COMPONENTS) - SET(ChibiOS_FIND_COMPONENTS nil hal st) - MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}") -ENDIF() - -LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil) -LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt) - -IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0)) - MESSAGE(STATUS "No kernel component selected, using Nil kernel") - LIST(APPEND ChibiOS_FIND_COMPONENTS nil) - SET(CHIBIOS_KERNEL nil) -ELSE() - IF((NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) AND (NOT (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))) - MESSAGE(FATAL_ERROR "Cannot use RT and Nil kernel at the same time") - ENDIF() - IF(NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) - SET(CHIBIOS_KERNEL nil) - ELSE() - SET(CHIBIOS_KERNEL rt) - ENDIF() -ENDIF() - -INCLUDE(ChibiOS/ChibiOS17_LD) -INCLUDE(ChibiOS/ChibiOS17_Kernel) -INCLUDE(ChibiOS/ChibiOS17_HAL) -#INCLUDE(ChibiOS/ChibiOS17_Various) -#INCLUDE(ChibiOS/ChibiOS17_Community) - -SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES} ${CHIBIOS_HAL_LIB_MODULES} ${CHIBIOS_VARIOUS_MODULES} ${CHIBIOS_COMMUNITY_MODULES}) - -IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") -ENDIF() - -FOREACH(comp ${ChibiOS_FIND_COMPONENTS}) - LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}") - ENDIF() - FOREACH(source ${CHIBIOS_${comp}_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}}) - ENDFOREACH() - IF(CHIBIOS_${comp}_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SOURCES) - FOREACH(source ${CHIBIOS_${comp}_PLATFORM_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_PLATFORM_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_PLATFORM_${source}}) - ENDFOREACH() - ENDIF() -ENDFOREACH() diff --git a/cmake/ChibiOS/ChibiOS17_HAL.cmake b/cmake/ChibiOS/ChibiOS17_HAL.cmake deleted file mode 100644 index e4917495..00000000 --- a/cmake/ChibiOS/ChibiOS17_HAL.cmake +++ /dev/null @@ -1,254 +0,0 @@ -SET(CHIBIOS_HAL_LIB_MODULES chprintf memstreams nullstreams) -SET(CHIBIOS_HAL_MODULES adc buffers can channels dac ext files gpt i2c i2s icu ioblock mac mii mmc_spi mmcsd pal pwm qspi queues rtc sdc serial serial_usb spi st streams uart usb_cdc usb wdg) - -IF(${CHIBIOS_KERNEL} STREQUAL nil) - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/nil) -ELSE() - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/rt) -ENDIF() - -SET(CHIBIOS_hal_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/include - ${CHIBIOS_ROOT}/os/hal/src/ - ${CHIBIOS_ROOT}/os/hal/osal/lib - ${CHIBIOS_OSAL_PATH} -) -SET(CHIBIOS_hal_SEARCH_HEADERS - hal.h - osal.h -) -SET(CHIBIOS_hal_SOURCES - hal.c - osal.c -) - -FOREACH(module ${CHIBIOS_HAL_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src) - SET(CHIBIOS_${module}_SOURCES hal_${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS hal_${module}.h) -ENDFOREACH() - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb wdg) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv1 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv2 - LLD/SPIv1 - LLD/TIMv1 - LLD/MACv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/SDMMCv1 - LLD/USARTv2 - LLD/SPIv2 - LLD/TIMv1 - LLD/USARTv2 - LLD/USBv1 - LDD/DMAv1 - LDD/xWDGv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_isr.h - stm32_rcc.h - stm32_registry.h - nvic.h - stm32_dma.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - nvic.c - stm32_dma.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS hal_${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES hal_${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} hal_ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} hal_ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - STM32F1xx - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv1 - LLD/TIMv1 - LLD/GPIOv1 - LLD/TIMv1 - LLD/RTCv1 - LLD/SDIOv1 - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/USBv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_isr.h - stm32_rcc.h - stm32_registry.h - nvic.h - stm32_dma.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - nvic.c - stm32_dma.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS hal_${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES hal_${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} hal_ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} hal_ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv2 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/MACv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/SDIOv1 - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/OTGv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv2 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_isr.h - stm32_rcc.h - stm32_registry.h - nvic.h - stm32_dma.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - nvic.c - stm32_dma.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS hal_${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES hal_${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} hal_ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} hal_ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu pal pwm rtc serial spi st uart usb wdg) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - LLD/ADCv1 - LLD/CANv1 - LLD/DACv1 - LLD/EXTIv1 - LLD/TIMv1 - LLD/I2Cv2 - LLD/TIMv1 - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD/USARTv2 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv2 - LLD/USBv1 - LLD/xWDGv1 - ) - - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32L0xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_isr.h - stm32_rcc.h - stm32_registry.h - nvic.h - stm32_dma.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - nvic.c - stm32_dma.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS hal_${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES hal_${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32L0xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} hal_ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} hal_ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS17_Kernel.cmake b/cmake/ChibiOS/ChibiOS17_Kernel.cmake deleted file mode 100644 index 1ebaa8ba..00000000 --- a/cmake/ChibiOS/ChibiOS17_Kernel.cmake +++ /dev/null @@ -1,166 +0,0 @@ -SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_ROOT}/os/license - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/startup/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/oslib/src - ${CHIBIOS_ROOT}/os/common/oslib/include - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/include -) - -SET(CHIBIOS_kernel_SEARCH_HEADERS - ch.h - chcore.h - chlicense.h - chtypes.h - cmparams.h - chbsem.h - chheap.h - chmboxes.h - chmemcore.h - chmempools.h -) - -SET(CHIBIOS_kernel_SOURCES - chcore.c - crt1.c - vectors.c - chheap.c - chmboxes.c - chmemcore.c - chmempools.c -) - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/common/startup/ARMCMx/devices/STM32F0xx - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/ST/STM32F0xx - ) - SET(CHIBIOS_kernel_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} - core_cm0.h - stm32f0xx.h - ) - SET(CHIBIOS_kernel_SOURCES - ${CHIBIOS_kernel_SOURCES} - crt0_v6m.S - chcore_v6m.c - chcoreasm_v6m.S - ) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/common/startup/ARMCMx/devices/STM32F1xx - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/ST/STM32F1xx - ) - SET(CHIBIOS_kernel_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} - core_cm3.h - stm32f1xx.h - ) - SET(CHIBIOS_kernel_SOURCES - ${CHIBIOS_kernel_SOURCES} - crt0_v7m.S - chcore_v7m.c - chcoreasm_v7m.S - ) -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/common/startup/ARMCMx/devices/STM32F4xx - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/ST/STM32F4xx - ) - SET(CHIBIOS_kernel_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} - core_cm4.h - stm32f4xx.h - ) - SET(CHIBIOS_kernel_SOURCES - ${CHIBIOS_kernel_SOURCES} - crt0_v7m.S - chcore_v7m.c - chcoreasm_v7m.S - ) -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/common/startup/ARMCMx/devices/STM32L0xx - ${CHIBIOS_ROOT}/os/common/ext/CMSIS/ST/STM32L0xx - ) - SET(CHIBIOS_kernel_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} - core_cm0.h - stm32l0xx.h - ) - SET(CHIBIOS_kernel_SOURCES - ${CHIBIOS_kernel_SOURCES} - crt0_v6m.S - chcore_v6m.c - chcoreasm_v6m.S - ) -ENDIF() - -SET(CHIBIOS_nil_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/nil/src - ${CHIBIOS_ROOT}/os/nil/include -) - -SET(CHIBIOS_rt_SEARCH_PATH - ${CHIBIOS_kernel_SEARCH_PATH} - ${CHIBIOS_ROOT}/os/rt/src - ${CHIBIOS_ROOT}/os/rt/include -) - -SET(CHIBIOS_nil_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} -) - -SET(CHIBIOS_rt_SEARCH_HEADERS - ${CHIBIOS_kernel_SEARCH_HEADERS} - ch.h - chalign.h - chchecks.h - chcond.h - chdebug.h - chdynamic.h - chevents.h - chmsg.h - chmtx.h - chregistry.h - chschd.h - chsem.h - chstats.h - chsys.h - chsystypes.h - chthreads.h - chtm.h - chtrace.h - chvt.h -) - -SET(CHIBIOS_nil_SOURCES - ${CHIBIOS_kernel_SOURCES} - ch.c -) - -SET(CHIBIOS_rt_SOURCES - ${CHIBIOS_kernel_SOURCES} - chcond.c - chdebug.c - chdynamic.c - chevents.c - chmsg.c - chmtx.c - chregistry.c - chschd.c - chsem.c - chstats.c - chsys.c - chthreads.c - chtm.c - chtrace.c - chvt.c -) diff --git a/cmake/ChibiOS/ChibiOS17_LD.cmake b/cmake/ChibiOS/ChibiOS17_LD.cmake deleted file mode 100644 index 57087d6e..00000000 --- a/cmake/ChibiOS/ChibiOS17_LD.cmake +++ /dev/null @@ -1,57 +0,0 @@ -IF(NOT CHIBIOS_PROCESS_STACK_SIZE) - SET(CHIBIOS_PROCESS_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_PROCESS_STACK_SIZE specified, using default: ${CHIBIOS_PROCESS_STACK_SIZE}") -ENDIF() - -IF(NOT CHIBIOS_MAIN_STACK_SIZE) - SET(CHIBIOS_MAIN_STACK_SIZE 0x200) - MESSAGE(STATUS "No CHIBIOS_MAIN_STACK_SIZE specified, using default: ${CHIBIOS_MAIN_STACK_SIZE}") -ENDIF() - -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${CHIBIOS_ROOT}/os/common/startup/ARMCMx/compilers/GCC/ld\"") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__process_stack_size__=${CHIBIOS_PROCESS_STACK_SIZE}") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__main_stack_size__=${CHIBIOS_MAIN_STACK_SIZE}") - -# Auto-generate linker script -IF(NOT ChibiOS_LINKER_SCRIPT) - FILE(WRITE ${CMAKE_BINARY_DIR}/chibios_link.ld.in - "MEMORY\n" - "{\n" - "flash0 : org = 0x08000000, len = \${STM32_FLASH_SIZE}\n" - "flash1 : org = 0x00000000, len = 0\n" - "flash2 : org = 0x00000000, len = 0\n" - "flash3 : org = 0x00000000, len = 0\n" - "flash4 : org = 0x00000000, len = 0\n" - "flash5 : org = 0x00000000, len = 0\n" - "flash6 : org = 0x00000000, len = 0\n" - "flash7 : org = 0x00000000, len = 0\n" - "ram0 : org = 0x20000000, len = \${STM32_RAM_SIZE}\n" - "ram1 : org = 0x00000000, len = 0\n" - "ram2 : org = 0x00000000, len = 0\n" - "ram3 : org = 0x00000000, len = 0\n" - "ram4 : org = \${STM32_CCRAM_ORIGIN}, len = \${STM32_CCRAM_SIZE}\n" - "ram5 : org = 0x00000000, len = 0\n" - "ram6 : org = 0x00000000, len = 0\n" - "ram7 : org = 0x00000000, len = 0\n" - "}\n" - "REGION_ALIAS(\"VECTORS_FLASH\", flash0);\n" - "REGION_ALIAS(\"VECTORS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"XTORS_FLASH\", flash0);\n" - "REGION_ALIAS(\"XTORS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"TEXT_FLASH\", flash0);\n" - "REGION_ALIAS(\"TEXT_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"RODATA_FLASH\", flash0);\n" - "REGION_ALIAS(\"RODATA_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"VARIOUS_FLASH\", flash0);\n" - "REGION_ALIAS(\"VARIOUS_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"RAM_INIT_FLASH_LMA\", flash0);\n" - "REGION_ALIAS(\"MAIN_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"PROCESS_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM_LMA\", flash0);\n" - "REGION_ALIAS(\"BSS_RAM\", ram0);\n" - "REGION_ALIAS(\"HEAP_RAM\", ram0);\n" - "INCLUDE rules.ld\n" - ) - SET(ChibiOS_LINKER_SCRIPT ${CMAKE_BINARY_DIR}/chibios_link.ld.in) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS2.cmake b/cmake/ChibiOS/ChibiOS2.cmake deleted file mode 100644 index 06a5f978..00000000 --- a/cmake/ChibiOS/ChibiOS2.cmake +++ /dev/null @@ -1,324 +0,0 @@ -SET(CHIBIOS_HAL_MODULES adc can ext gpt i2c icu mac mmc_spi mmcsd pal pwm rtc sdc serial serial_usb spi tm uart usb) -SET(CHIBIOS_VARIOUS_MODULES chprintf chrtclib evtimer memstreams shell syscalls fatfs lwip) -SET(CHIBIOS_COMPONENTS kernel hal ${CHIBIOS_HAL_MODULES} ${CHIBIOS_VARIOUS_MODULES}) - -IF(NOT ChibiOS_FIND_COMPONENTS) - SET(ChibiOS_FIND_COMPONENTS kernel) - MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}") - MESSAGE(STATUS "Supported ChibiOS components: ${CHIBIOS_COMPONENTS}") -ENDIF() - -SET(CHIBIOS_HAL_LLD_MODULES adc can ext gpt i2c icu mac pal pwm rtc sdc serial spi uart usb) - -SET(CHIBIOS_kernel_SEARCH_PATH - ${CHIBIOS_ROOT}/os/kernel/include - ${CHIBIOS_ROOT}/os/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx - ${CHIBIOS_ROOT}/os/kernel/src -) -SET(CHIBIOS_kernel_SEARCH_HEADERS - ch.h - nvic.h - chcore.h -) -SET(CHIBIOS_kernel_SOURCES - chsys.c - chdebug.c - chlists.c - chvt.c - chschd.c - chthreads.c - chdynamic.c - chregistry.c - chsem.c - chmtx.c - chcond.c - chevents.c - chmsg.c - chmboxes.c - chqueues.c - chmemcore.c - chheap.c - chmempools.c - crt0.c - chcore.c - chcore_v7m.c - nvic.c -) - -SET(CHIBIOS_hal_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src) -SET(CHIBIOS_hal_SEARCH_HEADERS hal.h) -SET(CHIBIOS_hal_SOURCES hal.c) - -FOREACH(module ${CHIBIOS_HAL_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/src) - SET(CHIBIOS_${module}_SOURCES ${module}.c) -ENDFOREACH() - -FOREACH(module ${CHIBIOS_VARIOUS_MODULES}) - IF(${module} STREQUAL fatfs) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/various/fatfs_bindings ${CHIBIOS_ROOT}/ext/fatfs/src/ ${CHIBIOS_ROOT}/ext/fatfs/src/option) - SET(CHIBIOS_${module}_SOURCES - fatfs_diskio.c - fatfs_syscall.c - ff.c - ccsbcs.c - ) - SET(CHIBIOS_${module}_SEARCH_HEADERS ff.h) - ELSEIF(${module} STREQUAL lwip) - SET(CHIBIOS_${module}_SEARCH_PATH - ${CHIBIOS_ROOT}/os/various/lwip_bindings - ${CHIBIOS_ROOT}/os/various/lwip_bindings/arch - ${CHIBIOS_ROOT}/ext/lwip/src/ - ${CHIBIOS_ROOT}/ext/lwip/src/include/ - ${CHIBIOS_ROOT}/ext/lwip/src/include/ipv4/ - ) - SET(CHIBIOS_${module}_SOURCES - lwipthread.c - sys_arch.c - netif/etharp.c - core/dhcp.c - core/dns.c - core/init.c - core/mem.c - core/memp.c - core/netif.c - core/pbuf.c - core/raw.c - core/stats.c - core/sys.c - core/tcp.c - core/tcp_in.c - core/tcp_out.c - core/udp.c - core/ipv4/autoip.c - core/ipv4/icmp.c - core/ipv4/igmp.c - core/ipv4/inet.c - core/ipv4/inet_chksum.c - core/ipv4/ip.c - core/ipv4/ip_addr.c - core/ipv4/ip_frag.c - core/def.c - core/timers.c - api/api_lib.c - api/api_msg.c - api/err.c - api/netbuf.c - api/netdb.c - api/netifapi.c - api/sockets.c - api/tcpip.c - ) - SET(CHIBIOS_${module}_SEARCH_HEADERS - lwipthread.h - sys_arch.h - lwip/api.h - lwip/ip.h - ) - ELSE() - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/various/) - SET(CHIBIOS_${module}_SOURCES ${module}.c) - IF(NOT (${module} STREQUAL syscalls)) - SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h) - ENDIF() - ENDIF() -ENDFOREACH() - -IF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_kernel_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/ports/common/ARMCMx/CMSIS/include - ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F4xx - ) - SET(CHIBIOS_kernel_PLATFORM_SOURCES - vectors.c - ) - SET(CHIBIOS_kernel_PLATFORM_SEARCH_HEADERS - core_cm4.h - cmparams.h - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/platforms/STM32F4xx - ${CHIBIOS_ROOT}/os/hal/platforms/STM32 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32.h - stm32f4xx.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - ) - - SET(CHIBIOS_HAL_PLATFORM_MODULE_PATHES - STM32F4xx - STM32 - STM32 - STM32/TIMv1 - STM32/I2Cv1 - STM32/TIMv1 - STM32 - STM32/GPIOv2 - STM32/TIMv1 - STM32/RTCv2 - STM32 - STM32/USARTv1 - STM32/SPIv1 - STM32/USARTv1 - STM32/OTGv1 - ) - - IF(NOT ChibiOS_LINKER_SCRIPT) - IF(NOT STM32_CHIP_TYPE) - STM32_GET_CHIP_TYPE(${STM32_CHIP} STM32_CHIP_TYPE) - ENDIF() - IF(NOT STM32_FLASH_SIZE) - STM32_GET_CHIP_PARAMETERS(${STM32_CHIP} STM32_FLASH_SIZE STM32_RAM_SIZE) - ENDIF() - IF(${STM32_CHIP_TYPE} STREQUAL 40_41xxx) - IF(${STM32_FLASH_SIZE} STREQUAL 1024K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F405xG.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F4xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ELSEIF(${STM32_CHIP_TYPE} STREQUAL 429_439xx) - IF(${STM32_FLASH_SIZE} STREQUAL 2048K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F429xI.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F4xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ENDIF() - - IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") - ENDIF() - ENDIF() - -ELSEIF(STM32_FAMILY STREQUAL "F1") - - SET(CHIBIOS_kernel_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/ports/common/ARMCMx/CMSIS/include - ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx - ) - SET(CHIBIOS_kernel_PLATFORM_SOURCES - vectors.c - ) - SET(CHIBIOS_kernel_PLATFORM_SEARCH_HEADERS - core_cm3.h - cmparams.h - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/platforms/STM32F1xx - ${CHIBIOS_ROOT}/os/hal/platforms/STM32 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32.h - stm32f10x.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - ) - - SET(CHIBIOS_HAL_PLATFORM_MODULE_PATHES - STM32F1xx - STM32 - STM32 - STM32/TIMv1 - STM32/I2Cv1 - STM32/TIMv1 - STM32 - STM32/GPIOv1 - STM32/TIMv1 - STM32/RTCv1 - STM32 - STM32/USARTv1 - STM32/SPIv1 - STM32/USARTv1 - STM32/USBv1 - ) - - IF(NOT ChibiOS_LINKER_SCRIPT) - IF(NOT STM32_CHIP_TYPE) - STM32_GET_CHIP_TYPE(${STM32_CHIP} STM32_CHIP_TYPE) - ENDIF() - IF(NOT STM32_FLASH_SIZE) - STM32_GET_CHIP_PARAMETERS(${STM32_CHIP} STM32_FLASH_SIZE STM32_RAM_SIZE) - ENDIF() - IF(${STM32_CHIP_TYPE} STREQUAL MD_VL) - IF(${STM32_FLASH_SIZE} STREQUAL 128K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F100xB.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ELSEIF(${STM32_CHIP_TYPE} STREQUAL MD) - IF(${STM32_FLASH_SIZE} STREQUAL 128K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F103xB.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ELSEIF(${STM32_CHIP_TYPE} STREQUAL HD) - IF(${STM32_FLASH_SIZE} STREQUAL 384K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F103xD.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ELSEIF(${STM32_FLASH_SIZE} STREQUAL 512K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F103xE.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ELSEIF(${STM32_CHIP_TYPE} STREQUAL XL) - IF(${STM32_FLASH_SIZE} STREQUAL 1024K) - FIND_FILE(ChibiOS_LINKER_SCRIPT NAMES STM32F103xG.ld PATHS ${CHIBIOS_ROOT}/os/ports/GCC/ARMCMx/STM32F1xx/ld NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - ENDIF() - ENDIF() - ENDIF() -ENDIF() - -IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") -ENDIF() - -SET(INDEX 0) -FOREACH(module ${CHIBIOS_HAL_LLD_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULE_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/platforms/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") -ENDFOREACH() - -IF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_ext_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/platforms/STM32F4xx) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_ext_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/platforms/STM32F1xx) -ENDIF() - -FOREACH(comp ${ChibiOS_FIND_COMPONENTS}) - LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}") - ENDIF() - FOREACH(source ${CHIBIOS_${comp}_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}}) - ENDFOREACH() - IF(CHIBIOS_${comp}_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SOURCES) - FOREACH(source ${CHIBIOS_${comp}_PLATFORM_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_PLATFORM_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_PLATFORM_${source}}) - ENDFOREACH() - ENDIF() -ENDFOREACH() - diff --git a/cmake/ChibiOS/ChibiOS3.cmake b/cmake/ChibiOS/ChibiOS3.cmake deleted file mode 100644 index 59daa665..00000000 --- a/cmake/ChibiOS/ChibiOS3.cmake +++ /dev/null @@ -1,78 +0,0 @@ -IF(NOT ChibiOS_FIND_COMPONENTS) - SET(ChibiOS_FIND_COMPONENTS nil hal st) - MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}") -ENDIF() - -LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil) -LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt) -LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal) -LIST(FIND ChibiOS_FIND_COMPONENTS st ChibiOS_FIND_COMPONENTS_st) - -IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0)) - MESSAGE(STATUS "No kernel component selected, using Nil kernel") - LIST(APPEND ChibiOS_FIND_COMPONENTS nil) - SET(CHIBIOS_KERNEL nil) -ELSE() - IF((NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) AND (NOT (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))) - MESSAGE(FATAL_ERROR "Cannot use RT and Nil kernel at the same time") - ENDIF() - IF(NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) - SET(CHIBIOS_KERNEL nil) - ELSE() - SET(CHIBIOS_KERNEL rt) - ENDIF() -ENDIF() - -IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0) - LIST(APPEND ChibiOS_FIND_COMPONENTS hal) -ENDIF() - -IF(${ChibiOS_FIND_COMPONENTS_st} LESS 0) - LIST(APPEND ChibiOS_FIND_COMPONENTS st) -ENDIF() - -INCLUDE(ChibiOS/ChibiOS3_LD) -INCLUDE(ChibiOS/ChibiOS3_HAL) - -IF(${CHIBIOS_KERNEL} STREQUAL rt) - INCLUDE(ChibiOS/ChibiOS3_RT) -ELSE() - INCLUDE(ChibiOS/ChibiOS3_NIL) -ENDIF() - -INCLUDE(ChibiOS/ChibiOS3_Various) - -SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES} ${CHIBIOS_HAL_LIB_MODULES} ${CHIBIOS_VARIOUS_MODULES}) - -IF(NOT ChibiOS_LINKER_SCRIPT) - MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.") -ENDIF() - -FOREACH(comp ${ChibiOS_FIND_COMPONENTS}) - LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}") - ENDIF() - FOREACH(source ${CHIBIOS_${comp}_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}}) - ENDFOREACH() - IF(CHIBIOS_${comp}_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS) - FOREACH(header ${CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS}) - FIND_PATH(CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() - IF(CHIBIOS_${comp}_PLATFORM_SOURCES) - FOREACH(source ${CHIBIOS_${comp}_PLATFORM_SOURCES}) - FIND_FILE(CHIBIOS_${comp}_PLATFORM_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH) - LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_PLATFORM_${source}}) - ENDFOREACH() - ENDIF() -ENDFOREACH() diff --git a/cmake/ChibiOS/ChibiOS3_HAL.cmake b/cmake/ChibiOS/ChibiOS3_HAL.cmake deleted file mode 100644 index fad7938f..00000000 --- a/cmake/ChibiOS/ChibiOS3_HAL.cmake +++ /dev/null @@ -1,192 +0,0 @@ -SET(CHIBIOS_HAL_LIB_MODULES chprintf memstreams nullstreams) -SET(CHIBIOS_HAL_MODULES adc can dac ext gpt i2c i2s icu mac mmc_spi mmcsd pal pwm rtc sdc serial serial_usb spi st uart usb) - -IF(${CHIBIOS_KERNEL} STREQUAL nil) - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/nil) -ELSE() - SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/rt) -ENDIF() - -SET(CHIBIOS_hal_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src/ ${CHIBIOS_OSAL_PATH}) -SET(CHIBIOS_hal_SEARCH_HEADERS hal.h osal.h) -SET(CHIBIOS_hal_SOURCES hal.c hal_queues.c osal.c) - -FOREACH(module ${CHIBIOS_HAL_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src) - SET(CHIBIOS_${module}_SOURCES ${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h) - - IF(${module} STREQUAL mmcsd) - SET(CHIBIOS_${module}_SOURCES hal_mmcsd.c) - ENDIF() -ENDFOREACH() - -FOREACH(module ${CHIBIOS_HAL_LIB_MODULES}) - SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/lib/streams) - SET(CHIBIOS_${module}_SOURCES ${module}.c) - SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h) -ENDFOREACH() - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - STM32F0xx - LLD - LLD - LLD/TIMv1 - LLD/I2Cv2 - LLD/SPIv1 - LLD/TIMv1 - LLD - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD - LLD/USARTv2 - LLD/SPIv2 - LLD/TIMv1 - LLD/USARTv2 - LLD/USBv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() - -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - STM32F1xx - LLD - LLD - LLD/TIMv1 - LLD/I2Cv1 - LLD/SPIv1 - LLD/TIMv1 - LLD - LLD/GPIOv1 - LLD/TIMv1 - LLD/RTCv1 - LLD - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/USBv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb) - SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES - STM32F4xx - LLD - LLD/DACv1 - LLD - LLD/TIMv1 - LLD/I2Cv1 - LLD/SPIv1 - LLD/TIMv1 - LLD - LLD/GPIOv2 - LLD/TIMv1 - LLD/RTCv2 - LLD - LLD/USARTv1 - LLD/SPIv1 - LLD/TIMv1 - LLD/USARTv1 - LLD/OTGv1 - ) - - SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx - ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx - ${CHIBIOS_ROOT}/os/hal/ports/STM32 - ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv2 - ) - SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS - hal_lld.h - stm32_dma.h - nvic.h - ) - SET(CHIBIOS_hal_PLATFORM_SOURCES - hal_lld.c - stm32_dma.c - nvic.c - ) - SET(INDEX 0) - FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES}) - LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path) - - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path}) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c) - - IF(${module} STREQUAL ext) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx) - SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h) - SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c) - ENDIF() - - MATH(EXPR INDEX "${INDEX} + 1") - ENDFOREACH() -ENDIF() - diff --git a/cmake/ChibiOS/ChibiOS3_LD.cmake b/cmake/ChibiOS/ChibiOS3_LD.cmake deleted file mode 100644 index c73fd75a..00000000 --- a/cmake/ChibiOS/ChibiOS3_LD.cmake +++ /dev/null @@ -1,38 +0,0 @@ - IF(NOT CHIBIOS_PROCESS_STACK_SIZE) - SET(CHIBIOS_PROCESS_STACK_SIZE 0x400) - MESSAGE(STATUS "No CHIBIOS_PROCESS_STACK_SIZE specified, using default: ${CHIBIOS_PROCESS_STACK_SIZE}") -ENDIF() - -IF(NOT CHIBIOS_MAIN_STACK_SIZE) - SET(CHIBIOS_MAIN_STACK_SIZE 0x400) - MESSAGE(STATUS "No CHIBIOS_MAIN_STACK_SIZE specified, using default: ${CHIBIOS_MAIN_STACK_SIZE}") -ENDIF() - -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC\"") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__process_stack_size__=${CHIBIOS_PROCESS_STACK_SIZE}") -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__main_stack_size__=${CHIBIOS_MAIN_STACK_SIZE}") - -# Auto-generate linker script -IF(NOT ChibiOS_LINKER_SCRIPT) - FILE(WRITE ${CMAKE_BINARY_DIR}/chibios_link.ld.in - "MEMORY\n" - "{\n" - " flash : org = 0x08000000, len = \${STM32_FLASH_SIZE}\n" - " ram0 : org = 0x20000000, len = \${STM32_RAM_SIZE}\n" - " ram1 : org = 0x00000000, len = 0\n" - " ram2 : org = 0x00000000, len = 0\n" - " ram3 : org = 0x00000000, len = 0\n" - " ram4 : org = \${STM32_CCRAM_ORIGIN}, len = \${STM32_CCRAM_SIZE}\n" - " ram5 : org = 0x00000000, len = 0\n" - " ram6 : org = 0x00000000, len = 0\n" - " ram7 : org = 0x00000000, len = 0\n" - "}\n" - "REGION_ALIAS(\"MAIN_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"PROCESS_STACK_RAM\", ram0);\n" - "REGION_ALIAS(\"DATA_RAM\", ram0);\n" - "REGION_ALIAS(\"BSS_RAM\", ram0);\n" - "REGION_ALIAS(\"HEAP_RAM\", ram0);\n" - "INCLUDE rules.ld\n" - ) - SET(ChibiOS_LINKER_SCRIPT ${CMAKE_BINARY_DIR}/chibios_link.ld.in) -ENDIF() \ No newline at end of file diff --git a/cmake/ChibiOS/ChibiOS3_NIL.cmake b/cmake/ChibiOS/ChibiOS3_NIL.cmake deleted file mode 100644 index ea925091..00000000 --- a/cmake/ChibiOS/ChibiOS3_NIL.cmake +++ /dev/null @@ -1,57 +0,0 @@ -SET(CHIBIOS_nil_SEARCH_PATH - ${CHIBIOS_ROOT}/os/nil/src - ${CHIBIOS_ROOT}/os/nil/include - ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx - ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/nil/src -) -SET(CHIBIOS_nil_SEARCH_HEADERS - nil.h - nilcore.h - niltypes.h -) -SET(CHIBIOS_nil_SOURCES - crt1.c - vectors.c - nilcore.c - nil.c -) - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v6m.s nilcore_v6m.c nilcoreasm_v6m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm0.h - stm32f0xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm3.h - stm32f10x.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_nil_SOURCES ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s) - SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS - core_cm4.h - stm32f4xx.h - cmparams.h - ) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS3_RT.cmake b/cmake/ChibiOS/ChibiOS3_RT.cmake deleted file mode 100644 index 120c5d9b..00000000 --- a/cmake/ChibiOS/ChibiOS3_RT.cmake +++ /dev/null @@ -1,76 +0,0 @@ -SET(CHIBIOS_rt_SEARCH_PATH - ${CHIBIOS_ROOT}/os/rt/src - ${CHIBIOS_ROOT}/os/rt/include - ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx - ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC - ${CHIBIOS_ROOT}/os/rt/src -) - -SET(CHIBIOS_rt_SEARCH_HEADERS - ch.h - chcore.h - chtypes.h -) -SET(CHIBIOS_rt_SOURCES - crt1.c - vectors.c - chcore.c - chsys.c - chdebug.c - chvt.c - chschd.c - chthreads.c - chtm.c - chstats.c - chdynamic.c - chregistry.c - chsem.c - chmtx.c - chcond.c - chevents.c - chmsg.c - chmboxes.c - chqueues.c - chmemcore.c - chheap.c - chmempools.c -) - -IF(STM32_FAMILY STREQUAL "F0") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v6m.s chcore_v6m.c chcoreasm_v6m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm0.h - stm32f0xx.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm3.h - stm32f10x.h - cmparams.h - ) -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(CHIBIOS_rt_SOURCES ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s) - SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH - ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx - ${CHIBIOS_ROOT}/os/ext/CMSIS/include - ${CHIBIOS_ROOT}/os/ext/CMSIS/ST - ) - SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS - core_cm4.h - stm32f4xx.h - cmparams.h - ) -ENDIF() diff --git a/cmake/ChibiOS/ChibiOS3_Various.cmake b/cmake/ChibiOS/ChibiOS3_Various.cmake deleted file mode 100644 index b8d77507..00000000 --- a/cmake/ChibiOS/ChibiOS3_Various.cmake +++ /dev/null @@ -1,12 +0,0 @@ -SET(CHIBIOS_VARIOUS_MODULES evtimer shell syscalls) - -SET(CHIBIOS_evtimer_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_evtimer_SOURCES evtimer.c) -SET(CHIBIOS_evtimer_SEARCH_HEADERS evtimer.h) - -SET(CHIBIOS_shell_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_shell_SOURCES shell.c) -SET(CHIBIOS_shell_SEARCH_HEADERS shell.h) - -SET(CHIBIOS_syscalls_SEARCH_PATH ${CHIBIOS_ROOT}/os/various) -SET(CHIBIOS_syscalls_SOURCES syscalls.c) diff --git a/cmake/FindBSP.cmake b/cmake/FindBSP.cmake new file mode 100644 index 00000000..d2b58298 --- /dev/null +++ b/cmake/FindBSP.cmake @@ -0,0 +1,340 @@ +set(BSP_F0_BOARDS + STM32F0xx_Nucleo_32 STM32F0xx-Nucleo STM32F072B-Discovery + STM32F0308-Discovery STM32072B_EVAL STM32091C_EVAL +) +set(BSP_F0_COMPONENTS + hx8347d l3gd20 spfd5408 st7735 stlm75 +) +set(BSP_F0_SOURCES_STM32F072B_Discovery eeprom gyroscope) +set(BSP_F0_SOURCES_STM32072B_EVAL eeprom lcd sd tsensor) +set(BSP_F0_SOURCES_STM32091C_EVAL eeprom lcd sd tsensor) +set(BSP_F0_DEVICE_STM32F072B_Discovery F072RB) +set(BSP_F0_DEVICE_STM32F0308_Discovery F030R8) +set(BSP_F0_DEVICE_STM32072B_EVAL F072VB) +set(BSP_F0_DEVICE_STM32091C_EVAL F091VC) + +set(BSP_F1_BOARDS + STM32F1xx_Nucleo STM32VL-Discovery STM3210C_EVAL STM3210E_EVAL +) +set(BSP_F1_COMPONENTS + ak4343 cs43l22 hx8347d ili9320 ili9325 lis302dl spfd5408 st7735 stlm75 + stmpe811 +) +set(BSP_F1_SOURCES_STM3210C_EVAL accelerometer audio eeprom io lcd sd ts) +set(BSP_F1_SOURCES_STM3210E_EVAL audio lcd nand nor sd serialflash sram tsensor) +set(BSP_F1_DEVICE_STM32VL_Discovery F100RB) +set(BSP_F1_DEVICE_STM3210C_EVAL F107VC) +set(BSP_F1_DEVICE_STM3210E_EVAL F103ZE) + +set(BSP_F2_BOARDS + STM32F2xx_Nucleo_144 STM322xG_EVAL +) +set(BSP_F2_COMPONENTS + cs43l22 ili9320 ili9325 ili9341 ov2640 st7735 stmpe811 +) +set(BSP_F2_SOURCES_STM322xG_EVAL audio camera eeprom io lcd sd sram ts) +set(BSP_F2_DEVICE_STM322xG_EVAL F207IG) + +set(BSP_F3_BOARDS + STM32F3-Discovery STM32F3xx_Nucleo_32 STM32F3xx_Nucleo_144 STM32F3xx-Nucleo + STM32F3348-Discovery STM32303C_EVAL STM32303E_EVAL STM32373C_EVAL +) +set(BSP_F3_COMPONENTS + cs42l52 cs43l22 hx8347d hx8347g hx8347i ili9320 ili9325 ili9328 l3gd20 + lsm303dlhc spfd5408 st7735 stts751 +) +set(BSP_F3_SOURCES_STM32F3_Discovery accelerometer gyroscope) +set(BSP_F3_SOURCES_STM32303C_EVAL audio eeprom lcd sd tsensor) +set(BSP_F3_SOURCES_STM32303E_EVAL audio eeprom lcd sd tsensor) +set(BSP_F3_SOURCES_STM32373C_EVAL audio eeprom lcd sd tsensor) +set(BSP_F3_DEVICE_STM32F3_Discovery F303VC) +set(BSP_F3_DEVICE_STM32F3348_Discovery F334C8) +set(BSP_F3_DEVICE_STM32303C_EVAL F303VC) +set(BSP_F3_DEVICE_STM32303E_EVAL F303VE) +set(BSP_F3_DEVICE_STM32373C_EVAL F373VC) + +set(BSP_F4_BOARDS + STM32F4-Discovery STM32F4xx_Nucleo_144 STM32F4xx-Nucleo STM32F401-Discovery + STM32F411E-Discovery STM32F413H-Discovery STM32F429I-Discovery + STM324x9I_EVAL STM324xG_EVAL STM32412G-Discovery STM32446E_EVAL + STM32469I_EVAL STM32469I-Discovery +) +set(BSP_F4_COMPONENTS + ampire480272 ampire640480 cs43l22 exc7200 ft6x06 ili9325 ili9341 l3gd20 + lis3dsh lis302dl ls016b8uy lsm303dlhc mfxstm32l152 n25q128a n25q256a + n25q512a otm8009a ov2640 s5k5cag s25fl512s st7735 st7789h2 stmpe811 + stmpe1600 ts3510 wm8994 +) +set(BSP_F4_SOURCES_STM32F4_Discovery accelerometer audio) +set(BSP_F4_SOURCES_STM32F401_Discovery accelerometer audio gyroscope) +set(BSP_F4_SOURCES_STM32F411E_Discovery accelerometer audio gyroscope) +set(BSP_F4_SOURCES_STM32F413H_Discovery audio lcd psram qspi sd ts) +set(BSP_F4_SOURCES_STM32F429I_Discovery eeprom gyroscope io lcd sdram ts) +set(BSP_F4_SOURCES_STM324x9I_EVAL audio camera eeprom io lcd nor sd sdram sram ts) +set(BSP_F4_SOURCES_STM324xG_EVAL audio camera eeprom io lcd sd sram ts) +set(BSP_F4_SOURCES_STM32412G_Discovery audio eeprom lcd qspi sd ts) +set(BSP_F4_SOURCES_STM3232446E_EVAL audio camera eeprom io lcd qspi sd sdram ts) +set(BSP_F4_SOURCES_STM32469I_EVAL audio camera eeprom io lcd nor qspi sd sdram sram ts) +set(BSP_F4_SOURCES_STM32469I_Discovery audio eeprom lcd qspi sd sdram ts) +set(BSP_F4_DEVICE_STM32F4_Discovery F407VG) +set(BSP_F4_DEVICE_STM32F401_Discovery F401VC) +set(BSP_F4_DEVICE_STM32F411E_Discovery F411VE) +set(BSP_F4_DEVICE_STM32F413H_Discovery F413ZH) +set(BSP_F4_DEVICE_STM32F429I_Discovery F429ZI) +set(BSP_F4_DEVICE_STM324x9I_EVAL F429NI) +set(BSP_F4_DEVICE_STM324xG_EVAL F407IG) +set(BSP_F4_DEVICE_STM32412G_Discovery F412ZG) +set(BSP_F4_DEVICE_STM32446E_EVAL F446ZE) +set(BSP_F4_DEVICE_STM32469I_EVAL F469NI) +set(BSP_F4_DEVICE_STM32469I_Discovery F469NI) + +set(BSP_F7_BOARDS + STM32F7xx_Nucleo_144 STM32F723E-Discovery STM32F769I_EVAL + STM32F769I-Discovery STM32F7308-Discovery STM32F7508-Discovery + STM32746G-Discovery STM32756G_EVAL +) +set(BSP_F7_COMPONENTS + adv7533 ampire480272 ampire640480 exc7200 ft6x06 ft5336 mfxstm32l152 + mx25l512 n25q128a n25q512a otm8009a ov5640 ov9655 rk043fn48h s5k5cag st7735 + st7789h2 stmpe811 ts3510 wm8994 +) +set(BSP_F7_SOURCES_STM32F723E_Discovery audio lcd psram qspi ts) +set(BSP_F7_SOURCES_STM32F769I_EVAL audio camera eeprom io lcd nor qspi sd sdram sram ts) +set(BSP_F7_SOURCES_STM32F769I_Discovery audio eeprom lcd qspi sd sdram ts) +set(BSP_F7_SOURCES_STM32F7308_Discovery audio lcd psram qspi ts) +set(BSP_F7_SOURCES_STM32F7508_Discovery audio camera eeprom lcd qspi sd sdram ts) +set(BSP_F7_SOURCES_STM32746G_Discovery audio camera eeprom lcd qspi sd sdram ts) +set(BSP_F7_SOURCES_STM32756G_EVAL audio camera eeprom io lcd nor qspi sd sdram sram ts) +set(BSP_F7_DEVICE_STM32F723E_Discovery F723IE) +set(BSP_F7_DEVICE_STM32F769I_EVAL F769NI) +set(BSP_F7_DEVICE_STM32F769I_Discovery F769NI) +set(BSP_F7_DEVICE_STM32F7308_Discovery F730I8) +set(BSP_F7_DEVICE_STM32F7508_Discovery F750N8) +set(BSP_F7_DEVICE_STM32746G_Discovery F746NG) +set(BSP_F7_DEVICE_STM32756G_EVAL F756NG) + +set(BSP_G0_BOARDS + STM32G0xx_Nucleo STM32G0xx_Nucleo_32 STM32G071B-Discovery STM32G081B_EVAL + STM32G0316-Discovery +) +set(BSP_G0_COMPONENTS + hx8347d ina230 sn65dp141 ssd1315 st7735 stlm75 tusb546 +) +set(BSP_G0_DIR_STM32G0316_Discovery STM32G0316-DISCO) +set(BSP_G0_SOURCES_STM32G071B_Discovery lcd pwr pwrmon) +set(BSP_G0_SOURCES_STM32G081B_EVAL lcd mux pwr sd tsensor) +set(BSP_G0_DEVICE_STM32G071B_Discovery G071RB) +set(BSP_G0_DEVICE_STM32G081B_EVAL G081RB) +set(BSP_G0_DEVICE_STM32G0316_Discovery G031J6) + +set(BSP_G4_BOARDS + B-G474E-DPOW1 STM32G4xx_Nucleo STM32G474E-EVAL +) +set(BSP_G4_COMPONENTS + hx8347d mfxstm32l152 mt25ql512abb st7735 stts751 wm8994 +) +set(BSP_G4_SOURCES_B-G474E-DPOW1 usbpd_pwr) +set(BSP_G4_SOURCES_STM32G481B_EVAL audio bus env_sensor idd io lcd qspi sd smartcard sram usbpd_pwr) +set(BSP_G4_DEVICE_B_G474E_DPOW1 G474RE) +set(BSP_G4_DEVICE_STM32G474E_EVAL G474QE) + +set(BSP_H7_BOARDS + STM32H7B3I-Discovery STM32H7B3I-EVAL STM32H7xx_Nucleo STM32H743I-EVAL + STM32H745I-Discovery STM32H747I-Discovery STM32H747I-EVAL + STM32H750B-Discovery +) +set(BSP_H7_COMPONENTS + adv7533 ampire480272 ampire640480 cs42l51 es_wifi exc7200 ft6x06 ft5336 + is42s16800j is42s32800g is42s32800j lan8742 m24lr64 mfxstm32l152 + mt25tl01g mt48lc4m32b2 mx25lm51245g otm8009a ov5640 ov9655 rk043fn48h + rk070er9427 s5k5cag st7735 stmpe811 ts3510 wm8994 +) +set(BSP_H7_DIR_STM32H7B3I_Discovery STM32H7B3I-DK) +set(BSP_H7_DIR_STM32H745I_Discovery STM32H745I-DISCO) +set(BSP_H7_DIR_STM32H747I_Discovery STM32H747I-DISCO) +set(BSP_H7_DIR_STM32H750B_Discovery STM32H750B-DK) +set(BSP_H7_SOURCES_STM32H7B3I_Discovery audio bus camera eeprom lcd ospi sd sdram ts) +set(BSP_H7_SOURCES_STM32H7B3I_EVAL audio bus camera eeprom io lcd nor ospi sd sdram sram ts) +set(BSP_H7_SOURCES_STM32H743I_EVAL audio bus eeprom io lcd nor qspi sd sdram sram ts) +set(BSP_H7_SOURCES_STM32H745I_Discovery audio bus lcd mmc qspi sdram ts) +set(BSP_H7_SOURCES_STM32H747I_Discovery audio bus camera lcd qspi sd sdram ts) +set(BSP_H7_SOURCES_STM32H747I_EVAL audio bus eeprom io lcd nor qspi sd sdram sram ts) +set(BSP_H7_SOURCES_STM32H750B_Discovery audio bus lcd mmc qspi sdram ts) +set(BSP_H7_DEVICE_STM32H7B3I_Discovery H7B3LI) +set(BSP_H7_DEVICE_STM32H7B3I_EVAL H7B3LI) +set(BSP_H7_DEVICE_STM32H743I_EVAL H743XI) +set(BSP_H7_DEVICE_STM32H745I_Discovery H745XI) +set(BSP_H7_DEVICE_STM32H747I_Discovery H747XI) +set(BSP_H7_DEVICE_STM32H747I_EVAL H743XI) +set(BSP_H7_DEVICE_STM32H750B_Discovery H750XB) + +set(BSP_L0_BOARDS + STM32L0xx_Nucleo STM32L0xx_Nucleo_32 STM32L073Z_EVAL STM32L0538-Discovery +) +set(BSP_L0_COMPONENTS + gde021a1 hx8347d mfxstm32l152 st7735 stlm75 +) +set(BSP_L0_SOURCES_STM32L073Z_EVAL eeprom glass_lcd idd io lcd sd tsensor) +set(BSP_L0_SOURCES_STM32L0538_Discovery epd) +set(BSP_L0_DEVICE_STM32L073Z_EVAL L073VZ) +set(BSP_L0_DEVICE_STM32L0538_Discovery L053C8) + +set(BSP_L1_BOARDS + STM32L1xx_Nucleo STM32L100C-Discovery STM32L152C-Discovery STM32L152D_EVAL +) +set(BSP_L1_COMPONENTS + cs43l22 hx8347d ili9320 ili9325 spfd5408 st7735 stlm75 +) +set(BSP_L1_SOURCES_STM32L152C_Discovery glass_lcd) +set(BSP_L1_SOURCES_STM32L152D_EVAL audio eeprom audio glass_lcd lcd nor sd sram tsensor) +set(BSP_L1_DEVICE_STM32L100C_Discovery L100RC) +set(BSP_L1_DEVICE_STM32L152C_Discovery L152RC) +set(BSP_L1_DEVICE_STM32L152D_EVAL L152ZD) + +set(BSP_L4_BOARDS + STM32L475E-IOT01 STM32L4P5G-Discovery STM32L4R9I_EVAL STM32L4R9I-Discovery + STM32L4xx_Nucleo STM32L4xx_Nucleo_32 STM32L4xx_Nucleo_144 STM32L476G_EVAL + STM32L476G-Discovery STM32L496G-Discovery +) +set(BSP_L4_COMPONENTS + cs42l51 cs43l22 cy8c4014lqi ft3x67 ft6x06 ft5336 hts221 hx8347g hx8347i + iss66wvh8m8 l3gd20 lis3mdl lps22hb ls016b8uy lsm6dsl lsm303c lsm303dlhc + m24sr mfxstm32l152 mx25lm51245g mx25r6435f n25q128a n25q256a ov9655 + rk043fn48h st7735 st7789h2 stmpe811 stmpe1600 wm8994 +) +set(BSP_L4_SOURCES_B_L475E_IOT01 accelerometer gyro hsensor magneto psensor qspi tsensor iot01) +set(BSP_L4_SOURCES_STM32L4P5G_Discovery idd io lcd mmc ospi_nor psram ts) +set(BSP_L4_SOURCES_STM32L4R9I_EVAL audio dsi_lcd dsi_ts eeprom idd io nor ospi_nor ospi_ram rgb_ts sd sram) +set(BSP_L4_SOURCES_STM32L4R9I_Discovery audio camera idd io lcd ospi_nor psram sd ts) +set(BSP_L4_SOURCES_STM32L476G_EVAL audio eeprom glass_lcd idd io lcd nor qspi sd sram ts) +set(BSP_L4_SOURCES_STM32L476G_Discovery audio compass glass_lcd gyroscope qspi) +set(BSP_L4_SOURCES_STM32L496G_Discovery audio camera idd io lcd qspi sd sram ts) +set(BSP_L4_DIR_STM32L475E_IOT01 B-L475E-IOT01) +set(BSP_L4_DEVICE_STM32L475E_IOT01 L475VG) +set(BSP_L4_DEVICE_STM32L4P5G_Discovery L4P5AG) +set(BSP_L4_DEVICE_STM32L4R9I_EVAL L4R9AI) +set(BSP_L4_DEVICE_STM32L4R9I_Discovery L4R9AI) +set(BSP_L4_DEVICE_STM32L476G_EVAL L476ZG) +set(BSP_L4_DEVICE_STM32L476G_Discovery L476VG) +set(BSP_L4_DEVICE_STM32L496G_Discovery L496AG) + +if(NOT BSP_FIND_COMPONENTS) + set(BSP_FIND_COMPONENTS + STM32F0 STM32F1 STM32F2 STM32F3 STM32F4 STM32F7 + STM32G0 STM32G4 + STM32H7_M7 STM32H7_M4 + STM32L0 STM32L1 STM32L4 + ) +endif() + +if(STM32H7 IN_LIST BSP_FIND_COMPONENTS) + list(REMOVE_ITEM BSP_FIND_COMPONENTS STM32H7) + list(APPEND BSP_FIND_COMPONENTS STM32H7_M7 STM32H7_M4) +endif() +list(REMOVE_DUPLICATES BSP_FIND_COMPONENTS) + +foreach(COMP ${BSP_FIND_COMPONENTS}) + string(TOLOWER ${COMP} COMP_L) + string(TOUPPER ${COMP} COMP_U) + + string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP_U ${COMP_U}) + if(NOT CMAKE_MATCH_1) + message(FATAL_ERROR "Unknown BSP component: ${COMP}") + endif() + + if(CMAKE_MATCH_3) + set(CORE ${CMAKE_MATCH_3}) + set(CORE_C "::${CORE}") + set(CORE_U "_${CORE}") + else() + unset(CORE) + unset(CORE_C) + unset(CORE_U) + endif() + + set(FAMILY ${CMAKE_MATCH_1}) + string(TOLOWER ${FAMILY} FAMILY_L) + + if(NOT STM32_CUBE_${FAMILY}_PATH) + set(STM32_CUBE_${FAMILY}_PATH /opt/STM32Cube${FAMILY} CACHE PATH "Path to STM32Cube${FAMILY}") + message(STATUS "No STM32_CUBE_${FAMILY}_PATH specified using default: ${STM32_CUBE_${FAMILY}_PATH}") + endif() + + find_path(BSP_${FAMILY}_PATH + NAMES Components/Common/io.h + PATHS "${STM32_CUBE_${FAMILY}_PATH}/Drivers/BSP" + NO_DEFAULT_PATH + ) + if (NOT BSP_${FAMILY}_PATH) + continue() + endif() + + set(BSP_${FAMILY}_INCLUDE "${BSP_${FAMILY}_PATH}/Components/Common") + + add_library(BSP::STM32::${FAMILY}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(BSP::STM32::${FAMILY}${CORE_C} INTERFACE STM32::${FAMILY}${CORE_C}) + target_include_directories(BSP::STM32::${FAMILY}${CORE_C} INTERFACE "${BSP_${FAMILY}_PATH}/Components/Common") + + foreach(BOARD ${BSP_${FAMILY}_BOARDS}) + string(REPLACE "-" "_" BOARD_CANONICAL ${BOARD}) + string(TOLOWER ${BOARD_CANONICAL} BOARD_CANONICAL_L) + set(BOARD_DEVICE ${BSP_${FAMILY}_DEVICE_${BOARD_CANONICAL}}) + + stm32_get_cores(DEV_CORES FAMILY ${FAMILY} DEVICE ${BOARD_DEVICE}) + if(CORE AND (NOT ${CORE} IN_LIST DEV_CORES)) + continue() + endif() + + find_path(BSP_${BOARD_CANONICAL}_PATH + NAMES ${BOARD_CANONICAL_L}.h + PATHS "${BSP_${FAMILY}_PATH}/${BOARD}" "${BSP_${FAMILY}_PATH}/${BSP_${FAMILY}_DIR_${BOARD_CANONICAL}}" + NO_DEFAULT_PATH + ) + if (NOT BSP_${BOARD_CANONICAL}_PATH) + continue() + endif() + + add_library(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE BSP::STM32::${FAMILY}${CORE_C} CMSIS::STM32::${FAMILY}${CORE_C}) + target_include_directories(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE "${BSP_${BOARD_CANONICAL}_PATH}") + target_sources(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE "${BSP_${BOARD_CANONICAL}_PATH}/${BOARD_CANONICAL_L}.c") + + foreach(SRC ${BSP_${FAMILY}_SOURCES_${BOARD_CANONICAL}}) + target_sources(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE "${BSP_${BOARD_CANONICAL}_PATH}/${BOARD_CANONICAL_L}_${SRC}.c") + endforeach() + if(BSP_${FAMILY}_DEVICE_${BOARD_CANONICAL}) + target_link_libraries(BSP::STM32::${BOARD_CANONICAL}${CORE_C} INTERFACE CMSIS::STM32::${BSP_${FAMILY}_DEVICE_${BOARD_CANONICAL}}${CORE_C}) + endif() + endforeach() + + foreach(BCOMP ${BSP_${FAMILY}_COMPONENTS}) + string(TOLOWER ${BCOMP} BCOMP_L) + string(TOUPPER ${BCOMP} BCOMP_U) + + add_library(BSP::STM32::${FAMILY}${CORE_C}::${BCOMP_U} INTERFACE IMPORTED) + target_link_libraries(BSP::STM32::${FAMILY}${CORE_C}::${BCOMP_U} INTERFACE BSP::STM32::${FAMILY}${CORE_C} CMSIS::STM32::${FAMILY}${CORE_C}) + target_include_directories(BSP::STM32::${FAMILY}${CORE_C}::${BCOMP_U} INTERFACE "${BSP_${FAMILY}_PATH}/Components/${BCOMP}") + + find_file(BSP_${BOARD_CANONICAL}_${COMP}_SOURCE + NAMES ${BCOMP}.c + PATHS "${BSP_${FAMILY}_PATH}/Components/${BCOMP}" + NO_DEFAULT_PATH + ) + if (BSP_${BOARD_CANONICAL}_${COMP}_SOURCE) + target_sources(BSP::STM32::${FAMILY}${CORE_C}::${BCOMP_U} INTERFACE "${BSP_${BOARD_CANONICAL}_${COMP}_SOURCE}") + endif() + endforeach() + + set(BSP_${COMP}_FOUND TRUE) + + if(BSP_${COMP}_FOUND) + list(APPEND BSP_INCLUDE_DIRS "${BSP_${FAMILY}_INCLUDE}") + endif() +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(BSP + REQUIRED_VARS BSP_INCLUDE_DIRS + FOUND_VAR BSP_FOUND + HANDLE_COMPONENTS +) diff --git a/cmake/FindCMSIS.cmake b/cmake/FindCMSIS.cmake index 13ca2c9d..44566ad4 100644 --- a/cmake/FindCMSIS.cmake +++ b/cmake/FindCMSIS.cmake @@ -1,196 +1,190 @@ -IF(STM32_CHIP_TYPE OR STM32_CHIP) - IF(NOT STM32_CHIP_TYPE) - STM32_GET_CHIP_TYPE(${STM32_CHIP} STM32_CHIP_TYPE) - IF(NOT STM32_CHIP_TYPE) - MESSAGE(FATAL_ERROR "Unknown chip: ${STM32_CHIP}. Try to use STM32_CHIP_TYPE directly.") - ENDIF() - MESSAGE(STATUS "${STM32_CHIP} is ${STM32_CHIP_TYPE} device") - ENDIF() - STRING(TOLOWER ${STM32_CHIP_TYPE} STM32_CHIP_TYPE_LOWER) -ENDIF() - -SET(CMSIS_COMMON_HEADERS - arm_common_tables.h - arm_const_structs.h - arm_math.h - core_cmFunc.h - core_cmInstr.h - core_cmSimd.h -) - -IF(STM32_FAMILY STREQUAL "F1") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm3.h) - SET(CMSIS_DEVICE_HEADERS stm32f1xx.h system_stm32f1xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f1xx.c) -ELSEIF(STM32_FAMILY STREQUAL "F2") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F2_V1.1.1") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - STRING(REGEX REPLACE "^(2[01]7).[BCDEFG]" "\\1" STM32_DEVICE_NUM ${STM32_CHIP_TYPE}) - SET(CMSIS_STARTUP_SOURCE startup_stm32f${STM32_DEVICE_NUM}xx.s) - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm4.h) - SET(CMSIS_DEVICE_HEADERS stm32f2xx.h system_stm32f2xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f2xx.c) -ELSEIF(STM32_FAMILY STREQUAL "F3") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F3_V1.6.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - STRING(REGEX REPLACE "^(3..).(.)" "\\1x\\2" STM32_STARTUP_NAME ${STM32_CODE}) - STRING(TOLOWER ${STM32_STARTUP_NAME} STM32_STARTUP_NAME_LOWER) - SET(CMSIS_STARTUP_SOURCE startup_stm32f${STM32_STARTUP_NAME_LOWER}.s) - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm4.h) - SET(CMSIS_DEVICE_HEADERS stm32f3xx.h system_stm32f3xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f3xx.c) -ELSEIF(STM32_FAMILY STREQUAL "F4") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F4_V1.8.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm4.h) - SET(CMSIS_DEVICE_HEADERS stm32f4xx.h system_stm32f4xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f4xx.c) -ELSEIF(STM32_FAMILY STREQUAL "F7") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F7_V1.3.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm7.h) - SET(CMSIS_DEVICE_HEADERS stm32f7xx.h system_stm32f7xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f7xx.c) -ELSEIF(STM32_FAMILY STREQUAL "F0") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F0_V1.4.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm3.h) - SET(CMSIS_DEVICE_HEADERS stm32f0xx.h system_stm32f0xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32f0xx.c) - -ELSEIF(STM32_FAMILY STREQUAL "G0") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_G0_V1.1.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm0plus.h) - SET(CMSIS_DEVICE_HEADERS stm32g0xx.h system_stm32g0xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32g0xx.c) - - STRING(REGEX REPLACE "^(0[3478][01]).[BCDEFG468]" "\\1" STM32_DEVICE_NUM ${STM32_CHIP_TYPE}) - SET(CMSIS_STARTUP_SOURCE startup_stm32g${STM32_DEVICE_NUM}xx.s) - -ELSEIF(STM32_FAMILY STREQUAL "H7") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_H7_V1.3.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm7.h) - SET(CMSIS_DEVICE_HEADERS stm32h7xx.h system_stm32h7xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32h7xx.c) - IF(NOT CMSIS_STARTUP_SOURCE) - SET(CMSIS_STARTUP_SOURCE startup_stm32h${STM32_CHIP_TYPE_LOWER}.s) - ENDIF() - message(STATUS "CMSIS_STARTUP_SOURCE @@@@@@ ${CMSIS_STARTUP_SOURCE}") -ELSEIF(STM32_FAMILY STREQUAL "L0") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_L0_V1.7.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm0.h) - SET(CMSIS_DEVICE_HEADERS stm32l0xx.h system_stm32l0xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32l0xx.c) - IF(NOT CMSIS_STARTUP_SOURCE) - SET(CMSIS_STARTUP_SOURCE startup_stm32l${STM32_CHIP_TYPE_LOWER}.s) - ENDIF() -ELSEIF(STM32_FAMILY STREQUAL "L1") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_L1_V1.8.0") - MESSAGE(WARNING "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - LIST(APPEND CMSIS_COMMON_HEADERS core_cm3.h) - SET(CMSIS_DEVICE_HEADERS stm32l1xx.h system_stm32l1xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32l1xx.c) - IF(NOT CMSIS_STARTUP_SOURCE) - SET(CMSIS_STARTUP_SOURCE startup_stm32l${STM32_CHIP_TYPE_LOWER}.s) - ENDIF() -ELSEIF(STM32_FAMILY STREQUAL "L4") - IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_L4_V1.9.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) - ENDIF() - - LIST(APPEND CMSIS_COMMON_HEADERS core_cm4.h) - SET(CMSIS_DEVICE_HEADERS stm32l4xx.h system_stm32l4xx.h) - SET(CMSIS_DEVICE_SOURCES system_stm32l4xx.c) - IF(NOT CMSIS_STARTUP_SOURCE) - SET(CMSIS_STARTUP_SOURCE startup_stm32l${STM32_CHIP_TYPE_LOWER}.s) - ENDIF() -ENDIF() - -IF(NOT CMSIS_STARTUP_SOURCE) - SET(CMSIS_STARTUP_SOURCE startup_stm32f${STM32_CHIP_TYPE_LOWER}.s) -ENDIF() - -FIND_PATH(CMSIS_COMMON_INCLUDE_DIR ${CMSIS_COMMON_HEADERS} - PATH_SUFFIXES include stm32${STM32_FAMILY_LOWER} cmsis - HINTS ${STM32Cube_DIR}/Drivers/CMSIS/Include/ - CMAKE_FIND_ROOT_PATH_BOTH -) - -FIND_PATH(CMSIS_DEVICE_INCLUDE_DIR ${CMSIS_DEVICE_HEADERS} - PATH_SUFFIXES include stm32${STM32_FAMILY_LOWER} cmsis - HINTS ${STM32Cube_DIR}/Drivers/CMSIS/Device/ST/STM32${STM32_FAMILY}xx/Include - CMAKE_FIND_ROOT_PATH_BOTH -) - -SET(CMSIS_INCLUDE_DIRS - ${CMSIS_DEVICE_INCLUDE_DIR} - ${CMSIS_COMMON_INCLUDE_DIR} -) - -FOREACH(SRC ${CMSIS_DEVICE_SOURCES}) - STRING(MAKE_C_IDENTIFIER "${SRC}" SRC_CLEAN) - SET(CMSIS_${SRC_CLEAN}_FILE SRC_FILE-NOTFOUND) - FIND_FILE(CMSIS_${SRC_CLEAN}_FILE ${SRC} - PATH_SUFFIXES src stm32${STM32_FAMILY_LOWER} cmsis - HINTS ${STM32Cube_DIR}/Drivers/CMSIS/Device/ST/STM32${STM32_FAMILY}xx/Source/Templates/ - CMAKE_FIND_ROOT_PATH_BOTH +if(NOT CMSIS_FIND_COMPONENTS) + set(CMSIS_FIND_COMPONENTS + STM32F0 STM32F1 STM32F2 STM32F3 STM32F4 STM32F7 + STM32G0 STM32G4 + STM32H7_M7 STM32H7_M4 + STM32L0 STM32L1 STM32L4 ) - LIST(APPEND CMSIS_SOURCES ${CMSIS_${SRC_CLEAN}_FILE}) -ENDFOREACH() - -IF(STM32_CHIP_TYPE) - SET(CMSIS_STARTUP_SOURCE_FILE SRC_FILE-NOTFOUND) - FIND_FILE(CMSIS_STARTUP_SOURCE_FILE ${CMSIS_STARTUP_SOURCE} - PATH_SUFFIXES src stm32${STM32_FAMILY_LOWER} cmsis - HINTS ${STM32Cube_DIR}/Drivers/CMSIS/Device/ST/STM32${STM32_FAMILY}xx/Source/Templates/gcc/ - CMAKE_FIND_ROOT_PATH_BOTH +endif() + +if(STM32H7 IN_LIST CMSIS_FIND_COMPONENTS) + list(REMOVE_ITEM CMSIS_FIND_COMPONENTS STM32H7) + list(APPEND CMSIS_FIND_COMPONENTS STM32H7_M7 STM32H7_M4) +endif() +list(REMOVE_DUPLICATES CMSIS_FIND_COMPONENTS) + +include(stm32/devices) + +function(cmsis_generate_default_linker_script FAMILY DEVICE CORE) + if(CORE) + set(CORE_C "::${CORE}") + set(CORE_U "_${CORE}") + endif() + + set(OUTPUT_LD_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DEVICE}${CORE_U}.ld") + + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} FLASH SIZE FLASH_SIZE ORIGIN FLASH_ORIGIN) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM SIZE RAM_SIZE ORIGIN RAM_ORIGIN) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} CCRAM SIZE CCRAM_SIZE ORIGIN CCRAM_ORIGIN) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} HEAP SIZE HEAP_SIZE) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} STACK SIZE STACK_SIZE) + + add_custom_command(OUTPUT "${OUTPUT_LD_FILE}" + COMMAND ${CMAKE_COMMAND} + -DFLASH_ORIGIN="${FLASH_ORIGIN}" + -DRAM_ORIGIN="${RAM_ORIGIN}" + -DCCRAM_ORIGIN="${CCRAM_ORIGIN}" + -DFLASH_SIZE="${FLASH_SIZE}" + -DRAM_SIZE="${RAM_SIZE}" + -DCCRAM_SIZE="${CCRAM_SIZE}" + -DSTACK_SIZE="${STACK_SIZE}" + -DHEAP_SIZE="${HEAP_SIZE}" + -DLINKER_SCRIPT="${OUTPUT_LD_FILE}" + -P "${STM32_CMAKE_DIR}/stm32/linker_ld.cmake" ) - LIST(APPEND CMSIS_SOURCES ${CMSIS_STARTUP_SOURCE_FILE}) -ENDIF() - -IF(CMSIS_FIND_COMPONENTS STREQUAL NN) - FIND_PACKAGE(CMSISNN) - LIST(APPEND CMSIS_SOURCES ${CMSISNN_SOURCES}) - LIST(APPEND CMSIS_INCLUDE_DIRS ${CMSISNN_INCLUDE_DIRS}) -ENDIF() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CMSIS DEFAULT_MSG CMSIS_INCLUDE_DIRS CMSIS_SOURCES) + add_custom_target(CMSIS_LD_${DEVICE}${CORE_U} DEPENDS "${OUTPUT_LD_FILE}") + add_dependencies(CMSIS::STM32::${DEVICE}${CORE_C} CMSIS_LD_${DEVICE}${CORE_U}) + stm32_add_linker_script(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE "${OUTPUT_LD_FILE}") +endfunction() + +foreach(COMP ${CMSIS_FIND_COMPONENTS}) + string(TOLOWER ${COMP} COMP_L) + string(TOUPPER ${COMP} COMP) + + string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP ${COMP}) + + if((NOT CMAKE_MATCH_1) AND (NOT CMAKE_MATCH_2)) + message(FATAL_ERROR "Unknown CMSIS component: ${COMP}") + endif() + + if(CMAKE_MATCH_2) + set(FAMILY ${CMAKE_MATCH_1}) + set(DEVICES "${CMAKE_MATCH_1}${CMAKE_MATCH_2}") + else() + set(FAMILY ${CMAKE_MATCH_1}) + stm32_get_devices_by_family(DEVICES FAMILY ${FAMILY} CORE ${CORE}) + endif() + + if(CMAKE_MATCH_3) + set(CORE ${CMAKE_MATCH_3}) + set(CORE_C "::${CORE}") + set(CORE_U "_${CORE}") + else() + unset(CORE) + unset(CORE_C) + unset(CORE_U) + endif() + + string(TOLOWER ${FAMILY} FAMILY_L) + + if((NOT STM32_CMSIS_${FAMILY}_PATH) AND (NOT STM32_CUBE_${FAMILY}_PATH)) + set(STM32_CUBE_${FAMILY}_PATH /opt/STM32Cube${FAMILY} CACHE PATH "Path to STM32Cube${FAMILY}") + message(STATUS "Neither STM32_CUBE_${FAMILY}_PATH nor STM32_CMSIS_${FAMILY}_PATH specified using default STM32_CUBE_${FAMILY}_PATH: ${STM32_CUBE_${FAMILY}_PATH}") + endif() + + find_path(CMSIS_${FAMILY}${CORE_U}_CORE_PATH + NAMES Include/cmsis_gcc.h + PATHS "${STM32_CMSIS_PATH}" "${STM32_CUBE_${FAMILY}_PATH}/Drivers/CMSIS" + NO_DEFAULT_PATH + ) + if (NOT CMSIS_${FAMILY}${CORE_U}_CORE_PATH) + continue() + endif() + + find_path(CMSIS_${FAMILY}${CORE_U}_PATH + NAMES Include/stm32${FAMILY_L}xx.h + PATHS "${STM32_CMSIS_${FAMILY}_PATH}" "${STM32_CUBE_${FAMILY}_PATH}/Drivers/CMSIS/Device/ST/STM32${FAMILY}xx" + NO_DEFAULT_PATH + ) + if (NOT CMSIS_${FAMILY}${CORE_U}_PATH) + continue() + endif() + list(APPEND CMSIS_INCLUDE_DIRS "${CMSIS_${FAMILY}${CORE_U}_CORE_PATH}/Include" "${CMSIS_${FAMILY}${CORE_U}_PATH}/Include") + + if(NOT CMSIS_${FAMILY}${CORE_U}_VERSION) + find_file(CMSIS_${FAMILY}${CORE_U}_PDSC + NAMES ARM.CMSIS.pdsc + PATHS "${CMSIS_${FAMILY}${CORE_U}_CORE_PATH}" + NO_DEFAULT_PATH + ) + if (NOT CMSIS_${FAMILY}${CORE_U}_PDSC) + set(CMSIS_${FAMILY}${CORE_U}_VERSION "0.0.0") + else() + file(STRINGS "${CMSIS_${FAMILY}${CORE_U}_PDSC}" VERSION_STRINGS REGEX "") + list(GET VERSION_STRINGS 0 STR) + string(REGEX MATCH "" MATCHED ${STR}) + set(CMSIS_${FAMILY}${CORE_U}_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" CACHE INTERNAL "CMSIS STM32${FAMILY}${CORE_U} version") + endif() + endif() + + set(CMSIS_${COMP}_VERSION ${CMSIS_${FAMILY}${CORE_U}_VERSION}) + set(CMSIS_VERSION ${CMSIS_${COMP}_VERSION}) + + find_file(CMSIS_${FAMILY}${CORE_U}_SOURCE + NAMES system_stm32${FAMILY_L}xx.c + PATHS "${CMSIS_${FAMILY}${CORE_U}_PATH}/Source/Templates" + NO_DEFAULT_PATH + ) + list(APPEND CMSIS_SOURCES "${CMSIS_${FAMILY}${CORE_U}_SOURCE}") + + if (NOT CMSIS_${FAMILY}${CORE_U}_SOURCE) + continue() + endif() + + if(NOT (TARGET CMSIS::STM32::${FAMILY}${CORE_C})) + add_library(CMSIS::STM32::${FAMILY}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(CMSIS::STM32::${FAMILY}${CORE_C} INTERFACE STM32::${FAMILY}${CORE_C}) + target_include_directories(CMSIS::STM32::${FAMILY}${CORE_C} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_CORE_PATH}/Include") + target_include_directories(CMSIS::STM32::${FAMILY}${CORE_C} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_PATH}/Include") + target_sources(CMSIS::STM32::${FAMILY}${CORE_C} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_SOURCE}") + endif() + + set(DEVICES_FOUND TRUE) + foreach(DEVICE ${DEVICES}) + stm32_get_cores(DEV_CORES FAMILY ${FAMILY} DEVICE ${DEVICE}) + if(CORE AND (NOT ${CORE} IN_LIST DEV_CORES)) + continue() + endif() + + stm32_get_chip_type(${FAMILY} ${DEVICE} TYPE) + string(TOLOWER ${DEVICE} DEVICE_L) + string(TOLOWER ${TYPE} TYPE_L) + + find_file(CMSIS_${FAMILY}${CORE_U}_${TYPE}_STARTUP + NAMES startup_stm32${TYPE_L}.s + PATHS "${CMSIS_${FAMILY}${CORE_U}_PATH}/Source/Templates/gcc" + NO_DEFAULT_PATH + ) + list(APPEND CMSIS_SOURCES "${CMSIS_${FAMILY}${CORE_U}_${TYPE}_STARTUP}") + if(NOT CMSIS_${FAMILY}${CORE_U}_${TYPE}_STARTUP) + set(DEVICES_FOUND FALSE) + break() + endif() + + if(NOT (TARGET CMSIS::STM32::${TYPE}${CORE_C})) + add_library(CMSIS::STM32::${TYPE}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(CMSIS::STM32::${TYPE}${CORE_C} INTERFACE CMSIS::STM32::${FAMILY}${CORE_C} STM32::${TYPE}${CORE_C}) + target_sources(CMSIS::STM32::${TYPE}${CORE_C} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_${TYPE}_STARTUP}") + endif() + + add_library(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE CMSIS::STM32::${TYPE}${CORE_C}) + cmsis_generate_default_linker_script(${FAMILY} ${DEVICE} "${CORE}") + endforeach() + + if(DEVICES_FOUND) + set(CMSIS_${COMP}_FOUND TRUE) + else() + set(CMSIS_${COMP}_FOUND FALSE) + endif() + list(REMOVE_DUPLICATES CMSIS_INCLUDE_DIRS) + list(REMOVE_DUPLICATES CMSIS_SOURCES) +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CMSIS + REQUIRED_VARS CMSIS_INCLUDE_DIRS CMSIS_SOURCES + FOUND_VAR CMSIS_FOUND + VERSION_VAR CMSIS_VERSION + HANDLE_COMPONENTS +) diff --git a/cmake/FindCMSISNN.cmake b/cmake/FindCMSISNN.cmake deleted file mode 100644 index ccbaa4ef..00000000 --- a/cmake/FindCMSISNN.cmake +++ /dev/null @@ -1,157 +0,0 @@ -INCLUDE(FetchContent) - -SET(FETCHCONTENT_UPDATES_DISCONNECTED ON) -FetchContent_Declare( - arm_cmsis - GIT_REPOSITORY https://github.com/ARM-software/CMSIS_5.git - ) - -FetchContent_GetProperties(arm_cmsis) -IF(NOT arm_cmsis_POPULATED) - MESSAGE(STATUS "Getting most recent ARM CMSIS sources") - FetchContent_Populate(arm_cmsis) - EXECUTE_PROCESS(COMMAND git -C ${arm_cmsis_SOURCE_DIR} checkout develop) -ENDIF() - -# FIND_PACKAGE(Fixedpoint) - -SET(ARM_CMSIS_DIR ${arm_cmsis_SOURCE_DIR}/CMSIS) - -SET(CMSIS_NN_HEADERS - arm_nnfunctions.h - arm_nnsupportfunctions.h - arm_nn_tables.h - ) - -FILE(GLOB CMSIS_NN_SOURCES ${ARM_CMSIS_DIR}/NN/Source/*/*.c) - -FIND_PATH(CMSIS_NN_INC_DIR ${CMSIS_NN_HEADERS} - PATHS ${ARM_CMSIS_DIR}/NN/Include - CMAKE_FIND_ROOT_PATH_BOTH - ) - -SET(CMSIS_DSP_HEADERS - arm_common_tables.h - arm_const_structs.h - arm_helium_utils.h - arm_math.h - arm_mve_tables.h - arm_vec_math.h - ) - -SET(CMSIS_DSP_PRIVATE_HEADERS - arm_sorting.h - arm_vec_fft.h - arm_vec_filtering.h - ) - -SET(CMSIS_DSP_SRCS - BasicMathFunctions.c - arm_gaussian_naive_bayes_predict_f32.c - CommonTables.c - ComplexMathFunctions.c - ControllerFunctions.c - arm_boolean_distance.c - arm_boolean_distance_template.h - arm_braycurtis_distance_f32.c - arm_canberra_distance_f32.c - arm_chebyshev_distance_f32.c - arm_cityblock_distance_f32.c - arm_correlation_distance_f32.c - arm_cosine_distance_f32.c - arm_dice_distance.c - arm_euclidean_distance_f32.c - arm_hamming_distance.c - arm_jaccard_distance.c - arm_jensenshannon_distance_f32.c - arm_kulsinski_distance.c - arm_minkowski_distance_f32.c - arm_rogerstanimoto_distance.c - arm_russellrao_distance.c - arm_sokalmichener_distance.c - arm_sokalsneath_distance.c - arm_yule_distance.c - FastMathFunctions.c - FilteringFunctions.c - MatrixFunctions.c - StatisticsFunctions.c - SupportFunctions.c - arm_svm_linear_init_f32.c - arm_svm_linear_predict_f32.c - arm_svm_polynomial_init_f32.c - arm_svm_polynomial_predict_f32.c - arm_svm_rbf_init_f32.c - arm_svm_rbf_predict_f32.c - arm_svm_sigmoid_init_f32.c - arm_svm_sigmoid_predict_f32.c - TransformFunctions.c - ) - -FOREACH(SRC ${CMSIS_DSP_SRCS}) - STRING(MAKE_C_IDENTIFIER "${SRC}" SRC_CLEAN) - SET(CMSIS_DSP_${SRC_CLEAN}_FILE ${SRC_CLEAN}-NOTFOUND) - FIND_FILE(CMSIS_DSP_${SRC_CLEAN}_FILE ${SRC} - PATH_SUFFIXES - BasicMathFunctions - BayesFunctions - CommonTables - ComplexMathFunctions - ControllerFunctions - DistanceFunctions - FastMathFunctions - FilteringFunctions - MatrixFunctions - StatisticsFunctions - SupportFunctions - SVMFunctions - TransformFunctions - PATHS ${ARM_CMSIS_DIR}/DSP/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND CMSIS_DSP_SOURCES ${CMSIS_DSP_${SRC_CLEAN}_FILE}) -ENDFOREACH() - -FIND_PATH(CMSIS_DSP_PRIVATE_INC_DIR ${CMSIS_DSP_PRIVATE_HEADERS} - PATHS ${ARM_CMSIS_DIR}/DSP/PrivateInclude - CMAKE_FIND_ROOT_PATH_BOTH - ) - -FIND_PATH(CMSIS_DSP_INC_DIR ${CMSIS_DSP_HEADERS} - PATHS ${ARM_CMSIS_DIR}/DSP/Include - CMAKE_FIND_ROOT_PATH_BOTH - ) - -SET(CMSIS_DSP_INC_DIRS - ${CMSIS_DSP_PRIVATE_INC_DIR} - ${CMSIS_DSP_INC_DIR} - ) - -SET(CMSISNN_INCLUDE_DIRS - ${CMSIS_DSP_INC_DIRS} - ${CMSIS_NN_INC_DIR} - ) - -SET(CMSISNN_SOURCES - ${CMSIS_DSP_SOURCES} - ${CMSIS_NN_SOURCES} - ) - -IF(STM32_FAMILY STREQUAL "F0") - ADD_DEFINITIONS(-DARM_MATH_CM0) -ELSEIF(STM32_FAMILY STREQUAL "F3") - ADD_DEFINITIONS(-DARM_MATH_CM3) -ELSEIF(STM32_FAMILY STREQUAL "F4") - #TODO find better solution to this - ADD_DEFINITIONS(-D__FPU_PRESENT=1) - ADD_DEFINITIONS(-DARM_MATH_CM4) -ELSEIF(STM32_FAMILY STREQUAL "F7") - ADD_DEFINITIONS(-DARM_MATH_CM7) -ELSEIF(STM32_FAMILY STREQUAL "L0") - ADD_DEFINITIONS(-DARM_MATH_CM0PLUS) -ELSE() - MESSAGE(STATUS "ARM_MATH define not found, see arm_math.h") -ENDIF() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CMSISNN DEFAULT_MSG CMSISNN_INCLUDE_DIRS CMSISNN_SOURCES) diff --git a/cmake/FindChibiOS.cmake b/cmake/FindChibiOS.cmake deleted file mode 100644 index 79f5bfc7..00000000 --- a/cmake/FindChibiOS.cmake +++ /dev/null @@ -1,27 +0,0 @@ -IF(NOT CHIBIOS_ROOT) - SET(CHIBIOS_ROOT /usr/src/chibios) - MESSAGE(STATUS "No CHIBIOS_ROOT specified, using default: ${CHIBIOS_ROOT}") -ENDIF() - - -MESSAGE(STATUS "Chibios version:" ${ChibiOS_FIND_VERSION_MAJOR}) - -IF(ChibiOS_FIND_VERSION_MAJOR EQUAL 2) - MESSAGE(FATAL_ERROR "ChibiOS v2.x.x is not supported. Use older version of stm32-cmake") -ELSEIF((ChibiOS_FIND_VERSION_MAJOR EQUAL 18)) - INCLUDE(ChibiOS/18.2/ChibiOS) -ELSEIF((ChibiOS_FIND_VERSION_MAJOR EQUAL 17)) - INCLUDE(ChibiOS/ChibiOS17) -ELSEIF((ChibiOS_FIND_VERSION_MAJOR EQUAL 16)) - INCLUDE(ChibiOS/ChibiOS16) -ELSEIF((NOT ChibiOS_FIND_VERSION_MAJOR) OR (ChibiOS_FIND_VERSION_MAJOR EQUAL 3)) - INCLUDE(ChibiOS/ChibiOS3) -ENDIF() - -LIST(REMOVE_DUPLICATES ChibiOS_INCLUDE_DIRS) -LIST(REMOVE_DUPLICATES ChibiOS_SOURCES) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ChibiOS DEFAULT_MSG ChibiOS_SOURCES ChibiOS_INCLUDE_DIRS ChibiOS_LINKER_SCRIPT) - - diff --git a/cmake/FindFATFS.cmake b/cmake/FindFATFS.cmake deleted file mode 100644 index 3ab8ce57..00000000 --- a/cmake/FindFATFS.cmake +++ /dev/null @@ -1,115 +0,0 @@ -IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) -ENDIF() - -SET(FATFS_COMMON_SOURCES - diskio.c - ff.c - ff_gen_drv.c -) - -CMAKE_POLICY(SET CMP0057 NEW) - -IF(NOT STORAGE_DRIVER) - MESSAGE(STATUS "No storage driver specified, please SET STORAGE_DRIVER to {SDCARD, SDRAM, SRAM, USBH}") -else() - if("SDCARD" IN_LIST STORAGE_DRIVER) - LIST(APPEND FATFS_DRIVER_SOURCES sd_diskio.c) - endif() - if("SDRAM" IN_LIST STORAGE_DRIVER) - LIST(APPEND FATFS_DRIVER_SOURCES sdram_diskio.c) - endif() - if("SRAM" IN_LIST STORAGE_DRIVER) - LIST(APPEND FATFS_DRIVER_SOURCES sram_diskio.c) - endif() - if("USBH" IN_LIST STORAGE_DRIVER) - LIST(APPEND FATFS_DRIVER_SOURCES usbh_diskio.c) - endif() -endif() - -SET(FATFS_OPTION_SOURCES syscall.c unicode.c) -#if(CODE_PAGE EQUAL CP932) -#list(APPEND FATFS_OPTION_SOURCES cc932.c) -#( cc936.c -# cc949.c -# cc950.c -# ccsbcs.c -# unicode.c -#) - -SET(FATFS_COMMON_HEADERS - diskio.h - ff.h - ff_gen_drv.h - ffconf_template.h - integer.h -) - -SET(FATFS_DRIVER_HEADERS - sd_diskio.h - sdram_diskio.h - sram_diskio.h - usbh_diskio.h -) - -FIND_PATH(FATFS_COMMON_INCLUDE_DIR ${FATFS_COMMON_HEADERS} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src - CMAKE_FIND_ROOT_PATH_BOTH -) - -FIND_PATH(FATFS_DRIVER_INCLUDE_DIR ${FATFS_DRIVER_HEADERS} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src/drivers/ - CMAKE_FIND_ROOT_PATH_BOTH -) - -IF(${FATFS_DRIVER_INCLUDE_DIR} STREQUAL FATFS_DRIVER_INCLUDE_DIR-NOTFOUND) - MESSAGE(WARNING "Driver header files not located in STM firmware, please manually include the appropriate X_diskio.h directory") - SET(FATFS_INCLUDE_DIRS - ${FATFS_COMMON_INCLUDE_DIR} - ) -ELSE() -SET(FATFS_INCLUDE_DIRS - ${FATFS_COMMON_INCLUDE_DIR} - ${FATFS_DRIVER_INCLUDE_DIR} -) -ENDIF() - -FOREACH(SRC ${FATFS_COMMON_SOURCES}) - SET(SRC_FILE SRC_FILE-NOTFOUND) - FIND_FILE(SRC_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src/ - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND FATFS_SOURCES ${SRC_FILE}) -ENDFOREACH() - -FOREACH(SRC ${FATFS_DRIVER_SOURCES}) - SET(SRC_FILE SRC_FILE-NOTFOUND) - FIND_FILE(SRC_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src/drivers/ - CMAKE_FIND_ROOT_PATH_BOTH - ) -STRING(FIND ${SRC_FILE} "NOTFOUND" SRC_FILE_NOTFOUND) -IF(NOT ${SRC_FILE_NOTFOUND} EQUAL -1) - MESSAGE(WARNING "Driver source files not located in STM firmware, please manually source the appropriate X_diskio.c files") -ELSE() - LIST(APPEND FATFS_SOURCES ${SRC_FILE}) -ENDIF() -ENDFOREACH() - -FOREACH(SRC ${FATFS_OPTION_SOURCES}) - SET(SRC_FILE SRC_FILE-NOTFOUND) - FIND_FILE(SRC_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src/option/ - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND FATFS_SOURCES ${SRC_FILE}) -ENDFOREACH() - -message(STATUS "fatfs include " ${FATFS_INCLUDE_DIRS}) -message(STATUS "fatfs sources " ${FATFS_SOURCES}) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(FATFS DEFAULT_MSG FATFS_INCLUDE_DIRS FATFS_SOURCES) diff --git a/cmake/FindFreeRTOS.cmake b/cmake/FindFreeRTOS.cmake index 1f77135a..05757510 100644 --- a/cmake/FindFreeRTOS.cmake +++ b/cmake/FindFreeRTOS.cmake @@ -1,142 +1,104 @@ -IF(STM32_FAMILY STREQUAL "F0") - SET(PORT_GCC_DIR_SUFFIX "CM0") -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(PORT_GCC_DIR_SUFFIX "CM3") -ELSEIF(STM32_FAMILY STREQUAL "F2") - SET(PORT_GCC_DIR_SUFFIX "CM3") -ELSEIF(STM32_FAMILY STREQUAL "F3") - SET(PORT_GCC_DIR_SUFFIX "CM4F") -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(PORT_GCC_DIR_SUFFIX "CM4F") -ELSEIF(STM32_FAMILY STREQUAL "F7") - SET(PORT_GCC_DIR_SUFFIX "CM7") -ELSEIF(STM32_FAMILY STREQUAL "H7") - SET(PORT_GCC_DIR_SUFFIX "CM7/r0p1") -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(PORT_GCC_DIR_SUFFIX "CM0") -ELSEIF(STM32_FAMILY STREQUAL "L1") - SET(PORT_GCC_DIR_SUFFIX "CM4F") -ENDIF() - -SET(FREERTOS_SRC_FILES - croutine.c - event_groups.c - list.c - queue.c - tasks.c - timers.c -) - -SET(FREERTOS_HEADERS - croutine.h - deprecated_definitions.h - event_groups.h - FreeRTOS.h - list.h - mpu_prototypes.h - mpu_wrappers.h - portable.h - projdefs.h - queue.h - semphr.h - StackMacros.h - task.h - timers.h -) - -IF(FREERTOS_CMSIS_V2) - SET(CMSIS_OS_SRC_FILE cmsis_os1.c) -ELSE() - SET(CMSIS_OS_SRC_FILE cmsis_os.c) -ENDIF() -SET(CMSIS_OS_INC_FILE cmsis_os.h) - -SET(PORT_ARM_SRC_FILE port.c) -SET(PORTMACRO_ARM_HEADER portmacro.h) - -IF(NOT FREERTOS_HEAP_IMPL) - MESSAGE(FATAL_ERROR "FREERTOS_HEAP_IMPL not defined. Define it to include proper heap implementation file.") -ELSE() - SET(HEAP_IMP_FILE heap_${FREERTOS_HEAP_IMPL}.c) -ENDIF() - -FIND_PATH(FREERTOS_COMMON_INC_DIR ${FREERTOS_HEADERS} - PATH_SUFFIXES include - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH -) - -SET(CMSIS_OS_INC_DIR CMSIS_OS_INC_DIR-NOTFOUND) -IF(FREERTOS_CMSIS_V2) - FIND_PATH(CMSIS_OS_INC_DIR ${CMSIS_OS_INC_FILE} - PATH_SUFFIXES CMSIS_RTOS_V2 - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) -ELSE() - FIND_PATH(CMSIS_OS_INC_DIR ${CMSIS_OS_INC_FILE} - PATH_SUFFIXES CMSIS_RTOS - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) -ENDIF() - -FIND_PATH(PORTMACRO_INC_DIR ${PORTMACRO_ARM_HEADER} - PATH_SUFFIXES ARM_${PORT_GCC_DIR_SUFFIX} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC - CMAKE_FIND_ROOT_PATH_BOTH -) - -FOREACH(SRC ${FREERTOS_SRC_FILES}) - STRING(MAKE_C_IDENTIFIER "${SRC}" SRC_CLEAN) - SET(FREERTOS_${SRC_CLEAN}_FILE FREERTOS_SRC_FILE-NOTFOUND) - FIND_FILE(FREERTOS_${SRC_CLEAN}_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND FREERTOS_SOURCES ${FREERTOS_${SRC_CLEAN}_FILE}) -ENDFOREACH() - -SET(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE}-NOTFOUND) -IF(FREERTOS_CMSIS_V2) - FIND_FILE(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE} - PATH_SUFFIXES CMSIS_RTOS_V2 - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) -ELSE() - FIND_FILE(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE} - PATH_SUFFIXES CMSIS_RTOS - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source - CMAKE_FIND_ROOT_PATH_BOTH - ) -ENDIF() - -FIND_FILE(PORT_ARM_SOURCE ${PORT_ARM_SRC_FILE} - PATH_SUFFIXES ARM_${PORT_GCC_DIR_SUFFIX} - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC - CMAKE_FIND_ROOT_PATH_BOTH +if(NOT FreeRTOS_FIND_COMPONENTS) + set(FreeRTOS_FIND_COMPONENTS + ARM_CM0 ARM_CM3 ARM_CM4F ARM_CM7 + ) +endif() +list(REMOVE_DUPLICATES FreeRTOS_FIND_COMPONENTS) + +set(FreeRTOS_HEAPS 1 2 3 4 5) + +if(NOT FREERTOS_PATH) + set(FREERTOS_PATH /opt/FreeRTOS CACHE PATH "Path to FreeRTOS") + message(STATUS "No FREERTOS_PATH specified using default: ${FREERTOS_PATH}") +endif() + +find_path(FreeRTOS_COMMON_INCLUDE + NAMES FreeRTOS.h + PATHS "${FREERTOS_PATH}/Source/include" + NO_DEFAULT_PATH ) +list(APPEND FreeRTOS_INCLUDE_DIRS "${FreeRTOS_COMMON_INCLUDE}") -FIND_FILE(HEAP_IMP_SOURCE ${HEAP_IMP_FILE} - PATH_SUFFIXES MemMang - HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source/portable - CMAKE_FIND_ROOT_PATH_BOTH +find_path(FreeRTOS_SOURCE_DIR + NAMES tasks.c + PATHS "${FREERTOS_PATH}/Source" + NO_DEFAULT_PATH ) - -SET(FreeRTOS_INCLUDE_DIRS - ${FREERTOS_COMMON_INC_DIR} - ${CMSIS_OS_INC_DIR} - ${PORTMACRO_INC_DIR} -) - -SET(FreeRTOS_SOURCES - ${FREERTOS_SOURCES} - ${CMSIS_OS_SOURCE} - ${PORT_ARM_SOURCE} - ${HEAP_IMP_SOURCE} +if(NOT (TARGET FreeRTOS)) + add_library(FreeRTOS INTERFACE IMPORTED) + target_sources(FreeRTOS INTERFACE + "${FreeRTOS_SOURCE_DIR}/tasks.c" + "${FreeRTOS_SOURCE_DIR}/list.c" + "${FreeRTOS_SOURCE_DIR}/queue.c" + ) + target_include_directories(FreeRTOS INTERFACE "${FreeRTOS_COMMON_INCLUDE}") +endif() + +if(NOT (TARGET FreeRTOS::Coroutine)) + add_library(FreeRTOS::Coroutine INTERFACE IMPORTED) + target_sources(FreeRTOS::Coroutine INTERFACE "${FreeRTOS_SOURCE_DIR}/croutine.c") + target_link_libraries(FreeRTOS::Coroutine INTERFACE FreeRTOS) +endif() + +if(NOT (TARGET FreeRTOS::EventGroups)) + add_library(FreeRTOS::EventGroups INTERFACE IMPORTED) + target_sources(FreeRTOS::EventGroups INTERFACE "${FreeRTOS_SOURCE_DIR}/event_groups.c") + target_link_libraries(FreeRTOS::EventGroups INTERFACE FreeRTOS) +endif() + +if(NOT (TARGET FreeRTOS::StreamBuffer)) + add_library(FreeRTOS::StreamBuffer INTERFACE IMPORTED) + target_sources(FreeRTOS::StreamBuffer INTERFACE "${FreeRTOS_SOURCE_DIR}/stream_buffer.c") + target_link_libraries(FreeRTOS::StreamBuffer INTERFACE FreeRTOS) +endif() + +if(NOT (TARGET FreeRTOS::Timers)) + add_library(FreeRTOS::Timers INTERFACE IMPORTED) + target_sources(FreeRTOS::Timers INTERFACE "${FreeRTOS_SOURCE_DIR}/timers.c") + target_link_libraries(FreeRTOS::Timers INTERFACE FreeRTOS) +endif() + +foreach(HEAP ${FreeRTOS_HEAPS}) + if(NOT (TARGET FreeRTOS::Heap::${HEAP})) + add_library(FreeRTOS::Heap::${HEAP} INTERFACE IMPORTED) + target_sources(FreeRTOS::Heap::${HEAP} INTERFACE "${FreeRTOS_SOURCE_DIR}/portable/MemMang/heap_${HEAP}.c") + target_link_libraries(FreeRTOS::Heap::${HEAP} INTERFACE FreeRTOS) + endif() +endforeach() + +foreach(PORT ${FreeRTOS_FIND_COMPONENTS}) + find_path(FreeRTOS_${PORT}_PATH + NAMES portmacro.h + PATHS "${FREERTOS_PATH}/Source/portable/GCC/${PORT}" + NO_DEFAULT_PATH + ) + list(APPEND FreeRTOS_INCLUDE_DIRS "${FreeRTOS_${PORT}_PATH}") + + find_file(FreeRTOS_${PORT}_SOURCE + NAMES port.c + PATHS "${FreeRTOS_${PORT}_PATH}" + NO_DEFAULT_PATH + ) + if(NOT (TARGET FreeRTOS::${PORT})) + add_library(FreeRTOS::${PORT} INTERFACE IMPORTED) + target_link_libraries(FreeRTOS::${PORT} INTERFACE FreeRTOS) + target_sources(FreeRTOS::${PORT} INTERFACE "${FreeRTOS_${PORT}_SOURCE}") + target_include_directories(FreeRTOS::${PORT} INTERFACE "${FreeRTOS_${PORT}_PATH}") + endif() + + if(FreeRTOS_${PORT}_PATH AND + FreeRTOS_${PORT}_SOURCE AND + FreeRTOS_COMMON_INCLUDE AND + FreeRTOS_SOURCE_DIR) + set(FreeRTOS_${PORT}_FOUND TRUE) + else() + set(FreeRTOS_${PORT}_FOUND FALSE) + endif() +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FreeRTOS + REQUIRED_VARS FreeRTOS_INCLUDE_DIRS + FOUND_VAR FreeRTOS_FOUND + HANDLE_COMPONENTS ) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeRTOS DEFAULT_MSG FreeRTOS_INCLUDE_DIRS FreeRTOS_SOURCES) diff --git a/cmake/FindHAL.cmake b/cmake/FindHAL.cmake new file mode 100644 index 00000000..65a6b116 --- /dev/null +++ b/cmake/FindHAL.cmake @@ -0,0 +1,356 @@ +set(HAL_DRIVERS_F0 + adc can cec comp cortex crc dac dma exti flash gpio i2c i2s irda iwdg pcd + pwr rcc rtc smartcard smbus spi tim tsc uart usart wwdg +) +set(HAL_EX_DRIVERS_F0 + adc crc dac flash i2c pcd pwr rcc rtc smartcard spi tim uart usart +) +set(HAL_LL_DRIVERS_F0 + adc comp crc crs dac dma exti gpio i2c pwr rcc rtc spi tim usart usb utils +) + +set(HAL_DRIVERS_F1 + adc can cec cortex crc dac dma eth exti flash gpio hcd i2c i2s irda iwdg + mmc nand nor pccard pcd pwr rcc rtc sd smartcard spi sram tim uart usart + wwdg +) +set(HAL_EX_DRIVERS_F1 + adc dac flash gpio pcd rcc rtc tim +) +set(HAL_LL_DRIVERS_F1 + adc crc dac dma exti fsmc gpio i2c pwr rcc rtc sdmmc spi tim usart usb utils +) + +set(HAL_DRIVERS_F2 + adc can cortex crc cryp dac dcmi dma eth exti flash gpio hash hcd i2c i2s + irda iwdg mmc nand nor pccard pcd pwr rcc rng rtc sd smartcard spi sram tim + uart usart wwdg +) +set(HAL_EX_DRIVERS_F2 + adc dac dcmi dma flash pcd pwr rcc rtc tim +) +set(HAL_LL_DRIVERS_F2 + adc crc dac dma exti fsmc gpio i2c pwr rcc rng rtc sdmmc spi tim usart usb + utils +) + +set(HAL_DRIVERS_F3 + adc can cec comp cortex crc dac dma exti flash gpio hrtim i2c i2s irda iwdg + nand nor opamp pccard pcd pwr rcc rtc sdadc smartcard smbus spi sram tim tsc + uart usart wwdg +) +set(HAL_EX_DRIVERS_F3 + adc crc dac flash i2c i2s opamp pcd pwr rcc rtc smartcard spi tim uart usart +) +set(HAL_LL_DRIVERS_F3 + adc comp crc dac dma exti fmc gpio hrtim i2c opamp pwr rcc rtc spi tim usart + usb utils +) + +set(HAL_DRIVERS_F4 + adc can cec cortex crc cryp dac dcmi dfsdm dma dma2d dsi eth exti flash + flash_ramfunc fmpi2c gpio hash hcd i2c i2s irda iwdg lptim ltdc mmc nand nor + pccard pcd pwr qspi rcc rng rtc sai sd sdram smartcard smbus spdifrx spi + sram tim uart usart wwdg +) +set(HAL_EX_DRIVERS_F4 + adc cryp dac dcmi dma flash fmpi2c hash i2c i2s ltdc pcd pwr rcc rtc sai tim +) +set(HAL_LL_DRIVERS_F4 + adc crc dac dma dma2d exti fmc fsmc gpio i2c lptim pwr rcc rng rtc sdmmc spi + tim usart usb utils +) + +set(HAL_DRIVERS_F7 + adc can cec cortex crc cryp dac dcmi dfsdm dma dma2d dsi eth exti flash + gpio hash hcd i2c i2s irda iwdg jpeg lptim ltdc mdios mmc nand nor pcd pwr + qspi rcc rng rtc sai sd sdram smartcard smbus spdifrx spi sram tim uart + usart wwdg +) +set(HAL_EX_DRIVERS_F7 + adc crc cryp dac dcmi dma flash hash i2c ltdc pcd pwr rcc rtc sai smartcard + spi tim uart +) +set(HAL_LL_DRIVERS_F7 + adc crc dac dma dma2d exti fmc gpio i2c lptim pwr rcc rng rtc sdmmc spi tim + usart usb utils +) + +set(HAL_DRIVERS_G0 + adc cec comp cortex crc cryp dac dma exti flash gpio i2c i2s irda iwdg lptim + pwr rcc rng rtc smartcard smbus spi tim uart usart wwdg +) +set(HAL_EX_DRIVERS_G0 + adc crc cryp dac dma flash i2c pwr rcc rtc smartcard spi tim uart usart +) +set(HAL_LL_DRIVERS_G0 + adc comp crc dac dma exti gpio i2c lptim lpuart pwr rcc rng rtc spi tim ucpd + usart utils +) + +set(HAL_DRIVERS_G4 + adc comp cordic cortex crc cryp dac dma exti fdcan flash flash_ramfunc fmac + gpio hrtim i2c i2s irda iwdg lptim nand nor opamp pcd pwr qspi rcc rng rtc + sai smartcard smbus spi sram tim uart usart wwdg +) +set(HAL_EX_DRIVERS_G4 + adc crc cryp dac dma flash i2c opamp pcd pwr rcc rtc sai smartcard spi tim + uart usart +) +set(HAL_LL_DRIVERS_G4 + adc comp cordic crc crs dac dma exti fmac fmc gpio hrtim i2c lptim lpuart + opamp pwr rcc rng rtc spi tim ucpd usart usb utils +) + +set(HAL_DRIVERS_H7 + adc cec comp cortex crc cryp dac dcmi dfsdm dma dma2d dsi dts eth exti fdcan + flash gfxmmu gpio hash hrtim hsem i2c i2s irda iwdg jpeg lptim ltdc mdios + mdma mmc nand nor opamp ospi otfdec pcd pssi pwr qspi ramecc rcc rng rtc sai + sd sdram smartcard smbus spdifrx spi sram swpmi tim uart usart wwdg +) +set(HAL_EX_DRIVERS_H7 + adc crc cryp dac dfsdm dma eth flash hash i2c i2s ltdc mmc opamp pcd pwr rcc + rng rtc sai sd smartcard spi tim uart usart +) +set(HAL_LL_DRIVERS_H7 + adc bdma comp crc crs dac delayblock dma dma2d exti fmc gpio hrtim i2c lptim + lpuart mdma opamp pwr rcc rng rtc sdmmc spi swpmi tim usart usb utils +) + +set(HAL_DRIVERS_L0 + adc comp cortex crc cryp dac dma firewall flash flash_ramfunc gpio i2c i2s + irda iwdg lcd lptim pcd pwr rcc rng rtc smartcard smbus spi tim tsc uart + usart wwdg +) +set(HAL_EX_DRIVERS_L0 + adc comp crc cryp dac flash i2c pcd pwr rcc rtc smartcard tim uart +) +set(HAL_LL_DRIVERS_L0 + adc comp crc crs dac dma exti gpio i2c lptim lpuart pwr rcc rng rtc spi tim + usart usb utils +) + +set(HAL_DRIVERS_L1 + adc comp cortex crc cryp dac dma flash flash_ramfunc gpio i2c i2s irda iwdg + lcd nor opamp pcd pwr rcc rtc sd smartcard spi sram tim uart usart wwdg +) +set(HAL_EX_DRIVERS_L1 + adc cryp dac flash opamp pcd pcd pwr rcc rtc tim +) +set(HAL_LL_DRIVERS_L1 + adc comp crc dac dma exti fsmc gpio i2c opamp pwr rcc rtc sdmmc spi tim + usart usb utils +) + +set(HAL_DRIVERS_L4 + adc can comp cortex crc cryp dac dcmi dfsdm dma dma2d dsi exti firewall + flash flash_ramfunc gfxmmu gpio hash hcd i2c irda iwdg lcd lptim ltdc mmc + nand nor opamp ospi pcd pka pssi pwr qspi rcc rng rtc sai sd smartcard smbus + spi sram swpmi tim tsc uart usart wwdg +) +set(HAL_EX_DRIVERS_L4 + adc crc cryp dac dfsdm dma flash hash i2c ltdc mmc opamp pcd pwr rcc rng rtc + sai sd smartcard spi tim uart usart +) +set(HAL_LL_DRIVERS_L4 + adc comp crc crs dac dma dma2d exti fmc gpio i2c lptim lpuart opamp pka pwr + rcc rng rtc sdmmc spi swpmi tim usart usb utils +) + +foreach(FAMILY ${STM32_SUPPORTED_FAMILIES}) + list(APPEND HAL_DRIVERS ${HAL_DRIVERS_${FAMILY}}) + list(APPEND HAL_LL_DRIVERS ${HAL_LL_DRIVERS_${FAMILY}}) +endforeach() +list(REMOVE_DUPLICATES HAL_DRIVERS) +list(REMOVE_DUPLICATES HAL_LL_DRIVERS) + +foreach(COMP ${HAL_FIND_COMPONENTS}) + string(TOLOWER ${COMP} COMP_L) + string(TOUPPER ${COMP} COMP_U) + + string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP_U ${COMP_U}) + if(CMAKE_MATCH_1) + list(APPEND HAL_FIND_COMPONENTS_FAMILIES ${COMP}) + continue() + endif() + if(${COMP_L} IN_LIST HAL_DRIVERS) + list(APPEND HAL_FIND_COMPONENTS_DRIVERS ${COMP}) + continue() + endif() + string(REGEX REPLACE "^ll_" "" COMP_L ${COMP_L}) + if(${COMP_L} IN_LIST HAL_LL_DRIVERS) + list(APPEND HAL_FIND_COMPONENTS_DRIVERS_LL ${COMP}) + continue() + endif() + message(FATAL_ERROR "Unknown HAL component: ${COMP}") +endforeach() + +if(NOT HAL_FIND_COMPONENTS_FAMILIES) + set(HAL_FIND_COMPONENTS_FAMILIES + STM32F0 STM32F1 STM32F2 STM32F3 STM32F4 STM32F7 + STM32G0 STM32G4 + STM32H7_M7 STM32H7_M4 + STM32L0 STM32L1 STM32L4 + ) +endif() +if(STM32H7 IN_LIST HAL_FIND_COMPONENTS_FAMILIES) + list(REMOVE_ITEM HAL_FIND_COMPONENTS_FAMILIES STM32H7) + list(APPEND HAL_FIND_COMPONENTS_FAMILIES STM32H7_M7 STM32H7_M4) +endif() +list(REMOVE_DUPLICATES HAL_FIND_COMPONENTS_FAMILIES) + +if((NOT HAL_FIND_COMPONENTS_DRIVERS) AND (NOT HAL_FIND_COMPONENTS_DRIVERS_LL)) + set(HAL_FIND_COMPONENTS_DRIVERS ${HAL_DRIVERS}) + set(HAL_FIND_COMPONENTS_DRIVERS_LL ${HAL_LL_DRIVERS}) +endif() +list(REMOVE_DUPLICATES HAL_FIND_COMPONENTS_DRIVERS) +list(REMOVE_DUPLICATES HAL_FIND_COMPONENTS_DRIVERS_LL) + +message(STATUS "Search for HAL families: ${HAL_FIND_COMPONENTS_FAMILIES}") +message(STATUS "Search for HAL drivers: ${HAL_FIND_COMPONENTS_DRIVERS}") +message(STATUS "Search for HAL LL drivers: ${HAL_FIND_COMPONENTS_DRIVERS_LL}") + +foreach(COMP ${HAL_FIND_COMPONENTS_FAMILIES}) + string(TOUPPER ${COMP} COMP_U) + + string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP_U ${COMP_U}) + if(CMAKE_MATCH_3) + set(CORE ${CMAKE_MATCH_3}) + set(CORE_C "::${CORE}") + set(CORE_U "_${CORE}") + else() + unset(CORE) + unset(CORE_C) + unset(CORE_U) + endif() + + set(FAMILY ${CMAKE_MATCH_1}) + string(TOLOWER ${FAMILY} FAMILY_L) + + if((NOT STM32_HAL_${FAMILY}_PATH) AND (NOT STM32_CUBE_${FAMILY}_PATH)) + set(STM32_CUBE_${FAMILY}_PATH /opt/STM32Cube${FAMILY} CACHE PATH "Path to STM32Cube${FAMILY}") + message(STATUS "Neither STM32_CUBE_${FAMILY}_PATH nor STM32_HAL_${FAMILY}_PATH specified using default STM32_CUBE_${FAMILY}_PATH: ${STM32_CUBE_${FAMILY}_PATH}") + endif() + + find_path(HAL_${FAMILY}_PATH + NAMES Inc/stm32${FAMILY_L}xx_hal.h + PATHS "${STM32_HAL_${FAMILY}_PATH}" "${STM32_CUBE_${FAMILY}_PATH}/Drivers/STM32${FAMILY}xx_HAL_Driver" + NO_DEFAULT_PATH + ) + if (NOT HAL_${FAMILY}_PATH) + continue() + endif() + + find_path(HAL_${FAMILY}${CORE_U}_INCLUDE + NAMES stm32${FAMILY_L}xx_hal.h + PATHS "${HAL_${FAMILY}_PATH}/Inc" + NO_DEFAULT_PATH + ) + find_file(HAL_${FAMILY}${CORE_U}_SOURCE + NAMES stm32${FAMILY_L}xx_hal.c + PATHS "${HAL_${FAMILY}_PATH}/Src" + NO_DEFAULT_PATH + ) + + if ((NOT HAL_${FAMILY}${CORE_U}_INCLUDE) OR (NOT HAL_${FAMILY}${CORE_U}_SOURCE)) + set(HAL_${COMP}_FOUND FALSE) + continue() + endif() + + if(NOT (TARGET HAL::STM32::${FAMILY}${CORE_C})) + add_library(HAL::STM32::${FAMILY}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(HAL::STM32::${FAMILY}${CORE_C} INTERFACE STM32::${FAMILY}${CORE_C} CMSIS::STM32::${FAMILY}${CORE_C}) + target_include_directories(HAL::STM32::${FAMILY}${CORE_C} INTERFACE "${HAL_${FAMILY}${CORE_U}_INCLUDE}") + target_sources(HAL::STM32::${FAMILY}${CORE_C} INTERFACE "${HAL_${FAMILY}${CORE_U}_SOURCE}") + endif() + + foreach(DRV_COMP ${HAL_FIND_COMPONENTS_DRIVERS}) + string(TOLOWER ${DRV_COMP} DRV_L) + string(TOUPPER ${DRV_COMP} DRV) + + if(NOT (DRV_L IN_LIST HAL_DRIVERS_${FAMILY})) + continue() + endif() + + find_file(HAL_${FAMILY}${CORE_U}_${DRV}_SOURCE + NAMES stm32${FAMILY_L}xx_hal_${DRV_L}.c + PATHS "${HAL_${FAMILY}_PATH}/Src" + NO_DEFAULT_PATH + ) + list(APPEND HAL_${FAMILY}${CORE_U}_SOURCES "${HAL_${FAMILY}_${DRV}_SOURCE}") + if(NOT HAL_${FAMILY}${CORE_U}_${DRV}_SOURCE) + message(WARNING "Cannot find ${DRV} driver for ${${FAMILY}${CORE_U}}") + set(HAL_${DRV_COMP}_FOUND FALSE) + continue() + endif() + + set(HAL_${DRV_COMP}_FOUND TRUE) + if(HAL_${FAMILY}${CORE_U}_${DRV}_SOURCE AND (NOT (TARGET HAL::STM32::${FAMILY}::${DRV}))) + add_library(HAL::STM32::${FAMILY}${CORE_C}::${DRV} INTERFACE IMPORTED) + target_link_libraries(HAL::STM32::${FAMILY}${CORE_C}::${DRV} INTERFACE HAL::STM32::${FAMILY}${CORE_C}) + target_sources(HAL::STM32::${FAMILY}${CORE_C}::${DRV} INTERFACE "${HAL_${FAMILY}${CORE_U}_${DRV}_SOURCE}") + endif() + + if(HAL_${FAMILY}${CORE_U}_${DRV}_SOURCE AND (${DRV_L} IN_LIST HAL_EX_DRIVERS_${FAMILY})) + find_file(HAL_${FAMILY}${CORE_U}_${DRV}_EX_SOURCE + NAMES stm32${FAMILY_L}xx_hal_${DRV_L}_ex.c + PATHS "${HAL_${FAMILY}_PATH}/Src" + NO_DEFAULT_PATH + ) + list(APPEND HAL_${FAMILY}${CORE_U}_SOURCES "${HAL_${FAMILY}${CORE_U}_${DRV}_EX_SOURCE}") + if(NOT HAL_${FAMILY}${CORE_U}_${DRV}_EX_SOURCE) + message(WARNING "Cannot find ${DRV}Ex driver for ${${FAMILY}${CORE_U}}") + endif() + + if((TARGET HAL::STM32::${FAMILY}${CORE_C}::${DRV}) AND (NOT (TARGET HAL::STM32::${FAMILY}${CORE_C}::${DRV}Ex))) + add_library(HAL::STM32::${FAMILY}${CORE_C}::${DRV}Ex INTERFACE IMPORTED) + target_link_libraries(HAL::STM32::${FAMILY}${CORE_C}::${DRV}Ex INTERFACE HAL::STM32::${FAMILY}${CORE_C}::${DRV}) + target_sources(HAL::STM32::${FAMILY}${CORE_C}::${DRV}Ex INTERFACE "${HAL_${FAMILY}${CORE_U}_${DRV}_EX_SOURCE}") + endif() + endif() + endforeach() + + foreach(DRV_COMP ${HAL_FIND_COMPONENTS_DRIVERS_LL}) + string(TOLOWER ${DRV_COMP} DRV_L) + string(REGEX REPLACE "^ll_" "" DRV_L ${DRV_L}) + string(TOUPPER ${DRV_L} DRV) + + if(NOT (DRV_L IN_LIST HAL_LL_DRIVERS_${FAMILY})) + continue() + endif() + + find_file(HAL_${FAMILY}${CORE_U}_${DRV}_LL_SOURCE + NAMES stm32${FAMILY_L}xx_ll_${DRV_L}.c + PATHS "${HAL_${FAMILY}_PATH}/Src" + NO_DEFAULT_PATH + ) + list(APPEND HAL_${FAMILY}${CORE_U}_SOURCES "${HAL_${FAMILY}_${DRV}_LL_SOURCE}") + if(NOT HAL_${FAMILY}${CORE_U}_${DRV}_LL_SOURCE) + message(WARNING "Cannot find LL_${DRV} driver for ${${FAMILY}${CORE_U}}") + set(HAL_${DRV_COMP}_FOUND FALSE) + continue() + endif() + + set(HAL_${DRV_COMP}_FOUND TRUE) + if(HAL_${FAMILY}${CORE_U}_${DRV}_LL_SOURCE AND (NOT (TARGET HAL::STM32::${FAMILY}${CORE_C}::LL_${DRV}))) + add_library(HAL::STM32::${FAMILY}${CORE_C}::LL_${DRV} INTERFACE IMPORTED) + target_link_libraries(HAL::STM32::${FAMILY}${CORE_C}::LL_${DRV} INTERFACE HAL::STM32::${FAMILY}${CORE_C}) + target_sources(HAL::STM32::${FAMILY}${CORE_C}::LL_${DRV} INTERFACE "${HAL_${FAMILY}${CORE_U}_${DRV}_LL_SOURCE}") + endif() + endforeach() + + set(HAL_${COMP}_FOUND TRUE) + list(APPEND HAL_INCLUDE_DIRS "${HAL_${FAMILY}${CORE_U}_INCLUDE}") + list(APPEND HAL_SOURCES "${HAL_${FAMILY}${CORE_U}_SOURCES}") +endforeach() + +list(REMOVE_DUPLICATES HAL_INCLUDE_DIRS) +list(REMOVE_DUPLICATES HAL_SOURCES) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HAL + REQUIRED_VARS HAL_INCLUDE_DIRS HAL_SOURCES + FOUND_VAR HAL_FOUND + HANDLE_COMPONENTS +) + diff --git a/cmake/FindSTM32BSP.cmake b/cmake/FindSTM32BSP.cmake deleted file mode 100644 index f0596621..00000000 --- a/cmake/FindSTM32BSP.cmake +++ /dev/null @@ -1,100 +0,0 @@ -MESSAGE("STM Board: ${STM_BOARD}") -IF(STM32_FAMILY STREQUAL "F4") - IF(STM_BOARD STREQUAL "STM32F429I-Discovery") - SET(BSP_COMPONENTS - eeprom - gyroscope - io - lcd - sdram - ts) - SET(BSP_PREFIX stm32f429i_discovery_) - SET(BSP_HEADERS stm32f429i_discovery.h) - SET(BSP_SRC stm32f429i_discovery.c) - ENDIF() - IF(STM_BOARD STREQUAL "STM324xG_EVAL") - SET(BSP_COMPONENTS - lcd - camera - eeprom - io - sd - sram - ts) - SET(BSP_PREFIX stm324xg_eval_) - SET(BSP_HEADERS stm324xg_eval.h) - SET(BSP_SRC stm324xg_eval.c) - ENDIF() - set(COMMON_COMPONENTS ampire480272 - ampire640480 - cs43l22 - exc7200 - ili9325 - ili9341 - l3gd20 - lis302dl - lis3dsh - lsm303dlhc - mfxstm32l152 - n25q256a - ov2640 - s5k5cag - st7735 - stmpe1600 - stmpe811 - ts3510 - wm8994 - ) -ENDIF() - -IF(NOT STM32BSP_FIND_COMPONENTS) - SET(STM32BSP_FIND_COMPONENTS ${BSP_COMPONENTS} ${COMMON_COMPONENTS}) - MESSAGE(STATUS "No STM32BSP components selected, using all: ${STM32BSP_FIND_COMPONENTS}") -ENDIF() - - - -FOREACH(cmp ${STM32BSP_FIND_COMPONENTS}) - LIST(FIND BSP_COMPONENTS ${cmp} STM32BSP_FOUND_INDEX) - IF(${STM32BSP_FOUND_INDEX} LESS 0) - LIST(FIND COMMON_COMPONENTS ${cmp} COMMON_FOUND_INDEX) - IF(${COMMON_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown STM32BSP component: ${cmp}. Available components: ${BSP_COMPONENTS} and ${COMMON_COMPONENTS}") - ELSE() - LIST(APPEND BSP_COMMON_HEADER ${cmp}.h) - LIST(APPEND BSP_SRC ${cmp}.c) - ENDIF() - ELSE() - LIST(APPEND BSP_HEADERS ${BSP_PREFIX}${cmp}.h) - LIST(APPEND BSP_SRC ${BSP_PREFIX}${cmp}.c) - ENDIF() -ENDFOREACH() - -FIND_PATH(STM32BSP_INCLUDE_DIR ${BSP_HEADERS} - HINTS ${STM32Cube_DIR}/Drivers/BSP/${STM_BOARD} - CMAKE_FIND_ROOT_PATH_BOTH - ) - -FOREACH(cmp ${BSP_COMMON_HEADERS}) - FIND_PATH(STM32BSP_${cmp}_INCLUDE_DIR ${cmp} - HINTS ${STM32Cube_DIR}/Drivers/BSP/Components - PATH_SUFFIXES ${cmp} - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND BSP_HEADERS ${STM32BSP_${cmp}_INCLUDE_DIR}) -ENDFOREACH() - -FOREACH(file ${BSP_SRC}) - STRING(REPLACE ".c" "" subfolder ${file}) - FIND_FILE(BSP_${file}_FILE ${file} - HINTS ${STM32Cube_DIR}/Drivers/BSP/${STM_BOARD} ${STM32Cube_DIR}/Drivers/BSP/Components - PATH_SUFFIXES ${subfolder} - CMAKE_FIND_ROOT_PATH_BOTH - ) - MESSAGE(STATUS "BSP file is " ${BSP_${file}_FILE}) - LIST(APPEND STM32BSP_SOURCES ${BSP_${file}_FILE}) -ENDFOREACH() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32BSP DEFAULT_MSG STM32BSP_INCLUDE_DIR STM32BSP_SOURCES) diff --git a/cmake/FindSTM32HAL.cmake b/cmake/FindSTM32HAL.cmake deleted file mode 100644 index a5751c6b..00000000 --- a/cmake/FindSTM32HAL.cmake +++ /dev/null @@ -1,199 +0,0 @@ -IF(STM32_FAMILY STREQUAL "F0") - SET(HAL_COMPONENTS adc can cec comp cortex crc dac dma flash gpio i2c - i2s irda iwdg pcd pwr rcc rtc smartcard smbus - spi tim tsc uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc crc dac flash i2c pcd pwr rcc rtc smartcard spi tim uart) - - SET(HAL_PREFIX stm32f0xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(HAL_COMPONENTS adc can cec cortex crc dac dma eth flash gpio hcd i2c - i2s irda iwdg nand nor pccard pcd pwr rcc rtc sd smartcard - spi sram tim uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc dac flash gpio pcd rcc rtc tim) - - SET(HAL_PREFIX stm32f1xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F2") - SET(HAL_COMPONENTS adc can cortex crc cryp dac dcmi dma eth flash - gpio hash hcd i2c i2s irda iwdg nand nor pccard - pcd pwr rcc rng rtc sd smartcard spi sram tim - uart usart wwdg fsmc sdmmc usb) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc dac dma flash pwr rcc rtc tim) - - SET(HAL_PREFIX stm32f2xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F3") - SET(HAL_COMPONENTS adc can cec comp cortex crc dac dma flash gpio i2c i2s - irda nand nor opamp pccard pcd pwr rcc rtc sdadc - smartcard smbus spi sram tim tsc uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - SET(HAL_EX_COMPONENTS adc crc dac flash i2c i2s opamp pcd pwr - rcc rtc smartcard spi tim uart) - - SET(HAL_PREFIX stm32f3xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(HAL_COMPONENTS adc can cec cortex crc cryp dac dcmi dma dma2d eth flash - flash_ramfunc fmpi2c gpio hash hcd i2c i2s irda iwdg ltdc - nand nor pccard pcd pwr qspi rcc rng rtc sai sd sdram - smartcard spdifrx spi sram tim uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc cryp dac dcmi dma flash fmpi2c hash i2c i2s pcd - pwr rcc rtc sai tim) - - SET(HAL_PREFIX stm32f4xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F7") - SET(HAL_COMPONENTS adc can cec cortex crc cryp dac dcmi dma dma2d eth flash - gpio hash hcd i2c i2s irda iwdg lptim ltdc nand nor pcd - pwr qspi rcc rng rtc sai sd sdram smartcard spdifrx spi - sram tim uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc crc cryp dac dcmi dma flash hash i2c pcd - pwr rcc rtc sai tim) - - SET(HAL_PREFIX stm32f7xx_) - -ELSEIF(STM32_FAMILY STREQUAL "H7") - SET(HAL_COMPONENTS adc can cec cortex crc cryp dac dcmi dma dma2d eth flash - gpio hash hcd i2c i2s irda iwdg lptim ltdc nand nor pcd - pwr qspi rcc rng rtc sai sd sdram smartcard spdifrx spi - sram tim uart usart wwdg fmc sdmmc usb) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc crc cryp dac dcmi dma flash hash i2c pcd - pwr rcc rtc sai tim) - - SET(HAL_PREFIX stm32h7xx_) - -ELSEIF(STM32_FAMILY STREQUAL "G0") - SET(HAL_COMPONENTS adc cec comp cortex crc cryp dac dma exti flash gpio i2c i2c i2s irda iwdg sptim pwr rcc rng rtc smartcard smbus spi tim uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS tim smartcard rtc rcc adc crc cryp dac dma flash pwr spi uart usart i2c) - - SET(HAL_PREFIX stm32g0xx_) - -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(HAL_COMPONENTS adc comp cortex crc crs cryp dac dma exti firewall flash gpio i2c - i2s irda iwdg lcd lptim lpuart pcd pwr rcc rng rtc smartcard - smbus spi tim tsc uart usart utils wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc comp crc cryp dac flash i2c pcd pwr rcc rtc smartcard tim uart usart) - - SET(HAL_PREFIX stm32l0xx_) -ELSEIF(STM32_FAMILY STREQUAL "L1") - SET(HAL_COMPONENTS adc comp cortex crc cryp dac dma flash flash_ramfunc - gpio i2c i2s irda iwdg lcd nor opamp pcd pwr rcc rtc - sd smartcard spi sram tim uart usart wwdg) - SET(HAL_REQUIRED_COMPONENTS cortex pwr) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc cryp dac flash opamp pcd pwr rcc rtc spi tim) - # Components that have ll_ in names instead of hal_ - - SET(HAL_PREFIX stm32l1xx_) -ELSEIF(STM32_FAMILY STREQUAL "L4") - SET(HAL_COMPONENTS adc can comp cortex crc cryp dac dcmi dfsdm dma dma2d dsi - firewall flash flash_ramfunc gfxmmu gpio hash hcd i2c irda iwdg - lcd lptim ltdc nand nor opamp ospi pcd pwr qspi rcc rng rtc sai - sd smartcard smbus spi sram swpmi tim tsc uart usart wwdg) - - SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc) - - # Components that have _ex sources - SET(HAL_EX_COMPONENTS adc crc cryp dac dfsdm dma flash hash i2c ltdc - opamp pcd pwr rcc rtc sai sd smartcard spi tim uart usart) - - SET(HAL_PREFIX stm32l4xx_) - -ENDIF() - -SET(HAL_HEADERS - ${HAL_PREFIX}hal.h - ${HAL_PREFIX}hal_def.h -) - -SET(HAL_SRCS - ${HAL_PREFIX}hal.c -) -IF(NOT STM32HAL_FIND_COMPONENTS) - SET(STM32HAL_FIND_COMPONENTS ${HAL_COMPONENTS}) - MESSAGE(STATUS "No STM32HAL components selected, using all: ${STM32HAL_FIND_COMPONENTS}") -ENDIF() - -FOREACH(cmp ${HAL_REQUIRED_COMPONENTS}) - LIST(FIND STM32HAL_FIND_COMPONENTS ${cmp} STM32HAL_FOUND_INDEX) - IF(${STM32HAL_FOUND_INDEX} LESS 0) - LIST(APPEND STM32HAL_FIND_COMPONENTS ${cmp}) - ENDIF() -ENDFOREACH() - -FOREACH(cmp ${STM32HAL_FIND_COMPONENTS}) - LIST(FIND HAL_COMPONENTS ${cmp} STM32HAL_FOUND_INDEX) - IF(${STM32HAL_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown STM32HAL component: ${cmp}. Available components: ${HAL_COMPONENTS}") - ELSE() - LIST(APPEND HAL_HEADERS ${HAL_PREFIX}hal_${cmp}.h) - LIST(APPEND HAL_SRCS ${HAL_PREFIX}hal_${cmp}.c) - ENDIF() - LIST(FIND HAL_EX_COMPONENTS ${cmp} STM32HAL_FOUND_INDEX) - IF(NOT (${STM32HAL_FOUND_INDEX} LESS 0)) - LIST(APPEND HAL_HEADERS ${HAL_PREFIX}hal_${cmp}_ex.h) - LIST(APPEND HAL_SRCS ${HAL_PREFIX}hal_${cmp}_ex.c) - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES HAL_HEADERS) -LIST(REMOVE_DUPLICATES HAL_SRCS) - -STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER) - -FIND_PATH(STM32HAL_INCLUDE_DIR ${HAL_HEADERS} - PATH_SUFFIXES include stm32${STM32_FAMILY_LOWER} - HINTS ${STM32Cube_DIR}/Drivers/STM32${STM32_FAMILY}xx_HAL_Driver/Inc - CMAKE_FIND_ROOT_PATH_BOTH -) - -FOREACH(HAL_SRC ${HAL_SRCS}) - STRING(MAKE_C_IDENTIFIER "${HAL_SRC}" HAL_SRC_CLEAN) - SET(HAL_${HAL_SRC_CLEAN}_FILE HAL_SRC_FILE-NOTFOUND) - FIND_FILE(HAL_${HAL_SRC_CLEAN}_FILE ${HAL_SRC} - PATH_SUFFIXES src stm32${STM32_FAMILY_LOWER} - HINTS ${STM32Cube_DIR}/Drivers/STM32${STM32_FAMILY}xx_HAL_Driver/Src - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND STM32HAL_SOURCES ${HAL_${HAL_SRC_CLEAN}_FILE}) -ENDFOREACH() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32HAL DEFAULT_MSG STM32HAL_INCLUDE_DIR STM32HAL_SOURCES) diff --git a/cmake/FindSTM32LL.cmake b/cmake/FindSTM32LL.cmake deleted file mode 100644 index 1f5c0362..00000000 --- a/cmake/FindSTM32LL.cmake +++ /dev/null @@ -1,131 +0,0 @@ -SET(STM32LL_HEADER_ONLY_COMPONENTS bus cortex iwdg system wwdg dmamux) - -IF(STM32_FAMILY STREQUAL "F0") - SET(LL_COMPONENTS adc bus comp cortex crc crs dac dma exti gpio i2c - iwdg pwr rcc rtc spi system tim usart utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f0xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F1") - SET(LL_COMPONENTS adc bus cortex crc dac dma exti fsmc gpio i2c - iwdg pwr rcc rtc sdmmc spi system tim usart usb utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f1xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F2") - SET(LL_COMPONENTS adc bus cortex crc dac dma exti fsmc gpio i2c iwdg pwr - rcc rng rtc sdmmc spi system tim usart usb utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f2xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F3") - SET(LL_COMPONENTS adc bus comp cortex crc dac dma exti fmc gpio hrtim i2c - iwdg opamp pwr rcc rtc spi system tim usart utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f3xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F4") - SET(LL_COMPONENTS adc bus cortex crc dac dma2d dma exti fmc fsmc gpio i2c iwdg - lptim pwr rcc rng rtc sdmmc spi system tim usart usb utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f4xx_) - -ELSEIF(STM32_FAMILY STREQUAL "F7") - SET(LL_COMPONENTS adc bus cortex crc dac dma2d dma exti fmc gpio i2c iwdg - lptim pwr rcc rng rtc sdmmc spi system tim usart usb utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32f7xx_) - -ELSEIF(STM32_FAMILY STREQUAL "H7") - SET(LL_COMPONENTS delayblock fmc sdmmc usb) - - SET(LL_PREFIX stm32h7xx_) - -ELSEIF(STM32_FAMILY STREQUAL "L0") - SET(LL_COMPONENTS adc bus comp cortex crc crs dac dma exti gpio i2c - iwdg lptim lpuart pwr rcc rng rtc spi system tim usart usb - utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32l0xx_) - -ELSEIF(STM32_FAMILY STREQUAL "L1") - SET(LL_COMPONENTS adc bus comp cortex crc dac dma exti fsmc gpio i2c iwdg opamp - pwr rcc rtc sdmmc spi tim usart utils) - SET(LL_REQUIRED_COMPONENTS pwr rcc utils) - - SET(LL_PREFIX stm32l1xx_) - -ELSEIF(STM32_FAMILY STREQUAL "L4") - SET(LL_COMPONENTS adc bus comp cortex crc crs dac dma2d dmamux dma exti - fmc gpio i2c iwdg lptim lpuart opamp pwr rcc rng rtc sdmmc spi - system tim usart usb utils wwdg) - - SET(LL_REQUIRED_COMPONENTS bus cortex pwr rcc system utils) - - SET(LL_PREFIX stm32l4xx_) - -ENDIF() - -IF(NOT NO_STM32LL_FULL_DRIVER) - ADD_DEFINITIONS(-DUSE_FULL_LL_DRIVER) -ENDIF() - -FOREACH(cmp ${LL_REQUIRED_COMPONENTS}) - LIST(FIND STM32LL_FIND_COMPONENTS ${cmp} STM32LL_FOUND_INDEX) - IF(${STM32LL_FOUND_INDEX} LESS 0) - LIST(APPEND STM32LL_FIND_COMPONENTS ${cmp}) - ENDIF() -ENDFOREACH() - -FOREACH(cmp ${STM32LL_FIND_COMPONENTS}) - LIST(FIND LL_COMPONENTS ${cmp} STM32LL_FOUND_INDEX) - IF(${STM32LL_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown STM32LL component: ${cmp}. Available components: ${LL_COMPONENTS}") - ELSE() - LIST(FIND STM32LL_HEADER_ONLY_COMPONENTS ${cmp} HEADER_ONLY_FOUND_INDEX) - IF(${HEADER_ONLY_FOUND_INDEX} LESS 0) - LIST(APPEND LL_SRCS ${LL_PREFIX}ll_${cmp}.c) - ENDIF() - LIST(APPEND LL_HEADERS ${LL_PREFIX}ll_${cmp}.h) - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES LL_HEADERS) -LIST(REMOVE_DUPLICATES LL_SRCS) - -STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER) - -FIND_PATH(STM32LL_INCLUDE_DIR ${LL_HEADERS} - PATH_SUFFIXES include stm32${STM32_FAMILY_LOWER} - HINTS ${STM32Cube_DIR}/Drivers/STM32${STM32_FAMILY}xx_HAL_Driver/Inc - CMAKE_FIND_ROOT_PATH_BOTH -) - -FOREACH(LL_SRC ${LL_SRCS}) - STRING(MAKE_C_IDENTIFIER "${LL_SRC}" LL_SRC_CLEAN) - SET(LL_${LL_SRC_CLEAN}_FILE LL_SRC_FILE-NOTFOUND) - FIND_FILE(LL_${LL_SRC_CLEAN}_FILE ${LL_SRC} - PATH_SUFFIXES src stm32${STM32_FAMILY_LOWER} - HINTS ${STM32Cube_DIR}/Drivers/STM32${STM32_FAMILY}xx_HAL_Driver/Src - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND STM32LL_SOURCES ${LL_${LL_SRC_CLEAN}_FILE}) -ENDFOREACH() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32LL DEFAULT_MSG STM32LL_INCLUDE_DIR STM32LL_SOURCES) diff --git a/cmake/FindSTM32STD.cmake b/cmake/FindSTM32STD.cmake deleted file mode 100644 index f68844c3..00000000 --- a/cmake/FindSTM32STD.cmake +++ /dev/null @@ -1,91 +0,0 @@ -IF(STM32_FAMILY STREQUAL "F4") - SET(STD_COMPONENTS adc can cec crc cryp dac dbgmcu dcmi dfsdm dma2d dma dsi - exti flash flash_ramfunc fmc fmpi2c fsmc gpio hash i2c iwdg lptim ltdc pwr qspi rcc - rng rtc sai sdio spdifrx spi syscfg tim usart wwdg) - - SET(STD_REQUIRED_COMPONENTS dma dma2d fmc i2c ltdc gpio rcc spi usart adc tim exti syscfg) - - SET(STD_EX_COMPONENTS cryp hash) - - SET(STD_PREFIX stm32f4xx_) -ENDIF() - -SET(STD_HEADERS - misc.h - stm32f4xx.h - core_cm4.h - ) - -SET(STD_SRCS - misc.c - ) - -IF(NOT STM32STD_FIND_COMPONENTS) - SET(STM32STD_FIND_COMPONENTS ${STD_COMPONENTS}) - MESSAGE(STATUS "No STM32STD components selected, using all: ${STM32STD_FIND_COMPONENTS}") -ENDIF() - -FOREACH(cmp ${STD_REQUIRED_COMPONENTS}) - LIST(FIND STM32STDPERIPH_FIND_COMPONENTS ${cmp} STM32STD_FOUND_INDEX) - IF(${STM32STD_FOUND_INDEX} LESS 0) - LIST(APPEND STM32STDPERIPH_FIND_COMPONENTS ${cmp}) - ENDIF() -ENDFOREACH() - -FOREACH(cmp ${STM32STD_FIND_COMPONENTS}) - LIST(FIND STD_COMPONENTS ${cmp} STM32STD_FOUND_INDEX) - IF($STM32STD_FOUND_INDEX LESS 0) - MESSAGE(FATAL_ERROR "Unknown STM32STD Peripheral component: ${cmp}. Available components: ${STD_COMPONENTS}") - ELSE() - LIST(APPEND STD_HEADERS ${STD_PREFIX}${cmp}.h) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}.c) - ENDIF() - LIST(FIND STD_EX_COMPONENTS ${cmp} STM32STD_FOUND_INDEX) - if(NOT (${STM32STD_FOUND_INDEX} LESS 0)) - STRING(COMPARE EQUAL ${cmp} "cryp" STM32_EQUAL) - if(${STM32_EQUAL}) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}_aes.c) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}_des.c) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}_tdes.c) - ENDIF() - STRING(COMPARE EQUAL ${cmp} "hash" STM32_EQUAL) - if(${STM32_EQUAL}) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}_md5.c) - LIST(APPEND STD_SRCS ${STD_PREFIX}${cmp}_sha1.c) - ENDIF() - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES STD_HEADERS) -LIST(REMOVE_DUPLICATES STD_SRCS) - -FOREACH(HEADER ${STD_HEADERS}) - FIND_PATH(STM32STD_${HEADER}_INCLUDE_DIR - NAMES ${HEADER} - PATHS - ${STM32STD_DIR}/Libraries/CMSIS/Device/ST/STM32F4xx/Include - ${STM32STD_DIR}/Libraries/CMSIS/Include - ${STM32STD_DIR}/Libraries/STM32F4xx_StdPeriph_Driver/inc - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND STM32STD_INCLUDE_DIR ${STM32STD_${HEADER}_INCLUDE_DIR}) -ENDFOREACH() - -SET(SRC_HINTS_DIR ${STM32STD_DIR}/Libraries/STM32${STM32_FAMILY}xx_StdPeriph_Driver/src) - -FOREACH(STD_SRC ${STD_SRCS}) - STRING(MAKE_C_IDENTIFIER "${STD_SRC}" STD_SRC_CLEAN) - SET(STD_${STD_SRC_CLEAN}_FILE STD_SRC_FILE-NOTFOUND) - FIND_FILE(STD_${STD_SRC_CLEAN}_FILE ${STD_SRC} - PATH_SUFFIXES src - HINTS ${SRC_HINTS_DIR} - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND STM32STD_SOURCES ${STD_${STD_SRC_CLEAN}_FILE}) -ENDFOREACH() - -LIST(REMOVE_DUPLICATES STM32STD_INCLUDE_DIR) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(STM32STD DEFAULT_MSG STM32STD_INCLUDE_DIR STM32STD_SOURCES) diff --git a/cmake/FindTFLite.cmake b/cmake/FindTFLite.cmake deleted file mode 100644 index c8389bc2..00000000 --- a/cmake/FindTFLite.cmake +++ /dev/null @@ -1,162 +0,0 @@ -SET(LIB_NAME tensorflow-microlite) - -IF(TF_RECACHE) - MESSAGE(STATUS "Rebasing TensorFlow source") - UNSET(TF_TAG CACHE) - UNSET(TF_COMMIT CACHE) -ENDIF() - -IF(NOT TF_SRC) - INCLUDE(FetchContent) - IF(TF_TAG) - MESSAGE(STATUS "Getting TF tag '${TF_TAG}' and not master") - FetchContent_Declare( - tf - GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git - GIT_PROGRESS FALSE - GIT_REMOTE_UPDATE_STRATEGY REBASE_CHECKOUT - GIT_TAG ${TF_TAG} - QUIET - ) - ELSEIF(TF_COMMIT) - MESSAGE(STATUS "Getting TF commit '${TF_COMMIT}' and not master") - FetchContent_Declare( - tf - GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git - GIT_PROGRESS FALSE - GIT_REMOTE_UPDATE_STRATEGY REBASE_CHECKOUT - GIT_TAG ${TF_COMMIT} - QUIET - ) - ELSE() - FetchContent_Declare( - tf - GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git - GIT_PROGRESS FALSE - GIT_REMOTE_UPDATE_STRATEGY REBASE_CHECKOUT - QUIET - ) - ENDIF() - FetchContent_GetProperties(tf) - IF(NOT tf_POPULATED) - MESSAGE(STATUS "TensorFlow sources not given/populated, fetching from GH...") - FetchContent_Populate(tf) - ENDIF() - SET(TF_SRC ${tf_SOURCE_DIR}) - - FetchContent_Declare( - flatbuffers - GIT_REPOSITORY https://github.com/google/flatbuffers.git - GIT_PROGRESS FALSE - QUIET - ) - FetchContent_GetProperties(flatbuffers) - IF(NOT flatbuffers_POPULATED) - MESSAGE(STATUS "Now getting 'flatbuffers'...") - FetchContent_Populate(flatbuffers) - ENDIF() - LIST(APPEND TFL_INC_DIRS ${flatbuffers_SOURCE_DIR}/include) - - FetchContent_Declare( - fixedpoint - GIT_REPOSITORY https://github.com/google/gemmlowp.git - GIT_PROGRESS FALSE - QUIET - ) - FetchContent_GetProperties(fixedpoint) - IF(NOT fixedpoint_POPULATED) - MESSAGE(STATUS "And finaly 'fixedpoint'...") - FetchContent_Populate(fixedpoint) - ENDIF() - LIST(APPEND TFL_INC_DIRS ${fixedpoint_SOURCE_DIR}) - - FetchContent_Declare( - ruy - GIT_REPOSITORY https://github.com/google/ruy.git - GIT_PROGRESS FALSE - QUIET - ) - FetchContent_GetProperties(ruy) - IF(NOT ruy_POPULATED) - MESSAGE(STATUS "Oh we also need 'ruy'...") - FetchContent_Populate(ruy) - ENDIF() - LIST(APPEND TFL_INC_DIRS ${ruy_SOURCE_DIR}) -ENDIF() - -SET(TFL_SRC ${TF_SRC}/tensorflow/lite) -SET(TFLM_SRC ${TFL_SRC}/micro) -SET(TFLD_SRC ${TFL_SRC}/tools/make/downloads) - -IF(EXISTS ${TFLD_SRC}/flatbuffers/include) - LIST(APPEND TFL_INC_DIRS ${TFLD_SRC}/flatbuffers/include) -ENDIF() - -IF(EXISTS ${TFLD_SRC}/gemmlowp) - LIST(APPEND ${TFLD_SRC}/gemmlowp) -ENDIF() - -LIST(APPEND TFL_INC_DIRS - ${TF_SRC} - ) - -FILE(GLOB TFL_ROOT_SRCS - ${TFLM_SRC}/*.cc - ) - -FILE(GLOB TFL_KERNELS_SRCS - ${TFLM_SRC}/kernels/*.cc - ${TFL_SRC}/kernels/internal/quantization_util.cc - ${TFL_SRC}/kernels/kernel_util.cc - ) - -FILE(GLOB TFL_CORE_API_SRCS - ${TFL_SRC}/core/api/*.cc - ) - -FILE(GLOB TFL_C_SRCS - ${TFL_SRC}/c/common.c - ) - -FILE(GLOB TFL_MEM_PLANNER_SRCS - ${TFLM_SRC}/memory_planner/*.cc - ) - -SET(TFL_SRCS - ${TFL_ROOT_SRCS} - ${TFL_KERNELS_SRCS} - ${TFL_CORE_API_SRCS} - ${TFL_C_SRCS} - ${TFL_MEM_PLANNER_SRCS} - ) - -LIST(FILTER TFL_SRCS EXCLUDE REGEX "([a-z0-9_]+_test.cc)$") - -ADD_LIBRARY(${LIB_NAME} STATIC - ${TFL_SRCS} -) - -TARGET_INCLUDE_DIRECTORIES(${LIB_NAME} PUBLIC - ${TFL_INC_DIRS} -) - -TARGET_COMPILE_DEFINITIONS(${LIB_NAME} PUBLIC - TF_LITE_USE_GLOBAL_MAX - TF_LITE_USE_GLOBAL_MIN - TF_LITE_USE_GLOBAL_CMATH_FUNCTIONS - TF_LITE_STATIC_MEMORY - TFLITE_EMULATE_FLOAT - "$<$:TF_LITE_STRIP_ERROR_STRINGS>" -) - -SET(TFLite_INCLUDE_DIRS - ${TFL_INC_DIRS} - ) - -SET(TFLite_SOURCES - ${TFL_SRCS} - ) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(TFLite DEFAULT_MSG TFLite_INCLUDE_DIRS TFLite_SOURCES) diff --git a/cmake/FindUSBDevice.cmake b/cmake/FindUSBDevice.cmake deleted file mode 100644 index 0849c779..00000000 --- a/cmake/FindUSBDevice.cmake +++ /dev/null @@ -1,136 +0,0 @@ -IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) -ENDIF() - -IF(NOT USBDevice_FIND_COMPONENTS) - SET(USBDevice_FIND_COMPONENTS ${USBDevice_COMPONENTS}) - MESSAGE(STATUS "No USBDevice components selected, using all: ${USBDevice_FIND_COMPONENTS}") -ENDIF() - -SET(USBDevice_SRC - Core/Src/usbd_ctlreq.c - Core/Src/usbd_core.c - Core/Src/usbd_ioreq.c -# Core/Src/usbd_conf_template.c -) - -SET(USBDevice_INC - Core/Inc/usbd_ctlreq.h - Core/Inc/usbd_ioreq.h - Core/Inc/usbd_core.h -# Core/Inc/usbd_conf_template.h - Core/Inc/usbd_def.h -) - -SET(USBDevice_COMPONENTS CDC DFU AUDIO Template MSC HID CustomHID) - -SET(USBDevice_COMPONENTS_CDC_HEADERS - Class/CDC/Inc/usbd_cdc.h -# Class/CDC/Inc/usbd_cdc_if_template.h -) -SET(USBDevice_COMPONENTS_CDC_SOURCES - Class/CDC/Src/usbd_cdc.c -# Class/CDC/Src/usbd_cdc_if_template.c -) - -SET(USBDevice_COMPONENTS_DFU_HEADERS -# Class/DFU/Inc/usbd_dfu_media_template.h - Class/DFU/Inc/usbd_dfu.h -) -SET(USBDevice_COMPONENTS_DFU_SOURCES - Class/DFU/Src/usbd_dfu.c -# Class/DFU/Src/usbd_dfu_media_template.c -) - -SET(USBDevice_COMPONENTS_AUDIO_HEADERS - Class/AUDIO/Inc/usbd_audio.h -# Class/AUDIO/Inc/usbd_audio_if_template.h -) -SET(USBDevice_COMPONENTS_AUDIO_SOURCES -# Class/AUDIO/Src/usbd_audio_if_template.c - Class/AUDIO/Src/usbd_audio.c -) - -SET(USBDevice_COMPONENTS_Template_HEADERS - Class/Template/Inc/usbd_template.h -) -SET(USBDevice_COMPONENTS_Template_SOURCES - Class/Template/Src/usbd_template.c -) - -SET(USBDevice_COMPONENTS_MSC_HEADERS - Class/MSC/Inc/usbd_msc_scsi.h -# Class/MSC/Inc/usbd_msc_storage_template.h - Class/MSC/Inc/usbd_msc_data.h - Class/MSC/Inc/usbd_msc.h - Class/MSC/Inc/usbd_msc_bot.h -) -SET(USBDevice_COMPONENTS_MSC_SOURCES - Class/MSC/Src/usbd_msc.c - Class/MSC/Src/usbd_msc_data.c - Class/MSC/Src/usbd_msc_bot.c - Class/MSC/Src/usbd_msc_scsi.c -# Class/MSC/Src/usbd_msc_storage_template.c -) - -IF(NOT USBDevice_HID_CONFIG_DIR) - MESSAGE(STATUS "No user defined HID sources, using library sources") - SET(USBDevice_COMPONENTS_HID_HEADERS - Class/HID/Inc/usbd_hid.h - ) - SET(USBDevice_COMPONENTS_HID_SOURCES - Class/HID/Src/usbd_hid.c - ) -ELSE() - MESSAGE(STATUS "Using user defined HID sources in ${USBDevice_HID_CONFIG_DIR}") - LIST(APPEND USBDevice_SOURCES ${USBDevice_HID_CONFIG_DIR}/usbd_hid.c) - LIST(APPEND USBDevice_INCLUDE_DIR ${USBDevice_HID_CONFIG_DIR}) - LIST(REMOVE_ITEM USBDevice_FIND_COMPONENTS HID) -ENDIF() - -SET(USBDevice_COMPONENTS_CustomHID_HEADERS -# Class/CustomHID/Inc/usbd_customhid_if_template.h - Class/CustomHID/Inc/usbd_customhid.h -) -SET(USBDevice_COMPONENTS_CustomHID_SOURCES - Class/CustomHID/Src/usbd_customhid.c -# Class/CustomHID/Src/usbd_customhid_if_template.c -) - -FOREACH(cmp ${USBDevice_FIND_COMPONENTS}) - LIST(FIND USBDevice_COMPONENTS ${cmp} USBDevice_FOUND_INDEX) - IF(${USBDevice_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown USBDevice component: ${cmp}. Available components: ${USBDevice_COMPONENTS}") - ENDIF() - LIST(FIND USBDevice_COMPONENTS ${cmp} USBDevice_FOUND_INDEX) - IF(NOT (${USBDevice_FOUND_INDEX} LESS 0)) - LIST(APPEND USBDevice_INC ${USBDevice_COMPONENTS_${cmp}_HEADERS}) - LIST(APPEND USBDevice_SRC ${USBDevice_COMPONENTS_${cmp}_SOURCES}) - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES USBDevice_INC) -LIST(REMOVE_DUPLICATES USBDevice_SRC) - -FOREACH(INC ${USBDevice_INC}) - SET(INC_FILE INC_FILE-NOTFOUND) - GET_FILENAME_COMPONENT(INC_FILE ${STM32Cube_DIR}/Middlewares/ST/STM32_USB_Device_Library/${INC} DIRECTORY) - MESSAGE(STATUS "Found ${INC}: ${INC_FILE}") - LIST(APPEND USBDevice_INCLUDE_DIR ${INC_FILE}) -ENDFOREACH() -LIST(REMOVE_DUPLICATES USBDevice_INCLUDE_DIR) - -FOREACH(SRC ${USBDevice_SRC}) - SET(SRC_FILE SRC_FILE-NOTFOUND) - FIND_FILE(SRC_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/ST/STM32_USB_Device_Library - CMAKE_FIND_ROOT_PATH_BOTH - ) - MESSAGE(STATUS "Found ${SRC}: ${SRC_FILE}") - LIST(APPEND USBDevice_SOURCES ${SRC_FILE}) -ENDFOREACH() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(USBDevice DEFAULT_MSG USBDevice_INCLUDE_DIR USBDevice_SOURCES) diff --git a/cmake/FindUSBHost.cmake b/cmake/FindUSBHost.cmake deleted file mode 100644 index 5f76881b..00000000 --- a/cmake/FindUSBHost.cmake +++ /dev/null @@ -1,117 +0,0 @@ -IF(NOT STM32Cube_DIR) - SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0") - MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR}) -ENDIF() - -SET(USBHost_HEADERS - Core/Inc/usbh_ctlreq.h - Core/Inc/usbh_ioreq.h - Core/Inc/usbh_core.h - Core/Src/usbh_pipes.h -) - -SET(USBHost_SRC - Core/Src/usbh_ctlreq.c - Core/Src/usbh_core.c - Core/Src/usbh_ioreq.c - Core/Src/usbh_pipes.c -) - -SET(USBHost_COMPONENTS CDC AUDIO MSC HID MTP) - -ADD_DEFINITIONS(-DUSE_USB_HS) -ADD_DEFINITIONS(-DUSE_HAL_DRIVER) - -SET(USBHost_COMPONENTS_CDC_HEADERS - Class/CDC/Inc/usbh_cdc.h -) -SET(USBHost_COMPONENTS_CDC_SOURCES - Class/CDC/Src/usbh_cdc.c -) - -SET(USBHost_COMPONENTS_AUDIO_HEADERS - Class/AUDIO/Inc/usbh_audio.h -) -SET(USBHost_COMPONENTS_AUDIO_SOURCES - Class/AUDIO/Src/usbh_audio.c -) - -SET(USBHost_COMPONENTS_MSC_HEADERS - Class/MSC/Inc/usbh_msc_scsi.h -# Class/MSC/Inc/usbh_msc_data.h - Class/MSC/Inc/usbh_msc.h - Class/MSC/Inc/usbh_msc_bot.h -) -SET(USBHost_COMPONENTS_MSC_SOURCES - Class/MSC/Src/usbh_msc.c -# Class/MSC/Src/usbh_msc_data.c - Class/MSC/Src/usbh_msc_bot.c - Class/MSC/Src/usbh_msc_scsi.c -) - -SET(USBHost_COMPONENTS_HID_HEADERS - Class/HID/Inc/usbh_hid_keybd.h - Class/HID/Inc/usbh_hid_mouse.h - Class/HID/Inc/usbh_hid_parser.h - Class/HID/Inc/usbh_hid_usage.h - Class/HID/Inc/usbh_hid.h -) -SET(USBHost_COMPONENTS_HID_SOURCES - Class/HID/Src/usbh_hid_keybd.c - Class/HID/Src/usbh_hid_mouse.c - Class/HID/Src/usbh_hid_parser.c - Class/HID/Src/usbh_hid.c -) - -SET(USBHost_COMPONENTS_MTP_HEADERS - Class/MTP/Inc/usbh_mtp_ptp.h - Class/MTP/Inc/usbh_mtp.h -) -SET(USBHost_COMPONENTS_MTP_SOURCES - Class/MTP/Src/usbh_mtp_ptp.c - Class/MTP/Src/usbh_mtp.c -) - -IF(NOT USBHost_FIND_COMPONENTS) - SET(USBHost_FIND_COMPONENTS ${USBHost_COMPONENTS}) - MESSAGE(STATUS "No USBHost components selected, using all: ${USBHost_FIND_COMPONENTS}") -ENDIF() - -MESSAGE(STATUS "USBHost components: ${USBHost_FIND_COMPONENTS}") - -FOREACH(cmp ${USBHost_FIND_COMPONENTS}) - LIST(FIND USBHost_COMPONENTS ${cmp} USBHost_FOUND_INDEX) - IF(${USBHost_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown USBHost component: ${cmp}. Available components: ${USBHost_COMPONENTS}") - ENDIF() - LIST(FIND USBHost_COMPONENTS ${cmp} USBHost_FOUND_INDEX) - IF(NOT (${USBHost_FOUND_INDEX} LESS 0)) - LIST(APPEND USBHost_HEADERS ${USBHost_COMPONENTS_${cmp}_HEADERS}) - LIST(APPEND USBHost_SRC ${USBHost_COMPONENTS_${cmp}_SOURCES}) - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES USBHost_HEADERS) -LIST(REMOVE_DUPLICATES USBHost_SRC) - -FOREACH(INC ${USBHost_HEADERS}) - SET(INC_FILE INC_FILE-NOTFOUND) - GET_FILENAME_COMPONENT(INC_FILE ${STM32Cube_DIR}/Middlewares/ST/STM32_USB_Host_Library/${INC} DIRECTORY) - MESSAGE(STATUS "Found ${INC}: ${INC_FILE}") - LIST(APPEND USBHost_INCLUDE_DIRS ${INC_FILE}) -ENDFOREACH() -LIST(REMOVE_DUPLICATES USBHost_INCLUDE_DIRS) - -FOREACH(SRC ${USBHost_SRC}) - SET(SRC_FILE SRC_FILE-NOTFOUND) - FIND_FILE(SRC_FILE ${SRC} - HINTS ${STM32Cube_DIR}/Middlewares/ST/STM32_USB_Host_Library - CMAKE_FIND_ROOT_PATH_BOTH - ) - MESSAGE(STATUS "Found ${SRC}: ${SRC_FILE}") - LIST(APPEND USBHost_SOURCES ${SRC_FILE}) -ENDFOREACH() - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(USBHost DEFAULT_MSG USBHost_INCLUDE_DIRS USBHost_SOURCES) diff --git a/cmake/FinduGFX.cmake b/cmake/FinduGFX.cmake deleted file mode 100644 index fe219b9d..00000000 --- a/cmake/FinduGFX.cmake +++ /dev/null @@ -1,225 +0,0 @@ -SET(uGFX_COMPONENTS gfx gadc gaudio gdisp_mcufont gdisp_fonts - gdisp_image gdriver gdisp gevent gfile ginput gmisc gos - gdisp_pixmap gqueue gtimer gtrans gwin - ) - -SET(uGFX_GDISP_DRIVERS ED060SC4 AlteraFramereader framebuffer ED060SC4 Fb24bpp - HX8347D ILI93xx ILI9320 ILI9325 ILI9341 ILI9481 LGDP4532 Nokia6610GE8 - Nokia6610GE12 PCD8544 PCF8812 R61505U RA8875 S6D1121 SPFD54124B SSD1289 - SSD1306 SSD1331 SSD1351 SSD1963 SSD2119 ST7565 - # STM32F429iDiscovery - STM32LTDC TestStub TLS8204) - -SET(uGFX_REQUIRED_COMPONENTS gfx gos gdisp gdriver) -LIST(APPEND uGFX_COMPONENTS ${uGFX_REQUIRED_COMPONENTS}) -LIST(APPEND uGFX_COMPONENTS ${uGFX_GDISP_DRIVERS}) - -SET(uGFX_PREFIX gfx) - -SET(uGFX_HEADERS - ${uGFX_PREFIX}.h - ${uGFX_PREFIX}_options.h - ${uGFX_PREFIX}_types.h - ${uGFX_PREFIX}_compilers.h - ) - -SET(uGFX_SRCS - ${uGFX_PREFIX}.c - ${uGFX_PREFIX}_mk.c - ) - -if(NOT uGFX_LLD_CONFIG) - MESSAGE("No uGFX_LLD_CONFIG given, this may result in an error") -ELSE() - LIST(APPEND uGFX_INCLUDE_DIRS ${uGFX_LLD_CONFIG}) -ENDIF() - -# Set defaults if no components given -IF(NOT uGFX_FIND_COMPONENTS) - SET(uGFX_FIND_COMPONENTS uGFX_COMPONENTS) - MESSAGE(STATUS "No uGFX components specified, using all: ${uGFX_COMPONENTS}") -ENDIF() - - -# Required components -FOREACH(cmp ${uGFX_REQUIRED_COMPONENTS}) - LIST(FIND uGFX_FIND_COMPONENTS ${cmp} uGFX_FOUND_INDEX) - IF(${uGFX_FOUND_INDEX} LESS 0) - LIST(APPEND uGFX_FIND_COMPONENTS ${cmp}) - ENDIF() -ENDFOREACH() - -IF(NOT uGFX_DRIVERS) - MESSAGE("No uGFX_DRIVERS set, available drivers: ${uGFX_GDISP_DRIVERS}") -ELSE() - FOREACH(driver ${uGFX_DRIVERS}) - LIST(FIND uGFX_GDISP_DRIVERS ${driver} DRIVER_INDEX) - IF(${DRIVER_INDEX} LESS 0) - LIST(APPEND uGFX_FIND_DRIVERS ${driver}) - ENDIF() - ENDFOREACH() -ENDIF() - -FOREACH(cmp ${uGFX_FIND_COMPONENTS}) - LIST(FIND uGFX_COMPONENTS ${cmp} uGFX_FOUND_INDEX) - IF(${uGFX_FOUND_INDEX} LESS 0) - MESSAGE(FATAL_ERROR "Unknown uGFX Module: ${cmp}. Available modules: ${uGFX_COMPONENTS}") - ELSE() - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES uGFX_FIND_COMPONENTS) - -INCLUDE(uGFX_GDISP) - -SET(uGFX_gfx_SEARCH_PATH ${uGFX_DIR} ${uGFX_DIR}/src) -SET(uGFX_gfx_HEADERS gfx.h) -SET(uGFX_gfx_SOURCES gfx.c) - -SET(uGFX_gadc_SEARCH_PATH ${uGFX_DIR}/src/gadc) -SET(uGFX_gadc_HEADERS gadc_driver.h gadc.h gadc_options.h gadc_rules.h) -SET(uGFX_gadc_SOURCES gadc.c) - -SET(uGFX_gaudio_SERCH_PATH ${uGFX_DIR}/src/gaudio) -SET(uGFX_gaudio_HEADERS gadc_driver_record.h gaudio_driver_play.h - gaudio.h gaudio_options.h gaudio_rules.h) -SET(uGFX_gaudio_SOURCES gaudio.c) - -SET(uGFX_gdriver_SEARCH_PATH ${uGFX_DIR}/src/gdriver) -SET(uGFX_gdriver_HEADERS gdriver_options.h gdriver_rules.h gdriver.h) -SET(uGFX_gdriver_SOURCES gdriver.c) - -SET(uGFX_gevent_SEARCH_PATH ${uGFX_DIR}/src/gevent) -SET(uGFX_gevent_HEADERS gevent.h gevent_options.h gevent_rules.h) -SET(uGFX_gevent_SOURCES gevent.c) - -SET(uGFX_gfile_SEARCH_PATH ${uGFX_DIR}/src/gfile) -SET(uGFX_gfile_HEADERS gfile_fatfs_wrapper.h gfile_fs.h gfile.h gfile_options.h - gfile_petitfs_wrapper.h gfile_rules.h) -SET(uGFX_gfile_SOURCES gfile.c gfile_fatfs_diskio_chibios.c gfile_fatfs_wrapper.c - gfile_fs_chibios.c gfile_fs_fatfs.c gfile_fs_mem.c gfile_fs_native.c - gfile_fs_petitfs.c gfile_fs_ram.c gfile_fs_rom.c gfile_fs_strings.c - gfile_petitfs_diskio_chibios.c gfile_petitfs_wrapper.c gfile_printg.c - gfile_scang.c gfile_stdio.c) - -SET(uGFX_ginput_SEARCH_PATH ${uGFX_DIR}/src/ginput) -SET(uGFX_ginput_HEADERS ginput_dial.h ginput_driver_dial.h ginput_driver_keyboard.h - ginput_driver_mouse.h ginput_driver_toggle.h ginput.h ginput_keyboard.h - ginput_keyboard_microcode.h ginput_mouse.h ginput_options.h ginput_rules.h - ginput_toggle.h) -SET(uGFX_ginput_SOURCES ginput.c ginput_dial.c ginput_keyboard.c - ginput_keyboard_microcode.c ginput_mouse.c ginput_toggle.c) - -SET(uGFX_gmisc_SEARCH_PATH ${uGFX_DIR}/src/gmisc) -SET(uGFX_gmisc_HEADERS gmisc.h gmisc_options.h gmisc_rules.h) -SET(uGFX_gmisc_SOURCES gmisc_arrayops.c gmisc.c gmisc_hittest.c gmisc_matrix2d.c - gmisc_trig.c) - -SET(uGFX_gos_SEARCH_PATH ${uGFX_DIR}/src/gos) -SET(uGFX_gos_HEADERS - gos_arduino.h gos_chibios.h gos_cmsis2.h gos_cmsis.h gos_ecos.h - gos_freertos.h gos.h gos_keil.h gos_linux.h gos_nios.h gos_options.h - gos_osx.h gos_qt.h gos_raw32.h gos_rawrtos.h gos_rtx5.h gos_rules.h - gos_win32.h gos_x_heap.h gos_x_threads_cortexm01.h gos_x_threads_cortexm347.h - gos_x_threads_cortexm47fp.h gos_x_threads.h gos_zephyr.h - ) -SET(uGFX_gos_SOURCES gos_arduino.c gos_chibios.c gos_cmsis2.c gos_cmsis.c - gos_ecos.c gos_freertos.c gos_linux.c gos_nios.c gos_osx.c gos_raw32.c - gos_rawrtos.c gos_win32.c gos_x_heap.c gos_x_threads.c gos_zephyr.c) - -SET(uGFX_gqueue_SEARCH_PATH ${uGFX_DIR}/src/gqueue) -SET(uGFX_gqueue_HEADERS gqueue.h gqueue_options.h gqueue_rules.h) -SET(uGFX_gqueue_SOURCES gqueue.c) - -SET(uGFX_gtimer_SEARCH_PATH ${uGFX_DIR}/src/gtimer) -SET(uGFX_gtimer_HEADERS gtimer.h gtimer_options.h gtimer_rules.h) -SET(uGFX_gtimer_SOURCES gtimer.c) - -SET(uGFX_gtrans_SEARCH_PATH ${uGFX_DIR}/src/gtrans) -SET(uGFX_gtrans_HEADERS gtrans.h gtrans_options.h gtrans_rules.h) -SET(uGFX_gtrans_SOURCES gtrans.c) - -SET(uGFX_gwin_SEARCH_PATH ${uGFX_DIR}/src/gwin) -SET(uGFX_gwin_HEADERS gwin_button.h gwin_container.h gwin.h gwin_label.h gwin_radio.h - gwin_textedit.h gwin_checkbox.h gwin_frame.h gwin_image.h gwin_list.h - gwin_rules.h gwin_widget.h gwin_class.h gwin_gl3d.h gwin_keyboard.h gwin_options.h - gwin_slider.h gwin_console.h gwin_graph.h gwin_keyboard_layout.h - gwin_progressbar.h gwin_tabset.h - ) -SET(uGFX_gwin_SOURCES gwin_button.c gwin_container.c gwin_image.c gwin_list.c - gwin_slider.c gwin_wm.c gwin.c gwin_frame.c gwin_keyboard.c gwin_tabset.c - gwin_checkbox.c gwin_gl3d.c gwin_keyboard_layout.c gwin_progressbar.c gwin_textedit.c - gwin_console.c gwin_graph.c gwin_label.c gwin_radio.c gwin_widget.c) - -SET(uGFX_gdisp_fonts_SEARCH_PATH - ${uGFX_DIR}/src/gdisp/fonts - ) - -SET(uGFX_gdisp_fonts_HEADERS - fonts.h - ) -SET(uGFX_gdisp_fonts_SOURCES - DejaVuSans16_aa.c DejaVuSans24_aa.c DejaVuSansBold12_aa.c fixed_10x20.c - fixed_7x14.c UI2.c DejaVuSans10.c DejaVuSans16.c DejaVuSans24.c DejaVuSansBold12.c - DejaVuSans12_aa.c DejaVuSans20_aa.c DejaVuSans32_aa.c fixed_5x8.c - LargeNumbers.c DejaVuSans12.c DejaVuSans20.c DejaVuSans32.c UI1.c - ) - -SET(uGFX_gdisp_mcufont_SEARCH_PATH - ${uGFX_DIR}/src/gdisp - ${uGFX_DIR}/src/gdisp/mcufont - ) -SET(uGFX_gdisp_mcufont_HEADERS - mcufont.h mf_bwfont.h mf_config.h mf_encoding.h mf_font.h mf_justify.h - mf_kerning.h mf_rlefont.h mf_scaledfont.h mf_wordwrap.h) -SET(uGFX_gdisp_mcufont_SOURCES - mf_bwfont.c mf_encoding.c mf_font.c mf_justify.c mf_kerning.c mf_rlefont.c - mf_scaledfont.c mf_wordwrap.c gdisp_fonts.c) - -SET(uGFX_gdisp_image_SEARCH_PATH ${uGFX_DIR}/src/gdisp) -SET(uGFX_gdisp_image_HEADERS gdisp_image.h) -SET(uGFX_gdisp_image_SOURCES - gdisp_image_bmp.c gdisp_image_gif.c gdisp_image_gif.c gdisp_image_jpg.c - gdisp_image_native.c gdisp_image_png.c gdisp_image.c) - -SET(uGFX_gdisp_pixmap_SEARCH_PATH ${uGFX_DIR}/src/gdisp) -SET(uGFX_gdisp_pixmap_HEADERS gdisp_pixmap.h) -SET(uGFX_gdisp_pixmap_SOURCES gdisp_pixmap.c) - - - -FOREACH(comp ${uGFX_FIND_COMPONENTS}) - LIST(FIND uGFX_COMPONENTS ${comp} INDEX) - IF(INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Unknown uGFX component: ${comp}\nSupported uGFX components: ${uGFX_COMPONENTS}") - ENDIF() - IF(uGFX_${comp}_SOURCES) - FOREACH(source ${uGFX_${comp}_SOURCES}) - FIND_FILE(uGFX_${comp}_${source} - NAMES ${source} - PATHS ${uGFX_${comp}_SEARCH_PATH} - NO_DEFAULT_PATH - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND uGFX_SOURCES ${uGFX_${comp}_${source}}) - ENDFOREACH() - ENDIF() - IF(uGFX_${comp}_HEADERS) - FOREACH(header ${uGFX_${comp}_HEADERS}) - FIND_PATH(uGFX_${comp}_${header}_INCLUDE_DIR - NAMES ${header} - PATHS ${uGFX_${comp}_SEARCH_PATH} - NO_DEFAULT_PATH - CMAKE_FIND_ROOT_PATH_BOTH - ) - LIST(APPEND uGFX_INCLUDE_DIRS ${uGFX_${comp}_${header}_INCLUDE_DIR}) - ENDFOREACH() - ENDIF() -ENDFOREACH() - -LIST(REMOVE_DUPLICATES uGFX_INCLUDE_DIRS) -LIST(REMOVE_DUPLICATES uGFX_SOURCES) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(uGFX DEFAULT_MSG uGFX_INCLUDE_DIRS uGFX_SOURCES) diff --git a/cmake/gcc_stm32.cmake b/cmake/gcc_stm32.cmake deleted file mode 100644 index 23462de1..00000000 --- a/cmake/gcc_stm32.cmake +++ /dev/null @@ -1,212 +0,0 @@ -GET_FILENAME_COMPONENT(STM32_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} DIRECTORY) -SET(CMAKE_MODULE_PATH ${STM32_CMAKE_DIR} ${CMAKE_MODULE_PATH}) - -SET(STM32_SUPPORTED_FAMILIES L0 L1 L4 F0 F1 F2 F3 F4 F7 G0 H7 CACHE INTERNAL "stm32 supported families") - -IF(STM32_CHIP) - SET(STM32_CHIP "${STM32_CHIP}" CACHE STRING "STM32 chip to build for") -ENDIF() - -IF(NOT TOOLCHAIN_PREFIX) - SET(TOOLCHAIN_PREFIX "/usr") - MESSAGE(STATUS "No TOOLCHAIN_PREFIX specified, using default: " ${TOOLCHAIN_PREFIX}) -ELSE() - FILE(TO_CMAKE_PATH "${TOOLCHAIN_PREFIX}" TOOLCHAIN_PREFIX) -ENDIF() - -IF(NOT TARGET_TRIPLET) - SET(TARGET_TRIPLET "arm-none-eabi") - MESSAGE(STATUS "No TARGET_TRIPLET specified, using default: " ${TARGET_TRIPLET}) -ENDIF() - -IF(NOT STM32_FAMILY) - MESSAGE(STATUS "No STM32_FAMILY specified, trying to get it from STM32_CHIP") - IF(NOT STM32_CHIP) - SET(STM32_FAMILY "F1" CACHE INTERNAL "stm32 family") - MESSAGE(STATUS "Neither STM32_FAMILY nor STM32_CHIP specified, using default STM32_FAMILY: ${STM32_FAMILY}") - ELSE() - STRING(REGEX REPLACE "^[sS][tT][mM]32(([fF][0-47])|([gG][0])|([hH]7)|([lL][0-14])|([tT])|([wW])).+$" "\\1" STM32_FAMILY ${STM32_CHIP}) - STRING(TOUPPER ${STM32_FAMILY} STM32_FAMILY) - MESSAGE(STATUS "Selected STM32 family: ${STM32_FAMILY}") - ENDIF() -ENDIF() - -STRING(TOUPPER "${STM32_FAMILY}" STM32_FAMILY) -LIST(FIND STM32_SUPPORTED_FAMILIES "${STM32_FAMILY}" FAMILY_INDEX) -IF(FAMILY_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32 family: ${STM32_FAMILY}") -ENDIF() - -SET(TOOLCHAIN_BIN_DIR "${TOOLCHAIN_PREFIX}/bin") -SET(TOOLCHAIN_INC_DIR "${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}/include") -SET(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}/lib") - -SET(CMAKE_SYSTEM_NAME Generic) -SET(CMAKE_SYSTEM_PROCESSOR arm) - -IF (WIN32) - SET(TOOL_EXECUTABLE_SUFFIX ".exe") -ELSE() - SET(TOOL_EXECUTABLE_SUFFIX "") -ENDIF() - -IF(${CMAKE_VERSION} VERSION_LESS 3.6.0) - INCLUDE(CMakeForceCompiler) - CMAKE_FORCE_C_COMPILER("${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}" GNU) - CMAKE_FORCE_CXX_COMPILER("${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX}" GNU) -ELSE() - SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) - SET(CMAKE_C_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}") - SET(CMAKE_CXX_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX}") -ENDIF() -SET(CMAKE_ASM_COMPILER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX}") - -SET(CMAKE_OBJCOPY "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objcopy tool") -SET(CMAKE_OBJDUMP "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "objdump tool") -SET(CMAKE_SIZE "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-size${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "size tool") -SET(CMAKE_DEBUGER "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "debuger") -SET(CMAKE_CPPFILT "${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-c++filt${TOOL_EXECUTABLE_SUFFIX}" CACHE INTERNAL "C++filt") - -SET(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags debug") -SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags debug") -SET(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "asm compiler flags debug") -SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-Xlinker -Map=output.map" CACHE INTERNAL "linker flags debug") - -SET(CMAKE_C_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "c compiler flags release") -SET(CMAKE_CXX_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "cxx compiler flags release") -SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release") -SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Xlinker -Map=output.map -s -flto" CACHE INTERNAL "linker flags release") - -SET(CMAKE_FIND_ROOT_PATH "${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}" ${EXTRA_FIND_PATH}) -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -FUNCTION(STM32_ADD_HEX_BIN_TARGETS TARGET) - IF(EXECUTABLE_OUTPUT_PATH) - SET(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}") - ELSE() - SET(FILENAME "${TARGET}") - ENDIF() - ADD_CUSTOM_TARGET(${TARGET}.hex ALL DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FILENAME}.hex) - ADD_CUSTOM_TARGET(${TARGET}.bin ALL DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FILENAME}.bin) -ENDFUNCTION() - -FUNCTION(STM32_ADD_DUMP_TARGET TARGET) - IF(EXECUTABLE_OUTPUT_PATH) - SET(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}") - ELSE() - SET(FILENAME "${TARGET}") - ENDIF() - ADD_CUSTOM_TARGET(${TARGET}.dump DEPENDS ${TARGET} COMMAND ${CMAKE_OBJDUMP} -x -D -S -s ${FILENAME} | ${CMAKE_CPPFILT} > ${FILENAME}.dump) -ENDFUNCTION() - -FUNCTION(STM32_PRINT_SIZE_OF_TARGETS TARGET) - IF(EXECUTABLE_OUTPUT_PATH) - SET(FILENAME "${EXECUTABLE_OUTPUT_PATH}/${TARGET}") - ELSE() - SET(FILENAME "${TARGET}") - ENDIF() - add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} ${FILENAME}) -ENDFUNCTION() - -STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER) -INCLUDE(gcc_stm32${STM32_FAMILY_LOWER}) - -FUNCTION(STM32_SET_FLASH_PARAMS TARGET STM32_FLASH_SIZE STM32_RAM_SIZE STM32_CCRAM_SIZE STM32_MIN_STACK_SIZE STM32_MIN_HEAP_SIZE STM32_FLASH_ORIGIN STM32_RAM_ORIGIN STM32_CCRAM_ORIGIN) - IF(NOT STM32_LINKER_SCRIPT) - MESSAGE(STATUS "No linker script specified, generating default") - INCLUDE(stm32_linker) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld ${STM32_LINKER_SCRIPT_TEXT}) - ELSE() - CONFIGURE_FILE(${STM32_LINKER_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld) - ENDIF() - - GET_TARGET_PROPERTY(TARGET_LD_FLAGS ${TARGET} LINK_FLAGS) - IF(TARGET_LD_FLAGS) - SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\" ${TARGET_LD_FLAGS}") - ELSE() - SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\"") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS ${TARGET_LD_FLAGS}) -ENDFUNCTION() - -FUNCTION(STM32_SET_FLASH_PARAMS TARGET FLASH_SIZE RAM_SIZE) - IF(NOT STM32_FLASH_ORIGIN) - SET(STM32_FLASH_ORIGIN "0x08000000") - ENDIF() - - IF(NOT STM32_RAM_ORIGIN) - SET(STM32_RAM_ORIGIN "0x20000000") - ENDIF() - - IF(NOT STM32_MIN_STACK_SIZE) - SET(STM32_MIN_STACK_SIZE "0x200") - ENDIF() - - IF(NOT STM32_MIN_HEAP_SIZE) - SET(STM32_MIN_HEAP_SIZE "0") - ENDIF() - - IF(NOT STM32_CCRAM_ORIGIN) - SET(STM32_CCRAM_ORIGIN "0x10000000") - ENDIF() - - IF(NOT STM32_LINKER_SCRIPT) - MESSAGE(STATUS "No linker script specified, generating default") - INCLUDE(stm32_linker) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld ${STM32_LINKER_SCRIPT_TEXT}) - ELSE() - CONFIGURE_FILE(${STM32_LINKER_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld) - ENDIF() - - GET_TARGET_PROPERTY(TARGET_LD_FLAGS ${TARGET} LINK_FLAGS) - IF(TARGET_LD_FLAGS) - SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\" ${TARGET_LD_FLAGS}") - ELSE() - SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\"") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS ${TARGET_LD_FLAGS}) -ENDFUNCTION() - -FUNCTION(STM32_SET_TARGET_PROPERTIES TARGET) - IF(NOT STM32_CHIP_TYPE) - IF(NOT STM32_CHIP) - MESSAGE(WARNING "Neither STM32_CHIP_TYPE nor STM32_CHIP selected, you'll have to use STM32_SET_CHIP_DEFINITIONS directly") - ELSE() - STM32_GET_CHIP_TYPE(${STM32_CHIP} STM32_CHIP_TYPE) - ENDIF() - ENDIF() - STM32_SET_CHIP_DEFINITIONS(${TARGET} ${STM32_CHIP_TYPE}) - IF(((NOT STM32_FLASH_SIZE) OR (NOT STM32_RAM_SIZE)) AND (NOT STM32_CHIP)) - MESSAGE(FATAL_ERROR "Cannot get chip parameters. Please specify either STM32_CHIP or STM32_FLASH_SIZE/STM32_RAM_SIZE") - ENDIF() - IF((NOT STM32_FLASH_SIZE) OR (NOT STM32_RAM_SIZE)) - STM32_GET_CHIP_PARAMETERS(${STM32_CHIP} STM32_FLASH_SIZE STM32_RAM_SIZE STM32_CCRAM_SIZE) - IF((NOT STM32_FLASH_SIZE) OR (NOT STM32_RAM_SIZE)) - MESSAGE(FATAL_ERROR "Unknown chip: ${STM32_CHIP}. Try to use STM32_FLASH_SIZE/STM32_RAM_SIZE directly.") - ENDIF() - ENDIF() - STM32_SET_FLASH_PARAMS(${TARGET} ${STM32_FLASH_SIZE} ${STM32_RAM_SIZE}) - MESSAGE(STATUS "${STM32_CHIP} has ${STM32_FLASH_SIZE}iB of flash memory and ${STM32_RAM_SIZE}iB of RAM") -ENDFUNCTION() - -FUNCTION(STM32_SET_HSE_VALUE TARGET STM32_HSE_VALUE) - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "HSE_VALUE=${STM32_HSE_VALUE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "HSE_VALUE=${STM32_HSE_VALUE}") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() - -MACRO(STM32_GENERATE_LIBRARIES NAME SOURCES LIBRARIES) - STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER) - FOREACH(CHIP_TYPE ${STM32_CHIP_TYPES}) - STRING(TOLOWER ${CHIP_TYPE} CHIP_TYPE_LOWER) - LIST(APPEND ${LIBRARIES} ${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER}) - ADD_LIBRARY(${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER} ${SOURCES}) - STM32_SET_CHIP_DEFINITIONS(${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER} ${CHIP_TYPE}) - ENDFOREACH() -ENDMACRO() diff --git a/cmake/gcc_stm32f0.cmake b/cmake/gcc_stm32f0.cmake deleted file mode 100644 index dc458b71..00000000 --- a/cmake/gcc_stm32f0.cmake +++ /dev/null @@ -1,94 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0 -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0 -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m0 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 030x6 030x8 031x6 038xx 042x6 048x6 051x8 058xx 070x6 070xB 071xB 072xB 078xx 091xC 098xx 030xC CACHE INTERNAL "stm32f0 chip types") -SET(STM32_CODES "030.[46]" "030.8" "031.[46]" "038.6" "042.[46]" "048.6" "051.[468]" "058.8" "070.6" "070.B" "071.[8B]" "072.[8B]" "078.B" "091.[BC]" "098.C" "030.C") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]((03[018].[468C])|(04[28].[46])|(05[18].[468])|(07[0128].[68B])|(09[18].[BC])).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](0[34579][0128]).[468BC].*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]0[34579][0128].([468BC]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "4") - SET(FLASH "16K") - ELSEIF(STM32_SIZE_CODE STREQUAL "6") - SET(FLASH "32K") - ELSEIF(STM32_SIZE_CODE STREQUAL "8") - SET(FLASH "64K") - ELSEIF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL 030x6) - SET(RAM "4K") - ELSEIF(${TYPE} STREQUAL 030x8) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 030xC) - SET(RAM "32K") - ELSEIF(${TYPE} STREQUAL 031x6) - SET(RAM "4K") - ELSEIF(${TYPE} STREQUAL 038xx) - SET(RAM "4K") - ELSEIF(${TYPE} STREQUAL 042x6) - SET(RAM "6K") - ELSEIF(${TYPE} STREQUAL 048x6) - SET(RAM "6K") - ELSEIF(${TYPE} STREQUAL 051x8) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 058xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 070x6) - SET(RAM "6K") - ELSEIF(${TYPE} STREQUAL 070xB) - SET(RAM "16K") - ELSEIF(${TYPE} STREQUAL 071xB) - SET(RAM "16K") - ELSEIF(${TYPE} STREQUAL 072xB) - SET(RAM "16K") - ELSEIF(${TYPE} STREQUAL 078xx) - SET(RAM "16K") - ELSEIF(${TYPE} STREQUAL 091xC) - SET(RAM "32K") - ELSEIF(${TYPE} STREQUAL 098xx) - SET(RAM "32K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F0 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F0;STM32F${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F0;STM32F${CHIP_TYPE}") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32f1.cmake b/cmake/gcc_stm32f1.cmake deleted file mode 100644 index 51f6a300..00000000 --- a/cmake/gcc_stm32f1.cmake +++ /dev/null @@ -1,134 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m3 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 100xB 100xE 101x6 101xB 101xE 101xG 102x6 102xB 103x6 103xB 103xE 103xG 105xC 107xC CACHE INTERNAL "stm32f1 chip types") -SET(STM32_CODES "100.[468B]" "100.[CDE]" "101.[46]" "101.[8B]" "101.[CDE]" "101.[FG]" "102.[46]" "102.[8B]" "103.[46]" "103.[8B]" "103.[CDE]" "103.[FG]" "105.[8BC]" "107.[BC]") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](10[012357].[468BCDEFG]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](10[012357]).[468BCDEFG].*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]10[012357].([468BCDEFG]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "4") - SET(FLASH "16K") - ELSEIF(STM32_SIZE_CODE STREQUAL "6") - SET(FLASH "32K") - ELSEIF(STM32_SIZE_CODE STREQUAL "8") - SET(FLASH "64K") - ELSEIF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - ELSEIF(STM32_SIZE_CODE STREQUAL "D") - SET(FLASH "384K") - ELSEIF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ELSEIF(STM32_SIZE_CODE STREQUAL "F") - SET(FLASH "768K") - ELSEIF(STM32_SIZE_CODE STREQUAL "G") - SET(FLASH "1024K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL 100xB) - IF((STM32_SIZE_CODE STREQUAL "4") OR (STM32_SIZE_CODE STREQUAL "6")) - SET(RAM "4K") - ELSE() - SET(RAM "8K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 100xE) - IF(STM32_SIZE_CODE STREQUAL "C") - SET(RAM "24K") - ELSE() - SET(RAM "32K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 101x6) - IF(STM32_SIZE_CODE STREQUAL "4") - SET(RAM "4K") - ELSE() - SET(RAM "6K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 101xB) - IF(STM32_SIZE_CODE STREQUAL "8") - SET(RAM "10K") - ELSE() - SET(RAM "16K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 101xE) - IF(STM32_SIZE_CODE STREQUAL "C") - SET(RAM "32K") - ELSE() - SET(RAM "48K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 101xG) - SET(RAM "80K") - ELSEIF(${TYPE} STREQUAL 102x6) - IF(STM32_SIZE_CODE STREQUAL "4") - SET(RAM "4K") - ELSE() - SET(RAM "6K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 102xB) - IF(STM32_SIZE_CODE STREQUAL "8") - SET(RAM "10K") - ELSE() - SET(RAM "16K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 103x6) - IF(STM32_SIZE_CODE STREQUAL "4") - SET(RAM "6K") - ELSE() - SET(RAM "10K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 103xB) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 103xE) - IF(STM32_SIZE_CODE STREQUAL "C") - SET(RAM "48K") - ELSE() - SET(RAM "54K") - ENDIF() - ELSEIF(${TYPE} STREQUAL 103xG) - SET(RAM "96K") - ELSEIF(${TYPE} STREQUAL 105xC) - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL 107xC) - SET(RAM "64K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F1 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F1;STM32F${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F1;STM32F${CHIP_TYPE}") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32f2.cmake b/cmake/gcc_stm32f2.cmake deleted file mode 100644 index c361a9c6..00000000 --- a/cmake/gcc_stm32f2.cmake +++ /dev/null @@ -1,72 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m3 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 205xB 205xC 205xE 205xF 205xG 215xE 215xG 207xC 207xE 207xF 207xG 217xE 217xG) -SET(STM32_CODES "205.B" "205.C" "205.E" "205.F" "205.G" "215.E" "215.G" "207.C" "207.E" "207.F" "207.G" "217.E" "217.G") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](2[01][57].[BCDEFG]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]2[01][57].([BCDEFG]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - ELSEIF(STM32_SIZE_CODE STREQUAL "D") - SET(FLASH "384K") - ELSEIF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ELSEIF(STM32_SIZE_CODE STREQUAL "F") - SET(FLASH "768K") - ELSEIF(STM32_SIZE_CODE STREQUAL "G") - SET(FLASH "1024K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - SET(RAM "128K") - - IF(${TYPE} STREQUAL 205xC) - SET(RAM "96K") - ELSEIF(${TYPE} STREQUAL 205xB) - SET(RAM "64K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F2 chip type: ${CHIP_TYPE}") - ENDIF() - - STRING(REGEX REPLACE "^(2[01][57]).[BCDEFG]" "\\1" DEVICE_NUM ${STM32_CHIP_TYPE}) - - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F2;STM32F${DEVICE_NUM}xx;${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F2;STM32F${DEVICE_NUM}xx") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32f3.cmake b/cmake/gcc_stm32f3.cmake deleted file mode 100644 index c05ef7a3..00000000 --- a/cmake/gcc_stm32f3.cmake +++ /dev/null @@ -1,81 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -Wa,--no-warn -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 301xx 302xx 303xx 334xx 373xx CACHE INTERNAL "stm32f3 chip types") -SET(STM32_CODES "301.." "302.." "303.." "334.." "373..") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](3[037][1234].[68BC]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](3[037][1234].[68BC]).*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]3[037][1234].([68BC]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "6") - SET(FLASH "32K") - SET(CCRAM_SIZE_IN_K "4") - ELSEIF(STM32_SIZE_CODE STREQUAL "8") - SET(FLASH "64K") - SET(CCRAM_SIZE_IN_K "4") - ELSEIF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - SET(CCRAM_SIZE_IN_K "8") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - SET(CCRAM_SIZE_IN_K "8") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL "301xx") - SET(RAM_SIZE_IN_K "16") - ELSEIF(${TYPE} STREQUAL "302xx") - SET(RAM_SIZE_IN_K "256") - ELSEIF(${TYPE} STREQUAL "303xx") - SET(RAM_SIZE_IN_K "48") - ELSEIF(${TYPE} STREQUAL "334xx") - SET(RAM_SIZE_IN_K "16") - ELSEIF(${TYPE} STREQUAL "373xx") - SET(RAM_SIZE_IN_K "128") - ENDIF() - - # RAM size = total RAM - CCRAM - MATH(EXPR RAM_SIZE_IN_K "${RAM_SIZE_IN_K}-${CCRAM_SIZE_IN_K}") - # Append the 'K' literal to the numbers - SET(RAM "${RAM_SIZE_IN_K}K") - SET(CCRAM "${CCRAM_SIZE_IN_K}K") - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} ${CCRAM}) -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F3 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - STRING(REGEX REPLACE "^(3..).(.)" "\\1x\\2" CHIP_TYPE_2 ${STM32_CODE}) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F3;STM32F${CHIP_TYPE_2};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F3;STM32F${CHIP_TYPE_2}") - ENDIF() - - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32f4.cmake b/cmake/gcc_stm32f4.cmake deleted file mode 100644 index 5070f7a0..00000000 --- a/cmake/gcc_stm32f4.cmake +++ /dev/null @@ -1,86 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -std=gnu11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -std=c++14 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 405xx 415xx 407xx 417xx 427xx 437xx 429xx 439xx 446xx 401xC 401xE 411xE CACHE INTERNAL "stm32f4 chip types") -SET(STM32_CODES "405.." "415.." "407.." "417.." "427.." "437.." "429.." "439.." "446.." "401.[CB]" "401.[ED]" "411.[CE]") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](4[01234][15679].[BCEGI]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](4[01234][15679].[BCEGI]).*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]4[01234][15679].([BCEGI]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - ELSEIF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ELSEIF(STM32_SIZE_CODE STREQUAL "G") - SET(FLASH "1024K") - ELSEIF(STM32_SIZE_CODE STREQUAL "I") - SET(FLASH "2048K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL "401xC") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "401xE") - SET(RAM "96K") - ELSEIF(${TYPE} STREQUAL "411xE") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "405xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "415xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "407xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "417xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "427xx") - SET(RAM "192K") - ELSEIF(${TYPE} STREQUAL "437xx") - SET(RAM "192K") - ELSEIF(${TYPE} STREQUAL "429xx") - SET(RAM "192K") - ELSEIF(${TYPE} STREQUAL "439xx") - SET(RAM "192K") - ELSEIF(${TYPE} STREQUAL "446xx") - SET(RAM "128K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "64K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F4 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F4;STM32F${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F4;STM32F${CHIP_TYPE}") - ENDIF() - - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32f7.cmake b/cmake/gcc_stm32f7.cmake deleted file mode 100644 index b05ff992..00000000 --- a/cmake/gcc_stm32f7.cmake +++ /dev/null @@ -1,75 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 745xx 746xx 756xx 765xx 767xx 777xx 769xx 779xx CACHE INTERNAL "stm32f7 chip types") -SET(STM32_CODES "745.." "746.." "756.." "765.." "767.." "777.." "769.." "779..") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](7[4567][5679].[EGI]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](7[4567][5679].[EGI]).*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[fF]7[4567][5679].([EGI]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ELSEIF(STM32_SIZE_CODE STREQUAL "G") - SET(FLASH "1024K") - ELSEIF(STM32_SIZE_CODE STREQUAL "I") - SET(FLASH "2048K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL "745xx") - SET(RAM "320K") - ELSEIF(${TYPE} STREQUAL "746xx") - SET(RAM "320K") - ELSEIF(${TYPE} STREQUAL "756xx") - SET(RAM "320K") - ELSEIF(${TYPE} STREQUAL "765xx") - SET(RAM "512K") - ELSEIF(${TYPE} STREQUAL "767xx") - SET(RAM "512K") - ELSEIF(${TYPE} STREQUAL "777xx") - SET(RAM "512K") - ELSEIF(${TYPE} STREQUAL "769xx") - SET(RAM "512K") - ELSEIF(${TYPE} STREQUAL "779xx") - SET(RAM "512K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - # First 64K of RAM are already CCM... - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32F7 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32F7;STM32F${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32F7;STM32F${CHIP_TYPE}") - ENDIF() - - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32g0.cmake b/cmake/gcc_stm32g0.cmake deleted file mode 100644 index da876667..00000000 --- a/cmake/gcc_stm32g0.cmake +++ /dev/null @@ -1,78 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0plus -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0plus -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m0plus -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m0 -mabi=aapcs --specs=nano.specs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0plus -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m0plus -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 070xB 071x8 071xB 081xB 041x8 031x8 041x6 031x6 031x4 CACHE INTERNAL "stm32g0 chip types") -SET(STM32_CODES "070.B" "071.8" "071.B" "081.B" "041.8" "031.8" "041.6" "031.6" "031.4") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(SUBSTRING ${CHIP} 6 5 STM32_CODE) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[gG](0[3478][1]).([468BJ]$|[68BCDE][AX]$)" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[gG](0[3478][1]).([468BJ]$|[68BCDE][AX]$)" "\\2" STM32_SIZE_CODE ${CHIP}) - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL 071x8) - SET(RAM "36K") - SET(FLASH "64K") - ELSEIF(${TYPE} STREQUAL 070xB) - SET(RAM "36K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 071xB) - SET(RAM "36K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 081xB) - SET(RAM "36K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 041x8) - SET(RAM "8K") - SET(FLASH "64K") - ELSEIF(${TYPE} STREQUAL 031x8) - SET(RAM "8K") - SET(FLASH "64K") - ELSEIF(${TYPE} STREQUAL 041x6) - SET(RAM "8K") - SET(FLASH "32K") - ELSEIF(${TYPE} STREQUAL 031x6) - SET(RAM "8K") - SET(FLASH "32K") - ELSEIF(${TYPE} STREQUAL 031x4) - SET(RAM "8K") - SET(FLASH "16K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32G0 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - STRING(REGEX REPLACE "^(0[3478][01]).[BCDEFGJ468]" "\\1" STM32_DEVICE_NUM ${STM32_CHIP_TYPE}) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32${STM32_FAMILY};STM32G${STM32_DEVICE_NUM}xx;${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32${STM32_FAMILY};STM32G${STM32_DEVICE_NUM}xx") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32h7.cmake b/cmake/gcc_stm32h7.cmake deleted file mode 100644 index e6e1fb02..00000000 --- a/cmake/gcc_stm32h7.cmake +++ /dev/null @@ -1,63 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 743xx 750xx 753xx CACHE INTERNAL "stm32h7 chip types") -SET(STM32_CODES "743.." "750.." "753..") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[hH](7[45][03].[BI]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[hH](7[45][03].[BI]).*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[hH]7[45][03].([BI]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "I") - SET(FLASH "2048K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL "743xx") - SET(RAM "1024K") - ELSEIF(${TYPE} STREQUAL "750xx") - SET(RAM "1024K") - ELSEIF(${TYPE} STREQUAL "753xx") - SET(RAM "1024K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - # First 64K of RAM are already CCM... - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32H7 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32H7;STM32H${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32H7;STM32H${CHIP_TYPE}") - ENDIF() - - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32l0.cmake b/cmake/gcc_stm32l0.cmake deleted file mode 100644 index ede279b7..00000000 --- a/cmake/gcc_stm32l0.cmake +++ /dev/null @@ -1,96 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0 -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m0 -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m0 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m0 -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 011xx 021xx 031xx 041xx 051xx 052xx 053xx 061xx 062xx 063xx 071xx 072xx 073xx 081xx 082xx 083xx CACHE INTERNAL "stm32l0 chip types") -SET(STM32_CODES "011.[34]" "021.4" "031.[46]" "041.6" "051.[68]" "052.[68]" "053.[68]" "061.8" "062.8" "063.8" "071.[BZ]" "072.[BZ]" "073.[8BZ]" "081.Z" "082.[BZ]" "083.[8BZ]") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL]((011.[34])|(021.4)|(031.[46])|(041.6)|(05[123].[68])|(06[123].8)|(07[123].[8BZ])|(08[123].[8BZ])).+$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL](0[12345678][123]).[3468BZ]" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL]0[12345678][123].([3468BZ])" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "3") - SET(FLASH "8K") - ELSEIF(STM32_SIZE_CODE STREQUAL "4") - SET(FLASH "16K") - ELSEIF(STM32_SIZE_CODE STREQUAL "6") - SET(FLASH "32K") - ELSEIF(STM32_SIZE_CODE STREQUAL "8") - SET(FLASH "64K") - ELSEIF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "Z") - SET(FLASH "192K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL 011xx) - SET(RAM "2K") - ELSEIF(${TYPE} STREQUAL 021xx) - SET(RAM "2K") - ELSEIF(${TYPE} STREQUAL 031xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 041xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 051xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 052xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 053xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 061xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 062xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 063xx) - SET(RAM "8K") - ELSEIF(${TYPE} STREQUAL 071xx) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 072xx) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 073xx) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 081xx) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 082xx) - SET(RAM "20K") - ELSEIF(${TYPE} STREQUAL 083xx) - SET(RAM "20K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "0K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32L0 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32L0;STM32L${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32L0;STM32L${CHIP_TYPE}") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32l1.cmake b/cmake/gcc_stm32l1.cmake deleted file mode 100644 index b7d6b22a..00000000 --- a/cmake/gcc_stm32l1.cmake +++ /dev/null @@ -1,133 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m3 -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m3 -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m3 -mabi=aapcs" CACHE INTERNAL "shared linker flags") - -SET(STM32_CHIP_TYPES 100xB 100xBA 100xC 151xB 151xBA 151xC 151xCA 151xD 151xDX 151xE 152xB 152xBA 152xC 152xCA 152xD 152xDX 152xE 162xC 162xCA 162xD 162xDX 162xE CACHE INTERNAL "stm32l1 chip types") -SET(STM32_CODES "100.B" "100.BA" "100.C" "151.B" "151.BA" "151.C" "151.CA" "151.D" "151.DX" "151.E" "152.B" "152.BA" "152.C" "152.CA" "152.D" "152.DX" "152.E" "162.C" "162.CA" "162.D" "162.DX" "162.E") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL]((100.[BC])|(100.[BC]A)|(15[12].[BCE])|(15[12].[BC]A)|(15[12].DX)|(162.[EDC])|(162.CA)|(162.DX)).+$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL](1[056][012]).([68BCDE]$|[68BCDE][AX]$)" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL](1[056][012]).([68BCDE]$|[68BCDE][AX]$)" "\\2" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "6" OR STM32_SIZE_CODE STREQUAL "6A") - SET(FLASH "32K") - ELSEIF(STM32_SIZE_CODE STREQUAL "8" OR STM32_SIZE_CODE STREQUAL "8A") - SET(FLASH "64K") - ELSEIF(STM32_SIZE_CODE STREQUAL "B" OR STM32_SIZE_CODE STREQUAL "BA") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C" OR STM32_SIZE_CODE STREQUAL "CA") - SET(FLASH "256K") - ELSEIF(STM32_SIZE_CODE STREQUAL "D" OR STM32_SIZE_CODE STREQUAL "DX") - SET(FLASH "384K") - ELSEIF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL 100xB) - SET(RAM "10K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 100xBA) - SET(RAM "16K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 100xC) - SET(RAM "16K") - SET(FLASH "256K") - - ELSEIF(${TYPE} STREQUAL 151xB) - SET(RAM "16K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 151xBA) - SET(RAM "32K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 151xC) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 151xCA) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 151xD) - SET(RAM "48K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 151xDX) - SET(RAM "80K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 151xE) - SET(RAM "80K") - SET(FLASH "512K") - - ELSEIF(${TYPE} STREQUAL 152xB) - SET(RAM "16K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 152xBA) - SET(RAM "32K") - SET(FLASH "128K") - ELSEIF(${TYPE} STREQUAL 152xC) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 152xCA) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 152xD) - SET(RAM "48K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 152xDX) - SET(RAM "80K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 152xE) - SET(RAM "80K") - SET(FLASH "512K") - - ELSEIF(${TYPE} STREQUAL 162xC) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 162xCA) - SET(RAM "32K") - SET(FLASH "256K") - ELSEIF(${TYPE} STREQUAL 162xD) - SET(RAM "48K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 162xDX) - SET(RAM "80K") - SET(FLASH "384K") - ELSEIF(${TYPE} STREQUAL 162xE) - SET(RAM "80K") - SET(FLASH "512K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32L1 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32L${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32L${CHIP_TYPE}") - ENDIF() - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/gcc_stm32l4.cmake b/cmake/gcc_stm32l4.cmake deleted file mode 100644 index 833b76fe..00000000 --- a/cmake/gcc_stm32l4.cmake +++ /dev/null @@ -1,104 +0,0 @@ -SET(CMAKE_C_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -std=gnu99 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "c compiler flags") -SET(CMAKE_CXX_FLAGS "-mthumb -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -std=c++11 -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize" CACHE INTERNAL "cxx compiler flags") -SET(CMAKE_ASM_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags") - -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "executable linker flags") -SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags") -SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags") -SET(STM32_CHIP_TYPES 431xx 432xx 433xx 442xx 443xx 451xx 452xx 462xx 471xx 475xx 476xx 485xx 486xx 496xx 4a6xx 4r5xx 4r7xx 4r9xx 4s5xx 4s7xx 4s9xx CACHE INTERNAL "stm32l4 chip types") -SET(STM32_CODES "431.." "432.." "433.." "442.." "443.." "451.." "452.." "462.." "471.." "475.." "476.." "485.." "486.." "496.." "4a6.." "4r5.." "4r7.." "4r9.." "4s5.." "4s7.." "4s9..") - -MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL](4[3456789ARS][1235679].[BCEGI]).*$" "\\1" STM32_CODE ${CHIP}) - SET(INDEX 0) - FOREACH(C_TYPE ${STM32_CHIP_TYPES}) - LIST(GET STM32_CODES ${INDEX} CHIP_TYPE_REGEXP) - IF(STM32_CODE MATCHES ${CHIP_TYPE_REGEXP}) - SET(RESULT_TYPE ${C_TYPE}) - ENDIF() - MATH(EXPR INDEX "${INDEX}+1") - ENDFOREACH() - SET(${CHIP_TYPE} ${RESULT_TYPE}) -ENDMACRO() - -MACRO(STM32_GET_CHIP_PARAMETERS CHIP FLASH_SIZE RAM_SIZE CCRAM_SIZE) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL](4[3456789ARS][1235679].[BCEGI]]).*$" "\\1" STM32_CODE ${CHIP}) - STRING(REGEX REPLACE "^[sS][tT][mM]32[lL]4[3456789ARS][1235679].([BCEGI]).*$" "\\1" STM32_SIZE_CODE ${CHIP}) - - IF(STM32_SIZE_CODE STREQUAL "B") - SET(FLASH "128K") - ELSEIF(STM32_SIZE_CODE STREQUAL "C") - SET(FLASH "256K") - ELSEIF(STM32_SIZE_CODE STREQUAL "E") - SET(FLASH "512K") - ELSEIF(STM32_SIZE_CODE STREQUAL "G") - SET(FLASH "1024K") - ELSEIF(STM32_SIZE_CODE STREQUAL "I") - SET(FLASH "2048K") - ENDIF() - - STM32_GET_CHIP_TYPE(${CHIP} TYPE) - - IF(${TYPE} STREQUAL "431xx") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "432xx") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "433xx") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "442xx") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "443xx") - SET(RAM "64K") - ELSEIF(${TYPE} STREQUAL "451xx") - SET(RAM "160K") - ELSEIF(${TYPE} STREQUAL "452xx") - SET(RAM "160K") - ELSEIF(${TYPE} STREQUAL "462xx") - SET(RAM "160K") - ELSEIF(${TYPE} STREQUAL "471xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "475xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "476xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "485xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "486xx") - SET(RAM "128K") - ELSEIF(${TYPE} STREQUAL "496xx") - SET(RAM "320K") - ELSEIF(${TYPE} STREQUAL "4a6xx") - SET(RAM "320K") - ELSEIF(${TYPE} STREQUAL "4r5xx") - SET(RAM "640K") - ELSEIF(${TYPE} STREQUAL "4r7xx") - SET(RAM "640K") - ELSEIF(${TYPE} STREQUAL "4r9xx") - SET(RAM "640K") - ELSEIF(${TYPE} STREQUAL "4s5xx") - SET(RAM "640K") - ELSEIF(${TYPE} STREQUAL "4s7xx") - SET(RAM "640K") - ELSEIF(${TYPE} STREQUAL "4s9xx") - SET(RAM "640K") - ENDIF() - - SET(${FLASH_SIZE} ${FLASH}) - SET(${RAM_SIZE} ${RAM}) - SET(${CCRAM_SIZE} "64K") -ENDMACRO() - -FUNCTION(STM32_SET_CHIP_DEFINITIONS TARGET CHIP_TYPE) - LIST(FIND STM32_CHIP_TYPES ${CHIP_TYPE} TYPE_INDEX) - IF(TYPE_INDEX EQUAL -1) - MESSAGE(FATAL_ERROR "Invalid/unsupported STM32L4 chip type: ${CHIP_TYPE}") - ENDIF() - GET_TARGET_PROPERTY(TARGET_DEFS ${TARGET} COMPILE_DEFINITIONS) - IF(TARGET_DEFS) - SET(TARGET_DEFS "STM32L4;STM32L${CHIP_TYPE};${TARGET_DEFS}") - ELSE() - SET(TARGET_DEFS "STM32L4;STM32L${CHIP_TYPE}") - ENDIF() - - SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_DEFINITIONS "${TARGET_DEFS}") -ENDFUNCTION() diff --git a/cmake/stm32/common.cmake b/cmake/stm32/common.cmake new file mode 100644 index 00000000..2531e10d --- /dev/null +++ b/cmake/stm32/common.cmake @@ -0,0 +1,237 @@ +set(STM32_SUPPORTED_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4) + +if(NOT STM32_TOOLCHAIN_PATH) + set(STM32_TOOLCHAIN_PATH "/usr") + message(STATUS "No STM32_TOOLCHAIN_PATH specified, using default: " ${STM32_TOOLCHAIN_PATH}) +else() + file(TO_CMAKE_PATH "${STM32_TOOLCHAIN_PATH}" STM32_TOOLCHAIN_PATH) +endif() + +if(NOT STM32_TARGET_TRIPLET) + set(STM32_TARGET_TRIPLET "arm-none-eabi") + message(STATUS "No STM32_TARGET_TRIPLET specified, using default: " ${STM32_TARGET_TRIPLET}) +endif() + +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR arm) + +set(TOOLCHAIN_SYSROOT "${STM32_TOOLCHAIN_PATH}/${STM32_TARGET_TRIPLET}") +set(TOOLCHAIN_BIN_PATH "${STM32_TOOLCHAIN_PATH}/bin") +set(TOOLCHAIN_INC_PATH "${STM32_TOOLCHAIN_PATH}/${STM32_TARGET_TRIPLET}/include") +set(TOOLCHAIN_LIB_PATH "${STM32_TOOLCHAIN_PATH}/${STM32_TARGET_TRIPLET}/lib") + +find_program(CMAKE_OBJCOPY NAMES ${STM32_TARGET_TRIPLET}-objcopy PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH) +find_program(CMAKE_OBJDUMP NAMES ${STM32_TARGET_TRIPLET}-objdump PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH) +find_program(CMAKE_SIZE NAMES ${STM32_TARGET_TRIPLET}-size PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH) +find_program(CMAKE_DEBUGGER NAMES ${STM32_TARGET_TRIPLET}-gdb PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH) +find_program(CMAKE_CPPFILT NAMES ${STM32_TARGET_TRIPLET}-c++filt PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH) + +function(stm32_get_chip_type FAMILY DEVICE TYPE) + set(INDEX 0) + foreach(C_TYPE ${STM32_${FAMILY}_TYPES}) + list(GET STM32_${FAMILY}_TYPE_MATCH ${INDEX} REGEXP) + if(${DEVICE} MATCHES ${REGEXP}) + set(RESULT_TYPE ${C_TYPE}) + endif() + math(EXPR INDEX "${INDEX}+1") + endforeach() + if(NOT RESULT_TYPE) + message(FATAL_ERROR "Invalid/unsupported device: ${DEVICE}") + endif() + set(${TYPE} ${RESULT_TYPE} PARENT_SCOPE) +endfunction() + +function(stm32_get_chip_info CHIP) + set(ARG_OPTIONS "") + set(ARG_SINGLE FAMILY DEVICE TYPE) + set(ARG_MULTIPLE "") + cmake_parse_arguments(PARSE_ARGV 1 ARG "${ARG_OPTIONS}" "${ARG_SINGLE}" "${ARG_MULTIPLE}") + + string(TOUPPER ${CHIP} CHIP) + + string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z]).*$" CHIP ${CHIP}) + + if((NOT CMAKE_MATCH_1) OR (NOT CMAKE_MATCH_2)) + message(FATAL_ERROR "Unknown chip ${CHIP}") + endif() + + set(STM32_FAMILY ${CMAKE_MATCH_1}) + set(STM32_DEVICE "${CMAKE_MATCH_1}${CMAKE_MATCH_2}") + + list(FIND STM32_SUPPORTED_FAMILIES ${STM32_FAMILY} STM32_FAMILY_INDEX) + if (STM32_FAMILY_INDEX EQUAL -1) + message(FATAL_ERROR "Unsupported family ${STM32_FAMILY} for device ${CHIP}") + endif() + + stm32_get_chip_type(${STM32_FAMILY} ${STM32_DEVICE} STM32_TYPE) + + if(ARG_FAMILY) + set(${ARG_FAMILY} ${STM32_FAMILY} PARENT_SCOPE) + endif() + if(ARG_DEVICE) + set(${ARG_DEVICE} ${STM32_DEVICE} PARENT_SCOPE) + endif() + if(ARG_TYPE) + set(${ARG_TYPE} ${STM32_TYPE} PARENT_SCOPE) + endif() +endfunction() + +function(stm32_get_cores CORES) + set(ARG_OPTIONS "") + set(ARG_SINGLE CHIP FAMILY DEVICE) + set(ARG_MULTIPLE "") + cmake_parse_arguments(PARSE_ARGV 1 ARG "${ARG_OPTIONS}" "${ARG_SINGLE}" "${ARG_MULTIPLE}") + + if(ARG_CHIP) + stm32_get_chip_info(${ARG_CHIP} FAMILY ARG_FAMILY TYPE ARG_TYPE DEVICE ARG_DEVICE) + elseif(ARG_FAMILY AND ARG_DEVICE) + stm32_get_chip_type(${ARG_FAMILY} ${ARG_DEVICE} ARG_TYPE) + elseif(ARG_FAMILY) + if(${ARG_FAMILY} STREQUAL "H7") + set(${CORES} M7 M4 PARENT_SCOPE) + else() + set(${CORES} "" PARENT_SCOPE) + endif() + return() + else() + message(FATAL_ERROR "Either CHIP or FAMILY or FAMILY/DEVICE should be specified for stm32_get_cores()") + endif() + + if(${ARG_FAMILY} STREQUAL "H7") + stm32h7_get_device_cores(${ARG_DEVICE} ${ARG_TYPE} CORE_LIST) + endif() + set(${CORES} "${CORE_LIST}" PARENT_SCOPE) +endfunction() + +function(stm32_get_memory_info) + set(ARG_OPTIONS FLASH RAM CCRAM STACK HEAP) + set(ARG_SINGLE CHIP FAMILY DEVICE CORE SIZE ORIGIN) + set(ARG_MULTIPLE "") + cmake_parse_arguments(INFO "${ARG_OPTIONS}" "${ARG_SINGLE}" "${ARG_MULTIPLE}" ${ARGN}) + + if((NOT INFO_CHIP) AND ((NOT INFO_FAMILY) OR (NOT INFO_DEVICE))) + message(FATAL_ERROR "Either CHIP or FAMILY/DEVICE is required for stm32_get_memory_info()") + endif() + + if(INFO_CHIP) + stm32_get_chip_info(${INFO_CHIP} FAMILY INFO_FAMILY TYPE INFO_TYPE DEVICE INFO_DEVICE) + else() + stm32_get_chip_type(${INFO_FAMILY} ${INFO_DEVICE} INFO_TYPE) + endif() + + string(REGEX REPLACE "^[FGHL][0-9][0-9A-Z][0-9].([3468BCDEFGHIZ])$" "\\1" SIZE_CODE ${INFO_DEVICE}) + + if(SIZE_CODE STREQUAL "3") + set(FLASH "8K") + elseif(SIZE_CODE STREQUAL "4") + set(FLASH "16K") + elseif(SIZE_CODE STREQUAL "6") + set(FLASH "32K") + elseif(SIZE_CODE STREQUAL "8") + set(FLASH "64K") + elseif(SIZE_CODE STREQUAL "B") + set(FLASH "128K") + elseif(SIZE_CODE STREQUAL "C") + set(FLASH "256K") + elseif(SIZE_CODE STREQUAL "D") + set(FLASH "384K") + elseif(SIZE_CODE STREQUAL "E") + set(FLASH "512K") + elseif(SIZE_CODE STREQUAL "F") + set(FLASH "768K") + elseif(SIZE_CODE STREQUAL "G") + set(FLASH "1024K") + elseif(SIZE_CODE STREQUAL "H") + set(FLASH "1536K") + elseif(SIZE_CODE STREQUAL "I") + set(FLASH "2048K") + elseif(SIZE_CODE STREQUAL "Z") + set(FLASH "192K") + else() + set(FLASH "16K") + message(WARNING "Unknow flash size for device ${DEVICE}. Set to ${FLASH}") + endif() + + list(FIND STM32_${INFO_FAMILY}_TYPES ${INFO_TYPE} TYPE_INDEX) + list(GET STM32_${INFO_FAMILY}_RAM_SIZES ${TYPE_INDEX} RAM) + list(GET STM32_${INFO_FAMILY}_CCRAM_SIZES ${TYPE_INDEX} CCRAM) + set(FLASH_ORIGIN 0x8000000) + set(RAM_ORIGIN 0x20000000) + set(CCRAM_ORIGIN 0x10000000) + + if(FAMILY STREQUAL "F1") + stm32f1_get_memory_info(${INFO_DEVICE} ${INFO_TYPE} FLASH RAM) + elseif(FAMILY STREQUAL "L1") + stm32l1_get_memory_info(${INFO_DEVICE} ${INFO_TYPE} FLASH RAM) + elseif(FAMILY STREQUAL "F2") + stm32f2_get_memory_info(${INFO_DEVICE} ${INFO_TYPE} FLASH RAM) + elseif(FAMILY STREQUAL "F3") + stm32f3_get_memory_info(${INFO_DEVICE} ${INFO_TYPE} FLASH RAM) + elseif(FAMILY STREQUAL "H7") + stm32h7_get_memory_info(${INFO_DEVICE} ${INFO_TYPE} "${INFO_CORE}" RAM FLASH_ORIGIN RAM_ORIGIN TWO_FLASH_BANKS) + if(TWO_FLASH_BANKS) + string(REGEX MATCH "([0-9]+)K" FLASH_KB ${FLASH}) + math(EXPR FLASH_KB "${CMAKE_MATCH_1} / 2") + set(FLASH "${FLASH_KB}K") + endif() + endif() + + if(INFO_FLASH) + set(SIZE ${FLASH}) + set(ORIGIN ${FLASH_ORIGIN}) + elseif(INFO_RAM) + set(SIZE ${RAM}) + set(ORIGIN ${RAM_ORIGIN}) + elseif(INFO_CCRAM) + set(SIZE ${CCRAM}) + set(ORIGIN ${CCRAM_ORIGIN}) + elseif(INFO_STACK) + if (RAM STREQUAL "2K") + set(SIZE 0x200) + else() + set(SIZE 0x400) + endif() + set(ORIGIN ${RAM_ORIGIN}) #TODO: Real stack pointer? + elseif(INFO_HEAP) + if (RAM STREQUAL "2K") + set(SIZE 0x100) + else() + set(SIZE 0x200) + endif() + set(ORIGIN ${RAM_ORIGIN}) #TODO: Real heap pointer? + endif() + + if(INFO_SIZE) + set(${INFO_SIZE} ${SIZE} PARENT_SCOPE) + endif() + if(INFO_ORIGIN) + set(${INFO_ORIGIN} ${ORIGIN} PARENT_SCOPE) + endif() +endfunction() + +function(stm32_add_linker_script TARGET VISIBILITY SCRIPT) + get_filename_component(SCRIPT "${SCRIPT}" ABSOLUTE) + target_link_options(${TARGET} ${VISIBILITY} -T "${SCRIPT}") +endfunction() + +if(NOT (TARGET STM32::NoSys)) + add_library(STM32::NoSys INTERFACE IMPORTED) + target_compile_options(STM32::NoSys INTERFACE $<$:--specs=nosys.specs>) + target_link_options(STM32::NoSys INTERFACE $<$:--specs=nosys.specs>) +endif() + +include(stm32/utilities) +include(stm32/f0) +include(stm32/f1) +include(stm32/f2) +include(stm32/f3) +include(stm32/f4) +include(stm32/f7) +include(stm32/g0) +include(stm32/g4) +include(stm32/h7) +include(stm32/l0) +include(stm32/l1) +include(stm32/l4) + + diff --git a/cmake/stm32/devices.cmake b/cmake/stm32/devices.cmake new file mode 100644 index 00000000..452e97f5 --- /dev/null +++ b/cmake/stm32/devices.cmake @@ -0,0 +1,1065 @@ +set(STM32_ALL_DEVICES + F030C6 + F030C8 + F030CC + F030F4 + F030K6 + F030R8 + F030RC + F031C4 + F031C6 + F031E6 + F031F4 + F031F6 + F031G4 + F031G6 + F031K4 + F031K6 + F038C6 + F038E6 + F038F6 + F038G6 + F038K6 + F042C4 + F042C6 + F042F4 + F042F6 + F042G4 + F042G6 + F042K4 + F042K6 + F042T6 + F048C6 + F048G6 + F048T6 + F051C4 + F051C6 + F051C8 + F051K4 + F051K6 + F051K8 + F051R4 + F051R6 + F051R8 + F051T8 + F058C8 + F058R8 + F058T8 + F070C6 + F070CB + F070F6 + F070RB + F071C8 + F071CB + F071RB + F071V8 + F071VB + F072C8 + F072CB + F072R8 + F072RB + F072V8 + F072VB + F078CB + F078RB + F078VB + F091CB + F091CC + F091RB + F091RC + F091VB + F091VC + F098CC + F098RC + F098VC + F100C4 + F100C6 + F100C8 + F100CB + F100R4 + F100R6 + F100R8 + F100RB + F100RC + F100RD + F100RE + F100V8 + F100VB + F100VC + F100VD + F100VE + F100ZC + F100ZD + F100ZE + F101C4 + F101C6 + F101C8 + F101CB + F101R4 + F101R6 + F101R8 + F101RB + F101RC + F101RD + F101RE + F101RF + F101RG + F101T4 + F101T6 + F101T8 + F101TB + F101V8 + F101VB + F101VC + F101VD + F101VE + F101VF + F101VG + F101ZC + F101ZD + F101ZE + F101ZF + F101ZG + F102C4 + F102C6 + F102C8 + F102CB + F102R4 + F102R6 + F102R8 + F102RB + F103C4 + F103C6 + F103C8 + F103CB + F103R4 + F103R6 + F103R8 + F103RB + F103RC + F103RD + F103RE + F103RF + F103RG + F103T4 + F103T6 + F103T8 + F103TB + F103V8 + F103VB + F103VC + F103VD + F103VE + F103VF + F103VG + F103ZC + F103ZD + F103ZE + F103ZF + F103ZG + F105R8 + F105RB + F105RC + F105V8 + F105VB + F105VC + F107RB + F107RC + F107VB + F107VC + F205RB + F205RC + F205RE + F205RF + F205RG + F205VB + F205VC + F205VE + F205VF + F205VG + F205ZC + F205ZE + F205ZF + F205ZG + F207IC + F207IE + F207IF + F207IG + F207VC + F207VE + F207VF + F207VG + F207ZC + F207ZE + F207ZF + F207ZG + F215RE + F215RG + F215VE + F215VG + F215ZE + F215ZG + F217IE + F217IG + F217VE + F217VG + F217ZE + F217ZG + F301C6 + F301C8 + F301K6 + F301K8 + F301R6 + F301R8 + F302C6 + F302C8 + F302CB + F302CC + F302K6 + F302K8 + F302R6 + F302R8 + F302RB + F302RC + F302RD + F302RE + F302VB + F302VC + F302VD + F302VE + F302ZD + F302ZE + F303C6 + F303C8 + F303CB + F303CC + F303K6 + F303K8 + F303R6 + F303R8 + F303RB + F303RC + F303RD + F303RE + F303VB + F303VC + F303VD + F303VE + F303ZD + F303ZE + F318C8 + F318K8 + F328C8 + F334C4 + F334C6 + F334C8 + F334K4 + F334K6 + F334K8 + F334R6 + F334R8 + F358CC + F358RC + F358VC + F373C8 + F373CB + F373CC + F373R8 + F373RB + F373RC + F373V8 + F373VB + F373VC + F378CC + F378RC + F378VC + F398VE + F401CB + F401CC + F401CD + F401CE + F401RB + F401RC + F401RD + F401RE + F401VB + F401VC + F401VD + F401VE + F405OE + F405OG + F405RG + F405VG + F405ZG + F407IE + F407IG + F407VE + F407VG + F407ZE + F407ZG + F410C8 + F410CB + F410R8 + F410RB + F410T8 + F410TB + F411CC + F411CE + F411RC + F411RE + F411VC + F411VE + F412CE + F412CG + F412RE + F412RG + F412VE + F412VG + F412ZE + F412ZG + F413CG + F413CH + F413MG + F413MH + F413RG + F413RH + F413VG + F413VH + F413ZG + F413ZH + F415OG + F415RG + F415VG + F415ZG + F417IE + F417IG + F417VE + F417VG + F417ZE + F417ZG + F423CH + F423MH + F423RH + F423VH + F423ZH + F427AG + F427AI + F427IG + F427II + F427VG + F427VI + F427ZG + F427ZI + F429AG + F429AI + F429BE + F429BG + F429BI + F429IE + F429IG + F429II + F429NE + F429NG + F429NI + F429VE + F429VG + F429VI + F429ZE + F429ZG + F429ZI + F437AI + F437IG + F437II + F437VG + F437VI + F437ZG + F437ZI + F439AI + F439BG + F439BI + F439IG + F439II + F439NG + F439NI + F439VG + F439VI + F439ZG + F439ZI + F446MC + F446ME + F446RC + F446RE + F446VC + F446VE + F446ZC + F446ZE + F469AE + F469AG + F469AI + F469BE + F469BG + F469BI + F469IE + F469IG + F469II + F469NE + F469NG + F469NI + F469VE + F469VG + F469VI + F469ZE + F469ZG + F469ZI + F479AG + F479AI + F479BG + F479BI + F479IG + F479II + F479NG + F479NI + F479VG + F479VI + F479ZG + F479ZI + F722IC + F722IE + F722RC + F722RE + F722VC + F722VE + F722ZC + F722ZE + F723IC + F723IE + F723VE + F723ZC + F723ZE + F730I8 + F730R8 + F730V8 + F730Z8 + F732IE + F732RE + F732VE + F732ZE + F733IE + F733VE + F733ZE + F745IE + F745IG + F745VE + F745VG + F745ZE + F745ZG + F746BE + F746BG + F746IE + F746IG + F746NE + F746NG + F746VE + F746VG + F746ZE + F746ZG + F750N8 + F750V8 + F750Z8 + F756BG + F756IG + F756NG + F756VG + F756ZG + F765BG + F765BI + F765IG + F765II + F765NG + F765NI + F765VG + F765VI + F765ZG + F765ZI + F767BG + F767BI + F767IG + F767II + F767NG + F767NI + F767VG + F767VI + F767ZG + F767ZI + F769AI + F769BG + F769BI + F769IG + F769II + F769NG + F769NI + F777BI + F777II + F777NI + F777VI + F777ZI + F778AI + F779AI + F779BI + F779II + F779NI + G030C6 + G030C8 + G030F6 + G030J6 + G030K6 + G030K8 + G031C4 + G031C6 + G031C8 + G031F4 + G031F6 + G031F8 + G031G4 + G031G6 + G031G8 + G031J4 + G031J6 + G031K4 + G031K6 + G031K8 + G031Y8 + G041C6 + G041C8 + G041F6 + G041F8 + G041G6 + G041G8 + G041J6 + G041K6 + G041K8 + G041Y8 + G070CB + G070KB + G070RB + G071C6 + G071C8 + G071CB + G071EB + G071G6 + G071G8 + G071GB + G071K6 + G071K8 + G071KB + G071R6 + G071R8 + G071RB + G081CB + G081EB + G081GB + G081KB + G081RB + G431C6 + G431C8 + G431CB + G431K6 + G431K8 + G431KB + G431M6 + G431M8 + G431MB + G431R6 + G431R8 + G431RB + G431V6 + G431V8 + G431VB + G441CB + G441KB + G441MB + G441RB + G441VB + G471CC + G471CE + G471MC + G471ME + G471QC + G471QE + G471RC + G471RE + G471VC + G471VE + G473CB + G473CC + G473CE + G473MB + G473MC + G473ME + G473QB + G473QC + G473QE + G473RB + G473RC + G473RE + G473VB + G473VC + G473VE + G474CB + G474CC + G474CE + G474MB + G474MC + G474ME + G474QB + G474QC + G474QE + G474RB + G474RC + G474RE + G474VB + G474VC + G474VE + G483CE + G483ME + G483QE + G483RE + G483VE + G484CE + G484ME + G484QE + G484RE + G484VE + GBK1CB + H742AG + H742AI + H742BG + H742BI + H742IG + H742II + H742VG + H742VI + H742XG + H742XI + H742ZG + H742ZI + H743AG + H743AI + H743BG + H743BI + H743IG + H743II + H743VG + H743VI + H743XG + H743XI + H743ZG + H743ZI + H745BG + H745BI + H745IG + H745II + H745XG + H745XI + H745ZG + H745ZI + H747AG + H747AI + H747BG + H747BI + H747IG + H747II + H747XG + H747XI + H747ZI + H750IB + H750VB + H750XB + H750ZB + H753AI + H753BI + H753II + H753VI + H753XI + H753ZI + H755BI + H755II + H755XI + H755ZI + H757AI + H757BI + H757II + H757XI + H757ZI + H7A3AG + H7A3AI + H7A3IG + H7A3II + H7A3LG + H7A3LI + H7A3NG + H7A3NI + H7A3QI + H7A3RG + H7A3RI + H7A3VG + H7A3VI + H7A3ZG + H7A3ZI + H7B0AB + H7B0IB + H7B0RB + H7B0VB + H7B0ZB + H7B3AI + H7B3II + H7B3LI + H7B3NI + H7B3QI + H7B3RI + H7B3VI + H7B3ZI + L010C6 + L010F4 + L010K4 + L010K8 + L010R8 + L010RB + L011D3 + L011D4 + L011E3 + L011E4 + L011F3 + L011F4 + L011G3 + L011G4 + L011K3 + L011K4 + L021D4 + L021F4 + L021G4 + L021K4 + L031C4 + L031C6 + L031E4 + L031E6 + L031F4 + L031F6 + L031G4 + L031G6 + L031K4 + L031K6 + L041C6 + L041E6 + L041F6 + L041G6 + L041K6 + L051C6 + L051C8 + L051K6 + L051K8 + L051R6 + L051R8 + L051T6 + L051T8 + L052C6 + L052C8 + L052K6 + L052K8 + L052R6 + L052R8 + L052T6 + L052T8 + L053C6 + L053C8 + L053R6 + L053R8 + L062C8 + L062K8 + L063C8 + L063R8 + L071C8 + L071CB + L071CZ + L071K8 + L071KB + L071KZ + L071RB + L071RZ + L071V8 + L071VB + L071VZ + L072CB + L072CZ + L072KB + L072KZ + L072RB + L072RZ + L072V8 + L072VB + L072VZ + L073CB + L073CZ + L073RB + L073RZ + L073V8 + L073VB + L073VZ + L081CB + L081CZ + L081KZ + L082CZ + L082KZ + L083CB + L083CZ + L083RB + L083RZ + L083V8 + L083VB + L083VZ + L100C6 + L100R8 + L100RB + L100RC + L151C6 + L151C8 + L151CB + L151CC + L151QC + L151QD + L151QE + L151R6 + L151R8 + L151RB + L151RC + L151RD + L151RE + L151UC + L151V8 + L151VB + L151VC + L151VD + L151VE + L151ZC + L151ZD + L151ZE + L152C6 + L152C8 + L152CB + L152CC + L152QC + L152QD + L152QE + L152R6 + L152R8 + L152RB + L152RC + L152RD + L152RE + L152UC + L152V8 + L152VB + L152VC + L152VD + L152VE + L152ZC + L152ZD + L152ZE + L162QC + L162QD + L162RC + L162RD + L162RE + L162VC + L162VD + L162VE + L162ZC + L162ZD + L162ZE + L412C8 + L412CB + L412K8 + L412KB + L412R8 + L412RB + L412T8 + L412TB + L422CB + L422KB + L422RB + L422TB + L431CB + L431CC + L431KB + L431KC + L431RB + L431RC + L431VC + L432KB + L432KC + L433CB + L433CC + L433RB + L433RC + L433VC + L442KC + L443CC + L443RC + L443VC + L451CC + L451CE + L451RC + L451RE + L451VC + L451VE + L452CC + L452CE + L452RC + L452RE + L452VC + L452VE + L462CE + L462RE + L462VE + L471QE + L471QG + L471RE + L471RG + L471VE + L471VG + L471ZE + L471ZG + L475RC + L475RE + L475RG + L475VC + L475VE + L475VG + L476JE + L476JG + L476ME + L476MG + L476QE + L476QG + L476RC + L476RE + L476RG + L476VC + L476VE + L476VG + L476ZE + L476ZG + L486JG + L486QG + L486RG + L486VG + L486ZG + L496AE + L496AG + L496QE + L496QG + L496RE + L496RG + L496VE + L496VG + L496ZE + L496ZG + L4A6AG + L4A6QG + L4A6RG + L4A6VG + L4A6ZG + L4P5AE + L4P5AG + L4P5CE + L4P5CG + L4P5QE + L4P5QG + L4P5RE + L4P5RG + L4P5VE + L4P5VG + L4P5ZE + L4P5ZG + L4Q5AG + L4Q5CG + L4Q5QG + L4Q5RG + L4Q5VG + L4Q5ZG + L4R5AG + L4R5AI + L4R5QG + L4R5QI + L4R5VG + L4R5VI + L4R5ZG + L4R5ZI + L4R7AI + L4R7VI + L4R7ZI + L4R9AG + L4R9AI + L4R9VG + L4R9VI + L4R9ZG + L4R9ZI + L4S5AI + L4S5QI + L4S5VI + L4S5ZI + L4S7AI + L4S7VI + L4S7ZI + L4S9AI + L4S9VI + L4S9ZI + L552CC + L552CE + L552ME + L552QC + L552QE + L552RC + L552RE + L552VC + L552VE + L552ZC + L552ZE + L562CE + L562ME + L562QE + L562RE + L562VE + L562ZE + MP151A + MP151C + MP153A + MP153C + MP157A + MP157C + WB50CG + WB55CC + WB55CE + WB55CG + WB55RC + WB55RE + WB55RG + WB55VC + WB55VE + WB55VG + WLE5J8 + WLE5JB + WLE5JC +) + +function(stm32_get_devices_by_family DEVICES) + set(ARG_OPTIONS "") + set(ARG_SINGLE FAMILY) + set(ARG_MULTIPLE "") + cmake_parse_arguments(PARSE_ARGV 1 ARG "${ARG_OPTIONS}" "${ARG_SINGLE}" "${ARG_MULTIPLE}") + set(LIST ${STM32_ALL_DEVICES}) + if(ARG_FAMILY) + list(FILTER LIST INCLUDE REGEX "^${ARG_FAMILY}") + endif() + set(${DEVICES} ${LIST} PARENT_SCOPE) +endfunction() diff --git a/cmake/stm32/f0.cmake b/cmake/stm32/f0.cmake new file mode 100644 index 00000000..92d5e7a3 --- /dev/null +++ b/cmake/stm32/f0.cmake @@ -0,0 +1,25 @@ +set(STM32_F0_TYPES + F030x6 F030x8 F031x6 F038xx F042x6 F048xx F051x8 F058xx + F070x6 F070xB F071xB F072xB F078xx F091xC F098xx F030xC +) +set(STM32_F0_TYPE_MATCH + "F030.[46]" "F030.8" "F031.[46]" "F038.." "F042.[46]" "F048.." "F051.[468]" "F058.." + "F070.6" "F070.B" "F071.[8B]" "F072.[8B]" "F078.." "F091.[BC]" "F098.." "F030.C" +) +set(STM32_F0_RAM_SIZES + 4K 8K 4K 4K 6K 6K 8K 8K + 6K 16K 16K 16K 16K 32K 32K 32K +) +set(STM32_F0_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K 0K 0K +) + +stm32_util_create_family_targets(F0) + +target_compile_options(STM32::F0 INTERFACE + -mcpu=cortex-m0 +) +target_link_options(STM32::F0 INTERFACE + -mcpu=cortex-m0 +) diff --git a/cmake/stm32/f1.cmake b/cmake/stm32/f1.cmake new file mode 100644 index 00000000..bc97ceb6 --- /dev/null +++ b/cmake/stm32/f1.cmake @@ -0,0 +1,78 @@ +set(STM32_F1_TYPES + F100xB F100xE F101x6 F101xB F101xE F101xG F102x6 F102xB + F103x6 F103xB F103xE F103xG F105xC F107xC +) +set(STM32_F1_TYPE_MATCH + "F100.[468B]" "F100.[CDE]" "F101.[46]" "F101.[8B]" "F101.[CDE]" "F101.[FG]" "F102.[46]" "F102.[8B]" + "F103.[46]" "F103.[8B]" "F103.[CDE]" "F103.[FG]" "F105.[8BC]" "F107.[BC]" +) +set(STM32_F1_RAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K +) +set(STM32_F1_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K +) + +stm32_util_create_family_targets(F1) + +target_compile_options(STM32::F1 INTERFACE + -mcpu=cortex-m3 +) +target_link_options(STM32::F1 INTERFACE + -mcpu=cortex-m3 +) + +function(stm32f1_get_memory_info DEVICE TYPE FLASH_SIZE RAM_SIZE) + string(REGEX REPLACE "F1[0-9][0-9].([468BCDEFGHI])" "\\1" SIZE_CODE ${DEVICE}) + + if((TYPE STREQUAL "F100xB") OR (TYPE STREQUAL "F100xE")) + if((SIZE_CODE STREQUAL "4") OR (SIZE_CODE STREQUAL "6")) + set(RAM "4K") + elseif((SIZE_CODE STREQUAL "8") OR (SIZE_CODE STREQUAL "B")) + set(RAM "8K") + elseif(SIZE_CODE STREQUAL "C") + set(RAM "24K") + elseif((SIZE_CODE STREQUAL "D") OR (SIZE_CODE STREQUAL "E")) + set(RAM "32K") + endif() + elseif((TYPE STREQUAL "F101x6") OR (TYPE STREQUAL "F101xB") OR + (TYPE STREQUAL "F101xE") OR (TYPE STREQUAL "F101xG") OR + (TYPE STREQUAL "F102x6") OR (TYPE STREQUAL "F102xB")) + if(SIZE_CODE STREQUAL "4") + set(RAM "4K") + elseif(SIZE_CODE STREQUAL "6") + set(RAM "6K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "10K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "16K") + elseif(SIZE_CODE STREQUAL "C") + set(RAM "32K") + elseif((SIZE_CODE STREQUAL "D") OR (SIZE_CODE STREQUAL "E")) + set(RAM "48K") + elseif((SIZE_CODE STREQUAL "F") OR (SIZE_CODE STREQUAL "G")) + set(RAM "80K") + endif() + elseif((TYPE STREQUAL "F103x6") OR (TYPE STREQUAL "F103xB") OR + (TYPE STREQUAL "F103xE") OR (TYPE STREQUAL "F103xG")) + if(SIZE_CODE STREQUAL "4") + set(RAM "6K") + elseif(SIZE_CODE STREQUAL "6") + set(RAM "10K") + elseif((SIZE_CODE STREQUAL "8") OR (SIZE_CODE STREQUAL "B")) + set(RAM "20K") + elseif(SIZE_CODE STREQUAL "C") + set(RAM "48K") + elseif((SIZE_CODE STREQUAL "D") OR (SIZE_CODE STREQUAL "E")) + set(RAM "64K") + elseif((SIZE_CODE STREQUAL "F") OR (SIZE_CODE STREQUAL "G")) + set(RAM "96K") + endif() + elseif((TYPE STREQUAL "F105xC") OR (TYPE STREQUAL "F107xC")) + set(RAM "64K") + endif() + + set(${RAM_SIZE} ${RAM} PARENT_SCOPE) +endfunction() diff --git a/cmake/stm32/f2.cmake b/cmake/stm32/f2.cmake new file mode 100644 index 00000000..38c2c2a5 --- /dev/null +++ b/cmake/stm32/f2.cmake @@ -0,0 +1,39 @@ +set(STM32_F2_TYPES + F205xx F215xx F207xx F217xx +) +set(STM32_F2_TYPE_MATCH + "F205.." "F215.." "F207.." "F217.." +) +set(STM32_F2_RAM_SIZES + 0K 128K 128K 128K +) +set(STM32_F2_CCRAM_SIZES + 0K 0K 0K 0K +) + +stm32_util_create_family_targets(F2) + +target_compile_options(STM32::F2 INTERFACE + -mcpu=cortex-m3 +) +target_link_options(STM32::F2 INTERFACE + -mcpu=cortex-m3 +) + +function(stm32f2_get_memory_info DEVICE TYPE FLASH_SIZE RAM_SIZE) + string(REGEX REPLACE "F2[0-9][0-9].([468BCDEFGHI])" "\\1" SIZE_CODE ${DEVICE}) + + if(TYPE STREQUAL "F205xx") + if(SIZE_CODE STREQUAL "B") + set(RAM "64K") + elseif(SIZE_CODE STREQUAL "C") + set(RAM "96K") + else() + set(RAM "128K") + endif() + endif() + + if(RAM) + set(${RAM_SIZE} ${RAM} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/stm32/f3.cmake b/cmake/stm32/f3.cmake new file mode 100644 index 00000000..d50a29d0 --- /dev/null +++ b/cmake/stm32/f3.cmake @@ -0,0 +1,59 @@ +set(STM32_F3_TYPES + F301x8 F302x8 F302xC F302xE F303x8 F303xC + F303xE F318xx F328xx F334x8 F358xx F373xC + F378xx F398xx +) +set(STM32_F3_TYPE_MATCH + "301.[68]" "302.[68]" "302.[BC]" "302.[ED]" "303.[68]" "303.[BC]" + "303.[ED]" "318.." "328.." "334.[468]" "358.." "373.[8BC]" + "378.." "398.." +) +set(STM32_F3_RAM_SIZES + 16K 16K 0K 64K 16K 0K + 80K 16K 16K 16K 48K 0K + 32K 80K +) +set(STM32_F3_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K + 0K 0K +) + +stm32_util_create_family_targets(F3) + +target_compile_options(STM32::F3 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::F3 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) + +function(stm32f3_get_memory_info DEVICE TYPE FLASH_SIZE RAM_SIZE) + string(REGEX REPLACE "F3[0-9][0-9].([468BCDEFGHI])" "\\1" SIZE_CODE ${DEVICE}) + + if(TYPE STREQUAL "F302xC") + if(SIZE_CODE STREQUAL "C") + set(RAM "40K") + else() + set(RAM "32K") + endif() + elseif(TYPE STREQUAL "F303xC") + if(SIZE_CODE STREQUAL "C") + set(RAM "48K") + else() + set(RAM "40K") + endif() + elseif(TYPE STREQUAL "F373xC") + if(SIZE_CODE STREQUAL "B") + set(RAM "24K") + elseif(SIZE_CODE STREQUAL "C") + set(RAM "32K") + else() + set(RAM "16K") + endif() + endif() + + if(RAM) + set(${RAM_SIZE} ${RAM} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/stm32/f4.cmake b/cmake/stm32/f4.cmake new file mode 100644 index 00000000..9d120b4d --- /dev/null +++ b/cmake/stm32/f4.cmake @@ -0,0 +1,29 @@ +set(STM32_F4_TYPES + F401xC F401xE F405xx F407xx F410Cx F410Rx F410Tx F411xE + F412Cx F412Rx F412Vx F412Zx F413xx F415xx F417xx F423xx + F427xx F429xx F437xx F439xx F446xx F469xx F479xx +) +set(STM32_F4_TYPE_MATCH + "F401.[CB]" "F401.[ED]" "F405.." "F407.." "F410C." "F410R." "F410T." "F411.[CE]" + "F412C." "F412R." "F412V." "F412Z." "F413.." "F415.." "F417.." "F423.." + "F427.." "F429.." "F437.." "F439.." "F446.." "F469.." "F479.." +) +set(STM32_F4_RAM_SIZES + 64K 96K 128K 128K 32K 32K 32K 128K + 256K 256K 256K 256K 256K 128K 128K 320K + 192K 192K 192K 192K 128K 320K 320K +) +set(STM32_F4_CCRAM_SIZES + 0K 0K 64K 64K 0K 0K 0K 0K + 0K 0K 0K 0K 64K 64K 64K 0K + 64K 64K 64K 64K 0K 64K 64K +) + +stm32_util_create_family_targets(F4) + +target_compile_options(STM32::F4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::F4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) diff --git a/cmake/stm32/f7.cmake b/cmake/stm32/f7.cmake new file mode 100644 index 00000000..cd9d87e7 --- /dev/null +++ b/cmake/stm32/f7.cmake @@ -0,0 +1,25 @@ +set(STM32_F7_TYPES + F756xx F746xx F745xx F765xx F767xx F769xx F777xx F779xx + F722xx F723xx F732xx F733xx F730xx F750xx +) +set(STM32_F7_TYPE_MATCH + "F756.." "F746.." "F745.." "F765.." "F767.." "F769.." "F777.." "F77[89].." + "F722.." "F723.." "F732.." "F733.." "F730.." "F750.." +) +set(STM32_F7_RAM_SIZES + 320K 320K 320K 512K 512K 512K 512K 512K + 256K 256K 256K 256K 256K 320K +) +set(STM32_F7_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K +) + +stm32_util_create_family_targets(F7) + +target_compile_options(STM32::F7 INTERFACE + -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::F7 INTERFACE + -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard +) diff --git a/cmake/stm32/g0.cmake b/cmake/stm32/g0.cmake new file mode 100644 index 00000000..9bda29d2 --- /dev/null +++ b/cmake/stm32/g0.cmake @@ -0,0 +1,21 @@ +set(STM32_G0_TYPES + G030xx G031xx G041xx G070xx G071xx G081xx +) +set(STM32_G0_TYPE_MATCH + "G030.." "G031.." "G041.." "G070.." "G071.." "G081.." +) +set(STM32_G0_RAM_SIZES + 8K 8K 8K 36K 36K 36K +) +set(STM32_G0_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K +) + +stm32_util_create_family_targets(G0) + +target_compile_options(STM32::G0 INTERFACE + -mcpu=cortex-m0plus +) +target_link_options(STM32::G0 INTERFACE + -mcpu=cortex-m0plus +) diff --git a/cmake/stm32/g4.cmake b/cmake/stm32/g4.cmake new file mode 100644 index 00000000..9b108860 --- /dev/null +++ b/cmake/stm32/g4.cmake @@ -0,0 +1,21 @@ +set(STM32_G4_TYPES + G431xx G441xx G471xx G473xx G483xx G474xx G484xx +) +set(STM32_G4_TYPE_MATCH + "G431.." "G441.." "G471.." "G473.." "G483.." "G474.." "G484.." +) +set(STM32_G4_RAM_SIZES + 32K 32K 128K 128K 128K 128K 128K +) +set(STM32_G4_CCRAM_SIZES + 10K 10K 32K 32K 32K 32K 32K +) + +stm32_util_create_family_targets(G4) + +target_compile_options(STM32::G4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::G4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) diff --git a/cmake/stm32/h7.cmake b/cmake/stm32/h7.cmake new file mode 100644 index 00000000..401a02f3 --- /dev/null +++ b/cmake/stm32/h7.cmake @@ -0,0 +1,86 @@ +set(STM32_H7_TYPES + H743xx H753xx H750xx H742xx H745xx H755xx H747xx H757xx + H7A3xx H7A3xxQ H7B3xx H7B3xxQ H7B0xx H7B0xxQ +) +set(STM32_H7_TYPE_MATCH + "H743.." "H753.." "H750.." "H742.." "H745.." "H755.." "H747.." "H757.." + "H7A3.." "H7A3..Q" "H7B3.." "H7B3..Q" "H7B0.." "H7B0..Q" +) +set(STM32_H7_RAM_SIZES + 128K 128K 128K 128K 128K 128K 128K 128K + 128K 128K 128K 128K 128K 128K +) +set(STM32_H7_M4_RAM_SIZES + 288K 288K 288K 288K 288K 288K 288K 288K + 288K 288K 288K 288K 288K 288K +) + +set(STM32_H7_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K +) + +set(STM32_H7_NO_FLASH_SPLIT + H750xx H7B0xx +) + +set(STM32_H7_DUAL_CORE + H745xx H755xx H747xx H757xx +) + +stm32_util_create_family_targets(H7 M7) + +target_compile_options(STM32::H7::M7 INTERFACE + -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::H7::M7 INTERFACE + -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard +) +target_compile_definitions(STM32::H7::M7 INTERFACE + -DCORE_CM7 +) + +stm32_util_create_family_targets(H7 M4) + +target_compile_options(STM32::H7::M4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::H7::M4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_compile_definitions(STM32::H7::M4 INTERFACE + -DCORE_CM4 +) + +function(stm32h7_get_memory_info DEVICE TYPE CORE RAM FLASH_ORIGIN RAM_ORIGIN TWO_FLASH_BANKS) + if(${TYPE} IN_LIST STM32_H7_NO_FLASH_SPLIT) + set(${TWO_FLASH_BANKS} FALSE PARENT_SCOPE) + else() + set(${TWO_FLASH_BANKS} TRUE PARENT_SCOPE) + endif() + if(NOT CORE) + set(CORE "M7") + endif() + list(FIND STM32_H7_TYPES ${TYPE} TYPE_INDEX) + if(CORE STREQUAL "M7") + list(GET STM32_H7_RAM_SIZES ${TYPE_INDEX} RAM_VALUE) + set(${RAM} ${RAM_VALUE} PARENT_SCOPE) + set(${FLASH_ORIGIN} 0x8000000 PARENT_SCOPE) + set(${RAM_ORIGIN} 0x20000000 PARENT_SCOPE) + elseif((${TYPE} IN_LIST STM32_H7_DUAL_CORE) AND (CORE STREQUAL "M4")) + list(GET STM32_H7_M4_RAM_SIZES ${TYPE_INDEX} RAM_VALUE) + set(${RAM} ${RAM_VALUE} PARENT_SCOPE) + set(${FLASH_ORIGIN} 0x8100000 PARENT_SCOPE) + set(${RAM_ORIGIN} 0x10000000 PARENT_SCOPE) + else() + message(FATAL_ERROR "Unknown core ${CORE}") + endif() +endfunction() + +function(stm32h7_get_device_cores DEVICE TYPE CORES) + if(${TYPE} IN_LIST STM32_H7_DUAL_CORE) + set(${CORES} M7 M4 PARENT_SCOPE) + else() + set(${CORES} M7 PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/stm32/l0.cmake b/cmake/stm32/l0.cmake new file mode 100644 index 00000000..abc5dfd1 --- /dev/null +++ b/cmake/stm32/l0.cmake @@ -0,0 +1,29 @@ +set(STM32_L0_TYPES + L010x4 L010x6 L010x8 L010xB L011xx L021xx L031xx L041xx + L051xx L052xx L053xx L061xx L062xx L063xx L071xx L072xx + L073xx L081xx L082xx L083xx +) +set(STM32_L0_TYPE_MATCH + "L010.4" "L010.6" "L010.8" "L010.B" "L011.." "L021.." "L031.." "L041.." + "L051.." "L052.." "L053.." "L061.." "L062.." "L063.." "L071.." "L072.." + "L073.." "L081.." "L082.." "L083.." +) +set(STM32_L0_RAM_SIZES + 2K 8K 8K 20K 2K 2K 8K 8K + 8K 8K 8K 8K 8K 8K 20K 20K + 20K 20K 20K 20K +) +set(STM32_L0_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K +) + +stm32_util_create_family_targets(L0) + +target_compile_options(STM32::L0 INTERFACE + -mcpu=cortex-m0plus +) +target_link_options(STM32::L0 INTERFACE + -mcpu=cortex-m0plus +) diff --git a/cmake/stm32/l1.cmake b/cmake/stm32/l1.cmake new file mode 100644 index 00000000..49b4bca9 --- /dev/null +++ b/cmake/stm32/l1.cmake @@ -0,0 +1,89 @@ +set(STM32_L1_TYPES + L100xB L100xBA L100xC L151xB L151xBA L151xC L151xCA L151xD + L151xDX L151xE L152xB L152xBA L152xC L152xCA L152xD L152xDX + L152xE L162xC L162xCA L162xD L162xDX L162xE +) +set(STM32_L1_TYPE_MATCH + "L100.[68B]" "L100.[68B]A" "L100.C" "L151.[68B]" "L151.[68B]A" "L151.C" "L151.CA" "L151.D" + "L151.DX" "L151.E" "L152.[68B]" "L152.[68B]A" "L152.C" "L152.CA" "L152.D" "L152.DX" + "L152.E" "L162.C" "L162.CA" "L162.D" "L162.DX" "L162.E" +) +set(STM32_L1_RAM_SIZES + 0K 0K 16K 0K 0K 32K 32K 48K + 80K 80K 0K 0K 32K 32K 48K 80K + 80K 32K 32K 48K 80K 80K +) +set(STM32_L1_CCRAM_SIZES + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K 0K 0K + 0K 0K 0K 0K 0K 0K +) + +stm32_util_create_family_targets(L1) + +target_compile_options(STM32::L1 INTERFACE + -mcpu=cortex-m3 +) +target_link_options(STM32::L1 INTERFACE + -mcpu=cortex-m3 +) + +function(stm32l1_get_memory_info DEVICE TYPE FLASH_SIZE RAM_SIZE) + string(REGEX REPLACE "L1[0-9][0-9].([68BCDE])" "\\1" SIZE_CODE ${DEVICE}) + + unset(RAM) + + if((TYPE STREQUAL "L100xB")) + if(SIZE_CODE STREQUAL "6") + set(RAM "4K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "8K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "10K") + endif() + elseif((TYPE STREQUAL "L100xBA")) + if(SIZE_CODE STREQUAL "6") + set(RAM "4K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "8K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "16K") + endif() + elseif((TYPE STREQUAL "L151xB")) + if(SIZE_CODE STREQUAL "6") + set(RAM "10K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "10K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "16K") + endif() + elseif((TYPE STREQUAL "L151xBA")) + if(SIZE_CODE STREQUAL "6") + set(RAM "16K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "32K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "32K") + endif() + elseif((TYPE STREQUAL "L152xB")) + if(SIZE_CODE STREQUAL "6") + set(RAM "10K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "10K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "16K") + endif() + elseif((TYPE STREQUAL "L152xBA")) + if(SIZE_CODE STREQUAL "6") + set(RAM "16K") + elseif(SIZE_CODE STREQUAL "8") + set(RAM "32K") + elseif(SIZE_CODE STREQUAL "B") + set(RAM "32K") + endif() + endif() + + if(RAM) + set(${RAM_SIZE} ${RAM} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/stm32/l4.cmake b/cmake/stm32/l4.cmake new file mode 100644 index 00000000..859ea796 --- /dev/null +++ b/cmake/stm32/l4.cmake @@ -0,0 +1,38 @@ +set(STM32_L4_TYPES + L412xx L422xx L431xx L432xx L433xx L442xx + L443xx L451xx L452xx L462xx L471xx L475xx + L476xx L485xx L486xx L496xx L4A6xx L4P5xx + L4Q5xx L4R5xx L4R7xx L4R9xx L4S5xx L4S7xx + L4S9xx +) +set(STM32_L4_TYPE_MATCH + "L412.." "L422.." "L431.." "L432.." "L433.." "L442.." + "L443.." "L451.." "L452.." "L462.." "L471.." "L475.." + "L476.." "L485.." "L486.." "L496.." "L4A6.." "L4P5.." + "L4Q5.." "L4R5.." "L4R7.." "L4R9.." "L4S5.." "L4S7.." + "L4S9.." +) + +set(STM32_L4_RAM_SIZES + 40K 40K 64K 64K 64K 64K + 64K 160K 160K 160K 128K 128K + 128K 128K 128K 320K 320K 320K + 320K 640K 640K 640K 640K 640K + 640K +) +set(STM32_L4_CCRAM_SIZES + 8K 8K 16K 16K 16K 16K + 16K 32K 32K 32K 32K 32K + 32K 32K 32K 64K 64K 64K + 64K 64K 64K 64K 64K 64K + 64K +) + +stm32_util_create_family_targets(L4) + +target_compile_options(STM32::L4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) +target_link_options(STM32::L4 INTERFACE + -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard +) diff --git a/cmake/stm32/linker_ld.cmake b/cmake/stm32/linker_ld.cmake new file mode 100644 index 00000000..70182719 --- /dev/null +++ b/cmake/stm32/linker_ld.cmake @@ -0,0 +1,144 @@ +if((NOT CCRAM_SIZE) OR (CCRAM_SIZE STREQUAL "0K")) + set(CCRAM_DEFINITION "") + set(CCRAM_SECTION "") +else() + set(CCRAM_DEFINITION " CCMRAM (rw) : ORIGIN = ${CCRAM_ORIGIN}, LENGTH = ${CCRAM_SIZE}\n") + set(CCRAM_SECTION " +_siccmram = LOADADDR(.ccmram);\n\ +.ccmram :\n\ +{\n\ +. = ALIGN(4);\n\ +_sccmram = .;\n\ +*(.ccmram)\n\ +*(.ccmram*)\n\ +. = ALIGN(4);\n\ +_eccmram = .;\n\ +} >CCMRAM AT> FLASH\n\ + ") +endif() + +set(SCRIPT_TEXT +"ENTRY(Reset_Handler)\n\ +\n\ +_estack = ${RAM_ORIGIN} + ${RAM_SIZE};\n\ +_Min_Heap_Size = ${HEAP_SIZE};\n\ +_Min_Stack_Size = ${STACK_SIZE};\n\ +\n\ +MEMORY\n\ +{\n\ + FLASH (rx) : ORIGIN = ${FLASH_ORIGIN}, LENGTH = ${FLASH_SIZE}\n\ + RAM (xrw) : ORIGIN = ${RAM_ORIGIN}, LENGTH = ${RAM_SIZE}\n\ +${CCRAM_DEFINITION}\n\ +}\n\ +\n\ +SECTIONS\n\ +{\n\ + .isr_vector :\n\ + {\n\ + . = ALIGN(4);\n\ + KEEP(*(.isr_vector))\n\ + . = ALIGN(4);\n\ + } >FLASH\n\ +\n\ + .text :\n\ + {\n\ + . = ALIGN(4);\n\ + *(.text)\n\ + *(.text*)\n\ + *(.glue_7)\n\ + *(.glue_7t)\n\ + *(.eh_frame)\n\ +\n\ + KEEP (*(.init))\n\ + KEEP (*(.fini))\n\ +\n\ + . = ALIGN(4);\n\ + _etext = .;\n\ + } >FLASH\n\ +\n\ + .rodata :\n\ + {\n\ + . = ALIGN(4);\n\ + *(.rodata)\n\ + *(.rodata*)\n\ + . = ALIGN(4);\n\ + } >FLASH\n\ +\n\ + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH\n\ + .ARM : {\n\ + __exidx_start = .;\n\ + *(.ARM.exidx*)\n\ + __exidx_end = .;\n\ + } >FLASH\n\ +\n\ + .preinit_array :\n\ + {\n\ + PROVIDE_HIDDEN (__preinit_array_start = .);\n\ + KEEP (*(.preinit_array*))\n\ + PROVIDE_HIDDEN (__preinit_array_end = .);\n\ + } >FLASH\n\ + .init_array :\n\ + {\n\ + PROVIDE_HIDDEN (__init_array_start = .);\n\ + KEEP (*(SORT(.init_array.*)))\n\ + KEEP (*(.init_array*))\n\ + PROVIDE_HIDDEN (__init_array_end = .);\n\ + } >FLASH\n\ + .fini_array :\n\ + {\n\ + PROVIDE_HIDDEN (__fini_array_start = .);\n\ + KEEP (*(SORT(.fini_array.*)))\n\ + KEEP (*(.fini_array*))\n\ + PROVIDE_HIDDEN (__fini_array_end = .);\n\ + } >FLASH\n\ +\n\ + _sidata = LOADADDR(.data);\n\ +\n\ + .data : \n\ + {\n\ + . = ALIGN(4);\n\ + _sdata = .; \n\ + *(.data)\n\ + *(.data*)\n\ +\n\ + . = ALIGN(4);\n\ + _edata = .;\n\ + } >RAM AT> FLASH\n\ +${CCRAM_SECTION}\n\ + . = ALIGN(4);\n\ + .bss :\n\ + {\n\ + _sbss = .;\n\ + __bss_start__ = _sbss;\n\ + *(.bss)\n\ + *(.bss*)\n\ + *(COMMON)\n\ +\n\ + . = ALIGN(4);\n\ + _ebss = .;\n\ + __bss_end__ = _ebss;\n\ + } >RAM\n\ +\n\ + ._user_heap_stack :\n\ + {\n\ + . = ALIGN(8);\n\ + PROVIDE ( end = . );\n\ + PROVIDE ( _end = . );\n\ + . = . + _Min_Heap_Size;\n\ + . = . + _Min_Stack_Size;\n\ + . = ALIGN(8);\n\ + } >RAM\n\ +\n\ + /DISCARD/ :\n\ + {\n\ + libc.a ( * )\n\ + libm.a ( * )\n\ + libgcc.a ( * )\n\ + }\n\ +\n\ + .ARM.attributes 0 : { *(.ARM.attributes) }\n\ +}" +) +file(WRITE "${LINKER_SCRIPT}" "${SCRIPT_TEXT}") + + diff --git a/cmake/stm32/utilities.cmake b/cmake/stm32/utilities.cmake new file mode 100644 index 00000000..196b9089 --- /dev/null +++ b/cmake/stm32/utilities.cmake @@ -0,0 +1,154 @@ +function(stm32_util_create_family_targets FAMILY) + set(CORES ${ARGN}) + list(LENGTH CORES NUM_CORES) + if(${NUM_CORES} EQUAL 0) + set(CORE "") + set(CORE_C "") + elseif(${NUM_CORES} EQUAL 1) + set(CORE "_${CORES}") + set(CORE_C "::${CORES}") + else() + message(FATAL_ERROR "Expected at most one core for family ${FAMILY}: ${CORES}") + endif() + + if(NOT (TARGET STM32::${FAMILY}${CORE_C})) + add_library(STM32::${FAMILY}${CORE_C} INTERFACE IMPORTED) + target_compile_options(STM32::${FAMILY}${CORE_C} INTERFACE + --sysroot="${TOOLCHAIN_SYSROOT}" + -mthumb -mabi=aapcs -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin -ffast-math + $<$:-Og> + $<$:-Os> + ) + target_link_options(STM32::${FAMILY}${CORE_C} INTERFACE + --sysroot="${TOOLCHAIN_SYSROOT}" + -mthumb -mabi=aapcs -Wl,--gc-sections + $<$:-Og> + $<$:-Os -s> + ) + target_compile_definitions(STM32::${FAMILY}${CORE_C} INTERFACE + STM32${FAMILY} + ) + endif() + foreach(TYPE ${STM32_${FAMILY}_TYPES}) + if(NOT (TARGET STM32::${TYPE}${CORE_C})) + add_library(STM32::${TYPE}${CORE_C} INTERFACE IMPORTED) + target_link_libraries(STM32::${TYPE}${CORE_C} INTERFACE STM32::${FAMILY}${CORE_C}) + target_compile_definitions(STM32::${TYPE}${CORE_C} INTERFACE + STM32${TYPE} + ) + endif() + endforeach() +endfunction() + +include(FetchContent) + +set(STM32_FETCH_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 ) +set(STM32_FETCH_CUBE_VERSIONS v1.11.1 v1.8.1 v1.9.0 v1.11.1 v1.25.1 v1.16.0 v1.3.0 v1.3.0 v1.8.0 v1.11.3 v1.10.0 v1.16.0) +set(STM32_FETCH_CMSIS_VERSIONS v2.3.4 v4.3.1 v2.2.4 v2.3.4 v2.6.4 v1.2.5 v1.3.0 v1.2.0 v1.9.0 v1.9.0 v2.3.1 v1.7.0 ) +set(STM32_FETCH_HAL_VERSIONS v1.7.4 v1.1.6 v1.2.5 v1.5.4 v1.7.9 v1.2.8 v1.3.0 v1.2.0 v1.9.0 v1.10.3 v1.4.2 v1.12.0) + +FetchContent_Declare( + STM32-CMSIS + GIT_REPOSITORY https://github.com/STMicroelectronics/cmsis_core/ + GIT_TAG v5.6.0 + GIT_PROGRESS TRUE +) + +set(IDX 0) +foreach(FAMILY ${STM32_FETCH_FAMILIES}) + string(TOLOWER ${FAMILY} FAMILY_L) + list(GET STM32_FETCH_CUBE_VERSIONS ${IDX} CUBE_VERSION) + list(GET STM32_FETCH_CMSIS_VERSIONS ${IDX} CMSIS_VERSION) + list(GET STM32_FETCH_HAL_VERSIONS ${IDX} HAL_VERSION) + + FetchContent_Declare( + STM32Cube${FAMILY} + GIT_REPOSITORY https://github.com/STMicroelectronics/STM32Cube${FAMILY}/ + GIT_TAG ${CUBE_VERSION} + GIT_PROGRESS TRUE + ) + FetchContent_Declare( + STM32-CMSIS-${FAMILY} + GIT_REPOSITORY https://github.com/STMicroelectronics/cmsis_device_${FAMILY_L}/ + GIT_TAG ${CMSIS_VERSION} + GIT_PROGRESS TRUE + ) + FetchContent_Declare( + STM32-HAL-${FAMILY} + GIT_REPOSITORY https://github.com/STMicroelectronics/stm32${FAMILY_L}xx_hal_driver/ + GIT_TAG ${HAL_VERSION} + GIT_PROGRESS TRUE + ) + math(EXPR IDX "${IDX} + 1") +endforeach() + +function(stm32_fetch_cube) + foreach(FAMILY ${ARGV}) + set(CUBE_NAME STM32Cube${FAMILY}) + string(TOLOWER ${CUBE_NAME} CUBE_NAME_L) + + if(STM32_CUBE_${FAMILY}_PATH) + message(INFO "STM32_CUBE_${FAMILY}_PATH specified, skipping fetch for ${CUBE_NAME}") + continue() + endif() + + FetchContent_GetProperties(${CUBE_NAME} POPULATED CUBE_POPULATED) + if(NOT CUBE_POPULATED) + set(FETCHCONTENT_QUIET FALSE) # To see progress + FetchContent_Populate(${CUBE_NAME}) + endif() + + set(STM32_CUBE_${FAMILY}_PATH ${${CUBE_NAME_L}_SOURCE_DIR} PARENT_SCOPE) + endforeach() +endfunction() + +function(stm32_fetch_cmsis) + if(NOT STM32_CMSIS_PATH) + if(NOT STM32-CMSIS_POPULATED) + set(FETCHCONTENT_QUIET FALSE) # To see progress + FetchContent_Populate(STM32-CMSIS) + endif() + + set(STM32_CMSIS_PATH ${stm32-cmsis_SOURCE_DIR} PARENT_SCOPE) + else() + message(INFO "STM32_CMSIS_PATH specified, skipping fetch for STM32-CMSIS") + endif() + foreach(FAMILY ${ARGV}) + set(CMSIS_NAME STM32-CMSIS-${FAMILY}) + string(TOLOWER ${CMSIS_NAME} CMSIS_NAME_L) + + if(STM32_CMSIS_${FAMILY}_PATH) + message(INFO "STM32_CMSIS_${FAMILY}_PATH specified, skipping fetch for ${CMSIS_NAME}") + continue() + endif() + + FetchContent_GetProperties(${CMSIS_NAME_L} POPULATED CMSIS_POPULATED) + if(NOT CMSIS_POPULATED) + set(FETCHCONTENT_QUIET FALSE) # To see progress + FetchContent_Populate(${CMSIS_NAME}) + endif() + + set(STM32_CMSIS_${FAMILY}_PATH ${${CMSIS_NAME_L}_SOURCE_DIR} PARENT_SCOPE) + endforeach() +endfunction() + +function(stm32_fetch_hal) + foreach(FAMILY ${ARGV}) + set(HAL_NAME STM32-HAL-${FAMILY}) + string(TOLOWER ${HAL_NAME} HAL_NAME_L) + + if(STM32_HAL_${FAMILY}_PATH) + message(INFO "STM32_HAL_${FAMILY}_PATH specified, skipping fetch for ${HAL_NAME}") + continue() + endif() + + FetchContent_GetProperties(${HAL_NAME} POPULATED HAL_POPULATED) + if(NOT HAL_POPULATED) + set(FETCHCONTENT_QUIET FALSE) # To see progress + FetchContent_Populate(${HAL_NAME}) + endif() + + set(STM32_HAL_${FAMILY}_PATH ${${HAL_NAME_L}_SOURCE_DIR} PARENT_SCOPE) + endforeach() +endfunction() + diff --git a/cmake/stm32_gcc.cmake b/cmake/stm32_gcc.cmake new file mode 100644 index 00000000..2619eeba --- /dev/null +++ b/cmake/stm32_gcc.cmake @@ -0,0 +1,9 @@ +get_filename_component(STM32_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} DIRECTORY) +list(APPEND CMAKE_MODULE_PATH ${STM32_CMAKE_DIR}) + +include(stm32/common) + +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +find_program(CMAKE_C_COMPILER NAMES ${STM32_TARGET_TRIPLET}-gcc PATHS ${TOOLCHAIN_BIN_PATH}) +find_program(CMAKE_CXX_COMPILER NAMES ${STM32_TARGET_TRIPLET}-g++ PATHS ${TOOLCHAIN_BIN_PATH}) +find_program(CMAKE_ASM_COMPILER NAMES ${STM32_TARGET_TRIPLET}-gcc PATHS ${TOOLCHAIN_BIN_PATH}) diff --git a/cmake/stm32_linker.cmake b/cmake/stm32_linker.cmake deleted file mode 100644 index b8aa2b1c..00000000 --- a/cmake/stm32_linker.cmake +++ /dev/null @@ -1,127 +0,0 @@ -# TODO: Add support for external RAM - -IF((NOT STM32_CCRAM_SIZE) OR (STM32_CCRAM_SIZE STREQUAL "0K")) - SET(STM32_CCRAM_DEF "") - SET(STM32_CCRAM_SECTION "") -ELSE() - SET(STM32_CCRAM_DEF " CCMRAM (rw) : ORIGIN = ${STM32_CCRAM_ORIGIN}, LENGTH = ${STM32_CCRAM_SIZE}\n") - SET(STM32_CCRAM_SECTION - " _siccmram = LOADADDR(.ccmram)\;\n" - " .ccmram :\n" - " {" - " . = ALIGN(4)\;\n" - " _sccmram = .\;\n" - " *(.ccmram)\n" - " *(.ccmram*)\n" - " . = ALIGN(4)\;\n" - " _eccmram = .\;\n" - " } >CCMRAM AT> FLASH\n" - ) -ENDIF() - -SET(STM32_LINKER_SCRIPT_TEXT - "ENTRY(Reset_Handler)\n" - "_estack = ${STM32_RAM_ORIGIN} + ${STM32_RAM_SIZE} - 1\;\n" - "_Min_Heap_Size = ${STM32_MIN_HEAP_SIZE}\;\n" - "_Min_Stack_Size = ${STM32_MIN_STACK_SIZE}\;\n" - "MEMORY\n" - "{\n" - " FLASH (rx) : ORIGIN = ${STM32_FLASH_ORIGIN}, LENGTH = ${STM32_FLASH_SIZE}\n" - " RAM (xrw) : ORIGIN = ${STM32_RAM_ORIGIN}, LENGTH = ${STM32_RAM_SIZE}\n" - "${STM32_CCRAM_DEF}" - "}\n" - "SECTIONS\n" - "{\n" - " .isr_vector :\n" - " {\n" - " . = ALIGN(4)\;\n" - " KEEP(*(.isr_vector))\n" - " . = ALIGN(4)\;\n" - " } >FLASH\n" - " .text :\n" - " {\n" - " . = ALIGN(4)\;\n" - " *(.text)\n" - " *(.text*)\n" - " *(.glue_7)\n" - " *(.glue_7t)\n" - " *(.eh_frame)\n" - " KEEP (*(.init))\n" - " KEEP (*(.fini))\n" - " . = ALIGN(4)\;\n" - " _etext = .\;\n" - " } >FLASH\n" - " .rodata :\n" - " {\n" - " . = ALIGN(4)\;\n" - " *(.rodata)\n" - " *(.rodata*)\n" - " . = ALIGN(4)\;\n" - " } >FLASH\n" - " .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH\n" - " .ARM : {\n" - " __exidx_start = .\;\n" - " *(.ARM.exidx*)\n" - " __exidx_end = .\;\n" - " } >FLASH\n" - " .preinit_array :\n" - " {\n" - " PROVIDE_HIDDEN (__preinit_array_start = .)\;\n" - " KEEP (*(.preinit_array*))\n" - " PROVIDE_HIDDEN (__preinit_array_end = .)\;\n" - " } >FLASH\n" - " .init_array :\n" - " {\n" - " PROVIDE_HIDDEN (__init_array_start = .)\;\n" - " KEEP (*(SORT(.init_array.*)))\n" - " KEEP (*(.init_array*))\n" - " PROVIDE_HIDDEN (__init_array_end = .)\;\n" - " } >FLASH\n" - " .fini_array :\n" - " {\n" - " PROVIDE_HIDDEN (__fini_array_start = .)\;\n" - " KEEP (*(SORT(.fini_array.*)))\n" - " KEEP (*(.fini_array*))\n" - " PROVIDE_HIDDEN (__fini_array_end = .)\;\n" - " } >FLASH\n" - " _sidata = LOADADDR(.data)\;\n" - " .data : \n" - " {\n" - " . = ALIGN(4)\;\n" - " _sdata = .\;\n" - " *(.data)\n" - " *(.data*)\n" - " . = ALIGN(4)\;\n" - " _edata = .\;\n" - " } >RAM AT> FLASH\n" - "${STM32_CCRAM_SECTION}" - " . = ALIGN(4)\;\n" - " .bss :\n" - " {\n" - " _sbss = .\;\n" - " __bss_start__ = _sbss\;\n" - " *(.bss)\n" - " *(.bss*)\n" - " *(COMMON)\n" - " . = ALIGN(4)\;\n" - " _ebss = .\;\n" - " __bss_end__ = _ebss\;\n" - " } >RAM\n" - " ._user_heap_stack :\n" - " {\n" - " . = ALIGN(4)\;\n" - " PROVIDE ( end = . )\;\n" - " PROVIDE ( _end = . )\;\n" - " . = . + _Min_Heap_Size\;\n" - " . = . + _Min_Stack_Size\;\n" - " . = ALIGN(4)\;\n" - " } >RAM\n" - " /DISCARD/ :\n" - " {\n" - " libc.a ( * )\n" - " libm.a ( * )\n" - " libgcc.a ( * )\n" - " }\n" - " .ARM.attributes 0 : { *(.ARM.attributes) }\n" - "}\n" -) diff --git a/cmake/uGFX_GDISP.cmake b/cmake/uGFX_GDISP.cmake deleted file mode 100644 index e3a84453..00000000 --- a/cmake/uGFX_GDISP.cmake +++ /dev/null @@ -1,13 +0,0 @@ -SET(uGFX_gdisp_SEARCH_PATH ${uGFX_DIR}/src/gdisp) -SET(uGFX_gdisp_HEADERS gdisp_colors.h gdisp_options.h gdisp_rules.h) -SET(uGFX_gdisp_SOURCES gdisp.c) - -FOREACH(driver ${uGFX_GDISP_DRIVERS}) - LIST(FIND uGFX_FIND_COMPONENTS ${driver} DRIVER_INDEX) - IF(NOT ${DRIVER_INDEX} LESS 0) - SET(uGFX_${driver}_SEARCH_PATH ${uGFX_DIR}/drivers/gdisp/${driver}) - SET(uGFX_${driver}_SOURCES gdisp_lld_${driver}.c) - SET(uGFX_${driver}_HEADERS gdisp_lld_config.h) - LIST(APPEND uGFX_GDISP_MODULES ${driver}) - ENDIF() -ENDFOREACH() diff --git a/cmake/uGFX_GOS.cmake b/cmake/uGFX_GOS.cmake deleted file mode 100644 index 86a69d42..00000000 --- a/cmake/uGFX_GOS.cmake +++ /dev/null @@ -1,11 +0,0 @@ -SET(uGFX_GOS_MODULES gos_arduino gos_chibios gos_ecos gos_freertos gos_linux gos_osx gos_raw32 gos_rawrtos gos_win32 gos_x_heap gos_x_threads) - -SET(uGFX_gos_SEARCH_PATH ${uGFX_DIR}/src/gos) -SET(uGFX_gos_HEADERS gos.h) - -FOREACH(module ${uGFX_GOS_MODULES}) - SET(uGFX_${module}_SEARCH_PATH ${uGFX_DIR}/src/gos) - SET(uGFX_${module}_SOURCES ${module}.c) - SET(uGFX_${module}_HEADERS ${module}.h) -ENDFOREACH() - diff --git a/examples/blinky/CMakeLists.txt b/examples/blinky/CMakeLists.txt new file mode 100644 index 00000000..81f23aa3 --- /dev/null +++ b/examples/blinky/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-blinky C ASM) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +find_package(CMSIS COMPONENTS STM32L0 STM32F1 STM32F4 REQUIRED) +find_package(HAL COMPONENTS STM32L0 STM32F1 STM32F4 RCC GPIO CORTEX REQUIRED) +# Find all drivers: +#find_package(HAL COMPONENTS STM32L0 STM32F1 STM32F4 REQUIRED) +# Find drivers for all families: +#find_package(HAL COMPONENTS RCC GPIO CORTEX REQUIRED) +# Find LL driver: +#find_package(HAL COMPONENTS LL_GPIO REQUIRED) +# Find everything: +#find_package(HAL REQUIRED) + +# STM32F4-Discovery +add_executable(stm32-blinky-f4 blinky.c stm32f4xx_hal_conf.h) +target_link_libraries(stm32-blinky-f4 + HAL::STM32::F4::RCC + HAL::STM32::F4::GPIO + HAL::STM32::F4::CORTEX + CMSIS::STM32::F407VG + STM32::NoSys +) + +# STM32VL-Discovery +add_executable(stm32-blinky-f1 blinky.c stm32f1xx_hal_conf.h) +target_link_libraries(stm32-blinky-f1 + HAL::STM32::F1::RCC + HAL::STM32::F1::GPIO + HAL::STM32::F1::CORTEX + CMSIS::STM32::F100RB + STM32::NoSys +) + +# STM32L0538-Discovery +add_executable(stm32-blinky-l0 blinky.c stm32l0xx_hal_conf.h) +target_link_libraries(stm32-blinky-l0 + HAL::STM32::L0::RCC + HAL::STM32::L0::GPIO + HAL::STM32::L0::CORTEX + CMSIS::STM32::L053C8 + STM32::NoSys +) diff --git a/examples/blinky/blinky.c b/examples/blinky/blinky.c new file mode 100644 index 00000000..8e108603 --- /dev/null +++ b/examples/blinky/blinky.c @@ -0,0 +1,58 @@ +#if defined STM32L0 + #include + + // STM32L0538-Discovery green led - PB4 + #define LED_PORT GPIOB + #define LED_PIN GPIO_PIN_4 + #define LED_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#elif defined STM32F1 + #include + + // STM32VL-Discovery green led - PC9 + #define LED_PORT GPIOC + #define LED_PIN GPIO_PIN_9 + #define LED_PORT_CLK_ENABLE __HAL_RCC_GPIOC_CLK_ENABLE +#elif defined STM32F4 + #include + + // STM32F4-Discovery green led - PD12 + #define LED_PORT GPIOD + #define LED_PIN GPIO_PIN_12 + #define LED_PORT_CLK_ENABLE __HAL_RCC_GPIOD_CLK_ENABLE +#endif + +void SysTick_Handler(void) +{ + HAL_IncTick(); + + // 1 Hz blinking + if ((HAL_GetTick() % 500) == 0) + HAL_GPIO_TogglePin(LED_PORT, LED_PIN); +} + +void initGPIO() +{ + GPIO_InitTypeDef GPIO_Config; + + GPIO_Config.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_Config.Pull = GPIO_NOPULL; + GPIO_Config.Speed = GPIO_SPEED_FREQ_HIGH; + + GPIO_Config.Pin = LED_PIN; + + LED_PORT_CLK_ENABLE(); + HAL_GPIO_Init(LED_PORT, &GPIO_Config); +} + +int main(void) +{ + HAL_Init(); + initGPIO(); + // 1kHz ticks + HAL_SYSTICK_Config(SystemCoreClock / 1000); + + for (;;) + __WFI(); + + return 0; +} diff --git a/stm32-blinky/stm32f1xx_hal_conf.h b/examples/blinky/stm32f1xx_hal_conf.h old mode 100644 new mode 100755 similarity index 54% rename from stm32-blinky/stm32f1xx_hal_conf.h rename to examples/blinky/stm32f1xx_hal_conf.h index 5c51d344..1d0488c3 --- a/stm32-blinky/stm32f1xx_hal_conf.h +++ b/examples/blinky/stm32f1xx_hal_conf.h @@ -2,47 +2,29 @@ ****************************************************************************** * @file stm32f1xx_hal_conf.h * @author MCD Application Team - * @version V1.0.0 - * @date 15-December-2014 * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f1xx_hal_conf.h. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2014 STMicroelectronics

+ *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F1xx_HAL_CONF_H #define __STM32F1xx_HAL_CONF_H #ifdef __cplusplus - extern "C" { +extern "C" { #endif /* Exported types ------------------------------------------------------------*/ @@ -50,17 +32,19 @@ /* ########################## Module Selection ############################## */ /** - * @brief This is the list of modules to be used in the HAL driver + * @brief This is the list of modules to be used in the HAL driver */ #define HAL_MODULE_ENABLED // #define HAL_ADC_MODULE_ENABLED // #define HAL_CAN_MODULE_ENABLED +// #define HAL_CAN_LEGACY_MODULE_ENABLED // #define HAL_CEC_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED // #define HAL_CRC_MODULE_ENABLED // #define HAL_DAC_MODULE_ENABLED #define HAL_DMA_MODULE_ENABLED // #define HAL_ETH_MODULE_ENABLED +// #define HAL_EXTI_MODULE_ENABLED #define HAL_FLASH_MODULE_ENABLED #define HAL_GPIO_MODULE_ENABLED // #define HAL_HCD_MODULE_ENABLED @@ -72,114 +56,144 @@ // #define HAL_NOR_MODULE_ENABLED // #define HAL_PCCARD_MODULE_ENABLED // #define HAL_PCD_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED +// #define HAL_PWR_MODULE_ENABLED #define HAL_RCC_MODULE_ENABLED // #define HAL_RTC_MODULE_ENABLED // #define HAL_SD_MODULE_ENABLED // #define HAL_SMARTCARD_MODULE_ENABLED // #define HAL_SPI_MODULE_ENABLED // #define HAL_SRAM_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED +// #define HAL_TIM_MODULE_ENABLED // #define HAL_UART_MODULE_ENABLED // #define HAL_USART_MODULE_ENABLED // #define HAL_WWDG_MODULE_ENABLED +// #define HAL_MMC_MODULE_ENABLED /* ########################## Oscillator Values adaptation ####################*/ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #if defined(USE_STM3210C_EVAL) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #else - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ #endif #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ +#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */ #endif /* HSI_VALUE */ +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ /** * @brief External Low Speed oscillator (LSE) value. * This value is used by the UART, RTC HAL module to compute the system frequency */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ - #if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ - /* Tip: To avoid modifying this file each time you need to use different HSE, === you can define the HSE value in your toolchain compiler preprocessor. */ /* ########################### System Configuration ######################### */ /** * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x000F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ -/*#define USE_FULL_ASSERT 1*/ - +/* #define USE_FULL_ASSERT 1U */ /* ################## Ethernet peripheral configuration ##################### */ /* Section 1 : Ethernet peripheral configuration */ /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)8) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ +#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ /* Section 2: PHY configuration section */ -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU /* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) +#define PHY_CONFIG_DELAY 0x00000FFFU -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + #define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -194,13 +208,13 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + #define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ #define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ #define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ @@ -211,152 +225,170 @@ #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ #define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ +/* ################## SPI peripheral configuration ########################## */ +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f1xx_hal_rcc.h" +#include "stm32f1xx_hal_rcc.h" #endif /* HAL_RCC_MODULE_ENABLED */ #ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f1xx_hal_gpio.h" +#include "stm32f1xx_hal_gpio.h" #endif /* HAL_GPIO_MODULE_ENABLED */ - + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32f1xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + #ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f1xx_hal_dma.h" +#include "stm32f1xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f1xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - +#include "stm32f1xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + #ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f1xx_hal_can.h" +#include "stm32f1xx_hal_can.h" #endif /* HAL_CAN_MODULE_ENABLED */ +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32f1xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + #ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f1xx_hal_cec.h" +#include "stm32f1xx_hal_cec.h" #endif /* HAL_CEC_MODULE_ENABLED */ #ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f1xx_hal_cortex.h" +#include "stm32f1xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ #ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f1xx_hal_adc.h" +#include "stm32f1xx_hal_adc.h" #endif /* HAL_ADC_MODULE_ENABLED */ #ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f1xx_hal_crc.h" +#include "stm32f1xx_hal_crc.h" #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f1xx_hal_dac.h" +#include "stm32f1xx_hal_dac.h" #endif /* HAL_DAC_MODULE_ENABLED */ #ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f1xx_hal_flash.h" +#include "stm32f1xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ #ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f1xx_hal_sram.h" +#include "stm32f1xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ #ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f1xx_hal_nor.h" +#include "stm32f1xx_hal_nor.h" #endif /* HAL_NOR_MODULE_ENABLED */ #ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f1xx_hal_i2c.h" +#include "stm32f1xx_hal_i2c.h" #endif /* HAL_I2C_MODULE_ENABLED */ #ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f1xx_hal_i2s.h" +#include "stm32f1xx_hal_i2s.h" #endif /* HAL_I2S_MODULE_ENABLED */ #ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f1xx_hal_iwdg.h" +#include "stm32f1xx_hal_iwdg.h" #endif /* HAL_IWDG_MODULE_ENABLED */ #ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f1xx_hal_pwr.h" +#include "stm32f1xx_hal_pwr.h" #endif /* HAL_PWR_MODULE_ENABLED */ #ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f1xx_hal_rtc.h" +#include "stm32f1xx_hal_rtc.h" #endif /* HAL_RTC_MODULE_ENABLED */ #ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f1xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ +#include "stm32f1xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ #ifdef HAL_SD_MODULE_ENABLED - #include "stm32f1xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ +#include "stm32f1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ #ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f1xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ +#include "stm32f1xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ #ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f1xx_hal_spi.h" +#include "stm32f1xx_hal_spi.h" #endif /* HAL_SPI_MODULE_ENABLED */ #ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f1xx_hal_tim.h" +#include "stm32f1xx_hal_tim.h" #endif /* HAL_TIM_MODULE_ENABLED */ #ifdef HAL_UART_MODULE_ENABLED - #include "stm32f1xx_hal_uart.h" +#include "stm32f1xx_hal_uart.h" #endif /* HAL_UART_MODULE_ENABLED */ #ifdef HAL_USART_MODULE_ENABLED - #include "stm32f1xx_hal_usart.h" +#include "stm32f1xx_hal_usart.h" #endif /* HAL_USART_MODULE_ENABLED */ #ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f1xx_hal_irda.h" +#include "stm32f1xx_hal_irda.h" #endif /* HAL_IRDA_MODULE_ENABLED */ #ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f1xx_hal_smartcard.h" +#include "stm32f1xx_hal_smartcard.h" #endif /* HAL_SMARTCARD_MODULE_ENABLED */ #ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f1xx_hal_wwdg.h" +#include "stm32f1xx_hal_wwdg.h" #endif /* HAL_WWDG_MODULE_ENABLED */ #ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f1xx_hal_pcd.h" +#include "stm32f1xx_hal_pcd.h" #endif /* HAL_PCD_MODULE_ENABLED */ - #ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f1xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - +#include "stm32f1xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED +#include "stm32f1xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function + * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); +void assert_failed(uint8_t* file, uint32_t line); #else - #define assert_param(expr) ((void)0) +#define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ + #ifdef __cplusplus } #endif diff --git a/stm32-newlib/stm32f4xx_hal_conf.h b/examples/blinky/stm32f4xx_hal_conf.h old mode 100644 new mode 100755 similarity index 56% rename from stm32-newlib/stm32f4xx_hal_conf.h rename to examples/blinky/stm32f4xx_hal_conf.h index b1b85ee7..ea1d6cdf --- a/stm32-newlib/stm32f4xx_hal_conf.h +++ b/examples/blinky/stm32f4xx_hal_conf.h @@ -2,37 +2,19 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @version V1.3.1 - * @date 25-March-2015 * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2015 STMicroelectronics

+ *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ @@ -53,48 +35,54 @@ * @brief This is the list of modules to be used in the HAL driver */ #define HAL_MODULE_ENABLED -// #define HAL_ADC_MODULE_ENABLED -// #define HAL_CAN_MODULE_ENABLED -// #define HAL_CRC_MODULE_ENABLED +// #define HAL_ADC_MODULE_ENABLED +// #define HAL_CAN_MODULE_ENABLED +// #define HAL_CAN_LEGACY_MODULE_ENABLED +// #define HAL_CRC_MODULE_ENABLED // #define HAL_CEC_MODULE_ENABLED -// #define HAL_CRYP_MODULE_ENABLED -// #define HAL_DAC_MODULE_ENABLED -// #define HAL_DCMI_MODULE_ENABLED +// #define HAL_CRYP_MODULE_ENABLED +// #define HAL_DAC_MODULE_ENABLED +// #define HAL_DCMI_MODULE_ENABLED #define HAL_DMA_MODULE_ENABLED -// #define HAL_DMA2D_MODULE_ENABLED -// #define HAL_ETH_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED +// #define HAL_DMA2D_MODULE_ENABLED +// #define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED // #define HAL_NAND_MODULE_ENABLED // #define HAL_NOR_MODULE_ENABLED // #define HAL_PCCARD_MODULE_ENABLED // #define HAL_SRAM_MODULE_ENABLED // #define HAL_SDRAM_MODULE_ENABLED -// #define HAL_HASH_MODULE_ENABLED +// #define HAL_HASH_MODULE_ENABLED #define HAL_GPIO_MODULE_ENABLED +// #define HAL_EXTI_MODULE_ENABLED // #define HAL_I2C_MODULE_ENABLED -// #define HAL_I2S_MODULE_ENABLED -// #define HAL_IWDG_MODULE_ENABLED -// #define HAL_LTDC_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -// #define HAL_QSPI_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -// #define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -// #define HAL_SAI_MODULE_ENABLED -// #define HAL_SD_MODULE_ENABLED -// #define HAL_SPI_MODULE_ENABLED -// #define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED +// #define HAL_SMBUS_MODULE_ENABLED +// #define HAL_I2S_MODULE_ENABLED +// #define HAL_IWDG_MODULE_ENABLED +// #define HAL_LTDC_MODULE_ENABLED +// #define HAL_DSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +// #define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +// #define HAL_RNG_MODULE_ENABLED +// #define HAL_RTC_MODULE_ENABLED +// #define HAL_SAI_MODULE_ENABLED +// #define HAL_SD_MODULE_ENABLED +// #define HAL_SPI_MODULE_ENABLED +// #define HAL_TIM_MODULE_ENABLED +// #define HAL_UART_MODULE_ENABLED // #define HAL_USART_MODULE_ENABLED -// #define HAL_IRDA_MODULE_ENABLED -// #define HAL_SMARTCARD_MODULE_ENABLED -// #define HAL_WWDG_MODULE_ENABLED +// #define HAL_IRDA_MODULE_ENABLED +// #define HAL_SMARTCARD_MODULE_ENABLED +// #define HAL_WWDG_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED // #define HAL_PCD_MODULE_ENABLED // #define HAL_HCD_MODULE_ENABLED // #define HAL_FMPI2C_MODULE_ENABLED // #define HAL_SPDIFRX_MODULE_ENABLED - +// #define HAL_DFSDM_MODULE_ENABLED +// #define HAL_LPTIM_MODULE_ENABLED +// #define HAL_MMC_MODULE_ENABLED /* ########################## HSE/HSI Values adaptation ##################### */ /** @@ -103,11 +91,11 @@ * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** @@ -116,31 +104,35 @@ * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ #if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ /** * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + /** * @brief External clock source for I2S peripheral * This value is used by the I2S HAL module to compute the I2S clock source * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ #endif /* EXTERNAL_CLOCK_VALUE */ /* Tip: To avoid modifying this file each time you need to use different HSE, @@ -150,54 +142,93 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1 +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ /* ########################## Assert Selection ############################## */ /** * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ -/* #define USE_FULL_ASSERT 1 */ +/* #define USE_FULL_ASSERT 1U */ /* ################## Ethernet peripheral configuration ##################### */ /* Section 1 : Ethernet peripheral configuration */ /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U /* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ /* Section 2: PHY configuration section */ /* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 +#define DP83848_PHY_ADDRESS 0x01U /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +#define PHY_RESET_DELAY 0x000000FFU /* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) +#define PHY_CONFIG_DELAY 0x00000FFFU -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ #define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ @@ -216,9 +247,9 @@ /* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ #define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ #define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ @@ -230,6 +261,15 @@ #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ #define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + /* Includes ------------------------------------------------------------------*/ /** * @brief Include module's header file @@ -243,6 +283,10 @@ #include "stm32f4xx_hal_gpio.h" #endif /* HAL_GPIO_MODULE_ENABLED */ +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ @@ -259,6 +303,10 @@ #include "stm32f4xx_hal_can.h" #endif /* HAL_CAN_MODULE_ENABLED */ +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + #ifdef HAL_CRC_MODULE_ENABLED #include "stm32f4xx_hal_crc.h" #endif /* HAL_CRC_MODULE_ENABLED */ @@ -305,7 +353,7 @@ #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -315,6 +363,10 @@ #include "stm32f4xx_hal_i2c.h" #endif /* HAL_I2C_MODULE_ENABLED */ +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + #ifdef HAL_I2S_MODULE_ENABLED #include "stm32f4xx_hal_i2s.h" #endif /* HAL_I2S_MODULE_ENABLED */ @@ -383,6 +435,10 @@ #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + #ifdef HAL_QSPI_MODULE_ENABLED #include "stm32f4xx_hal_qspi.h" #endif /* HAL_QSPI_MODULE_ENABLED */ @@ -398,22 +454,34 @@ #ifdef HAL_SPDIFRX_MODULE_ENABLED #include "stm32f4xx_hal_spdifrx.h" #endif /* HAL_SPDIFRX_MODULE_ENABLED */ - + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function + * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else - #define assert_param(expr) ((void)0) + #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ diff --git a/examples/blinky/stm32l0xx_hal_conf.h b/examples/blinky/stm32l0xx_hal_conf.h new file mode 100755 index 00000000..88160c3c --- /dev/null +++ b/examples/blinky/stm32l0xx_hal_conf.h @@ -0,0 +1,338 @@ +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +// #define HAL_ADC_MODULE_ENABLED +// #define HAL_COMP_MODULE_ENABLED +// #define HAL_CRC_MODULE_ENABLED +// #define HAL_CRYP_MODULE_ENABLED +// #define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +// #define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +// #define HAL_I2C_MODULE_ENABLED +// #define HAL_I2S_MODULE_ENABLED +// #define HAL_IWDG_MODULE_ENABLED +// #define HAL_LCD_MODULE_ENABLED +// #define HAL_LPTIM_MODULE_ENABLED +// #define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +// #define HAL_RNG_MODULE_ENABLED +// #define HAL_RTC_MODULE_ENABLED +// #define HAL_SPI_MODULE_ENABLED +// #define HAL_TIM_MODULE_ENABLED +// #define HAL_TSC_MODULE_ENABLED +// #define HAL_UART_MODULE_ENABLED +// #define HAL_USART_MODULE_ENABLED +// #define HAL_IRDA_MODULE_ENABLED +// #define HAL_SMARTCARD_MODULE_ENABLED +// #define HAL_SMBUS_MODULE_ENABLED +// #define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +// #define HAL_PCD_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define PREREAD_ENABLE 0U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/examples/custom-linker-script/CMakeLists.txt b/examples/custom-linker-script/CMakeLists.txt new file mode 100644 index 00000000..a2f65d4a --- /dev/null +++ b/examples/custom-linker-script/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-custom-linker-script C ASM) + +find_package(CMSIS COMPONENTS STM32F407VG REQUIRED) + +set(PROJECT_SOURCES + main.c +) + +add_executable(stm32-custom-linker-script.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-custom-linker-script.elf CMSIS::STM32::F407xx STM32::NoSys) +stm32_add_linker_script(stm32-custom-linker-script.elf PRIVATE F407VG.ld) diff --git a/examples/custom-linker-script/F407VG.ld b/examples/custom-linker-script/F407VG.ld new file mode 100644 index 00000000..77184833 --- /dev/null +++ b/examples/custom-linker-script/F407VG.ld @@ -0,0 +1,132 @@ +ENTRY(Reset_Handler) + +_estack = 0x20000000 + 128K; +_Min_Heap_Size = 0x200; +_Min_Stack_Size = 0x400; + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K + +} + +SECTIONS +{ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) + . = ALIGN(4); + } >FLASH + + .text : + { + . = ALIGN(4); + *(.text) + *(.text*) + *(.glue_7) + *(.glue_7t) + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; + } >FLASH + + .rodata : + { + . = ALIGN(4); + *(.rodata) + *(.rodata*) + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + _sidata = LOADADDR(.data); + + .data : + { + . = ALIGN(4); + _sdata = .; + *(.data) + *(.data*) + + . = ALIGN(4); + _edata = .; + } >RAM AT> FLASH + +_siccmram = LOADADDR(.ccmram); +.ccmram : +{ +. = ALIGN(4); +_sccmram = .; +*(.ccmram) +*(.ccmram*) +. = ALIGN(4); +_eccmram = .; +} >CCMRAM AT> FLASH + + . = ALIGN(4); + .bss : + { + _sbss = .; + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; + __bss_end__ = _ebss; + } >RAM + + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} \ No newline at end of file diff --git a/examples/custom-linker-script/main.c b/examples/custom-linker-script/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/examples/custom-linker-script/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/examples/fetch-cmsis-hal/CMakeLists.txt b/examples/fetch-cmsis-hal/CMakeLists.txt new file mode 100644 index 00000000..827ba5ca --- /dev/null +++ b/examples/fetch-cmsis-hal/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-fetch-cmsis-hal C ASM) + +stm32_fetch_cmsis(F4 L0) +stm32_fetch_hal(F4 L0) + +find_package(CMSIS COMPONENTS STM32F407VG STM32L053C8 REQUIRED) +find_package(HAL COMPONENTS STM32F4 STM32L0 REQUIRED) + +set(PROJECT_SOURCES + main.c +) + +add_executable(stm32-fetch-f4.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-fetch-f4.elf CMSIS::STM32::F407VG STM32::NoSys) + +add_executable(stm32-fetch-l0.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-fetch-l0.elf CMSIS::STM32::L053C8 STM32::NoSys) diff --git a/examples/fetch-cmsis-hal/main.c b/examples/fetch-cmsis-hal/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/examples/fetch-cmsis-hal/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/examples/fetch-cube/CMakeLists.txt b/examples/fetch-cube/CMakeLists.txt new file mode 100644 index 00000000..e8eaffcf --- /dev/null +++ b/examples/fetch-cube/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-fetch-cube C ASM) + +stm32_fetch_cube(F4 L0) + +find_package(CMSIS COMPONENTS STM32F407VG STM32L053C8 REQUIRED) + +set(PROJECT_SOURCES + main.c +) + +add_executable(stm32-fetch-f4.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-fetch-f4.elf CMSIS::STM32::F407VG STM32::NoSys) + +add_executable(stm32-fetch-l0.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-fetch-l0.elf CMSIS::STM32::L053C8 STM32::NoSys) diff --git a/examples/fetch-cube/main.c b/examples/fetch-cube/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/examples/fetch-cube/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/examples/freertos/CMakeLists.txt b/examples/freertos/CMakeLists.txt new file mode 100644 index 00000000..0a10c107 --- /dev/null +++ b/examples/freertos/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-freertos C ASM) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +find_package(CMSIS COMPONENTS STM32F407VG REQUIRED) +find_package(HAL COMPONENTS STM32F407VG REQUIRED) +find_package(FreeRTOS COMPONENTS ARM_CM4F REQUIRED) + +set(PROJECT_SOURCES + main.c + FreeRTOSConfig.h +) + +add_executable(stm32-freertos.elf ${PROJECT_SOURCES} stm32f4xx_hal_conf.h) +target_link_libraries(stm32-freertos.elf PRIVATE + FreeRTOS::Timers + FreeRTOS::Heap::1 + FreeRTOS::ARM_CM4F + HAL::STM32::F4::RCC + HAL::STM32::F4::GPIO + HAL::STM32::F4::CORTEX + CMSIS::STM32::F407VG + STM32::NoSys +) diff --git a/examples/freertos/FreeRTOSConfig.h b/examples/freertos/FreeRTOSConfig.h new file mode 100644 index 00000000..141bfbb4 --- /dev/null +++ b/examples/freertos/FreeRTOSConfig.h @@ -0,0 +1,124 @@ +/* + * FreeRTOS Kernel V10.4.1 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ + + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +#include +extern uint32_t SystemCoreClock; + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) +#define configMAX_PRIORITIES ( 5 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 8 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 10 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configGENERATE_RUN_TIME_STATS 0 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 /* 15 priority levels */ +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler +#define xPortSysTickHandler SysTick_Handler + +#endif /* FREERTOS_CONFIG_H */ + diff --git a/examples/freertos/main.c b/examples/freertos/main.c new file mode 100644 index 00000000..18b28c9d --- /dev/null +++ b/examples/freertos/main.c @@ -0,0 +1,69 @@ +#include +#include +#include + +#include + +// STM32F4-Discovery green led - PD12 +#define LED_PORT GPIOD +#define LED_PIN GPIO_PIN_12 +#define LED_PORT_CLK_ENABLE __HAL_RCC_GPIOD_CLK_ENABLE + +static void blinky(void *arg) +{ + for(;;) + { + vTaskDelay(500); + HAL_GPIO_TogglePin(LED_PORT, LED_PIN); + } +} + +void initGPIO() +{ + GPIO_InitTypeDef GPIO_Config; + + GPIO_Config.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_Config.Pull = GPIO_NOPULL; + GPIO_Config.Speed = GPIO_SPEED_FREQ_HIGH; + + GPIO_Config.Pin = LED_PIN; + + LED_PORT_CLK_ENABLE(); + HAL_GPIO_Init(LED_PORT, &GPIO_Config); +} + +int main(void) +{ + SystemInit(); + initGPIO(); + + xTaskCreate(blinky, "blinky", configMINIMAL_STACK_SIZE * 4, NULL, tskIDLE_PRIORITY + 1, NULL); + + vTaskStartScheduler(); + for (;;); + + return 0; +} + +void vApplicationTickHook(void) +{ +} + +void vApplicationIdleHook(void) +{ +} + +void vApplicationMallocFailedHook(void) +{ + taskDISABLE_INTERRUPTS(); + for(;;); +} + +void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName) +{ + (void) pcTaskName; + (void) pxTask; + + taskDISABLE_INTERRUPTS(); + for(;;); +} diff --git a/examples/freertos/stm32f4xx_hal_conf.h b/examples/freertos/stm32f4xx_hal_conf.h new file mode 100755 index 00000000..ea1d6cdf --- /dev/null +++ b/examples/freertos/stm32f4xx_hal_conf.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +// #define HAL_ADC_MODULE_ENABLED +// #define HAL_CAN_MODULE_ENABLED +// #define HAL_CAN_LEGACY_MODULE_ENABLED +// #define HAL_CRC_MODULE_ENABLED +// #define HAL_CEC_MODULE_ENABLED +// #define HAL_CRYP_MODULE_ENABLED +// #define HAL_DAC_MODULE_ENABLED +// #define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +// #define HAL_DMA2D_MODULE_ENABLED +// #define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +// #define HAL_NAND_MODULE_ENABLED +// #define HAL_NOR_MODULE_ENABLED +// #define HAL_PCCARD_MODULE_ENABLED +// #define HAL_SRAM_MODULE_ENABLED +// #define HAL_SDRAM_MODULE_ENABLED +// #define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +// #define HAL_EXTI_MODULE_ENABLED +// #define HAL_I2C_MODULE_ENABLED +// #define HAL_SMBUS_MODULE_ENABLED +// #define HAL_I2S_MODULE_ENABLED +// #define HAL_IWDG_MODULE_ENABLED +// #define HAL_LTDC_MODULE_ENABLED +// #define HAL_DSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +// #define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +// #define HAL_RNG_MODULE_ENABLED +// #define HAL_RTC_MODULE_ENABLED +// #define HAL_SAI_MODULE_ENABLED +// #define HAL_SD_MODULE_ENABLED +// #define HAL_SPI_MODULE_ENABLED +// #define HAL_TIM_MODULE_ENABLED +// #define HAL_UART_MODULE_ENABLED +// #define HAL_USART_MODULE_ENABLED +// #define HAL_IRDA_MODULE_ENABLED +// #define HAL_SMARTCARD_MODULE_ENABLED +// #define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +// #define HAL_PCD_MODULE_ENABLED +// #define HAL_HCD_MODULE_ENABLED +// #define HAL_FMPI2C_MODULE_ENABLED +// #define HAL_SPDIFRX_MODULE_ENABLED +// #define HAL_DFSDM_MODULE_ENABLED +// #define HAL_LPTIM_MODULE_ENABLED +// #define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/template/CMakeLists.txt b/examples/template/CMakeLists.txt new file mode 100644 index 00000000..e8e8d497 --- /dev/null +++ b/examples/template/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +project(stm32-template C ASM) + +find_package(CMSIS COMPONENTS STM32F407VG REQUIRED) +# Find CMSIS for all F4 devices: +#find_package(CMSIS COMPONENTS STM32F4 REQUIRED) +# Find CMSIS for all devices: +#find_package(CMSIS REQUIRED) + +set(PROJECT_SOURCES + main.c +) + +add_executable(stm32-template.elf ${PROJECT_SOURCES}) +target_link_libraries(stm32-template.elf CMSIS::STM32::F407VG STM32::NoSys) diff --git a/examples/template/main.c b/examples/template/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/examples/template/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/packages/CMakeLists.txt b/packages/CMakeLists.txt deleted file mode 100644 index 692017b8..00000000 --- a/packages/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -cmake_minimum_required(VERSION 2.8.3) -set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../gcc_stm32.cmake") -project(stm32_packages) - -if (NOT DEFINED TARGET_TRIPLET) - set(TARGET_TRIPLET "arm-none-eabi") -endif() -set(CMAKE_BUILD_TYPE "Release") -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules") - -set(STM_ARCHIVE_BASEURL "http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware") -set(STM_ARCHIVE_F1 "stsw-stm32054.zip") -set(STM_ARCHIVE_F4 "stm32f4_dsp_stdperiph_lib.zip") -set(STM_ARCHIVE_VERSION_F1 "3.5.0") -set(STM_ARCHIVE_VERSION_F4 "1.3.0") -set(STM_ARCHIVE_DIR_F1 "STM32F10x_StdPeriph_Lib_V${STM_ARCHIVE_VERSION_F1}") -set(STM_ARCHIVE_DIR_F4 "STM32F4xx_DSP_StdPeriph_Lib_V${STM_ARCHIVE_VERSION_F4}") - -set(PACKAGE_TYPE "deb") - -if(NOT DEFINED STM32_FAMILY) - message(FATAL_ERROR "Please specify STM32_FAMILY, eg cmake -DSTM32_FAMILY=F4") -endif() - -set(STM_ARCHIVE "${STM_ARCHIVE_${STM32_FAMILY}}") -if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${STM_ARCHIVE}") - message(STATUS "Using already-downloaded archive: ${STM_ARCHIVE}") -else() - message(STATUS "From st.com, downloading ${STM_ARCHIVE}") - file(DOWNLOAD "${STM_ARCHIVE_BASEURL}/${STM_ARCHIVE}" - "${CMAKE_CURRENT_BINARY_DIR}/${STM_ARCHIVE}" SHOW_PROGRESS) -endif() - -set(STM_ARCHIVE_DIR "${STM_ARCHIVE_DIR_${STM32_FAMILY}}") -set(STM_ARCHIVE_FULLDIR "${CMAKE_CURRENT_BINARY_DIR}/${STM_ARCHIVE_DIR}") -if(EXISTS "${STM_ARCHIVE_FULLDIR}") - message(STATUS "Using already-extracted path: ${STM_ARCHIVE_DIR}") -else() - execute_process(COMMAND unzip -o ${STM_ARCHIVE}) -endif() - -add_custom_target(debs ALL) - -# Install everything into a subdirectory so that we can package it from there. -set(STM32F1_CHIP_TYPES HD HD_VL MD MD_VL LD LD_VL XL) -set(STM32F4_CHIP_TYPES 401xx 40_41xxx 427_437xx 429_439xx) -set(STM32_CHIP_TYPES "${STM32${STM32_FAMILY}_CHIP_TYPES}") -set(STM32${STM32_FAMILY}_StdPeriphLib_DIR "${STM_ARCHIVE_FULLDIR}") - -# Add targets for building cmsis libraries -set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install/usr/${TARGET_TRIPLET}/") -add_subdirectory(../cmsis ${CMAKE_CURRENT_BINARY_DIR}/cmsis) - -# Add targets for building stdperiph libraries, which need the cmsis headers -get_property(CMSIS_INCLUDE_DIR DIRECTORY ../cmsis PROPERTY INCLUDE_DIRECTORIES) -add_subdirectory(../stdperiph ${CMAKE_CURRENT_BINARY_DIR}/stdperiph) - -# Ensure all those get built. -add_custom_target(install_stm32${STM32_FAMILY_LOWER}) -add_dependencies(install_stm32${STM32_FAMILY_LOWER} - cmsis_${STM32_FAMILY_LOWER} - stdperiph_${STM32_FAMILY_LOWER}) - -set(MODULES_DIR ${CMAKE_CURRENT_BINARY_DIR}/install/usr/share/cmake-2.8/Modules) -add_custom_command(TARGET install_stm32${STM32_FAMILY_LOWER} POST_BUILD - COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/FindCMSIS.cmake - ${MODULES_DIR}/FindCMSIS.cmake - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/FindStdPeriphLib.cmake - ${MODULES_DIR}/FindStdPeriphLib.cmake - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../gcc_stm32.cmake - ${MODULES_DIR}/gcc_stm32.cmake - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../gcc_stm32${STM32_FAMILY_LOWER}.cmake - ${MODULES_DIR}/gcc_stm32${STM32_FAMILY_LOWER}.cmake -) - -# Create package. -set(PACKAGE_NAME "stm32${STM32_FAMILY_LOWER}-stdperiph") -set(PACKAGE_VERSION "${STM_ARCHIVE_VERSION_${STM32_FAMILY}}") -set(PACKAGE_FILENAME "${PACKAGE_NAME}_${PACKAGE_VERSION}_all.${PACKAGE_TYPE}") - -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_FILENAME} - COMMAND fpm -a all -s dir -t ${PACKAGE_TYPE} -n ${PACKAGE_NAME} - -d gcc-arm-none-eabi - -v ${PACKAGE_VERSION} -C install usr -) -add_custom_target(${PACKAGE_FILENAME}_ - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_FILENAME} -) -add_dependencies(${PACKAGE_FILENAME}_ install_stm32${STM32_FAMILY_LOWER}) -add_dependencies(debs ${PACKAGE_FILENAME}_) diff --git a/packages/README.md b/packages/README.md deleted file mode 100644 index 1d1c39d1..00000000 --- a/packages/README.md +++ /dev/null @@ -1,46 +0,0 @@ -Package Generation -================== - -This directory creates a debian package of the stm32f1 or f4 CMSIS and StdPeriph libraries -and headers. This is useful for a few reasons: - - - You can use `sudo dpkg -i` to install a deb and avoid manually compiling - and installing the library. - - You can place the deb on an apt repository, and make it trivially easy to - set up a development environment on any Ubuntu or Debian machine---this is - great for getting a whole team up and running quickly, or for throwaway - environments such as CI builders and virtual machines. - -Toolchain ---------- - -You need the right GCC compiler, which is `gcc-arm-none-eabi`. Fortunately, if you're on -Ubuntu, this is really easy to get from Launchpad, thanks to Terry Guo's PPA: - -~~~ -sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa -sudo apt-get update -sudo apt-get install gcc-arm-embedded -~~~ - -Building the deb ----------------- - -You'll need a [fpm](https://github.com/jordansissel/fpm), which is what actually produces -the deb package from a folder of files. This comes from rubygems: - -~~~ -sudo apt-get install rubygems -gem install fpm -~~~ - -Apart from that, it's a regular build: - -~~~ -mkdir packages/build -cd packages/build -cmake .. -DSTM32_FAMILY=F4 -make -~~~ - -Enjoy your deb! diff --git a/stm32-blinky/CMakeLists.txt b/stm32-blinky/CMakeLists.txt deleted file mode 100644 index 9d98cb52..00000000 --- a/stm32-blinky/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -PROJECT(stm32-blinky) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -ENABLE_LANGUAGE(ASM) - -FIND_PACKAGE(CMSIS REQUIRED) -FIND_PACKAGE(STM32HAL COMPONENTS gpio tim REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMSIS_INCLUDE_DIRS} - ${STM32HAL_INCLUDE_DIR} -) - -SET(PROJECT_SOURCES - main.c -) - -ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES} ${CMSIS_SOURCES} ${STM32HAL_SOURCES}) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}) diff --git a/stm32-blinky/main.c b/stm32-blinky/main.c deleted file mode 100644 index aa24e84b..00000000 --- a/stm32-blinky/main.c +++ /dev/null @@ -1,250 +0,0 @@ -#if defined STM32F1 -# include -#elif defined STM32F2 -# include -#elif defined STM32F4 -# include -#elif defined STM32G0 -# include -#endif - -void initGPIO() -{ - GPIO_InitTypeDef GPIO_Config; - - GPIO_Config.Mode = GPIO_MODE_AF_PP; - GPIO_Config.Pull = GPIO_NOPULL; - -#if defined STM32F1 - __GPIOC_CLK_ENABLE(); - __AFIO_CLK_ENABLE(); - - GPIO_Config.Pin = GPIO_PIN_8; - GPIO_Config.Speed = GPIO_SPEED_HIGH; - HAL_GPIO_Init(GPIOC, &GPIO_Config); -#elif defined STM32F2 - __GPIOD_CLK_ENABLE(); - - GPIO_Config.Alternate = GPIO_AF2_TIM4; - GPIO_Config.Pin = GPIO_PIN_12; - GPIO_Config.Speed = GPIO_SPEED_HIGH; - HAL_GPIO_Init(GPIOD, &GPIO_Config); -#elif defined STM32F4 - __GPIOA_CLK_ENABLE(); - - GPIO_Config.Alternate = GPIO_AF2_TIM3; - GPIO_Config.Pin = GPIO_PIN_6; - GPIO_Config.Speed = GPIO_SPEED_HIGH; - HAL_GPIO_Init(GPIOA, &GPIO_Config); -#elif defined STM32G0 - __GPIOA_CLK_ENABLE(); -#if defined STM32G070xx - GPIO_Config.Alternate = GPIO_AF2_TIM1; -#else - GPIO_Config.Alternate = GPIO_AF2_TIM2; -#endif - - GPIO_Config.Pin = GPIO_PIN_5; - GPIO_Config.Speed = GPIO_SPEED_FREQ_HIGH; - HAL_GPIO_Init(GPIOA, &GPIO_Config); - -#endif -} - -void initTimers() -{ - TIM_HandleTypeDef TIM_Handle; - - // 10 kHz timer. -#if defined STM32F1 - __TIM8_CLK_ENABLE(); - TIM_Handle.Instance = TIM8; - TIM_Handle.Init.Prescaler = (uint16_t)(HAL_RCC_GetPCLK2Freq() / 10000) - 1; -#elif defined STM32F2 - __TIM4_CLK_ENABLE(); - TIM_Handle.Instance = TIM4; - TIM_Handle.Init.Prescaler = (uint16_t)(HAL_RCC_GetPCLK2Freq() / 100000) - 1; -#elif defined STM32F4 - __TIM3_CLK_ENABLE(); - TIM_Handle.Instance = TIM3; - // TIM3 Clocked from SYSCLK = 168 MHz - TIM_Handle.Init.Prescaler = (uint16_t)(HAL_RCC_GetSysClockFreq() / 10000) - 1; -#elif defined STM32G0 - -#if defined STM32G070xx - TIM_Handle.Instance = TIM1; - __TIM1_CLK_ENABLE(); -#else - TIM_Handle.Instance = TIM2; - __TIM2_CLK_ENABLE(); -#endif - - TIM_Handle.Init.Prescaler = (uint16_t)(HAL_RCC_GetSysClockFreq() / 10000) - 1; - -#endif - - // 1 Hz blinking - TIM_Handle.Init.Period = 10000; - TIM_Handle.Init.ClockDivision = 0; - TIM_Handle.Init.CounterMode = TIM_COUNTERMODE_UP; - - HAL_TIM_Base_Init(&TIM_Handle); - HAL_TIM_PWM_Init(&TIM_Handle); - - TIM_OC_InitTypeDef TIM_OCConfig; - - TIM_OCConfig.OCMode = TIM_OCMODE_PWM1; - // 5000 / 10000 = 50% duty cycle. - TIM_OCConfig.Pulse = 4999; - TIM_OCConfig.OCPolarity = TIM_OCPOLARITY_HIGH; - TIM_OCConfig.OCFastMode = TIM_OCFAST_DISABLE; - -#if defined STM32F1 - HAL_TIM_PWM_ConfigChannel(&TIM_Handle, &TIM_OCConfig, TIM_CHANNEL_3); - HAL_TIM_PWM_Start(&TIM_Handle, TIM_CHANNEL_3); -#elif defined STM32F2 - HAL_TIM_PWM_ConfigChannel(&TIM_Handle, &TIM_OCConfig, TIM_CHANNEL_1); - HAL_TIM_PWM_Start(&TIM_Handle, TIM_CHANNEL_1); -#elif defined STM32F4 - HAL_TIM_PWM_ConfigChannel(&TIM_Handle, &TIM_OCConfig, TIM_CHANNEL_1); - HAL_TIM_PWM_Start(&TIM_Handle, TIM_CHANNEL_1); -#elif defined STM32G0 - HAL_TIM_PWM_ConfigChannel(&TIM_Handle, &TIM_OCConfig, TIM_CHANNEL_1); - HAL_TIM_PWM_Start(&TIM_Handle, TIM_CHANNEL_1); -#endif -} - -static void initClock(void) -{ - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - -#if defined STM32F1 - __HAL_RCC_PWR_CLK_ENABLE(); - - uint8_t fLatency; - - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.LSEState = RCC_LSE_OFF; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.HSICalibrationValue = 0; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - -# if (defined STM32F100xB) || (defined STM32F100xE) - // 8 MHz * 3 = 24 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL3; - fLatency = FLASH_LATENCY_0; -# elif (defined STM32F101x6) || (defined STM32F101xB) || (defined STM32F101xE) || (defined STM32F101xG) - // 8 MHz / 2 * 9 = 36 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV2; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_1; -# elif (defined STM32F102x6) || (defined STM32F102xB) - // 8 MHz * 6 = 48 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; - fLatency = FLASH_LATENCY_1; -# elif (defined STM32F103x6) || (defined STM32F103xB) || (defined STM32F103xE) || (defined STM32F103xG) - // 8 MHz * 9 = 72 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_2; -# elif (defined STM32F105xC) || (defined STM32F107xC) - // 8 MHz * 9 = 72 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_2; -# endif - - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, fLatency); -#elif defined STM32F2 - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 25; - RCC_OscInitStruct.PLL.PLLN = 240; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 5; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -#elif defined STM32F4 - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - // 8 MHz * 336 / 8 / 2 = 168 MHz SYSCLK - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV4; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); - - if (HAL_GetREVID() == 0x1001) - { - __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); - } -#elif defined STM32G0 - - HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - |RCC_CLOCKTYPE_PCLK1; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0); - -#endif -} - -void initAll(void) -{ - HAL_Init(); - - initClock(); - initGPIO(); - initTimers(); -} - -int main(void) -{ - initAll(); - for (;;); - return 0; -} diff --git a/stm32-chibios-template/chibios-nil-f0-template/CMakeLists.txt b/stm32-chibios-template/chibios-nil-f0-template/CMakeLists.txt deleted file mode 100644 index 297cd80f..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F051x8) - -cmake_minimum_required(VERSION 3.4) -project(chibios-nil-f0-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -#FIND_PACKAGE(ChibiOS COMPONENTS nil hal adc can ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb memstreams nullstreams REQUIRED) - -FIND_PACKAGE(ChibiOS COMPONENTS nil hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=FALSE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/nilconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-nil-f0-template/board/board.c b/stm32-chibios-template/chibios-nil-f0-template/board/board.c deleted file mode 100755 index 76f4b814..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/board/board.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-nil-f0-template/board/board.h b/stm32-chibios-template/chibios-nil-f0-template/board/board.h deleted file mode 100755 index 28f9e31f..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/board/board.h +++ /dev/null @@ -1,753 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ST STM32F0-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32F0_DISCOVERY -#define BOARD_NAME "ST STM32F0-Discovery" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - * NOTE: HSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 0U -#endif - -#define STM32_HSE_BYPASS - - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_PIN11 11U -#define GPIOA_PIN12 12U -#define GPIOA_SWDAT 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_LED4 8U -#define GPIOC_LED3 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_OSC32_IN 14U -#define GPIOC_OSC32_OUT 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOF_OSC_IN 0U -#define GPIOF_OSC_OUT 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - BUTTON (input floating). - * PA1 - PIN1 (input pullup). - * PA2 - PIN2 (input pullup). - * PA3 - PIN3 (input pullup). - * PA4 - PIN4 (input pullup). - * PA5 - PIN5 (input pullup). - * PA6 - PIN6 (input pullup). - * PA7 - PIN7 (input pullup). - * PA8 - PIN8 (input pullup). - * PA9 - PIN9 (input pullup). - * PA10 - PIN10 (input pullup). - * PA11 - PIN11 (input pullup). - * PA12 - PIN12 (input pullup). - * PA13 - SWDAT (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - PIN15 (input pullup). - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_INPUT(GPIOA_PIN11) | \ - PIN_MODE_INPUT(GPIOA_PIN12) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDAT) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDAT) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN1) | \ - PIN_OSPEED_2M(GPIOA_PIN2) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_2M(GPIOA_PIN5) | \ - PIN_OSPEED_2M(GPIOA_PIN6) | \ - PIN_OSPEED_2M(GPIOA_PIN7) | \ - PIN_OSPEED_2M(GPIOA_PIN8) | \ - PIN_OSPEED_2M(GPIOA_PIN9) | \ - PIN_OSPEED_2M(GPIOA_PIN10) | \ - PIN_OSPEED_2M(GPIOA_PIN11) | \ - PIN_OSPEED_2M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDAT) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDAT) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_PIN11) | \ - PIN_ODR_HIGH(GPIOA_PIN12) | \ - PIN_ODR_HIGH(GPIOA_SWDAT) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 0) | \ - PIN_AFIO_AF(GPIOA_PIN6, 0) | \ - PIN_AFIO_AF(GPIOA_PIN7, 0)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_PIN11, 0) | \ - PIN_AFIO_AF(GPIOA_PIN12, 0) | \ - PIN_AFIO_AF(GPIOA_SWDAT, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (input pullup). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 (input pullup). - * PB7 - PIN7 (input pullup). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_INPUT(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_INPUT(GPIOB_PIN6) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_PIN0) | \ - PIN_OSPEED_2M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_PIN3) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_2M(GPIOB_PIN6) | \ - PIN_OSPEED_2M(GPIOB_PIN7) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_PIN13) | \ - PIN_OSPEED_2M(GPIOB_PIN14) | \ - PIN_OSPEED_2M(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 0) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - LED4 (output pushpull maximum). - * PC9 - LED3 (output pushpull maximum). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - OSC32_IN (input floating). - * PC15 - OSC32_OUT (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_OUTPUT(GPIOC_LED4) | \ - PIN_MODE_OUTPUT(GPIOC_LED3) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ - PIN_MODE_INPUT(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_2M(GPIOC_PIN0) | \ - PIN_OSPEED_2M(GPIOC_PIN1) | \ - PIN_OSPEED_2M(GPIOC_PIN2) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_2M(GPIOC_PIN5) | \ - PIN_OSPEED_2M(GPIOC_PIN6) | \ - PIN_OSPEED_2M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_LED4) | \ - PIN_OSPEED_40M(GPIOC_LED3) | \ - PIN_OSPEED_2M(GPIOC_PIN10) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_40M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_40M(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOC_LED4) | \ - PIN_PUPDR_FLOATING(GPIOC_LED3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_LOW(GPIOC_LED4) | \ - PIN_ODR_LOW(GPIOC_LED3) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ - PIN_ODR_HIGH(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED4, 0) | \ - PIN_AFIO_AF(GPIOC_LED3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_IN, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_OUT, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD10 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_2M(GPIOD_PIN0) | \ - PIN_OSPEED_2M(GPIOD_PIN1) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_2M(GPIOD_PIN3) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_2M(GPIOD_PIN6) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_2M(GPIOD_PIN11) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - OSC_IN (input floating). - * PF1 - OSC_OUT (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ - PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_2M(GPIOF_OSC_IN) | \ - PIN_OSPEED_2M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ - PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0) | \ - PIN_AFIO_AF(GPIOF_OSC_OUT, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f0-template/config/halconf.h b/stm32-chibios-template/chibios-nil-f0-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f0-template/config/mcuconf.h b/stm32-chibios-template/chibios-nil-f0-template/config/mcuconf.h deleted file mode 100755 index e5120374..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/config/mcuconf.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F0xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 3...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F0xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_HSI14_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED FALSE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 12 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE STM32_PPRE_DIV1 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_CECSW STM32_CECSW_HSI -#define STM32_I2C1SW STM32_I2C1SW_HSI -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_RTCSEL STM32_RTCSEL_LSI - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 2 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 2 -#define STM32_GPT_TIM2_IRQ_PRIORITY 2 -#define STM32_GPT_TIM3_IRQ_PRIORITY 2 -#define STM32_GPT_TIM14_IRQ_PRIORITY 2 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 3 -#define STM32_I2C_I2C2_IRQ_PRIORITY 3 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 3 -#define STM32_ICU_TIM2_IRQ_PRIORITY 3 -#define STM32_ICU_TIM3_IRQ_PRIORITY 3 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 3 -#define STM32_PWM_TIM2_IRQ_PRIORITY 3 -#define STM32_PWM_TIM3_IRQ_PRIORITY 3 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USART1_PRIORITY 3 -#define STM32_SERIAL_USART2_PRIORITY 3 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 2 -#define STM32_SPI_SPI2_IRQ_PRIORITY 2 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 2 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 3 -#define STM32_UART_USART2_IRQ_PRIORITY 3 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f0-template/config/nilconf.h b/stm32-chibios-template/chibios-nil-f0-template/config/nilconf.h deleted file mode 100644 index 778bab7d..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/config/nilconf.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file nilconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _NILCONF_H_ -#define _NILCONF_H_ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Number of user threads in the application. - * @note This number is not inclusive of the idle thread which is - * Implicitly handled. - */ -#define NIL_CFG_NUM_THREADS 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name System timer settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define NIL_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @note This value together with the @p NIL_CFG_ST_RESOLUTION - * option defines the maximum amount of time allowed for - * timeouts. - */ -#define NIL_CFG_ST_FREQUENCY 50000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define NIL_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define NIL_CFG_USE_EVENTS TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System assertions. - */ -#define NIL_CFG_ENABLE_ASSERTS FALSE - -/** - * @brief Stack check. - */ -#define NIL_CFG_ENABLE_STACK_CHECK FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System initialization hook. - */ -#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_INIT_HOOK() { \ -} -#endif - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define NIL_CFG_THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - */ -#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \ - /* Add custom threads initialization code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define NIL_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define NIL_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief System halt hook. - */ -#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \ -} -#endif - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in nilcore.h). */ -/*===========================================================================*/ - -#endif /* _NILCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f0-template/main.c b/stm32-chibios-template/chibios-nil-f0-template/main.c deleted file mode 100755 index 3d50ee9a..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/main.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "nil.h" -#include "hal.h" -#include "test.h" - -THD_TABLE_BEGIN - THD_TABLE_ENTRY(waThread1, "Thread1", Thread1, NULL) -THD_TABLE_END -int main(void) { - - halInit(); - chSysInit(); - - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-nil-f0-template/work/test.c b/stm32-chibios-template/chibios-nil-f0-template/work/test.c deleted file mode 100644 index d5bd9ecc..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/work/test.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "nil.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg) { - - (void)arg; - while (true) { - palSetPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - palClearPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - } -} - - diff --git a/stm32-chibios-template/chibios-nil-f0-template/work/test.h b/stm32-chibios-template/chibios-nil-f0-template/work/test.h deleted file mode 100644 index b2fc79f8..00000000 --- a/stm32-chibios-template/chibios-nil-f0-template/work/test.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TEST_H -#define TEST_H -extern THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg); - -#endif // TEST_H diff --git a/stm32-chibios-template/chibios-nil-f1-template/CMakeLists.txt b/stm32-chibios-template/chibios-nil-f1-template/CMakeLists.txt deleted file mode 100644 index d75cb93d..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F100x6) - -cmake_minimum_required(VERSION 3.4) -project(chibios-nil-f1-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -#FIND_PACKAGE(ChibiOS COMPONENTS nil hal adc can ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb memstreams nullstreams REQUIRED) - -FIND_PACKAGE(ChibiOS COMPONENTS nil hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=FALSE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/nilconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-nil-f1-template/board/board.c b/stm32-chibios-template/chibios-nil-f1-template/board/board.c deleted file mode 100755 index 2809c9d1..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/board/board.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -#if HAL_USE_PAL || defined(__DOXYGEN__) -const PALConfig pal_default_config = -{ - {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, - {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, - {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, - {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, - {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, -}; -#endif - -/* - * Early initialization code. - * This initialization must be performed just after stack setup and before - * any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -/* - * Board-specific initialization code. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-nil-f1-template/board/board.h b/stm32-chibios-template/chibios-nil-f1-template/board/board.h deleted file mode 100755 index 2edddd6d..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/board/board.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for STMicroelectronics STM32VL-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32VL_DISCOVERY -#define BOARD_NAME "ST STM32VL-Discovery" - -/* - * Board frequencies. - */ -#define STM32_LSECLK 32768 -#define STM32_HSECLK 8000000 - -/* - * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. - */ -#define STM32F10X_MD_VL - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0 -#define GPIOA_SPI1NSS 4 - -#define GPIOB_SPI2NSS 12 - -#define GPIOC_LED4 8 -#define GPIOC_LED3 9 - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -/* - * Port A setup. - * Everything input with pull-up except: - * PA0 - Normal input (BUTTON). - * PA2 - Alternate output (USART2 TX). - * PA3 - Normal input (USART2 RX). - * PA4 - Push pull output (SPI1 NSS), initially high state. - * PA5 - Alternate output (SPI1 SCK). - * PA6 - Normal input (SPI1 MISO). - * PA7 - Alternate output (SPI1 MOSI). - * PA9 - Alternate output (USART1 TX). - * PA10 - Normal input (USART1 RX). - */ -#define VAL_GPIOACRL 0xB4B34B84 /* PA7...PA0 */ -#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ -#define VAL_GPIOAODR 0xFFFFFFFF - -/* - * Port B setup. - * Everything input with pull-up except: - * PB12 - Push pull output (SPI2 NSS), initially high state. - * PB13 - Alternate output (SPI2 SCK). - * PB14 - Normal input (SPI2 MISO). - * PB15 - Alternate output (SPI2 MOSI). - */ -#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ -#define VAL_GPIOBCRH 0xB4B38888 /* PB15...PB8 */ -#define VAL_GPIOBODR 0xFFFFFFFF - -/* - * Port C setup. - * Everything input with pull-up except: - * PC8 - Push-pull output (LED4), initially low state. - * PC9 - Push-pull output (LED3), initially low state. - */ -#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ -#define VAL_GPIOCCRH 0x88888833 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFCFF - -/* - * Port D setup. - * Everything input with pull-up except: - * PD0 - Normal input (XTAL). - * PD1 - Normal input (XTAL). - */ -#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ -#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ -#define VAL_GPIODODR 0xFFFFFFFF - -/* - * Port E setup. - * Everything input with pull-up except: - */ -#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ -#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ -#define VAL_GPIOEODR 0xFFFFFFFF - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f1-template/config/halconf.h b/stm32-chibios-template/chibios-nil-f1-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f1-template/config/mcuconf.h b/stm32-chibios-template/chibios-nil-f1-template/config/mcuconf.h deleted file mode 100755 index 0b9399f9..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/config/mcuconf.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -#define STM32F100_MCUCONF - -/* - * STM32F103 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED FALSE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 3 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV1 -#define STM32_PPRE2 STM32_PPRE2_DIV1 -#define STM32_ADCPRE STM32_ADCPRE_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_RTCSEL STM32_RTCSEL_HSEDIV -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 6 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 TRUE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * RTC driver system settings. - */ -#define STM32_RTC_IRQ_PRIORITY 15 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f1-template/config/nilconf.h b/stm32-chibios-template/chibios-nil-f1-template/config/nilconf.h deleted file mode 100644 index ac06d302..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/config/nilconf.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file nilconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _NILCONF_H_ -#define _NILCONF_H_ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Number of user threads in the application. - * @note This number is not inclusive of the idle thread which is - * Implicitly handled. - */ -#define NIL_CFG_NUM_THREADS 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name System timer settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define NIL_CFG_ST_RESOLUTION 16 - -/** - * @brief System tick frequency. - * @note This value together with the @p NIL_CFG_ST_RESOLUTION - * option defines the maximum amount of time allowed for - * timeouts. - */ -#define NIL_CFG_ST_FREQUENCY 50000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define NIL_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define NIL_CFG_USE_EVENTS TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System assertions. - */ -#define NIL_CFG_ENABLE_ASSERTS FALSE - -/** - * @brief Stack check. - */ -#define NIL_CFG_ENABLE_STACK_CHECK FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System initialization hook. - */ -#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_INIT_HOOK() { \ -} -#endif - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define NIL_CFG_THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - */ -#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \ - /* Add custom threads initialization code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define NIL_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define NIL_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief System halt hook. - */ -#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \ -} -#endif - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in nilcore.h). */ -/*===========================================================================*/ - -#endif /* _NILCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f1-template/main.c b/stm32-chibios-template/chibios-nil-f1-template/main.c deleted file mode 100755 index 3d50ee9a..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/main.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "nil.h" -#include "hal.h" -#include "test.h" - -THD_TABLE_BEGIN - THD_TABLE_ENTRY(waThread1, "Thread1", Thread1, NULL) -THD_TABLE_END -int main(void) { - - halInit(); - chSysInit(); - - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-nil-f1-template/work/test.c b/stm32-chibios-template/chibios-nil-f1-template/work/test.c deleted file mode 100644 index d5bd9ecc..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/work/test.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "nil.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg) { - - (void)arg; - while (true) { - palSetPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - palClearPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - } -} - - diff --git a/stm32-chibios-template/chibios-nil-f1-template/work/test.h b/stm32-chibios-template/chibios-nil-f1-template/work/test.h deleted file mode 100644 index b2fc79f8..00000000 --- a/stm32-chibios-template/chibios-nil-f1-template/work/test.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TEST_H -#define TEST_H -extern THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg); - -#endif // TEST_H diff --git a/stm32-chibios-template/chibios-nil-f4-template/CMakeLists.txt b/stm32-chibios-template/chibios-nil-f4-template/CMakeLists.txt deleted file mode 100644 index 7fe3cd79..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F407xG) - -cmake_minimum_required(VERSION 3.4) -project(chibios-nil-f4-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb memstreams nullstreams REQUIRED) - -#FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=TRUE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/nilconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-nil-f4-template/board/board.c b/stm32-chibios-template/chibios-nil-f4-template/board/board.c deleted file mode 100755 index 692cf99b..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/board/board.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief SDC card write protection detection. - */ -bool sdc_lld_is_write_protected(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-nil-f4-template/board/board.h b/stm32-chibios-template/chibios-nil-f4-template/board/board.h deleted file mode 100755 index 32c22d45..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/board/board.h +++ /dev/null @@ -1,1296 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for STMicroelectronics STM32F4-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32F4_DISCOVERY -#define BOARD_NAME "STMicroelectronics STM32F4-Discovery" - - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -/* - * Board voltages. - * Required for performance limits calculation. - */ -#define STM32_VDD 300U - -/* - * MCU type as defined in the ST header. - */ - - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_LRCK 4U -#define GPIOA_SPC 5U -#define GPIOA_SDO 6U -#define GPIOA_SDI 7U -#define GPIOA_PIN8 8U -#define GPIOA_VBUS_FS 9U -#define GPIOA_OTG_FS_ID 10U -#define GPIOA_OTG_FS_DM 11U -#define GPIOA_OTG_FS_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_SWO 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_SCL 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_SDA 9U -#define GPIOB_CLK_IN 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_OTG_FS_POWER_ON 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PDM_OUT 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_MCLK 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_SCLK 10U -#define GPIOC_PIN11 11U -#define GPIOC_SDIN 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_RESET 4U -#define GPIOD_OVER_CURRENT 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_LED4 12U -#define GPIOD_LED3 13U -#define GPIOD_LED5 14U -#define GPIOD_LED6 15U - -#define GPIOE_INT1 0U -#define GPIOE_INT2 1U -#define GPIOE_PIN2 2U -#define GPIOE_CS_SPI 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_PIN0 0U -#define GPIOF_PIN1 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_OSC_IN 0U -#define GPIOH_OSC_OUT 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -#define GPIOI_PIN0 0U -#define GPIOI_PIN1 1U -#define GPIOI_PIN2 2U -#define GPIOI_PIN3 3U -#define GPIOI_PIN4 4U -#define GPIOI_PIN5 5U -#define GPIOI_PIN6 6U -#define GPIOI_PIN7 7U -#define GPIOI_PIN8 8U -#define GPIOI_PIN9 9U -#define GPIOI_PIN10 10U -#define GPIOI_PIN11 11U -#define GPIOI_PIN12 12U -#define GPIOI_PIN13 13U -#define GPIOI_PIN14 14U -#define GPIOI_PIN15 15U - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - BUTTON (input floating). - * PA1 - PIN1 (input pullup). - * PA2 - PIN2 (input pullup). - * PA3 - PIN3 (input pullup). - * PA4 - LRCK (alternate 6). - * PA5 - SPC (alternate 5). - * PA6 - SDO (alternate 5). - * PA7 - SDI (alternate 5). - * PA8 - PIN8 (input pullup). - * PA9 - VBUS_FS (input floating). - * PA10 - OTG_FS_ID (alternate 10). - * PA11 - OTG_FS_DM (alternate 10). - * PA12 - OTG_FS_DP (alternate 10). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - PIN15 (input pullup). - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_ALTERNATE(GPIOA_LRCK) | \ - PIN_MODE_ALTERNATE(GPIOA_SPC) | \ - PIN_MODE_ALTERNATE(GPIOA_SDO) | \ - PIN_MODE_ALTERNATE(GPIOA_SDI) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_VBUS_FS) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_ID) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_LRCK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SPC) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SDO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SDI) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_VBUS_FS) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_ID) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_100M(GPIOA_PIN2) | \ - PIN_OSPEED_100M(GPIOA_PIN3) | \ - PIN_OSPEED_100M(GPIOA_LRCK) | \ - PIN_OSPEED_50M(GPIOA_SPC) | \ - PIN_OSPEED_50M(GPIOA_SDO) | \ - PIN_OSPEED_50M(GPIOA_SDI) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_VBUS_FS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOA_LRCK) | \ - PIN_PUPDR_FLOATING(GPIOA_SPC) | \ - PIN_PUPDR_FLOATING(GPIOA_SDO) | \ - PIN_PUPDR_FLOATING(GPIOA_SDI) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOA_VBUS_FS) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_ID) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \ - PIN_PUPDR_FLOATING(GPIOA_SWDIO) | \ - PIN_PUPDR_FLOATING(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_LRCK) | \ - PIN_ODR_HIGH(GPIOA_SPC) | \ - PIN_ODR_HIGH(GPIOA_SDO) | \ - PIN_ODR_HIGH(GPIOA_SDI) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_VBUS_FS) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_ID) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_LRCK, 6) | \ - PIN_AFIO_AF(GPIOA_SPC, 5) | \ - PIN_AFIO_AF(GPIOA_SDO, 5) | \ - PIN_AFIO_AF(GPIOA_SDI, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_VBUS_FS, 0) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_ID, 10) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - SWO (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - SCL (alternate 4). - * PB7 - PIN7 (input pullup). - * PB8 - PIN8 (input pullup). - * PB9 - SDA (alternate 4). - * PB10 - CLK_IN (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_SWO) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_SCL) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_ALTERNATE(GPIOB_SDA) | \ - PIN_MODE_INPUT(GPIOB_CLK_IN) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOB_CLK_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_SCL) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_SDA) | \ - PIN_OSPEED_100M(GPIOB_CLK_IN) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_SWO) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_SCL) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOB_SDA) | \ - PIN_PUPDR_PULLUP(GPIOB_CLK_IN) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_SWO) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_SCL) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_SDA) | \ - PIN_ODR_HIGH(GPIOB_CLK_IN) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_SWO, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_SCL, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_SDA, 4) | \ - PIN_AFIO_AF(GPIOB_CLK_IN, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - OTG_FS_POWER_ON (output pushpull maximum). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PDM_OUT (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - MCLK (alternate 6). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - SCLK (alternate 6). - * PC11 - PIN11 (input pullup). - * PC12 - SDIN (alternate 6). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input pullup). - * PC15 - PIN15 (input pullup). - */ -#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_OTG_FS_POWER_ON) |\ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PDM_OUT) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_ALTERNATE(GPIOC_MCLK) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_ALTERNATE(GPIOC_SCLK) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_ALTERNATE(GPIOC_SDIN) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PDM_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_MCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_SCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_SDIN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PDM_OUT) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_MCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_SCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_SDIN) | \ - PIN_OSPEED_100M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PDM_OUT) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOC_MCLK) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOC_SCLK) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOC_SDIN) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_OTG_FS_POWER_ON) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PDM_OUT) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_MCLK) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_SCLK) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_SDIN) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_OTG_FS_POWER_ON, 0) |\ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PDM_OUT, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_MCLK, 6)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_SCLK, 6) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_SDIN, 6) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - RESET (output pushpull maximum). - * PD5 - OVER_CURRENT (input floating). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD10 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - LED4 (output pushpull maximum). - * PD13 - LED3 (output pushpull maximum). - * PD14 - LED5 (output pushpull maximum). - * PD15 - LED6 (output pushpull maximum). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_OUTPUT(GPIOD_RESET) | \ - PIN_MODE_INPUT(GPIOD_OVER_CURRENT) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_OUTPUT(GPIOD_LED4) | \ - PIN_MODE_OUTPUT(GPIOD_LED3) | \ - PIN_MODE_OUTPUT(GPIOD_LED5) | \ - PIN_MODE_OUTPUT(GPIOD_LED6)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_RESET) | \ - PIN_OTYPE_PUSHPULL(GPIOD_OVER_CURRENT) |\ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED6)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_RESET) | \ - PIN_OSPEED_100M(GPIOD_OVER_CURRENT) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_LED4) | \ - PIN_OSPEED_100M(GPIOD_LED3) | \ - PIN_OSPEED_100M(GPIOD_LED5) | \ - PIN_OSPEED_100M(GPIOD_LED6)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOD_RESET) | \ - PIN_PUPDR_FLOATING(GPIOD_OVER_CURRENT) |\ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOD_LED4) | \ - PIN_PUPDR_FLOATING(GPIOD_LED3) | \ - PIN_PUPDR_FLOATING(GPIOD_LED5) | \ - PIN_PUPDR_FLOATING(GPIOD_LED6)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_RESET) | \ - PIN_ODR_HIGH(GPIOD_OVER_CURRENT) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_LOW(GPIOD_LED4) | \ - PIN_ODR_LOW(GPIOD_LED3) | \ - PIN_ODR_LOW(GPIOD_LED5) | \ - PIN_ODR_LOW(GPIOD_LED6)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_RESET, 0) | \ - PIN_AFIO_AF(GPIOD_OVER_CURRENT, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_LED4, 0) | \ - PIN_AFIO_AF(GPIOD_LED3, 0) | \ - PIN_AFIO_AF(GPIOD_LED5, 0) | \ - PIN_AFIO_AF(GPIOD_LED6, 0)) - -/* - * GPIOE setup: - * - * PE0 - INT1 (input floating). - * PE1 - INT2 (input floating). - * PE2 - PIN2 (input floating). - * PE3 - CS_SPI (output pushpull maximum). - * PE4 - PIN4 (input floating). - * PE5 - PIN5 (input floating). - * PE6 - PIN6 (input floating). - * PE7 - PIN7 (input floating). - * PE8 - PIN8 (input floating). - * PE9 - PIN9 (input floating). - * PE10 - PIN10 (input floating). - * PE11 - PIN11 (input floating). - * PE12 - PIN12 (input floating). - * PE13 - PIN13 (input floating). - * PE14 - PIN14 (input floating). - * PE15 - PIN15 (input floating). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_INT1) | \ - PIN_MODE_INPUT(GPIOE_INT2) | \ - PIN_MODE_INPUT(GPIOE_PIN2) | \ - PIN_MODE_OUTPUT(GPIOE_CS_SPI) | \ - PIN_MODE_INPUT(GPIOE_PIN4) | \ - PIN_MODE_INPUT(GPIOE_PIN5) | \ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_INPUT(GPIOE_PIN8) | \ - PIN_MODE_INPUT(GPIOE_PIN9) | \ - PIN_MODE_INPUT(GPIOE_PIN10) | \ - PIN_MODE_INPUT(GPIOE_PIN11) | \ - PIN_MODE_INPUT(GPIOE_PIN12) | \ - PIN_MODE_INPUT(GPIOE_PIN13) | \ - PIN_MODE_INPUT(GPIOE_PIN14) | \ - PIN_MODE_INPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_INT1) | \ - PIN_OTYPE_PUSHPULL(GPIOE_INT2) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOE_CS_SPI) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_INT1) | \ - PIN_OSPEED_100M(GPIOE_INT2) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_CS_SPI) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_INT1) | \ - PIN_PUPDR_FLOATING(GPIOE_INT2) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOE_CS_SPI) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_INT1) | \ - PIN_ODR_HIGH(GPIOE_INT2) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_CS_SPI) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_HIGH(GPIOE_PIN8) | \ - PIN_ODR_HIGH(GPIOE_PIN9) | \ - PIN_ODR_HIGH(GPIOE_PIN10) | \ - PIN_ODR_HIGH(GPIOE_PIN11) | \ - PIN_ODR_HIGH(GPIOE_PIN12) | \ - PIN_ODR_HIGH(GPIOE_PIN13) | \ - PIN_ODR_HIGH(GPIOE_PIN14) | \ - PIN_ODR_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_INT1, 0) | \ - PIN_AFIO_AF(GPIOE_INT2, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) | \ - PIN_AFIO_AF(GPIOE_CS_SPI, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) | \ - PIN_AFIO_AF(GPIOE_PIN5, 0) | \ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - PIN0 (input floating). - * PF1 - PIN1 (input floating). - * PF2 - PIN2 (input floating). - * PF3 - PIN3 (input floating). - * PF4 - PIN4 (input floating). - * PF5 - PIN5 (input floating). - * PF6 - PIN6 (input floating). - * PF7 - PIN7 (input floating). - * PF8 - PIN8 (input floating). - * PF9 - PIN9 (input floating). - * PF10 - PIN10 (input floating). - * PF11 - PIN11 (input floating). - * PF12 - PIN12 (input floating). - * PF13 - PIN13 (input floating). - * PF14 - PIN14 (input floating). - * PF15 - PIN15 (input floating). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ - PIN_MODE_INPUT(GPIOF_PIN1) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ - PIN_ODR_HIGH(GPIOF_PIN1) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0) | \ - PIN_AFIO_AF(GPIOF_PIN1, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input floating). - * PG1 - PIN1 (input floating). - * PG2 - PIN2 (input floating). - * PG3 - PIN3 (input floating). - * PG4 - PIN4 (input floating). - * PG5 - PIN5 (input floating). - * PG6 - PIN6 (input floating). - * PG7 - PIN7 (input floating). - * PG8 - PIN8 (input floating). - * PG9 - PIN9 (input floating). - * PG10 - PIN10 (input floating). - * PG11 - PIN11 (input floating). - * PG12 - PIN12 (input floating). - * PG13 - PIN13 (input floating). - * PG14 - PIN14 (input floating). - * PG15 - PIN15 (input floating). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_PIN11) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_PIN13) | \ - PIN_OSPEED_100M(GPIOG_PIN14) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - OSC_IN (input floating). - * PH1 - OSC_OUT (input floating). - * PH2 - PIN2 (input floating). - * PH3 - PIN3 (input floating). - * PH4 - PIN4 (input floating). - * PH5 - PIN5 (input floating). - * PH6 - PIN6 (input floating). - * PH7 - PIN7 (input floating). - * PH8 - PIN8 (input floating). - * PH9 - PIN9 (input floating). - * PH10 - PIN10 (input floating). - * PH11 - PIN11 (input floating). - * PH12 - PIN12 (input floating). - * PH13 - PIN13 (input floating). - * PH14 - PIN14 (input floating). - * PH15 - PIN15 (input floating). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ - PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ - PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0) | \ - PIN_AFIO_AF(GPIOH_OSC_OUT, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - -/* - * GPIOI setup: - * - * PI0 - PIN0 (input floating). - * PI1 - PIN1 (input floating). - * PI2 - PIN2 (input floating). - * PI3 - PIN3 (input floating). - * PI4 - PIN4 (input floating). - * PI5 - PIN5 (input floating). - * PI6 - PIN6 (input floating). - * PI7 - PIN7 (input floating). - * PI8 - PIN8 (input floating). - * PI9 - PIN9 (input floating). - * PI10 - PIN10 (input floating). - * PI11 - PIN11 (input floating). - * PI12 - PIN12 (input floating). - * PI13 - PIN13 (input floating). - * PI14 - PIN14 (input floating). - * PI15 - PIN15 (input floating). - */ -#define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_PIN0) | \ - PIN_MODE_INPUT(GPIOI_PIN1) | \ - PIN_MODE_INPUT(GPIOI_PIN2) | \ - PIN_MODE_INPUT(GPIOI_PIN3) | \ - PIN_MODE_INPUT(GPIOI_PIN4) | \ - PIN_MODE_INPUT(GPIOI_PIN5) | \ - PIN_MODE_INPUT(GPIOI_PIN6) | \ - PIN_MODE_INPUT(GPIOI_PIN7) | \ - PIN_MODE_INPUT(GPIOI_PIN8) | \ - PIN_MODE_INPUT(GPIOI_PIN9) | \ - PIN_MODE_INPUT(GPIOI_PIN10) | \ - PIN_MODE_INPUT(GPIOI_PIN11) | \ - PIN_MODE_INPUT(GPIOI_PIN12) | \ - PIN_MODE_INPUT(GPIOI_PIN13) | \ - PIN_MODE_INPUT(GPIOI_PIN14) | \ - PIN_MODE_INPUT(GPIOI_PIN15)) -#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) -#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN15)) -#define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \ - PIN_ODR_HIGH(GPIOI_PIN1) | \ - PIN_ODR_HIGH(GPIOI_PIN2) | \ - PIN_ODR_HIGH(GPIOI_PIN3) | \ - PIN_ODR_HIGH(GPIOI_PIN4) | \ - PIN_ODR_HIGH(GPIOI_PIN5) | \ - PIN_ODR_HIGH(GPIOI_PIN6) | \ - PIN_ODR_HIGH(GPIOI_PIN7) | \ - PIN_ODR_HIGH(GPIOI_PIN8) | \ - PIN_ODR_HIGH(GPIOI_PIN9) | \ - PIN_ODR_HIGH(GPIOI_PIN10) | \ - PIN_ODR_HIGH(GPIOI_PIN11) | \ - PIN_ODR_HIGH(GPIOI_PIN12) | \ - PIN_ODR_HIGH(GPIOI_PIN13) | \ - PIN_ODR_HIGH(GPIOI_PIN14) | \ - PIN_ODR_HIGH(GPIOI_PIN15)) -#define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0) | \ - PIN_AFIO_AF(GPIOI_PIN1, 0) | \ - PIN_AFIO_AF(GPIOI_PIN2, 0) | \ - PIN_AFIO_AF(GPIOI_PIN3, 0) | \ - PIN_AFIO_AF(GPIOI_PIN4, 0) | \ - PIN_AFIO_AF(GPIOI_PIN5, 0) | \ - PIN_AFIO_AF(GPIOI_PIN6, 0) | \ - PIN_AFIO_AF(GPIOI_PIN7, 0)) -#define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0) | \ - PIN_AFIO_AF(GPIOI_PIN9, 0) | \ - PIN_AFIO_AF(GPIOI_PIN10, 0) | \ - PIN_AFIO_AF(GPIOI_PIN11, 0) | \ - PIN_AFIO_AF(GPIOI_PIN12, 0) | \ - PIN_AFIO_AF(GPIOI_PIN13, 0) | \ - PIN_AFIO_AF(GPIOI_PIN14, 0) | \ - PIN_AFIO_AF(GPIOI_PIN15, 0)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f4-template/config/halconf.h b/stm32-chibios-template/chibios-nil-f4-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f4-template/config/mcuconf.h b/stm32-chibios-template/chibios-nil-f4-template/config/mcuconf.h deleted file mode 100755 index 80417b89..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/config/mcuconf.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F4xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F4xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_CLOCK48_REQUIRED TRUE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLM_VALUE 8 -#define STM32_PLLN_VALUE 336 -#define STM32_PLLP_VALUE 2 -#define STM32_PLLQ_VALUE 7 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV4 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_RTCPRE_VALUE 8 -#define STM32_MCO1SEL STM32_MCO1SEL_HSI -#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 -#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK -#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 -#define STM32_I2SSRC STM32_I2SSRC_CKIN -#define STM32_PLLI2SN_VALUE 192 -#define STM32_PLLI2SR_VALUE 5 -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_BKPRAM_ENABLE FALSE - -/* - * ADC driver system settings. - */ -#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 6 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 6 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 FALSE -#define STM32_DAC_USE_DAC1_CH2 FALSE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI22_IRQ_PRIORITY 15 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM6 FALSE -#define STM32_GPT_USE_TIM7 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_USE_TIM9 FALSE -#define STM32_GPT_USE_TIM11 FALSE -#define STM32_GPT_USE_TIM12 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 -#define STM32_GPT_TIM9_IRQ_PRIORITY 7 -#define STM32_GPT_TIM11_IRQ_PRIORITY 7 -#define STM32_GPT_TIM12_IRQ_PRIORITY 7 -#define STM32_GPT_TIM14_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_USE_I2C3 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C3_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_I2C3_DMA_PRIORITY 3 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_USE_TIM9 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 -#define STM32_ICU_TIM9_IRQ_PRIORITY 7 - -/* - * MAC driver system settings. - */ -#define STM32_MAC_TRANSMIT_BUFFERS 2 -#define STM32_MAC_RECEIVE_BUFFERS 4 -#define STM32_MAC_BUFFERS_SIZE 1522 -#define STM32_MAC_PHY_TIMEOUT 100 -#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE -#define STM32_MAC_ETH1_IRQ_PRIORITY 13 -#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_USE_TIM9 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 -#define STM32_PWM_TIM9_IRQ_PRIORITY 7 - -/* - * SDC driver system settings. - */ -#define STM32_SDC_SDIO_DMA_PRIORITY 3 -#define STM32_SDC_SDIO_IRQ_PRIORITY 9 -#define STM32_SDC_WRITE_TIMEOUT_MS 250 -#define STM32_SDC_READ_TIMEOUT_MS 25 -#define STM32_SDC_CLOCK_ACTIVATION_DELAY 10 -#define STM32_SDC_SDIO_UNALIGNED_SUPPORT TRUE -#define STM32_SDC_SDIO_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USE_USART6 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 -#define STM32_SERIAL_USART6_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) -#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) -#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USE_UART4 FALSE -#define STM32_UART_USE_UART5 FALSE -#define STM32_UART_USE_USART6 FALSE -#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_UART4_IRQ_PRIORITY 12 -#define STM32_UART_UART5_IRQ_PRIORITY 12 -#define STM32_UART_USART6_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_UART4_DMA_PRIORITY 0 -#define STM32_UART_UART5_DMA_PRIORITY 0 -#define STM32_UART_USART6_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_OTG1 TRUE -#define STM32_USB_USE_OTG2 FALSE -#define STM32_USB_OTG1_IRQ_PRIORITY 14 -#define STM32_USB_OTG2_IRQ_PRIORITY 14 -#define STM32_USB_OTG1_RX_FIFO_SIZE 512 -#define STM32_USB_OTG2_RX_FIFO_SIZE 1024 -#define STM32_USB_OTG_THREAD_PRIO LOWPRIO -#define STM32_USB_OTG_THREAD_STACK_SIZE 128 -#define STM32_USB_OTGFIFO_FILL_BASEPRI 0 - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-nil-f4-template/config/nilconf.h b/stm32-chibios-template/chibios-nil-f4-template/config/nilconf.h deleted file mode 100644 index 778bab7d..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/config/nilconf.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file nilconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _NILCONF_H_ -#define _NILCONF_H_ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Number of user threads in the application. - * @note This number is not inclusive of the idle thread which is - * Implicitly handled. - */ -#define NIL_CFG_NUM_THREADS 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name System timer settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define NIL_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @note This value together with the @p NIL_CFG_ST_RESOLUTION - * option defines the maximum amount of time allowed for - * timeouts. - */ -#define NIL_CFG_ST_FREQUENCY 50000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define NIL_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define NIL_CFG_USE_EVENTS TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System assertions. - */ -#define NIL_CFG_ENABLE_ASSERTS FALSE - -/** - * @brief Stack check. - */ -#define NIL_CFG_ENABLE_STACK_CHECK FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System initialization hook. - */ -#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_INIT_HOOK() { \ -} -#endif - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define NIL_CFG_THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - */ -#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \ - /* Add custom threads initialization code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define NIL_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define NIL_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief System halt hook. - */ -#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \ -} -#endif - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in nilcore.h). */ -/*===========================================================================*/ - -#endif /* _NILCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-nil-f4-template/main.c b/stm32-chibios-template/chibios-nil-f4-template/main.c deleted file mode 100755 index 3d50ee9a..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/main.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "nil.h" -#include "hal.h" -#include "test.h" - -THD_TABLE_BEGIN - THD_TABLE_ENTRY(waThread1, "Thread1", Thread1, NULL) -THD_TABLE_END -int main(void) { - - halInit(); - chSysInit(); - - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-nil-f4-template/work/test.c b/stm32-chibios-template/chibios-nil-f4-template/work/test.c deleted file mode 100644 index 1c5d8e4c..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/work/test.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "nil.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg) { - - (void)arg; - while (true) { - palSetPad(GPIOD, GPIOD_LED3); /* Orange. */ - chThdSleepMilliseconds(500); - palClearPad(GPIOD, GPIOD_LED3); /* Orange. */ - chThdSleepMilliseconds(500); - } -} - - diff --git a/stm32-chibios-template/chibios-nil-f4-template/work/test.h b/stm32-chibios-template/chibios-nil-f4-template/work/test.h deleted file mode 100644 index b2fc79f8..00000000 --- a/stm32-chibios-template/chibios-nil-f4-template/work/test.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TEST_H -#define TEST_H -extern THD_WORKING_AREA(waThread1, 128); -THD_FUNCTION(Thread1, arg); - -#endif // TEST_H diff --git a/stm32-chibios-template/chibios-rt-f0-template/.idea/chibios-rt-f0-template.iml b/stm32-chibios-template/chibios-rt-f0-template/.idea/chibios-rt-f0-template.iml deleted file mode 100644 index 15cd5e61..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/.idea/chibios-rt-f0-template.iml +++ /dev/null @@ -1,338 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/stm32-chibios-template/chibios-rt-f0-template/.idea/encodings.xml b/stm32-chibios-template/chibios-rt-f0-template/.idea/encodings.xml deleted file mode 100644 index 97626ba4..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/stm32-chibios-template/chibios-rt-f0-template/.idea/misc.xml b/stm32-chibios-template/chibios-rt-f0-template/.idea/misc.xml deleted file mode 100644 index 87a6b246..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/.idea/misc.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/stm32-chibios-template/chibios-rt-f0-template/.idea/modules.xml b/stm32-chibios-template/chibios-rt-f0-template/.idea/modules.xml deleted file mode 100644 index 5e1df87c..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/stm32-chibios-template/chibios-rt-f0-template/.idea/workspace.xml b/stm32-chibios-template/chibios-rt-f0-template/.idea/workspace.xml deleted file mode 100644 index 21ce0a33..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/.idea/workspace.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1454253712955 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/stm32-chibios-template/chibios-rt-f0-template/CMakeLists.txt b/stm32-chibios-template/chibios-rt-f0-template/CMakeLists.txt deleted file mode 100644 index aa42fb63..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F051x8) - -cmake_minimum_required(VERSION 3.4) -project(chibios-rt-f0-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED) - -#FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=FALSE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/chconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-rt-f0-template/board/board.c b/stm32-chibios-template/chibios-rt-f0-template/board/board.c deleted file mode 100755 index 76f4b814..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/board/board.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-rt-f0-template/board/board.h b/stm32-chibios-template/chibios-rt-f0-template/board/board.h deleted file mode 100755 index 28f9e31f..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/board/board.h +++ /dev/null @@ -1,753 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for ST STM32F0-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32F0_DISCOVERY -#define BOARD_NAME "ST STM32F0-Discovery" - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - * NOTE: HSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#define STM32_LSEDRV (3U << 3U) - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 0U -#endif - -#define STM32_HSE_BYPASS - - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_PIN4 4U -#define GPIOA_PIN5 5U -#define GPIOA_PIN6 6U -#define GPIOA_PIN7 7U -#define GPIOA_PIN8 8U -#define GPIOA_PIN9 9U -#define GPIOA_PIN10 10U -#define GPIOA_PIN11 11U -#define GPIOA_PIN12 12U -#define GPIOA_SWDAT 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_PIN3 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_PIN6 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_PIN9 9U -#define GPIOB_PIN10 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_PIN0 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PIN3 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_PIN7 7U -#define GPIOC_LED4 8U -#define GPIOC_LED3 9U -#define GPIOC_PIN10 10U -#define GPIOC_PIN11 11U -#define GPIOC_PIN12 12U -#define GPIOC_PIN13 13U -#define GPIOC_OSC32_IN 14U -#define GPIOC_OSC32_OUT 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_PIN4 4U -#define GPIOD_PIN5 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_PIN12 12U -#define GPIOD_PIN13 13U -#define GPIOD_PIN14 14U -#define GPIOD_PIN15 15U - -#define GPIOF_OSC_IN 0U -#define GPIOF_OSC_OUT 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_10M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_40M(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - BUTTON (input floating). - * PA1 - PIN1 (input pullup). - * PA2 - PIN2 (input pullup). - * PA3 - PIN3 (input pullup). - * PA4 - PIN4 (input pullup). - * PA5 - PIN5 (input pullup). - * PA6 - PIN6 (input pullup). - * PA7 - PIN7 (input pullup). - * PA8 - PIN8 (input pullup). - * PA9 - PIN9 (input pullup). - * PA10 - PIN10 (input pullup). - * PA11 - PIN11 (input pullup). - * PA12 - PIN12 (input pullup). - * PA13 - SWDAT (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - PIN15 (input pullup). - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_PIN5) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_PIN7) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_PIN9) | \ - PIN_MODE_INPUT(GPIOA_PIN10) | \ - PIN_MODE_INPUT(GPIOA_PIN11) | \ - PIN_MODE_INPUT(GPIOA_PIN12) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDAT) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDAT) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_2M(GPIOA_BUTTON) | \ - PIN_OSPEED_2M(GPIOA_PIN1) | \ - PIN_OSPEED_2M(GPIOA_PIN2) | \ - PIN_OSPEED_2M(GPIOA_PIN3) | \ - PIN_OSPEED_2M(GPIOA_PIN4) | \ - PIN_OSPEED_2M(GPIOA_PIN5) | \ - PIN_OSPEED_2M(GPIOA_PIN6) | \ - PIN_OSPEED_2M(GPIOA_PIN7) | \ - PIN_OSPEED_2M(GPIOA_PIN8) | \ - PIN_OSPEED_2M(GPIOA_PIN9) | \ - PIN_OSPEED_2M(GPIOA_PIN10) | \ - PIN_OSPEED_2M(GPIOA_PIN11) | \ - PIN_OSPEED_2M(GPIOA_PIN12) | \ - PIN_OSPEED_40M(GPIOA_SWDAT) | \ - PIN_OSPEED_40M(GPIOA_SWCLK) | \ - PIN_OSPEED_40M(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOA_SWDAT) | \ - PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_PIN5) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_PIN7) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_PIN9) | \ - PIN_ODR_HIGH(GPIOA_PIN10) | \ - PIN_ODR_HIGH(GPIOA_PIN11) | \ - PIN_ODR_HIGH(GPIOA_PIN12) | \ - PIN_ODR_HIGH(GPIOA_SWDAT) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 0) | \ - PIN_AFIO_AF(GPIOA_PIN5, 0) | \ - PIN_AFIO_AF(GPIOA_PIN6, 0) | \ - PIN_AFIO_AF(GPIOA_PIN7, 0)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_PIN9, 0) | \ - PIN_AFIO_AF(GPIOA_PIN10, 0) | \ - PIN_AFIO_AF(GPIOA_PIN11, 0) | \ - PIN_AFIO_AF(GPIOA_PIN12, 0) | \ - PIN_AFIO_AF(GPIOA_SWDAT, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - PIN3 (input pullup). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - PIN6 (input pullup). - * PB7 - PIN7 (input pullup). - * PB8 - PIN8 (input pullup). - * PB9 - PIN9 (input pullup). - * PB10 - PIN10 (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_INPUT(GPIOB_PIN3) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_INPUT(GPIOB_PIN6) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_PIN10) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_2M(GPIOB_PIN0) | \ - PIN_OSPEED_2M(GPIOB_PIN1) | \ - PIN_OSPEED_40M(GPIOB_PIN2) | \ - PIN_OSPEED_40M(GPIOB_PIN3) | \ - PIN_OSPEED_40M(GPIOB_PIN4) | \ - PIN_OSPEED_2M(GPIOB_PIN5) | \ - PIN_OSPEED_2M(GPIOB_PIN6) | \ - PIN_OSPEED_2M(GPIOB_PIN7) | \ - PIN_OSPEED_2M(GPIOB_PIN8) | \ - PIN_OSPEED_2M(GPIOB_PIN9) | \ - PIN_OSPEED_2M(GPIOB_PIN10) | \ - PIN_OSPEED_2M(GPIOB_PIN11) | \ - PIN_OSPEED_2M(GPIOB_PIN12) | \ - PIN_OSPEED_2M(GPIOB_PIN13) | \ - PIN_OSPEED_2M(GPIOB_PIN14) | \ - PIN_OSPEED_2M(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_PIN3) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_PIN10) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN3, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 0) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_PIN10, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - PIN0 (input pullup). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PIN3 (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - PIN7 (input pullup). - * PC8 - LED4 (output pushpull maximum). - * PC9 - LED3 (output pushpull maximum). - * PC10 - PIN10 (input pullup). - * PC11 - PIN11 (input pullup). - * PC12 - PIN12 (input pullup). - * PC13 - PIN13 (input pullup). - * PC14 - OSC32_IN (input floating). - * PC15 - OSC32_OUT (input floating). - */ -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_OUTPUT(GPIOC_LED4) | \ - PIN_MODE_OUTPUT(GPIOC_LED3) | \ - PIN_MODE_INPUT(GPIOC_PIN10) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ - PIN_MODE_INPUT(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_LED3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_2M(GPIOC_PIN0) | \ - PIN_OSPEED_2M(GPIOC_PIN1) | \ - PIN_OSPEED_2M(GPIOC_PIN2) | \ - PIN_OSPEED_2M(GPIOC_PIN3) | \ - PIN_OSPEED_2M(GPIOC_PIN4) | \ - PIN_OSPEED_2M(GPIOC_PIN5) | \ - PIN_OSPEED_2M(GPIOC_PIN6) | \ - PIN_OSPEED_2M(GPIOC_PIN7) | \ - PIN_OSPEED_40M(GPIOC_LED4) | \ - PIN_OSPEED_40M(GPIOC_LED3) | \ - PIN_OSPEED_2M(GPIOC_PIN10) | \ - PIN_OSPEED_2M(GPIOC_PIN11) | \ - PIN_OSPEED_2M(GPIOC_PIN12) | \ - PIN_OSPEED_2M(GPIOC_PIN13) | \ - PIN_OSPEED_40M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_40M(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOC_LED4) | \ - PIN_PUPDR_FLOATING(GPIOC_LED3) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_LOW(GPIOC_LED4) | \ - PIN_ODR_LOW(GPIOC_LED3) | \ - PIN_ODR_HIGH(GPIOC_PIN10) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ - PIN_ODR_HIGH(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED4, 0) | \ - PIN_AFIO_AF(GPIOC_LED3, 0) | \ - PIN_AFIO_AF(GPIOC_PIN10, 0) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_IN, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_OUT, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - PIN4 (input pullup). - * PD5 - PIN5 (input pullup). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD10 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - PIN12 (input pullup). - * PD13 - PIN13 (input pullup). - * PD14 - PIN14 (input pullup). - * PD15 - PIN15 (input pullup). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_PIN4) | \ - PIN_MODE_INPUT(GPIOD_PIN5) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_INPUT(GPIOD_PIN12) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_PIN14) | \ - PIN_MODE_INPUT(GPIOD_PIN15)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_2M(GPIOD_PIN0) | \ - PIN_OSPEED_2M(GPIOD_PIN1) | \ - PIN_OSPEED_2M(GPIOD_PIN2) | \ - PIN_OSPEED_2M(GPIOD_PIN3) | \ - PIN_OSPEED_2M(GPIOD_PIN4) | \ - PIN_OSPEED_2M(GPIOD_PIN5) | \ - PIN_OSPEED_2M(GPIOD_PIN6) | \ - PIN_OSPEED_2M(GPIOD_PIN7) | \ - PIN_OSPEED_2M(GPIOD_PIN8) | \ - PIN_OSPEED_2M(GPIOD_PIN9) | \ - PIN_OSPEED_2M(GPIOD_PIN10) | \ - PIN_OSPEED_2M(GPIOD_PIN11) | \ - PIN_OSPEED_2M(GPIOD_PIN12) | \ - PIN_OSPEED_2M(GPIOD_PIN13) | \ - PIN_OSPEED_2M(GPIOD_PIN14) | \ - PIN_OSPEED_2M(GPIOD_PIN15)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN15)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_PIN4) | \ - PIN_ODR_HIGH(GPIOD_PIN5) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_HIGH(GPIOD_PIN12) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_PIN14) | \ - PIN_ODR_HIGH(GPIOD_PIN15)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN4, 0) | \ - PIN_AFIO_AF(GPIOD_PIN5, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_PIN12, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_PIN14, 0) | \ - PIN_AFIO_AF(GPIOD_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - OSC_IN (input floating). - * PF1 - OSC_OUT (input floating). - * PF2 - PIN2 (input pullup). - * PF3 - PIN3 (input pullup). - * PF4 - PIN4 (input pullup). - * PF5 - PIN5 (input pullup). - * PF6 - PIN6 (input pullup). - * PF7 - PIN7 (input pullup). - * PF8 - PIN8 (input pullup). - * PF9 - PIN9 (input pullup). - * PF10 - PIN10 (input pullup). - * PF11 - PIN11 (input pullup). - * PF12 - PIN12 (input pullup). - * PF13 - PIN13 (input pullup). - * PF14 - PIN14 (input pullup). - * PF15 - PIN15 (input pullup). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ - PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_2M(GPIOF_OSC_IN) | \ - PIN_OSPEED_2M(GPIOF_OSC_OUT) | \ - PIN_OSPEED_2M(GPIOF_PIN2) | \ - PIN_OSPEED_2M(GPIOF_PIN3) | \ - PIN_OSPEED_2M(GPIOF_PIN4) | \ - PIN_OSPEED_2M(GPIOF_PIN5) | \ - PIN_OSPEED_2M(GPIOF_PIN6) | \ - PIN_OSPEED_2M(GPIOF_PIN7) | \ - PIN_OSPEED_2M(GPIOF_PIN8) | \ - PIN_OSPEED_2M(GPIOF_PIN9) | \ - PIN_OSPEED_2M(GPIOF_PIN10) | \ - PIN_OSPEED_2M(GPIOF_PIN11) | \ - PIN_OSPEED_2M(GPIOF_PIN12) | \ - PIN_OSPEED_2M(GPIOF_PIN13) | \ - PIN_OSPEED_2M(GPIOF_PIN14) | \ - PIN_OSPEED_2M(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ - PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0) | \ - PIN_AFIO_AF(GPIOF_OSC_OUT, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f0-template/config/chconf.h b/stm32-chibios-template/chibios-rt-f0-template/config/chconf.h deleted file mode 100755 index d9bf8649..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/config/chconf.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 10000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_QUEUES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_TRACE FALSE - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f0-template/config/halconf.h b/stm32-chibios-template/chibios-rt-f0-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f0-template/config/mcuconf.h b/stm32-chibios-template/chibios-rt-f0-template/config/mcuconf.h deleted file mode 100755 index e5120374..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/config/mcuconf.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F0xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 3...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F0xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_HSI_ENABLED TRUE -#define STM32_HSI14_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED FALSE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 -#define STM32_PREDIV_VALUE 1 -#define STM32_PLLMUL_VALUE 12 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE STM32_PPRE_DIV1 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_ADCSW STM32_ADCSW_HSI14 -#define STM32_CECSW STM32_CECSW_HSI -#define STM32_I2C1SW STM32_I2C1SW_HSI -#define STM32_USART1SW STM32_USART1SW_PCLK -#define STM32_RTCSEL STM32_RTCSEL_LSI - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 2 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 2 -#define STM32_GPT_TIM2_IRQ_PRIORITY 2 -#define STM32_GPT_TIM3_IRQ_PRIORITY 2 -#define STM32_GPT_TIM14_IRQ_PRIORITY 2 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 3 -#define STM32_I2C_I2C2_IRQ_PRIORITY 3 -#define STM32_I2C_USE_DMA TRUE -#define STM32_I2C_I2C1_DMA_PRIORITY 1 -#define STM32_I2C_I2C2_DMA_PRIORITY 1 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 3 -#define STM32_ICU_TIM2_IRQ_PRIORITY 3 -#define STM32_ICU_TIM3_IRQ_PRIORITY 3 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 3 -#define STM32_PWM_TIM2_IRQ_PRIORITY 3 -#define STM32_PWM_TIM3_IRQ_PRIORITY 3 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USART1_PRIORITY 3 -#define STM32_SERIAL_USART2_PRIORITY 3 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 2 -#define STM32_SPI_SPI2_IRQ_PRIORITY 2 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 2 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 3 -#define STM32_UART_USART2_IRQ_PRIORITY 3 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f0-template/main.c b/stm32-chibios-template/chibios-rt-f0-template/main.c deleted file mode 100755 index 2089721f..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/main.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "ch.h" -#include "hal.h" -#include "test.h" - -int main(void) { - - halInit(); - chSysInit(); - - testInit(); - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-rt-f0-template/work/test.c b/stm32-chibios-template/chibios-rt-f0-template/work/test.c deleted file mode 100644 index ccd1732d..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/work/test.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "ch.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -static THD_WORKING_AREA(waThread1, 128); -static THD_FUNCTION(Thread1, arg) { - - (void)arg; - chRegSetThreadName("blinker"); - while (true) { - palSetPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - palClearPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - } -} - -void testInit(void) -{ - /* - * Creates the example thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); -} diff --git a/stm32-chibios-template/chibios-rt-f0-template/work/test.h b/stm32-chibios-template/chibios-rt-f0-template/work/test.h deleted file mode 100644 index a7b971cc..00000000 --- a/stm32-chibios-template/chibios-rt-f0-template/work/test.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TEST_H -#define TEST_H -void testInit(void); -#endif // TEST_H diff --git a/stm32-chibios-template/chibios-rt-f1-template/CMakeLists.txt b/stm32-chibios-template/chibios-rt-f1-template/CMakeLists.txt deleted file mode 100644 index fee9c3c7..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F100x6) - -cmake_minimum_required(VERSION 3.4) -project(chibios-rt-f1-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc dac can dac ext gpt i2c i2s icu mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED) - -#FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=FALSE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/chconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-rt-f1-template/board/board.c b/stm32-chibios-template/chibios-rt-f1-template/board/board.c deleted file mode 100755 index 2809c9d1..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/board/board.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -#if HAL_USE_PAL || defined(__DOXYGEN__) -const PALConfig pal_default_config = -{ - {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, - {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, - {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, - {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, - {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, -}; -#endif - -/* - * Early initialization code. - * This initialization must be performed just after stack setup and before - * any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -/* - * Board-specific initialization code. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-rt-f1-template/board/board.h b/stm32-chibios-template/chibios-rt-f1-template/board/board.h deleted file mode 100755 index 2edddd6d..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/board/board.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for STMicroelectronics STM32VL-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32VL_DISCOVERY -#define BOARD_NAME "ST STM32VL-Discovery" - -/* - * Board frequencies. - */ -#define STM32_LSECLK 32768 -#define STM32_HSECLK 8000000 - -/* - * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. - */ -#define STM32F10X_MD_VL - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0 -#define GPIOA_SPI1NSS 4 - -#define GPIOB_SPI2NSS 12 - -#define GPIOC_LED4 8 -#define GPIOC_LED3 9 - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -/* - * Port A setup. - * Everything input with pull-up except: - * PA0 - Normal input (BUTTON). - * PA2 - Alternate output (USART2 TX). - * PA3 - Normal input (USART2 RX). - * PA4 - Push pull output (SPI1 NSS), initially high state. - * PA5 - Alternate output (SPI1 SCK). - * PA6 - Normal input (SPI1 MISO). - * PA7 - Alternate output (SPI1 MOSI). - * PA9 - Alternate output (USART1 TX). - * PA10 - Normal input (USART1 RX). - */ -#define VAL_GPIOACRL 0xB4B34B84 /* PA7...PA0 */ -#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ -#define VAL_GPIOAODR 0xFFFFFFFF - -/* - * Port B setup. - * Everything input with pull-up except: - * PB12 - Push pull output (SPI2 NSS), initially high state. - * PB13 - Alternate output (SPI2 SCK). - * PB14 - Normal input (SPI2 MISO). - * PB15 - Alternate output (SPI2 MOSI). - */ -#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ -#define VAL_GPIOBCRH 0xB4B38888 /* PB15...PB8 */ -#define VAL_GPIOBODR 0xFFFFFFFF - -/* - * Port C setup. - * Everything input with pull-up except: - * PC8 - Push-pull output (LED4), initially low state. - * PC9 - Push-pull output (LED3), initially low state. - */ -#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ -#define VAL_GPIOCCRH 0x88888833 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFCFF - -/* - * Port D setup. - * Everything input with pull-up except: - * PD0 - Normal input (XTAL). - * PD1 - Normal input (XTAL). - */ -#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ -#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ -#define VAL_GPIODODR 0xFFFFFFFF - -/* - * Port E setup. - * Everything input with pull-up except: - */ -#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ -#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ -#define VAL_GPIOEODR 0xFFFFFFFF - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f1-template/config/chconf.h b/stm32-chibios-template/chibios-rt-f1-template/config/chconf.h deleted file mode 100755 index 228ee022..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/config/chconf.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 16 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 1000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_QUEUES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_TRACE FALSE - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f1-template/config/halconf.h b/stm32-chibios-template/chibios-rt-f1-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f1-template/config/mcuconf.h b/stm32-chibios-template/chibios-rt-f1-template/config/mcuconf.h deleted file mode 100755 index 0b9399f9..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/config/mcuconf.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -#define STM32F100_MCUCONF - -/* - * STM32F103 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED FALSE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1 -#define STM32_PLLMUL_VALUE 3 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV1 -#define STM32_PPRE2 STM32_PPRE2_DIV1 -#define STM32_ADCPRE STM32_ADCPRE_DIV2 -#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK -#define STM32_RTCSEL STM32_RTCSEL_HSEDIV -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 6 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 TRUE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * RTC driver system settings. - */ -#define STM32_RTC_IRQ_PRIORITY 15 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 TRUE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 TRUE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f1-template/main.c b/stm32-chibios-template/chibios-rt-f1-template/main.c deleted file mode 100755 index 2089721f..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/main.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "ch.h" -#include "hal.h" -#include "test.h" - -int main(void) { - - halInit(); - chSysInit(); - - testInit(); - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-rt-f1-template/work/test.c b/stm32-chibios-template/chibios-rt-f1-template/work/test.c deleted file mode 100644 index ccd1732d..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/work/test.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "ch.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -static THD_WORKING_AREA(waThread1, 128); -static THD_FUNCTION(Thread1, arg) { - - (void)arg; - chRegSetThreadName("blinker"); - while (true) { - palSetPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - palClearPad(GPIOC, GPIOC_LED4); - chThdSleepMilliseconds(500); - } -} - -void testInit(void) -{ - /* - * Creates the example thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); -} diff --git a/stm32-chibios-template/chibios-rt-f1-template/work/test.h b/stm32-chibios-template/chibios-rt-f1-template/work/test.h deleted file mode 100644 index a7b971cc..00000000 --- a/stm32-chibios-template/chibios-rt-f1-template/work/test.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TEST_H -#define TEST_H -void testInit(void); -#endif // TEST_H diff --git a/stm32-chibios-template/chibios-rt-f4-template/CMakeLists.txt b/stm32-chibios-template/chibios-rt-f4-template/CMakeLists.txt deleted file mode 100644 index d8254887..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# define chip used in this project, this set must define before project definition -# for this project dont use cmake commandline option -DSTM32_CHIP= -set(STM32_CHIP STM32F407xG) - -cmake_minimum_required(VERSION 3.4) -project(chibios-rt-f4-template) - -ENABLE_LANGUAGE(ASM) - -# test build all available ChibiOS COMPONENTS for F4 chip -FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED) - -#FIND_PACKAGE(ChibiOS COMPONENTS rt hal pal REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} - config - board - work -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=TRUE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - - -set(SOURCE_FILES main.c board/board.c board/board.h config/mcuconf.h config/halconf.h config/chconf.h work/test.c work/test.h ) - -add_executable(${CMAKE_PROJECT_NAME}.elf ${SOURCE_FILES} ${ChibiOS_SOURCES}) - -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}.elf) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - diff --git a/stm32-chibios-template/chibios-rt-f4-template/board/board.c b/stm32-chibios-template/chibios-rt-f4-template/board/board.c deleted file mode 100755 index 692cf99b..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/board/board.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -#if HAL_USE_PAL || defined(__DOXYGEN__) -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -const PALConfig pal_default_config = { -#if STM32_HAS_GPIOA - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, -#endif -#if STM32_HAS_GPIOB - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, -#endif -#if STM32_HAS_GPIOC - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, -#endif -#if STM32_HAS_GPIOD - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, -#endif -#if STM32_HAS_GPIOE - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, -#endif -#if STM32_HAS_GPIOF - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, -#endif -#if STM32_HAS_GPIOG - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, -#endif -#if STM32_HAS_GPIOH - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, -#endif -#if STM32_HAS_GPIOI - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -#endif -}; -#endif - -/** - * @brief Early initialization code. - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -#if HAL_USE_SDC || defined(__DOXYGEN__) -/** - * @brief SDC card detection. - */ -bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief SDC card write protection detection. - */ -bool sdc_lld_is_write_protected(SDCDriver *sdcp) { - - (void)sdcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif /* HAL_USE_SDC */ - -#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) -/** - * @brief MMC_SPI card detection. - */ -bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return true; -} - -/** - * @brief MMC_SPI card write protection detection. - */ -bool mmc_lld_is_write_protected(MMCDriver *mmcp) { - - (void)mmcp; - /* TODO: Fill the implementation.*/ - return false; -} -#endif - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { -} diff --git a/stm32-chibios-template/chibios-rt-f4-template/board/board.h b/stm32-chibios-template/chibios-rt-f4-template/board/board.h deleted file mode 100755 index 32c22d45..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/board/board.h +++ /dev/null @@ -1,1296 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for STMicroelectronics STM32F4-Discovery board. - */ - -/* - * Board identifier. - */ -#define BOARD_ST_STM32F4_DISCOVERY -#define BOARD_NAME "STMicroelectronics STM32F4-Discovery" - - -/* - * Board oscillators-related settings. - * NOTE: LSE not fitted. - */ -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 0U -#endif - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000U -#endif - -/* - * Board voltages. - * Required for performance limits calculation. - */ -#define STM32_VDD 300U - -/* - * MCU type as defined in the ST header. - */ - - -/* - * IO pins assignments. - */ -#define GPIOA_BUTTON 0U -#define GPIOA_PIN1 1U -#define GPIOA_PIN2 2U -#define GPIOA_PIN3 3U -#define GPIOA_LRCK 4U -#define GPIOA_SPC 5U -#define GPIOA_SDO 6U -#define GPIOA_SDI 7U -#define GPIOA_PIN8 8U -#define GPIOA_VBUS_FS 9U -#define GPIOA_OTG_FS_ID 10U -#define GPIOA_OTG_FS_DM 11U -#define GPIOA_OTG_FS_DP 12U -#define GPIOA_SWDIO 13U -#define GPIOA_SWCLK 14U -#define GPIOA_PIN15 15U - -#define GPIOB_PIN0 0U -#define GPIOB_PIN1 1U -#define GPIOB_PIN2 2U -#define GPIOB_SWO 3U -#define GPIOB_PIN4 4U -#define GPIOB_PIN5 5U -#define GPIOB_SCL 6U -#define GPIOB_PIN7 7U -#define GPIOB_PIN8 8U -#define GPIOB_SDA 9U -#define GPIOB_CLK_IN 10U -#define GPIOB_PIN11 11U -#define GPIOB_PIN12 12U -#define GPIOB_PIN13 13U -#define GPIOB_PIN14 14U -#define GPIOB_PIN15 15U - -#define GPIOC_OTG_FS_POWER_ON 0U -#define GPIOC_PIN1 1U -#define GPIOC_PIN2 2U -#define GPIOC_PDM_OUT 3U -#define GPIOC_PIN4 4U -#define GPIOC_PIN5 5U -#define GPIOC_PIN6 6U -#define GPIOC_MCLK 7U -#define GPIOC_PIN8 8U -#define GPIOC_PIN9 9U -#define GPIOC_SCLK 10U -#define GPIOC_PIN11 11U -#define GPIOC_SDIN 12U -#define GPIOC_PIN13 13U -#define GPIOC_PIN14 14U -#define GPIOC_PIN15 15U - -#define GPIOD_PIN0 0U -#define GPIOD_PIN1 1U -#define GPIOD_PIN2 2U -#define GPIOD_PIN3 3U -#define GPIOD_RESET 4U -#define GPIOD_OVER_CURRENT 5U -#define GPIOD_PIN6 6U -#define GPIOD_PIN7 7U -#define GPIOD_PIN8 8U -#define GPIOD_PIN9 9U -#define GPIOD_PIN10 10U -#define GPIOD_PIN11 11U -#define GPIOD_LED4 12U -#define GPIOD_LED3 13U -#define GPIOD_LED5 14U -#define GPIOD_LED6 15U - -#define GPIOE_INT1 0U -#define GPIOE_INT2 1U -#define GPIOE_PIN2 2U -#define GPIOE_CS_SPI 3U -#define GPIOE_PIN4 4U -#define GPIOE_PIN5 5U -#define GPIOE_PIN6 6U -#define GPIOE_PIN7 7U -#define GPIOE_PIN8 8U -#define GPIOE_PIN9 9U -#define GPIOE_PIN10 10U -#define GPIOE_PIN11 11U -#define GPIOE_PIN12 12U -#define GPIOE_PIN13 13U -#define GPIOE_PIN14 14U -#define GPIOE_PIN15 15U - -#define GPIOF_PIN0 0U -#define GPIOF_PIN1 1U -#define GPIOF_PIN2 2U -#define GPIOF_PIN3 3U -#define GPIOF_PIN4 4U -#define GPIOF_PIN5 5U -#define GPIOF_PIN6 6U -#define GPIOF_PIN7 7U -#define GPIOF_PIN8 8U -#define GPIOF_PIN9 9U -#define GPIOF_PIN10 10U -#define GPIOF_PIN11 11U -#define GPIOF_PIN12 12U -#define GPIOF_PIN13 13U -#define GPIOF_PIN14 14U -#define GPIOF_PIN15 15U - -#define GPIOG_PIN0 0U -#define GPIOG_PIN1 1U -#define GPIOG_PIN2 2U -#define GPIOG_PIN3 3U -#define GPIOG_PIN4 4U -#define GPIOG_PIN5 5U -#define GPIOG_PIN6 6U -#define GPIOG_PIN7 7U -#define GPIOG_PIN8 8U -#define GPIOG_PIN9 9U -#define GPIOG_PIN10 10U -#define GPIOG_PIN11 11U -#define GPIOG_PIN12 12U -#define GPIOG_PIN13 13U -#define GPIOG_PIN14 14U -#define GPIOG_PIN15 15U - -#define GPIOH_OSC_IN 0U -#define GPIOH_OSC_OUT 1U -#define GPIOH_PIN2 2U -#define GPIOH_PIN3 3U -#define GPIOH_PIN4 4U -#define GPIOH_PIN5 5U -#define GPIOH_PIN6 6U -#define GPIOH_PIN7 7U -#define GPIOH_PIN8 8U -#define GPIOH_PIN9 9U -#define GPIOH_PIN10 10U -#define GPIOH_PIN11 11U -#define GPIOH_PIN12 12U -#define GPIOH_PIN13 13U -#define GPIOH_PIN14 14U -#define GPIOH_PIN15 15U - -#define GPIOI_PIN0 0U -#define GPIOI_PIN1 1U -#define GPIOI_PIN2 2U -#define GPIOI_PIN3 3U -#define GPIOI_PIN4 4U -#define GPIOI_PIN5 5U -#define GPIOI_PIN6 6U -#define GPIOI_PIN7 7U -#define GPIOI_PIN8 8U -#define GPIOI_PIN9 9U -#define GPIOI_PIN10 10U -#define GPIOI_PIN11 11U -#define GPIOI_PIN12 12U -#define GPIOI_PIN13 13U -#define GPIOI_PIN14 14U -#define GPIOI_PIN15 15U - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * Please refer to the STM32 Reference Manual for details. - */ -#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2U)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2U)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2U)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2U)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) -#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) - -/* - * GPIOA setup: - * - * PA0 - BUTTON (input floating). - * PA1 - PIN1 (input pullup). - * PA2 - PIN2 (input pullup). - * PA3 - PIN3 (input pullup). - * PA4 - LRCK (alternate 6). - * PA5 - SPC (alternate 5). - * PA6 - SDO (alternate 5). - * PA7 - SDI (alternate 5). - * PA8 - PIN8 (input pullup). - * PA9 - VBUS_FS (input floating). - * PA10 - OTG_FS_ID (alternate 10). - * PA11 - OTG_FS_DM (alternate 10). - * PA12 - OTG_FS_DP (alternate 10). - * PA13 - SWDIO (alternate 0). - * PA14 - SWCLK (alternate 0). - * PA15 - PIN15 (input pullup). - */ -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_PIN2) | \ - PIN_MODE_INPUT(GPIOA_PIN3) | \ - PIN_MODE_ALTERNATE(GPIOA_LRCK) | \ - PIN_MODE_ALTERNATE(GPIOA_SPC) | \ - PIN_MODE_ALTERNATE(GPIOA_SDO) | \ - PIN_MODE_ALTERNATE(GPIOA_SDI) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_VBUS_FS) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_ID) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) | \ - PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ - PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ - PIN_MODE_INPUT(GPIOA_PIN15)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOA_LRCK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SPC) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SDO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SDI) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_VBUS_FS) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_ID) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_BUTTON) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_100M(GPIOA_PIN2) | \ - PIN_OSPEED_100M(GPIOA_PIN3) | \ - PIN_OSPEED_100M(GPIOA_LRCK) | \ - PIN_OSPEED_50M(GPIOA_SPC) | \ - PIN_OSPEED_50M(GPIOA_SDO) | \ - PIN_OSPEED_50M(GPIOA_SDI) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_VBUS_FS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_SWDIO) | \ - PIN_OSPEED_100M(GPIOA_SWCLK) | \ - PIN_OSPEED_100M(GPIOA_PIN15)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOA_LRCK) | \ - PIN_PUPDR_FLOATING(GPIOA_SPC) | \ - PIN_PUPDR_FLOATING(GPIOA_SDO) | \ - PIN_PUPDR_FLOATING(GPIOA_SDI) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOA_VBUS_FS) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_ID) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \ - PIN_PUPDR_FLOATING(GPIOA_SWDIO) | \ - PIN_PUPDR_FLOATING(GPIOA_SWCLK) | \ - PIN_PUPDR_PULLUP(GPIOA_PIN15)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_PIN2) | \ - PIN_ODR_HIGH(GPIOA_PIN3) | \ - PIN_ODR_HIGH(GPIOA_LRCK) | \ - PIN_ODR_HIGH(GPIOA_SPC) | \ - PIN_ODR_HIGH(GPIOA_SDO) | \ - PIN_ODR_HIGH(GPIOA_SDI) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_VBUS_FS) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_ID) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \ - PIN_ODR_HIGH(GPIOA_SWDIO) | \ - PIN_ODR_HIGH(GPIOA_SWCLK) | \ - PIN_ODR_HIGH(GPIOA_PIN15)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_PIN2, 0) | \ - PIN_AFIO_AF(GPIOA_PIN3, 0) | \ - PIN_AFIO_AF(GPIOA_LRCK, 6) | \ - PIN_AFIO_AF(GPIOA_SPC, 5) | \ - PIN_AFIO_AF(GPIOA_SDO, 5) | \ - PIN_AFIO_AF(GPIOA_SDI, 5)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_VBUS_FS, 0) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_ID, 10) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10) | \ - PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ - PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN15, 0)) - -/* - * GPIOB setup: - * - * PB0 - PIN0 (input pullup). - * PB1 - PIN1 (input pullup). - * PB2 - PIN2 (input pullup). - * PB3 - SWO (alternate 0). - * PB4 - PIN4 (input pullup). - * PB5 - PIN5 (input pullup). - * PB6 - SCL (alternate 4). - * PB7 - PIN7 (input pullup). - * PB8 - PIN8 (input pullup). - * PB9 - SDA (alternate 4). - * PB10 - CLK_IN (input pullup). - * PB11 - PIN11 (input pullup). - * PB12 - PIN12 (input pullup). - * PB13 - PIN13 (input pullup). - * PB14 - PIN14 (input pullup). - * PB15 - PIN15 (input pullup). - */ -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ - PIN_MODE_INPUT(GPIOB_PIN1) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_SWO) | \ - PIN_MODE_INPUT(GPIOB_PIN4) | \ - PIN_MODE_INPUT(GPIOB_PIN5) | \ - PIN_MODE_ALTERNATE(GPIOB_SCL) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_ALTERNATE(GPIOB_SDA) | \ - PIN_MODE_INPUT(GPIOB_CLK_IN) | \ - PIN_MODE_INPUT(GPIOB_PIN11) | \ - PIN_MODE_INPUT(GPIOB_PIN12) | \ - PIN_MODE_INPUT(GPIOB_PIN13) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_SCL) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_OPENDRAIN(GPIOB_SDA) | \ - PIN_OTYPE_PUSHPULL(GPIOB_CLK_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_PIN0) | \ - PIN_OSPEED_100M(GPIOB_PIN1) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_SWO) | \ - PIN_OSPEED_100M(GPIOB_PIN4) | \ - PIN_OSPEED_100M(GPIOB_PIN5) | \ - PIN_OSPEED_100M(GPIOB_SCL) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_SDA) | \ - PIN_OSPEED_100M(GPIOB_CLK_IN) | \ - PIN_OSPEED_100M(GPIOB_PIN11) | \ - PIN_OSPEED_100M(GPIOB_PIN12) | \ - PIN_OSPEED_100M(GPIOB_PIN13) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_SWO) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOB_SCL) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOB_SDA) | \ - PIN_PUPDR_PULLUP(GPIOB_CLK_IN) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ - PIN_ODR_HIGH(GPIOB_PIN1) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_SWO) | \ - PIN_ODR_HIGH(GPIOB_PIN4) | \ - PIN_ODR_HIGH(GPIOB_PIN5) | \ - PIN_ODR_HIGH(GPIOB_SCL) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_SDA) | \ - PIN_ODR_HIGH(GPIOB_CLK_IN) | \ - PIN_ODR_HIGH(GPIOB_PIN11) | \ - PIN_ODR_HIGH(GPIOB_PIN12) | \ - PIN_ODR_HIGH(GPIOB_PIN13) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ - PIN_AFIO_AF(GPIOB_PIN1, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_SWO, 0) | \ - PIN_AFIO_AF(GPIOB_PIN4, 0) | \ - PIN_AFIO_AF(GPIOB_PIN5, 0) | \ - PIN_AFIO_AF(GPIOB_SCL, 4) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_SDA, 4) | \ - PIN_AFIO_AF(GPIOB_CLK_IN, 0) | \ - PIN_AFIO_AF(GPIOB_PIN11, 0) | \ - PIN_AFIO_AF(GPIOB_PIN12, 0) | \ - PIN_AFIO_AF(GPIOB_PIN13, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * GPIOC setup: - * - * PC0 - OTG_FS_POWER_ON (output pushpull maximum). - * PC1 - PIN1 (input pullup). - * PC2 - PIN2 (input pullup). - * PC3 - PDM_OUT (input pullup). - * PC4 - PIN4 (input pullup). - * PC5 - PIN5 (input pullup). - * PC6 - PIN6 (input pullup). - * PC7 - MCLK (alternate 6). - * PC8 - PIN8 (input pullup). - * PC9 - PIN9 (input pullup). - * PC10 - SCLK (alternate 6). - * PC11 - PIN11 (input pullup). - * PC12 - SDIN (alternate 6). - * PC13 - PIN13 (input pullup). - * PC14 - PIN14 (input pullup). - * PC15 - PIN15 (input pullup). - */ -#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_OTG_FS_POWER_ON) |\ - PIN_MODE_INPUT(GPIOC_PIN1) | \ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PDM_OUT) | \ - PIN_MODE_INPUT(GPIOC_PIN4) | \ - PIN_MODE_INPUT(GPIOC_PIN5) | \ - PIN_MODE_INPUT(GPIOC_PIN6) | \ - PIN_MODE_ALTERNATE(GPIOC_MCLK) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_ALTERNATE(GPIOC_SCLK) | \ - PIN_MODE_INPUT(GPIOC_PIN11) | \ - PIN_MODE_ALTERNATE(GPIOC_SDIN) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_PIN14) | \ - PIN_MODE_INPUT(GPIOC_PIN15)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PDM_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOC_MCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_SCLK) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOC_SDIN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OSPEED_100M(GPIOC_PIN1) | \ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PDM_OUT) | \ - PIN_OSPEED_100M(GPIOC_PIN4) | \ - PIN_OSPEED_100M(GPIOC_PIN5) | \ - PIN_OSPEED_100M(GPIOC_PIN6) | \ - PIN_OSPEED_100M(GPIOC_MCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_SCLK) | \ - PIN_OSPEED_100M(GPIOC_PIN11) | \ - PIN_OSPEED_100M(GPIOC_SDIN) | \ - PIN_OSPEED_100M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_PIN14) | \ - PIN_OSPEED_100M(GPIOC_PIN15)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\ - PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOC_PDM_OUT) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOC_MCLK) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOC_SCLK) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOC_SDIN) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN14) | \ - PIN_PUPDR_PULLUP(GPIOC_PIN15)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_OTG_FS_POWER_ON) | \ - PIN_ODR_HIGH(GPIOC_PIN1) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PDM_OUT) | \ - PIN_ODR_HIGH(GPIOC_PIN4) | \ - PIN_ODR_HIGH(GPIOC_PIN5) | \ - PIN_ODR_HIGH(GPIOC_PIN6) | \ - PIN_ODR_HIGH(GPIOC_MCLK) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_SCLK) | \ - PIN_ODR_HIGH(GPIOC_PIN11) | \ - PIN_ODR_HIGH(GPIOC_SDIN) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_PIN14) | \ - PIN_ODR_HIGH(GPIOC_PIN15)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_OTG_FS_POWER_ON, 0) |\ - PIN_AFIO_AF(GPIOC_PIN1, 0) | \ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PDM_OUT, 0) | \ - PIN_AFIO_AF(GPIOC_PIN4, 0) | \ - PIN_AFIO_AF(GPIOC_PIN5, 0) | \ - PIN_AFIO_AF(GPIOC_PIN6, 0) | \ - PIN_AFIO_AF(GPIOC_MCLK, 6)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_SCLK, 6) | \ - PIN_AFIO_AF(GPIOC_PIN11, 0) | \ - PIN_AFIO_AF(GPIOC_SDIN, 6) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_PIN14, 0) | \ - PIN_AFIO_AF(GPIOC_PIN15, 0)) - -/* - * GPIOD setup: - * - * PD0 - PIN0 (input pullup). - * PD1 - PIN1 (input pullup). - * PD2 - PIN2 (input pullup). - * PD3 - PIN3 (input pullup). - * PD4 - RESET (output pushpull maximum). - * PD5 - OVER_CURRENT (input floating). - * PD6 - PIN6 (input pullup). - * PD7 - PIN7 (input pullup). - * PD8 - PIN8 (input pullup). - * PD9 - PIN9 (input pullup). - * PD10 - PIN10 (input pullup). - * PD11 - PIN11 (input pullup). - * PD12 - LED4 (output pushpull maximum). - * PD13 - LED3 (output pushpull maximum). - * PD14 - LED5 (output pushpull maximum). - * PD15 - LED6 (output pushpull maximum). - */ -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ - PIN_MODE_INPUT(GPIOD_PIN1) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_OUTPUT(GPIOD_RESET) | \ - PIN_MODE_INPUT(GPIOD_OVER_CURRENT) | \ - PIN_MODE_INPUT(GPIOD_PIN6) | \ - PIN_MODE_INPUT(GPIOD_PIN7) | \ - PIN_MODE_INPUT(GPIOD_PIN8) | \ - PIN_MODE_INPUT(GPIOD_PIN9) | \ - PIN_MODE_INPUT(GPIOD_PIN10) | \ - PIN_MODE_INPUT(GPIOD_PIN11) | \ - PIN_MODE_OUTPUT(GPIOD_LED4) | \ - PIN_MODE_OUTPUT(GPIOD_LED3) | \ - PIN_MODE_OUTPUT(GPIOD_LED5) | \ - PIN_MODE_OUTPUT(GPIOD_LED6)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_RESET) | \ - PIN_OTYPE_PUSHPULL(GPIOD_OVER_CURRENT) |\ - PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED4) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED5) | \ - PIN_OTYPE_PUSHPULL(GPIOD_LED6)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_PIN0) | \ - PIN_OSPEED_100M(GPIOD_PIN1) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_RESET) | \ - PIN_OSPEED_100M(GPIOD_OVER_CURRENT) | \ - PIN_OSPEED_100M(GPIOD_PIN6) | \ - PIN_OSPEED_100M(GPIOD_PIN7) | \ - PIN_OSPEED_100M(GPIOD_PIN8) | \ - PIN_OSPEED_100M(GPIOD_PIN9) | \ - PIN_OSPEED_100M(GPIOD_PIN10) | \ - PIN_OSPEED_100M(GPIOD_PIN11) | \ - PIN_OSPEED_100M(GPIOD_LED4) | \ - PIN_OSPEED_100M(GPIOD_LED3) | \ - PIN_OSPEED_100M(GPIOD_LED5) | \ - PIN_OSPEED_100M(GPIOD_LED6)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOD_RESET) | \ - PIN_PUPDR_FLOATING(GPIOD_OVER_CURRENT) |\ - PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ - PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOD_LED4) | \ - PIN_PUPDR_FLOATING(GPIOD_LED3) | \ - PIN_PUPDR_FLOATING(GPIOD_LED5) | \ - PIN_PUPDR_FLOATING(GPIOD_LED6)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ - PIN_ODR_HIGH(GPIOD_PIN1) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_RESET) | \ - PIN_ODR_HIGH(GPIOD_OVER_CURRENT) | \ - PIN_ODR_HIGH(GPIOD_PIN6) | \ - PIN_ODR_HIGH(GPIOD_PIN7) | \ - PIN_ODR_HIGH(GPIOD_PIN8) | \ - PIN_ODR_HIGH(GPIOD_PIN9) | \ - PIN_ODR_HIGH(GPIOD_PIN10) | \ - PIN_ODR_HIGH(GPIOD_PIN11) | \ - PIN_ODR_LOW(GPIOD_LED4) | \ - PIN_ODR_LOW(GPIOD_LED3) | \ - PIN_ODR_LOW(GPIOD_LED5) | \ - PIN_ODR_LOW(GPIOD_LED6)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ - PIN_AFIO_AF(GPIOD_PIN1, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_RESET, 0) | \ - PIN_AFIO_AF(GPIOD_OVER_CURRENT, 0) | \ - PIN_AFIO_AF(GPIOD_PIN6, 0) | \ - PIN_AFIO_AF(GPIOD_PIN7, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ - PIN_AFIO_AF(GPIOD_PIN9, 0) | \ - PIN_AFIO_AF(GPIOD_PIN10, 0) | \ - PIN_AFIO_AF(GPIOD_PIN11, 0) | \ - PIN_AFIO_AF(GPIOD_LED4, 0) | \ - PIN_AFIO_AF(GPIOD_LED3, 0) | \ - PIN_AFIO_AF(GPIOD_LED5, 0) | \ - PIN_AFIO_AF(GPIOD_LED6, 0)) - -/* - * GPIOE setup: - * - * PE0 - INT1 (input floating). - * PE1 - INT2 (input floating). - * PE2 - PIN2 (input floating). - * PE3 - CS_SPI (output pushpull maximum). - * PE4 - PIN4 (input floating). - * PE5 - PIN5 (input floating). - * PE6 - PIN6 (input floating). - * PE7 - PIN7 (input floating). - * PE8 - PIN8 (input floating). - * PE9 - PIN9 (input floating). - * PE10 - PIN10 (input floating). - * PE11 - PIN11 (input floating). - * PE12 - PIN12 (input floating). - * PE13 - PIN13 (input floating). - * PE14 - PIN14 (input floating). - * PE15 - PIN15 (input floating). - */ -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_INT1) | \ - PIN_MODE_INPUT(GPIOE_INT2) | \ - PIN_MODE_INPUT(GPIOE_PIN2) | \ - PIN_MODE_OUTPUT(GPIOE_CS_SPI) | \ - PIN_MODE_INPUT(GPIOE_PIN4) | \ - PIN_MODE_INPUT(GPIOE_PIN5) | \ - PIN_MODE_INPUT(GPIOE_PIN6) | \ - PIN_MODE_INPUT(GPIOE_PIN7) | \ - PIN_MODE_INPUT(GPIOE_PIN8) | \ - PIN_MODE_INPUT(GPIOE_PIN9) | \ - PIN_MODE_INPUT(GPIOE_PIN10) | \ - PIN_MODE_INPUT(GPIOE_PIN11) | \ - PIN_MODE_INPUT(GPIOE_PIN12) | \ - PIN_MODE_INPUT(GPIOE_PIN13) | \ - PIN_MODE_INPUT(GPIOE_PIN14) | \ - PIN_MODE_INPUT(GPIOE_PIN15)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_INT1) | \ - PIN_OTYPE_PUSHPULL(GPIOE_INT2) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOE_CS_SPI) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_INT1) | \ - PIN_OSPEED_100M(GPIOE_INT2) | \ - PIN_OSPEED_100M(GPIOE_PIN2) | \ - PIN_OSPEED_100M(GPIOE_CS_SPI) | \ - PIN_OSPEED_100M(GPIOE_PIN4) | \ - PIN_OSPEED_100M(GPIOE_PIN5) | \ - PIN_OSPEED_100M(GPIOE_PIN6) | \ - PIN_OSPEED_100M(GPIOE_PIN7) | \ - PIN_OSPEED_100M(GPIOE_PIN8) | \ - PIN_OSPEED_100M(GPIOE_PIN9) | \ - PIN_OSPEED_100M(GPIOE_PIN10) | \ - PIN_OSPEED_100M(GPIOE_PIN11) | \ - PIN_OSPEED_100M(GPIOE_PIN12) | \ - PIN_OSPEED_100M(GPIOE_PIN13) | \ - PIN_OSPEED_100M(GPIOE_PIN14) | \ - PIN_OSPEED_100M(GPIOE_PIN15)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_INT1) | \ - PIN_PUPDR_FLOATING(GPIOE_INT2) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOE_CS_SPI) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN15)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_INT1) | \ - PIN_ODR_HIGH(GPIOE_INT2) | \ - PIN_ODR_HIGH(GPIOE_PIN2) | \ - PIN_ODR_HIGH(GPIOE_CS_SPI) | \ - PIN_ODR_HIGH(GPIOE_PIN4) | \ - PIN_ODR_HIGH(GPIOE_PIN5) | \ - PIN_ODR_HIGH(GPIOE_PIN6) | \ - PIN_ODR_HIGH(GPIOE_PIN7) | \ - PIN_ODR_HIGH(GPIOE_PIN8) | \ - PIN_ODR_HIGH(GPIOE_PIN9) | \ - PIN_ODR_HIGH(GPIOE_PIN10) | \ - PIN_ODR_HIGH(GPIOE_PIN11) | \ - PIN_ODR_HIGH(GPIOE_PIN12) | \ - PIN_ODR_HIGH(GPIOE_PIN13) | \ - PIN_ODR_HIGH(GPIOE_PIN14) | \ - PIN_ODR_HIGH(GPIOE_PIN15)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_INT1, 0) | \ - PIN_AFIO_AF(GPIOE_INT2, 0) | \ - PIN_AFIO_AF(GPIOE_PIN2, 0) | \ - PIN_AFIO_AF(GPIOE_CS_SPI, 0) | \ - PIN_AFIO_AF(GPIOE_PIN4, 0) | \ - PIN_AFIO_AF(GPIOE_PIN5, 0) | \ - PIN_AFIO_AF(GPIOE_PIN6, 0) | \ - PIN_AFIO_AF(GPIOE_PIN7, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ - PIN_AFIO_AF(GPIOE_PIN9, 0) | \ - PIN_AFIO_AF(GPIOE_PIN10, 0) | \ - PIN_AFIO_AF(GPIOE_PIN11, 0) | \ - PIN_AFIO_AF(GPIOE_PIN12, 0) | \ - PIN_AFIO_AF(GPIOE_PIN13, 0) | \ - PIN_AFIO_AF(GPIOE_PIN14, 0) | \ - PIN_AFIO_AF(GPIOE_PIN15, 0)) - -/* - * GPIOF setup: - * - * PF0 - PIN0 (input floating). - * PF1 - PIN1 (input floating). - * PF2 - PIN2 (input floating). - * PF3 - PIN3 (input floating). - * PF4 - PIN4 (input floating). - * PF5 - PIN5 (input floating). - * PF6 - PIN6 (input floating). - * PF7 - PIN7 (input floating). - * PF8 - PIN8 (input floating). - * PF9 - PIN9 (input floating). - * PF10 - PIN10 (input floating). - * PF11 - PIN11 (input floating). - * PF12 - PIN12 (input floating). - * PF13 - PIN13 (input floating). - * PF14 - PIN14 (input floating). - * PF15 - PIN15 (input floating). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ - PIN_MODE_INPUT(GPIOF_PIN1) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_PIN7) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_PIN7) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ - PIN_ODR_HIGH(GPIOF_PIN1) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_PIN7) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0) | \ - PIN_AFIO_AF(GPIOF_PIN1, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_PIN7, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * GPIOG setup: - * - * PG0 - PIN0 (input floating). - * PG1 - PIN1 (input floating). - * PG2 - PIN2 (input floating). - * PG3 - PIN3 (input floating). - * PG4 - PIN4 (input floating). - * PG5 - PIN5 (input floating). - * PG6 - PIN6 (input floating). - * PG7 - PIN7 (input floating). - * PG8 - PIN8 (input floating). - * PG9 - PIN9 (input floating). - * PG10 - PIN10 (input floating). - * PG11 - PIN11 (input floating). - * PG12 - PIN12 (input floating). - * PG13 - PIN13 (input floating). - * PG14 - PIN14 (input floating). - * PG15 - PIN15 (input floating). - */ -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_PIN5) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_PIN11) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_PIN13) | \ - PIN_MODE_INPUT(GPIOG_PIN14) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_PIN5) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_PIN11) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_PIN13) | \ - PIN_OSPEED_100M(GPIOG_PIN14) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_PIN5) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_PIN11) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_PIN13) | \ - PIN_ODR_HIGH(GPIOG_PIN14) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_PIN5, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_PIN11, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_PIN13, 0) | \ - PIN_AFIO_AF(GPIOG_PIN14, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * GPIOH setup: - * - * PH0 - OSC_IN (input floating). - * PH1 - OSC_OUT (input floating). - * PH2 - PIN2 (input floating). - * PH3 - PIN3 (input floating). - * PH4 - PIN4 (input floating). - * PH5 - PIN5 (input floating). - * PH6 - PIN6 (input floating). - * PH7 - PIN7 (input floating). - * PH8 - PIN8 (input floating). - * PH9 - PIN9 (input floating). - * PH10 - PIN10 (input floating). - * PH11 - PIN11 (input floating). - * PH12 - PIN12 (input floating). - * PH13 - PIN13 (input floating). - * PH14 - PIN14 (input floating). - * PH15 - PIN15 (input floating). - */ -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ - PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ - PIN_MODE_INPUT(GPIOH_PIN2) | \ - PIN_MODE_INPUT(GPIOH_PIN3) | \ - PIN_MODE_INPUT(GPIOH_PIN4) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_PIN11) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_PIN2) | \ - PIN_OSPEED_100M(GPIOH_PIN3) | \ - PIN_OSPEED_100M(GPIOH_PIN4) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_PIN11) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ - PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ - PIN_ODR_HIGH(GPIOH_PIN2) | \ - PIN_ODR_HIGH(GPIOH_PIN3) | \ - PIN_ODR_HIGH(GPIOH_PIN4) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_PIN11) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0) | \ - PIN_AFIO_AF(GPIOH_OSC_OUT, 0) | \ - PIN_AFIO_AF(GPIOH_PIN2, 0) | \ - PIN_AFIO_AF(GPIOH_PIN3, 0) | \ - PIN_AFIO_AF(GPIOH_PIN4, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_PIN11, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - -/* - * GPIOI setup: - * - * PI0 - PIN0 (input floating). - * PI1 - PIN1 (input floating). - * PI2 - PIN2 (input floating). - * PI3 - PIN3 (input floating). - * PI4 - PIN4 (input floating). - * PI5 - PIN5 (input floating). - * PI6 - PIN6 (input floating). - * PI7 - PIN7 (input floating). - * PI8 - PIN8 (input floating). - * PI9 - PIN9 (input floating). - * PI10 - PIN10 (input floating). - * PI11 - PIN11 (input floating). - * PI12 - PIN12 (input floating). - * PI13 - PIN13 (input floating). - * PI14 - PIN14 (input floating). - * PI15 - PIN15 (input floating). - */ -#define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_PIN0) | \ - PIN_MODE_INPUT(GPIOI_PIN1) | \ - PIN_MODE_INPUT(GPIOI_PIN2) | \ - PIN_MODE_INPUT(GPIOI_PIN3) | \ - PIN_MODE_INPUT(GPIOI_PIN4) | \ - PIN_MODE_INPUT(GPIOI_PIN5) | \ - PIN_MODE_INPUT(GPIOI_PIN6) | \ - PIN_MODE_INPUT(GPIOI_PIN7) | \ - PIN_MODE_INPUT(GPIOI_PIN8) | \ - PIN_MODE_INPUT(GPIOI_PIN9) | \ - PIN_MODE_INPUT(GPIOI_PIN10) | \ - PIN_MODE_INPUT(GPIOI_PIN11) | \ - PIN_MODE_INPUT(GPIOI_PIN12) | \ - PIN_MODE_INPUT(GPIOI_PIN13) | \ - PIN_MODE_INPUT(GPIOI_PIN14) | \ - PIN_MODE_INPUT(GPIOI_PIN15)) -#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_PIN0) | \ - PIN_OSPEED_100M(GPIOI_PIN1) | \ - PIN_OSPEED_100M(GPIOI_PIN2) | \ - PIN_OSPEED_100M(GPIOI_PIN3) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_PIN8) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_PIN10) | \ - PIN_OSPEED_100M(GPIOI_PIN11) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) -#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN15)) -#define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \ - PIN_ODR_HIGH(GPIOI_PIN1) | \ - PIN_ODR_HIGH(GPIOI_PIN2) | \ - PIN_ODR_HIGH(GPIOI_PIN3) | \ - PIN_ODR_HIGH(GPIOI_PIN4) | \ - PIN_ODR_HIGH(GPIOI_PIN5) | \ - PIN_ODR_HIGH(GPIOI_PIN6) | \ - PIN_ODR_HIGH(GPIOI_PIN7) | \ - PIN_ODR_HIGH(GPIOI_PIN8) | \ - PIN_ODR_HIGH(GPIOI_PIN9) | \ - PIN_ODR_HIGH(GPIOI_PIN10) | \ - PIN_ODR_HIGH(GPIOI_PIN11) | \ - PIN_ODR_HIGH(GPIOI_PIN12) | \ - PIN_ODR_HIGH(GPIOI_PIN13) | \ - PIN_ODR_HIGH(GPIOI_PIN14) | \ - PIN_ODR_HIGH(GPIOI_PIN15)) -#define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0) | \ - PIN_AFIO_AF(GPIOI_PIN1, 0) | \ - PIN_AFIO_AF(GPIOI_PIN2, 0) | \ - PIN_AFIO_AF(GPIOI_PIN3, 0) | \ - PIN_AFIO_AF(GPIOI_PIN4, 0) | \ - PIN_AFIO_AF(GPIOI_PIN5, 0) | \ - PIN_AFIO_AF(GPIOI_PIN6, 0) | \ - PIN_AFIO_AF(GPIOI_PIN7, 0)) -#define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0) | \ - PIN_AFIO_AF(GPIOI_PIN9, 0) | \ - PIN_AFIO_AF(GPIOI_PIN10, 0) | \ - PIN_AFIO_AF(GPIOI_PIN11, 0) | \ - PIN_AFIO_AF(GPIOI_PIN12, 0) | \ - PIN_AFIO_AF(GPIOI_PIN13, 0) | \ - PIN_AFIO_AF(GPIOI_PIN14, 0) | \ - PIN_AFIO_AF(GPIOI_PIN15, 0)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f4-template/config/chconf.h b/stm32-chibios-template/chibios-rt-f4-template/config/chconf.h deleted file mode 100755 index 4a34b223..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/config/chconf.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 10000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_QUEUES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_TRACE FALSE - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f4-template/config/halconf.h b/stm32-chibios-template/chibios-rt-f4-template/config/halconf.h deleted file mode 100755 index 27dd1ac9..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/config/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios-template/chibios-rt-f4-template/config/mcuconf.h b/stm32-chibios-template/chibios-rt-f4-template/config/mcuconf.h deleted file mode 100755 index 80417b89..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/config/mcuconf.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F4xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F4xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_CLOCK48_REQUIRED TRUE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLM_VALUE 8 -#define STM32_PLLN_VALUE 336 -#define STM32_PLLP_VALUE 2 -#define STM32_PLLQ_VALUE 7 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV4 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_RTCPRE_VALUE 8 -#define STM32_MCO1SEL STM32_MCO1SEL_HSI -#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 -#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK -#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 -#define STM32_I2SSRC STM32_I2SSRC_CKIN -#define STM32_PLLI2SN_VALUE 192 -#define STM32_PLLI2SR_VALUE 5 -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_BKPRAM_ENABLE FALSE - -/* - * ADC driver system settings. - */ -#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 6 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 6 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 FALSE -#define STM32_DAC_USE_DAC1_CH2 FALSE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI22_IRQ_PRIORITY 15 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM6 FALSE -#define STM32_GPT_USE_TIM7 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_USE_TIM9 FALSE -#define STM32_GPT_USE_TIM11 FALSE -#define STM32_GPT_USE_TIM12 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 -#define STM32_GPT_TIM9_IRQ_PRIORITY 7 -#define STM32_GPT_TIM11_IRQ_PRIORITY 7 -#define STM32_GPT_TIM12_IRQ_PRIORITY 7 -#define STM32_GPT_TIM14_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_USE_I2C3 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C3_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_I2C3_DMA_PRIORITY 3 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_USE_TIM9 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 -#define STM32_ICU_TIM9_IRQ_PRIORITY 7 - -/* - * MAC driver system settings. - */ -#define STM32_MAC_TRANSMIT_BUFFERS 2 -#define STM32_MAC_RECEIVE_BUFFERS 4 -#define STM32_MAC_BUFFERS_SIZE 1522 -#define STM32_MAC_PHY_TIMEOUT 100 -#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE -#define STM32_MAC_ETH1_IRQ_PRIORITY 13 -#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_USE_TIM9 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 -#define STM32_PWM_TIM9_IRQ_PRIORITY 7 - -/* - * SDC driver system settings. - */ -#define STM32_SDC_SDIO_DMA_PRIORITY 3 -#define STM32_SDC_SDIO_IRQ_PRIORITY 9 -#define STM32_SDC_WRITE_TIMEOUT_MS 250 -#define STM32_SDC_READ_TIMEOUT_MS 25 -#define STM32_SDC_CLOCK_ACTIVATION_DELAY 10 -#define STM32_SDC_SDIO_UNALIGNED_SUPPORT TRUE -#define STM32_SDC_SDIO_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USE_USART6 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 -#define STM32_SERIAL_USART6_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) -#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) -#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USE_UART4 FALSE -#define STM32_UART_USE_UART5 FALSE -#define STM32_UART_USE_USART6 FALSE -#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_UART4_IRQ_PRIORITY 12 -#define STM32_UART_UART5_IRQ_PRIORITY 12 -#define STM32_UART_USART6_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_UART4_DMA_PRIORITY 0 -#define STM32_UART_UART5_DMA_PRIORITY 0 -#define STM32_UART_USART6_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_OTG1 TRUE -#define STM32_USB_USE_OTG2 FALSE -#define STM32_USB_OTG1_IRQ_PRIORITY 14 -#define STM32_USB_OTG2_IRQ_PRIORITY 14 -#define STM32_USB_OTG1_RX_FIFO_SIZE 512 -#define STM32_USB_OTG2_RX_FIFO_SIZE 1024 -#define STM32_USB_OTG_THREAD_PRIO LOWPRIO -#define STM32_USB_OTG_THREAD_STACK_SIZE 128 -#define STM32_USB_OTGFIFO_FILL_BASEPRI 0 - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios-template/chibios-rt-f4-template/main.c b/stm32-chibios-template/chibios-rt-f4-template/main.c deleted file mode 100755 index 2089721f..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/main.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "ch.h" -#include "hal.h" -#include "test.h" - -int main(void) { - - halInit(); - chSysInit(); - - testInit(); - - while (true) { - if (palReadPad(GPIOA, GPIOA_BUTTON)) - chThdSleepMilliseconds(500); - } -} diff --git a/stm32-chibios-template/chibios-rt-f4-template/work/test.c b/stm32-chibios-template/chibios-rt-f4-template/work/test.c deleted file mode 100644 index 1804251a..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/work/test.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "ch.h" -#include "hal.h" -#include "test.h" -/* - * This is a periodic thread that does absolutely nothing except flashing - * a LED. - */ -static THD_WORKING_AREA(waThread1, 128); -static THD_FUNCTION(Thread1, arg) { - - (void)arg; - chRegSetThreadName("blinker"); - while (true) { - palSetPad(GPIOD, GPIOD_LED3); /* Orange. */ - chThdSleepMilliseconds(500); - palClearPad(GPIOD, GPIOD_LED3); /* Orange. */ - chThdSleepMilliseconds(500); - } -} - -void testInit(void) -{ - /* - * Creates the example thread. - */ - chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); -} diff --git a/stm32-chibios-template/chibios-rt-f4-template/work/test.h b/stm32-chibios-template/chibios-rt-f4-template/work/test.h deleted file mode 100644 index a7b971cc..00000000 --- a/stm32-chibios-template/chibios-rt-f4-template/work/test.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef TEST_H -#define TEST_H -void testInit(void); -#endif // TEST_H diff --git a/stm32-chibios/CMakeLists.txt b/stm32-chibios/CMakeLists.txt deleted file mode 100644 index 5dd9301f..00000000 --- a/stm32-chibios/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -PROJECT(stm32-chibios) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -ENABLE_LANGUAGE(ASM) - -FIND_PACKAGE(ChibiOS COMPONENTS nil hal pal serial REQUIRED) -# For use ChibiOS v16.x.x use this string -#FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal pal serial REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${ChibiOS_INCLUDE_DIRS} -) - -SET(PROJECT_SOURCES - main.c - board.c -) - -ADD_DEFINITIONS(-DCORTEX_USE_FPU=FALSE) - -SET(STM32_LINKER_SCRIPT ${ChibiOS_LINKER_SCRIPT}) - -ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES} ${ChibiOS_SOURCES}) -TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME}) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}) diff --git a/stm32-chibios/board.c b/stm32-chibios/board.c deleted file mode 100644 index a36a0110..00000000 --- a/stm32-chibios/board.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "hal.h" - -const PALConfig pal_default_config = -{ - {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, - VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, - {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, - VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, - {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, - VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, - {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, - VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, - {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, - VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, - {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, - VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, - {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, - VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, - {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, - VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, - {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, - VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} -}; - -void __early_init(void) -{ - stm32_clock_init(); -} - -void boardInit(void) -{ -} diff --git a/stm32-chibios/board.h b/stm32-chibios/board.h deleted file mode 100644 index b75fc273..00000000 --- a/stm32-chibios/board.h +++ /dev/null @@ -1,1267 +0,0 @@ -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for STMicroelectronics WaveShare XCore407I/EVK407I board. - */ - -/* - * Board identifier. - */ -#define BOARD_WAVESHARE_XCORE407I -#define BOARD_NAME "WaveShare XCore407I/EVK407I" - - - -#if !defined(STM32_LSECLK) -#define STM32_LSECLK 32768 -#endif - -#if !defined(STM32_HSECLK) -#define STM32_HSECLK 8000000 -#endif - -#define STM32_VDD 330 - -#define GPIOA_PIN0 0 -#define GPIOA_PIN1 1 -#define GPIOA_MDIO 2 -#define GPIOA_ULPI_D0 3 -#define GPIOA_PIN4 4 -#define GPIOA_ULPI_CK 5 -#define GPIOA_PIN6 6 -#define GPIOA_MII_CRS_DV 7 -#define GPIOA_PIN8 8 -#define GPIOA_VBUS_FS 9 -#define GPIOA_OTG_FS_ID 10 -#define GPIOA_OTG_FS_DM 11 -#define GPIOA_OTG_FS_DP 12 -#define GPIOA_JTMS 13 -#define GPIOA_JTCK 14 -#define GPIOA_JTDI 15 - -#define GPIOB_ULPI_D1 0 -#define GPIOB_ULPI_D2 1 -#define GPIOB_PIN2 2 -#define GPIOB_JTDO 3 -#define GPIOB_NJTRST 4 -#define GPIOB_ULPI_D7 5 -#define GPIOB_PIN6 6 -#define GPIOB_PIN7 7 -#define GPIOB_PIN8 8 -#define GPIOB_PIN9 9 -#define GPIOB_ULPI_D3 10 -#define GPIOB_ULPI_D4 11 -#define GPIOB_ULPI_D5 12 -#define GPIOB_ULPI_D6 13 -#define GPIOB_PIN14 14 -#define GPIOB_PIN15 15 - -#define GPIOC_ULPI_STP 0 -#define GPIOC_OTG_FS_POWER_ON 1 -#define GPIOC_PIN2 2 -#define GPIOC_PIN3 3 -#define GPIOC_MII_RX_D0 4 -#define GPIOC_MII_RX_D1 5 -#define GPIOC_TP_IRQ 6 -#define GPIOC_PIN7 7 -#define GPIOC_PIN8 8 -#define GPIOC_PIN9 9 -#define GPIOC_USART3_TX 10 -#define GPIOC_USART3_RX 11 -#define GPIOC_PIN12 12 -#define GPIOC_PIN13 13 -#define GPIOC_OSC32_IN 14 -#define GPIOC_OSC32_OUT 15 - -#define GPIOD_FSMC_D2 0 -#define GPIOD_FSMC_D3 1 -#define GPIOD_PIN2 2 -#define GPIOD_PIN3 3 -#define GPIOD_FSMC_NOE 4 -#define GPIOD_FSMC_NWE 5 -#define GPIOD_FSMC_NWAIT 6 -#define GPIOD_FSMC_NCE2 7 -#define GPIOD_FSMC_D13 8 -#define GPIOD_FSMC_D14 9 -#define GPIOD_FSMC_D15 10 -#define GPIOD_FSMC_A16 11 -#define GPIOD_FSMC_A17 12 -#define GPIOD_PIN13 13 -#define GPIOD_FSMC_D0 14 -#define GPIOD_FSMC_D1 15 - -#define GPIOE_PIN0 0 -#define GPIOE_PIN1 1 -#define GPIOE_JOY_A 2 -#define GPIOE_JOY_B 3 -#define GPIOE_JOY_C 4 -#define GPIOE_JOY_D 5 -#define GPIOE_JOY_PRESS 6 -#define GPIOE_FSMC_D4 7 -#define GPIOE_FSMC_D5 8 -#define GPIOE_FSMC_D6 9 -#define GPIOE_FSMC_D7 10 -#define GPIOE_FSMC_D8 11 -#define GPIOE_FSMC_D9 12 -#define GPIOE_FSMC_D10 13 -#define GPIOE_FSMC_D11 14 -#define GPIOE_FSMC_D12 15 - -#define GPIOF_PIN0 0 -#define GPIOF_PIN1 1 -#define GPIOF_PIN2 2 -#define GPIOF_PIN3 3 -#define GPIOF_PIN4 4 -#define GPIOF_PIN5 5 -#define GPIOF_PIN6 6 -#define GPIOF_LCD_PWM 7 -#define GPIOF_PIN8 8 -#define GPIOF_PIN9 9 -#define GPIOF_PIN10 10 -#define GPIOF_PIN11 11 -#define GPIOF_PIN12 12 -#define GPIOF_PIN13 13 -#define GPIOF_PIN14 14 -#define GPIOF_PIN15 15 - -#define GPIOG_PIN0 0 -#define GPIOG_PIN1 1 -#define GPIOG_PIN2 2 -#define GPIOG_PIN3 3 -#define GPIOG_PIN4 4 -#define GPIOG_FSMC_A15 5 -#define GPIOG_PIN6 6 -#define GPIOG_PIN7 7 -#define GPIOG_PIN8 8 -#define GPIOG_PIN9 9 -#define GPIOG_PIN10 10 -#define GPIOG_MII_TX_EN 11 -#define GPIOG_PIN12 12 -#define GPIOG_MII_TX_D0 13 -#define GPIOG_MII_TX_D1 14 -#define GPIOG_PIN15 15 - -#define GPIOH_OSC_IN 0 -#define GPIOH_OSC_OUT 1 -#define GPIOH_LED1 2 -#define GPIOH_LED2 3 -#define GPIOH_ULPI_NXT 4 -#define GPIOH_PIN5 5 -#define GPIOH_PIN6 6 -#define GPIOH_PIN7 7 -#define GPIOH_PIN8 8 -#define GPIOH_PIN9 9 -#define GPIOH_PIN10 10 -#define GPIOH_ULPI_RESET 11 -#define GPIOH_PIN12 12 -#define GPIOH_PIN13 13 -#define GPIOH_PIN14 14 -#define GPIOH_PIN15 15 - -#define GPIOI_TP_CS 0 -#define GPIOI_SPI2_SCK 1 -#define GPIOI_SPI2_MISO 2 -#define GPIOI_SPI2_MOSI 3 -#define GPIOI_PIN4 4 -#define GPIOI_PIN5 5 -#define GPIOI_PIN6 6 -#define GPIOI_PIN7 7 -#define GPIOI_LED3 8 -#define GPIOI_PIN9 9 -#define GPIOI_LED4 10 -#define GPIOI_ULPI_DIR 11 -#define GPIOI_PIN12 12 -#define GPIOI_PIN13 13 -#define GPIOI_PIN14 14 -#define GPIOI_PIN15 15 - -#define PIN_MODE_INPUT(n) (0U << ((n) * 2)) -#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2)) -#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2)) -#define PIN_MODE_ANALOG(n) (3U << ((n) * 2)) -#define PIN_ODR_LOW(n) (0U << (n)) -#define PIN_ODR_HIGH(n) (1U << (n)) -#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) -#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) -#define PIN_OSPEED_2M(n) (0U << ((n) * 2)) -#define PIN_OSPEED_25M(n) (1U << ((n) * 2)) -#define PIN_OSPEED_50M(n) (2U << ((n) * 2)) -#define PIN_OSPEED_100M(n) (3U << ((n) * 2)) -#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2)) -#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2)) -#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2)) -#define PIN_AFIO_AF(n, v) ((v##U) << ((n % 8) * 4)) - -/* - * PA0 - PIN0 (input floating). - * PA1 - PIN1 (input floating). - * PA2 - MDIO (input floating). - * PA3 - ULPI_D0 (input floating). - * PA4 - PIN4 (input floating). - * PA5 - ULPI_CK (input floating). - * PA6 - PIN6 (input floating). - * PA7 - MII_CRS_DV (input floating). - * PA8 - PIN8 (input floating). - * PA9 - VBUS_FS (input floating). - * PA10 - OTG_FS_ID (input floating). - * PA11 - OTG_FS_DM (input floating). - * PA12 - OTG_FS_DP (input floating). - * PA13 - JTMS (alternate 0). - * PA14 - JTCK (alternate 0). - * PA15 - JTDI (alternate 0). - */ - -#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ - PIN_MODE_INPUT(GPIOA_PIN1) | \ - PIN_MODE_INPUT(GPIOA_MDIO) | \ - PIN_MODE_INPUT(GPIOA_ULPI_D0) | \ - PIN_MODE_INPUT(GPIOA_PIN4) | \ - PIN_MODE_INPUT(GPIOA_ULPI_CK) | \ - PIN_MODE_INPUT(GPIOA_PIN6) | \ - PIN_MODE_INPUT(GPIOA_MII_CRS_DV) | \ - PIN_MODE_INPUT(GPIOA_PIN8) | \ - PIN_MODE_INPUT(GPIOA_VBUS_FS) | \ - PIN_MODE_INPUT(GPIOA_OTG_FS_ID) | \ - PIN_MODE_INPUT(GPIOA_OTG_FS_DM) | \ - PIN_MODE_INPUT(GPIOA_OTG_FS_DP) | \ - PIN_MODE_ALTERNATE(GPIOA_JTMS) | \ - PIN_MODE_ALTERNATE(GPIOA_JTCK) | \ - PIN_MODE_ALTERNATE(GPIOA_JTDI)) -#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOA_MDIO) | \ - PIN_OTYPE_PUSHPULL(GPIOA_ULPI_D0) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOA_ULPI_CK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOA_MII_CRS_DV) |\ - PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOA_VBUS_FS) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_ID) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \ - PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \ - PIN_OTYPE_PUSHPULL(GPIOA_JTMS) | \ - PIN_OTYPE_PUSHPULL(GPIOA_JTCK) | \ - PIN_OTYPE_PUSHPULL(GPIOA_JTDI)) -#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_100M(GPIOA_PIN0) | \ - PIN_OSPEED_100M(GPIOA_PIN1) | \ - PIN_OSPEED_100M(GPIOA_MDIO) | \ - PIN_OSPEED_100M(GPIOA_ULPI_D0) | \ - PIN_OSPEED_100M(GPIOA_PIN4) | \ - PIN_OSPEED_100M(GPIOA_ULPI_CK) | \ - PIN_OSPEED_100M(GPIOA_PIN6) | \ - PIN_OSPEED_100M(GPIOA_MII_CRS_DV) | \ - PIN_OSPEED_100M(GPIOA_PIN8) | \ - PIN_OSPEED_100M(GPIOA_VBUS_FS) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_ID) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DM) | \ - PIN_OSPEED_100M(GPIOA_OTG_FS_DP) | \ - PIN_OSPEED_100M(GPIOA_JTMS) | \ - PIN_OSPEED_100M(GPIOA_JTCK) | \ - PIN_OSPEED_100M(GPIOA_JTDI)) -#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOA_MDIO) | \ - PIN_PUPDR_FLOATING(GPIOA_ULPI_D0) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOA_ULPI_CK) | \ - PIN_PUPDR_FLOATING(GPIOA_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOA_MII_CRS_DV) |\ - PIN_PUPDR_FLOATING(GPIOA_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOA_VBUS_FS) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_ID) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \ - PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \ - PIN_PUPDR_FLOATING(GPIOA_JTMS) | \ - PIN_PUPDR_FLOATING(GPIOA_JTCK) | \ - PIN_PUPDR_FLOATING(GPIOA_JTDI)) -#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ - PIN_ODR_HIGH(GPIOA_PIN1) | \ - PIN_ODR_HIGH(GPIOA_MDIO) | \ - PIN_ODR_HIGH(GPIOA_ULPI_D0) | \ - PIN_ODR_HIGH(GPIOA_PIN4) | \ - PIN_ODR_HIGH(GPIOA_ULPI_CK) | \ - PIN_ODR_HIGH(GPIOA_PIN6) | \ - PIN_ODR_HIGH(GPIOA_MII_CRS_DV) | \ - PIN_ODR_HIGH(GPIOA_PIN8) | \ - PIN_ODR_HIGH(GPIOA_VBUS_FS) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_ID) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \ - PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \ - PIN_ODR_HIGH(GPIOA_JTMS) | \ - PIN_ODR_HIGH(GPIOA_JTCK) | \ - PIN_ODR_HIGH(GPIOA_JTDI)) -#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN1, 0) | \ - PIN_AFIO_AF(GPIOA_MDIO, 0) | \ - PIN_AFIO_AF(GPIOA_ULPI_D0, 0) | \ - PIN_AFIO_AF(GPIOA_PIN4, 6) | \ - PIN_AFIO_AF(GPIOA_ULPI_CK, 0) | \ - PIN_AFIO_AF(GPIOA_PIN6, 5) | \ - PIN_AFIO_AF(GPIOA_MII_CRS_DV, 0)) -#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ - PIN_AFIO_AF(GPIOA_VBUS_FS, 0) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_ID, 0) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DM, 0) | \ - PIN_AFIO_AF(GPIOA_OTG_FS_DP, 0) | \ - PIN_AFIO_AF(GPIOA_JTMS, 0) | \ - PIN_AFIO_AF(GPIOA_JTCK, 0) | \ - PIN_AFIO_AF(GPIOA_JTDI, 0)) - -/* - * PB0 - ULPI_D1 (input floating). - * PB1 - ULPI_D2 (input floating). - * PB2 - PIN2 (input floating). - * PB3 - JTDO (alternate 0). - * PB4 - NJTRST (alternate 0). - * PB5 - ULPI_D7 (input floating). - * PB6 - PIN6 (input floating). - * PB7 - PIN7 (input floating). - * PB8 - PIN8 (input floating). - * PB9 - PIN9 (input floating). - * PB10 - ULPI_D3 (input floating). - * PB11 - ULPI_D4 (input floating). - * PB12 - ULPI_D5 (input floating). - * PB13 - ULPI_D6 (input floating). - * PB14 - PIN14 (input floating). - * PB15 - PIN15 (input floating). - */ - -#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ULPI_D1) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D2) | \ - PIN_MODE_INPUT(GPIOB_PIN2) | \ - PIN_MODE_ALTERNATE(GPIOB_JTDO) | \ - PIN_MODE_ALTERNATE(GPIOB_NJTRST) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D7) | \ - PIN_MODE_INPUT(GPIOB_PIN6) | \ - PIN_MODE_INPUT(GPIOB_PIN7) | \ - PIN_MODE_INPUT(GPIOB_PIN8) | \ - PIN_MODE_INPUT(GPIOB_PIN9) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D3) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D4) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D5) | \ - PIN_MODE_INPUT(GPIOB_ULPI_D6) | \ - PIN_MODE_INPUT(GPIOB_PIN14) | \ - PIN_MODE_INPUT(GPIOB_PIN15)) -#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D1) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOB_JTDO) | \ - PIN_OTYPE_PUSHPULL(GPIOB_NJTRST) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D3) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D4) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D5) | \ - PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D6) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) -#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_100M(GPIOB_ULPI_D1) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D2) | \ - PIN_OSPEED_100M(GPIOB_PIN2) | \ - PIN_OSPEED_100M(GPIOB_JTDO) | \ - PIN_OSPEED_100M(GPIOB_NJTRST) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D7) | \ - PIN_OSPEED_100M(GPIOB_PIN6) | \ - PIN_OSPEED_100M(GPIOB_PIN7) | \ - PIN_OSPEED_100M(GPIOB_PIN8) | \ - PIN_OSPEED_100M(GPIOB_PIN9) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D3) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D4) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D5) | \ - PIN_OSPEED_100M(GPIOB_ULPI_D6) | \ - PIN_OSPEED_100M(GPIOB_PIN14) | \ - PIN_OSPEED_100M(GPIOB_PIN15)) -#define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_ULPI_D1) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D2) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOB_JTDO) | \ - PIN_PUPDR_FLOATING(GPIOB_NJTRST) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D7) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D3) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D4) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D5) | \ - PIN_PUPDR_FLOATING(GPIOB_ULPI_D6) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOB_PIN15)) -#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ULPI_D1) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D2) | \ - PIN_ODR_HIGH(GPIOB_PIN2) | \ - PIN_ODR_HIGH(GPIOB_JTDO) | \ - PIN_ODR_HIGH(GPIOB_NJTRST) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D7) | \ - PIN_ODR_HIGH(GPIOB_PIN6) | \ - PIN_ODR_HIGH(GPIOB_PIN7) | \ - PIN_ODR_HIGH(GPIOB_PIN8) | \ - PIN_ODR_HIGH(GPIOB_PIN9) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D3) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D4) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D5) | \ - PIN_ODR_HIGH(GPIOB_ULPI_D6) | \ - PIN_ODR_HIGH(GPIOB_PIN14) | \ - PIN_ODR_HIGH(GPIOB_PIN15)) -#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ULPI_D1, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D2, 0) | \ - PIN_AFIO_AF(GPIOB_PIN2, 0) | \ - PIN_AFIO_AF(GPIOB_JTDO, 0) | \ - PIN_AFIO_AF(GPIOB_NJTRST, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D7, 0) | \ - PIN_AFIO_AF(GPIOB_PIN6, 0) | \ - PIN_AFIO_AF(GPIOB_PIN7, 0)) -#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ - PIN_AFIO_AF(GPIOB_PIN9, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D3, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D4, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D5, 0) | \ - PIN_AFIO_AF(GPIOB_ULPI_D6, 0) | \ - PIN_AFIO_AF(GPIOB_PIN14, 0) | \ - PIN_AFIO_AF(GPIOB_PIN15, 0)) - -/* - * PC0 - ULPI_STP (input floating). - * PC1 - OTG_FS_POWER_ON (input floating). - * PC2 - PIN2 (input floating). - * PC3 - PIN3 (input floating). - * PC4 - MII_RX_D0 (input floating). - * PC5 - MII_RX_D1 (input floating). - * PC6 - TP_IRQ (input floating). - * PC7 - PIN7 (input floating). - * PC8 - PIN8 (input floating). - * PC9 - PIN9 (input floating). - * PC10 - USART3_TX (input floating). - * PC11 - USART3_RX (input floating). - * PC12 - PIN12 (input floating). - * PC13 - PIN13 (input floating). - * PC14 - OSC32_IN (input floating). - * PC15 - OSC32_OUT (input floating). - */ - -#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_ULPI_STP) | \ - PIN_MODE_INPUT(GPIOC_OTG_FS_POWER_ON) |\ - PIN_MODE_INPUT(GPIOC_PIN2) | \ - PIN_MODE_INPUT(GPIOC_PIN3) | \ - PIN_MODE_INPUT(GPIOC_MII_RX_D0) | \ - PIN_MODE_INPUT(GPIOC_MII_RX_D1) | \ - PIN_MODE_INPUT(GPIOC_TP_IRQ) | \ - PIN_MODE_INPUT(GPIOC_PIN7) | \ - PIN_MODE_INPUT(GPIOC_PIN8) | \ - PIN_MODE_INPUT(GPIOC_PIN9) | \ - PIN_MODE_INPUT(GPIOC_USART3_TX) | \ - PIN_MODE_INPUT(GPIOC_USART3_RX) | \ - PIN_MODE_INPUT(GPIOC_PIN12) | \ - PIN_MODE_INPUT(GPIOC_PIN13) | \ - PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ - PIN_MODE_INPUT(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_ULPI_STP) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOC_MII_RX_D0) | \ - PIN_OTYPE_PUSHPULL(GPIOC_MII_RX_D1) | \ - PIN_OTYPE_PUSHPULL(GPIOC_TP_IRQ) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOC_USART3_TX) | \ - PIN_OTYPE_PUSHPULL(GPIOC_USART3_RX) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_100M(GPIOC_ULPI_STP) | \ - PIN_OSPEED_100M(GPIOC_OTG_FS_POWER_ON) |\ - PIN_OSPEED_100M(GPIOC_PIN2) | \ - PIN_OSPEED_100M(GPIOC_PIN3) | \ - PIN_OSPEED_100M(GPIOC_MII_RX_D0) | \ - PIN_OSPEED_100M(GPIOC_MII_RX_D1) | \ - PIN_OSPEED_100M(GPIOC_TP_IRQ) | \ - PIN_OSPEED_100M(GPIOC_PIN7) | \ - PIN_OSPEED_100M(GPIOC_PIN8) | \ - PIN_OSPEED_100M(GPIOC_PIN9) | \ - PIN_OSPEED_100M(GPIOC_USART3_TX) | \ - PIN_OSPEED_100M(GPIOC_USART3_RX) | \ - PIN_OSPEED_100M(GPIOC_PIN12) | \ - PIN_OSPEED_100M(GPIOC_PIN13) | \ - PIN_OSPEED_100M(GPIOC_OSC32_IN) | \ - PIN_OSPEED_100M(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_ULPI_STP) | \ - PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\ - PIN_PUPDR_FLOATING(GPIOC_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOC_MII_RX_D0) | \ - PIN_PUPDR_FLOATING(GPIOC_MII_RX_D1) | \ - PIN_PUPDR_FLOATING(GPIOC_TP_IRQ) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOC_USART3_TX) | \ - PIN_PUPDR_FLOATING(GPIOC_USART3_RX) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOC_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ - PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_ULPI_STP) | \ - PIN_ODR_HIGH(GPIOC_OTG_FS_POWER_ON) | \ - PIN_ODR_HIGH(GPIOC_PIN2) | \ - PIN_ODR_HIGH(GPIOC_PIN3) | \ - PIN_ODR_HIGH(GPIOC_MII_RX_D0) | \ - PIN_ODR_HIGH(GPIOC_MII_RX_D1) | \ - PIN_ODR_HIGH(GPIOC_TP_IRQ) | \ - PIN_ODR_HIGH(GPIOC_PIN7) | \ - PIN_ODR_HIGH(GPIOC_PIN8) | \ - PIN_ODR_HIGH(GPIOC_PIN9) | \ - PIN_ODR_HIGH(GPIOC_USART3_TX) | \ - PIN_ODR_HIGH(GPIOC_USART3_RX) | \ - PIN_ODR_HIGH(GPIOC_PIN12) | \ - PIN_ODR_HIGH(GPIOC_PIN13) | \ - PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ - PIN_ODR_HIGH(GPIOC_OSC32_OUT)) -#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_ULPI_STP, 0) | \ - PIN_AFIO_AF(GPIOC_OTG_FS_POWER_ON, 0) |\ - PIN_AFIO_AF(GPIOC_PIN2, 0) | \ - PIN_AFIO_AF(GPIOC_PIN3, 0) | \ - PIN_AFIO_AF(GPIOC_MII_RX_D0, 0) | \ - PIN_AFIO_AF(GPIOC_MII_RX_D1, 0) | \ - PIN_AFIO_AF(GPIOC_TP_IRQ, 0) | \ - PIN_AFIO_AF(GPIOC_PIN7, 0)) -#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ - PIN_AFIO_AF(GPIOC_PIN9, 0) | \ - PIN_AFIO_AF(GPIOC_USART3_TX, 0) | \ - PIN_AFIO_AF(GPIOC_USART3_RX, 0) | \ - PIN_AFIO_AF(GPIOC_PIN12, 0) | \ - PIN_AFIO_AF(GPIOC_PIN13, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_IN, 0) | \ - PIN_AFIO_AF(GPIOC_OSC32_OUT, 0)) - -/* - * PD0 - FSMC_D2 (input floating). - * PD1 - FSMC_D3 (input floating). - * PD2 - PIN2 (input floating). - * PD3 - PIN3 (input floating). - * PD4 - FSMC_NOE (input floating). - * PD5 - FSMC_NWE (input floating). - * PD6 - FSMC_NWAIT (input floating). - * PD7 - FSMC_NCE2 (input floating). - * PD8 - FSMC_D13 (input floating). - * PD9 - FSMC_D14 (input floating). - * PD10 - FSMC_D15 (input floating). - * PD11 - FSMC_A16 (input floating). - * PD12 - FSMC_A17 (input floating). - * PD13 - PIN13 (input floating). - * PD14 - FSMC_D0 (input floating). - * PD15 - FSMC_D1 (input floating). - */ - -#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_FSMC_D2) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D3) | \ - PIN_MODE_INPUT(GPIOD_PIN2) | \ - PIN_MODE_INPUT(GPIOD_PIN3) | \ - PIN_MODE_INPUT(GPIOD_FSMC_NOE) | \ - PIN_MODE_INPUT(GPIOD_FSMC_NWE) | \ - PIN_MODE_INPUT(GPIOD_FSMC_NWAIT) | \ - PIN_MODE_INPUT(GPIOD_FSMC_NCE2) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D13) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D14) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D15) | \ - PIN_MODE_INPUT(GPIOD_FSMC_A16) | \ - PIN_MODE_INPUT(GPIOD_FSMC_A17) | \ - PIN_MODE_INPUT(GPIOD_PIN13) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D0) | \ - PIN_MODE_INPUT(GPIOD_FSMC_D1)) -#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_NOE) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_NWE) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_NWAIT) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_NCE2) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D14) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D15) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_A16) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_A17) | \ - PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D0) | \ - PIN_OTYPE_PUSHPULL(GPIOD_FSMC_D1)) -#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_100M(GPIOD_FSMC_D2) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D3) | \ - PIN_OSPEED_100M(GPIOD_PIN2) | \ - PIN_OSPEED_100M(GPIOD_PIN3) | \ - PIN_OSPEED_100M(GPIOD_FSMC_NOE) | \ - PIN_OSPEED_100M(GPIOD_FSMC_NWE) | \ - PIN_OSPEED_100M(GPIOD_FSMC_NWAIT) | \ - PIN_OSPEED_100M(GPIOD_FSMC_NCE2) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D13) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D14) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D15) | \ - PIN_OSPEED_100M(GPIOD_FSMC_A16) | \ - PIN_OSPEED_100M(GPIOD_FSMC_A17) | \ - PIN_OSPEED_100M(GPIOD_PIN13) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D0) | \ - PIN_OSPEED_100M(GPIOD_FSMC_D1)) -#define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_FSMC_D2) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D3) | \ - PIN_PUPDR_FLOATING(GPIOD_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOD_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_NOE) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_NWE) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_NWAIT) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_NCE2) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D13) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D14) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D15) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_A16) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_A17) | \ - PIN_PUPDR_FLOATING(GPIOD_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D0) | \ - PIN_PUPDR_FLOATING(GPIOD_FSMC_D1)) -#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_FSMC_D2) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D3) | \ - PIN_ODR_HIGH(GPIOD_PIN2) | \ - PIN_ODR_HIGH(GPIOD_PIN3) | \ - PIN_ODR_HIGH(GPIOD_FSMC_NOE) | \ - PIN_ODR_HIGH(GPIOD_FSMC_NWE) | \ - PIN_ODR_HIGH(GPIOD_FSMC_NWAIT) | \ - PIN_ODR_HIGH(GPIOD_FSMC_NCE2) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D13) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D14) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D15) | \ - PIN_ODR_HIGH(GPIOD_FSMC_A16) | \ - PIN_ODR_HIGH(GPIOD_FSMC_A17) | \ - PIN_ODR_HIGH(GPIOD_PIN13) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D0) | \ - PIN_ODR_HIGH(GPIOD_FSMC_D1)) -#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_FSMC_D2, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_D3, 0) | \ - PIN_AFIO_AF(GPIOD_PIN2, 0) | \ - PIN_AFIO_AF(GPIOD_PIN3, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_NOE, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_NWE, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_NWAIT, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_NCE2, 0)) -#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_FSMC_D13, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_D14, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_D15, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_A16, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_A17, 0) | \ - PIN_AFIO_AF(GPIOD_PIN13, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_D0, 0) | \ - PIN_AFIO_AF(GPIOD_FSMC_D1, 0)) - -/* - * PE0 - PIN0 (input floating). - * PE1 - PIN1 (input floating). - * PE2 - JOY_A (input floating). - * PE3 - JOY_B (input floating). - * PE4 - JOY_C (input floating). - * PE5 - JOY_D (input floating). - * PE6 - JOY_PRESS (input floating). - * PE7 - FSMC_D4 (input floating). - * PE8 - FSMC_D5 (input floating). - * PE9 - FSMC_D6 (input floating). - * PE10 - FSMC_D7 (input floating). - * PE11 - FSMC_D8 (input floating). - * PE12 - FSMC_D9 (input floating). - * PE13 - FSMC_D10 (input floating). - * PE14 - FSMC_D11 (input floating). - * PE15 - FSMC_D12 (input floating). - */ - -#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ - PIN_MODE_INPUT(GPIOE_PIN1) | \ - PIN_MODE_INPUT(GPIOE_JOY_A) | \ - PIN_MODE_INPUT(GPIOE_JOY_B) | \ - PIN_MODE_INPUT(GPIOE_JOY_C) | \ - PIN_MODE_INPUT(GPIOE_JOY_D) | \ - PIN_MODE_INPUT(GPIOE_JOY_PRESS) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D4) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D5) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D6) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D7) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D8) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D9) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D10) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D11) | \ - PIN_MODE_INPUT(GPIOE_FSMC_D12)) -#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOE_JOY_A) | \ - PIN_OTYPE_PUSHPULL(GPIOE_JOY_B) | \ - PIN_OTYPE_PUSHPULL(GPIOE_JOY_C) | \ - PIN_OTYPE_PUSHPULL(GPIOE_JOY_D) | \ - PIN_OTYPE_PUSHPULL(GPIOE_JOY_PRESS) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D4) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D5) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D6) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D7) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D8) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D9) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D10) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D11) | \ - PIN_OTYPE_PUSHPULL(GPIOE_FSMC_D12)) -#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_100M(GPIOE_PIN0) | \ - PIN_OSPEED_100M(GPIOE_PIN1) | \ - PIN_OSPEED_100M(GPIOE_JOY_A) | \ - PIN_OSPEED_100M(GPIOE_JOY_B) | \ - PIN_OSPEED_100M(GPIOE_JOY_C) | \ - PIN_OSPEED_100M(GPIOE_JOY_D) | \ - PIN_OSPEED_100M(GPIOE_JOY_PRESS) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D4) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D5) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D6) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D7) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D8) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D9) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D10) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D11) | \ - PIN_OSPEED_100M(GPIOE_FSMC_D12)) -#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOE_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOE_JOY_A) | \ - PIN_PUPDR_FLOATING(GPIOE_JOY_B) | \ - PIN_PUPDR_FLOATING(GPIOE_JOY_C) | \ - PIN_PUPDR_FLOATING(GPIOE_JOY_D) | \ - PIN_PUPDR_FLOATING(GPIOE_JOY_PRESS) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D4) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D5) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D6) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D7) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D8) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D9) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D10) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D11) | \ - PIN_PUPDR_FLOATING(GPIOE_FSMC_D12)) -#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ - PIN_ODR_HIGH(GPIOE_PIN1) | \ - PIN_ODR_HIGH(GPIOE_JOY_A) | \ - PIN_ODR_HIGH(GPIOE_JOY_B) | \ - PIN_ODR_HIGH(GPIOE_JOY_C) | \ - PIN_ODR_HIGH(GPIOE_JOY_D) | \ - PIN_ODR_HIGH(GPIOE_JOY_PRESS) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D4) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D5) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D6) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D7) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D8) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D9) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D10) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D11) | \ - PIN_ODR_HIGH(GPIOE_FSMC_D12)) -#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ - PIN_AFIO_AF(GPIOE_PIN1, 0) | \ - PIN_AFIO_AF(GPIOE_JOY_A, 0) | \ - PIN_AFIO_AF(GPIOE_JOY_B, 0) | \ - PIN_AFIO_AF(GPIOE_JOY_C, 0) | \ - PIN_AFIO_AF(GPIOE_JOY_D, 0) | \ - PIN_AFIO_AF(GPIOE_JOY_PRESS, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D4, 0)) -#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_FSMC_D5, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D6, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D7, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D8, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D9, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D10, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D11, 0) | \ - PIN_AFIO_AF(GPIOE_FSMC_D12, 0)) - -/* - * PF0 - PIN0 (input floating). - * PF1 - PIN1 (input floating). - * PF2 - PIN2 (input floating). - * PF3 - PIN3 (input floating). - * PF4 - PIN4 (input floating). - * PF5 - PIN5 (input floating). - * PF6 - PIN6 (input floating). - * PF7 - LCD_PWM (input floating). - * PF8 - PIN8 (input floating). - * PF9 - PIN9 (input floating). - * PF10 - PIN10 (input floating). - * PF11 - PIN11 (input floating). - * PF12 - PIN12 (input floating). - * PF13 - PIN13 (input floating). - * PF14 - PIN14 (input floating). - * PF15 - PIN15 (input floating). - */ -#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ - PIN_MODE_INPUT(GPIOF_PIN1) | \ - PIN_MODE_INPUT(GPIOF_PIN2) | \ - PIN_MODE_INPUT(GPIOF_PIN3) | \ - PIN_MODE_INPUT(GPIOF_PIN4) | \ - PIN_MODE_INPUT(GPIOF_PIN5) | \ - PIN_MODE_INPUT(GPIOF_PIN6) | \ - PIN_MODE_INPUT(GPIOF_LCD_PWM) | \ - PIN_MODE_INPUT(GPIOF_PIN8) | \ - PIN_MODE_INPUT(GPIOF_PIN9) | \ - PIN_MODE_INPUT(GPIOF_PIN10) | \ - PIN_MODE_INPUT(GPIOF_PIN11) | \ - PIN_MODE_INPUT(GPIOF_PIN12) | \ - PIN_MODE_INPUT(GPIOF_PIN13) | \ - PIN_MODE_INPUT(GPIOF_PIN14) | \ - PIN_MODE_INPUT(GPIOF_PIN15)) -#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOF_LCD_PWM) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) -#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_100M(GPIOF_PIN0) | \ - PIN_OSPEED_100M(GPIOF_PIN1) | \ - PIN_OSPEED_100M(GPIOF_PIN2) | \ - PIN_OSPEED_100M(GPIOF_PIN3) | \ - PIN_OSPEED_100M(GPIOF_PIN4) | \ - PIN_OSPEED_100M(GPIOF_PIN5) | \ - PIN_OSPEED_100M(GPIOF_PIN6) | \ - PIN_OSPEED_100M(GPIOF_LCD_PWM) | \ - PIN_OSPEED_100M(GPIOF_PIN8) | \ - PIN_OSPEED_100M(GPIOF_PIN9) | \ - PIN_OSPEED_100M(GPIOF_PIN10) | \ - PIN_OSPEED_100M(GPIOF_PIN11) | \ - PIN_OSPEED_100M(GPIOF_PIN12) | \ - PIN_OSPEED_100M(GPIOF_PIN13) | \ - PIN_OSPEED_100M(GPIOF_PIN14) | \ - PIN_OSPEED_100M(GPIOF_PIN15)) -#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOF_LCD_PWM) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN11) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOF_PIN15)) -#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ - PIN_ODR_HIGH(GPIOF_PIN1) | \ - PIN_ODR_HIGH(GPIOF_PIN2) | \ - PIN_ODR_HIGH(GPIOF_PIN3) | \ - PIN_ODR_HIGH(GPIOF_PIN4) | \ - PIN_ODR_HIGH(GPIOF_PIN5) | \ - PIN_ODR_HIGH(GPIOF_PIN6) | \ - PIN_ODR_HIGH(GPIOF_LCD_PWM) | \ - PIN_ODR_HIGH(GPIOF_PIN8) | \ - PIN_ODR_HIGH(GPIOF_PIN9) | \ - PIN_ODR_HIGH(GPIOF_PIN10) | \ - PIN_ODR_HIGH(GPIOF_PIN11) | \ - PIN_ODR_HIGH(GPIOF_PIN12) | \ - PIN_ODR_HIGH(GPIOF_PIN13) | \ - PIN_ODR_HIGH(GPIOF_PIN14) | \ - PIN_ODR_HIGH(GPIOF_PIN15)) -#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0) | \ - PIN_AFIO_AF(GPIOF_PIN1, 0) | \ - PIN_AFIO_AF(GPIOF_PIN2, 0) | \ - PIN_AFIO_AF(GPIOF_PIN3, 0) | \ - PIN_AFIO_AF(GPIOF_PIN4, 0) | \ - PIN_AFIO_AF(GPIOF_PIN5, 0) | \ - PIN_AFIO_AF(GPIOF_PIN6, 0) | \ - PIN_AFIO_AF(GPIOF_LCD_PWM, 0)) -#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ - PIN_AFIO_AF(GPIOF_PIN9, 0) | \ - PIN_AFIO_AF(GPIOF_PIN10, 0) | \ - PIN_AFIO_AF(GPIOF_PIN11, 0) | \ - PIN_AFIO_AF(GPIOF_PIN12, 0) | \ - PIN_AFIO_AF(GPIOF_PIN13, 0) | \ - PIN_AFIO_AF(GPIOF_PIN14, 0) | \ - PIN_AFIO_AF(GPIOF_PIN15, 0)) - -/* - * PG0 - PIN0 (input floating). - * PG1 - PIN1 (input floating). - * PG2 - PIN2 (input floating). - * PG3 - PIN3 (input floating). - * PG4 - PIN4 (input floating). - * PG5 - FSMC_A15 (input floating). - * PG6 - PIN6 (input floating). - * PG7 - PIN7 (input floating). - * PG8 - PIN8 (input floating). - * PG9 - PIN9 (input floating). - * PG10 - PIN10 (input floating). - * PG11 - MII_TX_EN (input floating). - * PG12 - PIN12 (input floating). - * PG13 - MII_TX_D0 (input floating). - * PG14 - MII_TX_D1 (input floating). - * PG15 - PIN15 (input floating). - */ - -#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ - PIN_MODE_INPUT(GPIOG_PIN1) | \ - PIN_MODE_INPUT(GPIOG_PIN2) | \ - PIN_MODE_INPUT(GPIOG_PIN3) | \ - PIN_MODE_INPUT(GPIOG_PIN4) | \ - PIN_MODE_INPUT(GPIOG_FSMC_A15) | \ - PIN_MODE_INPUT(GPIOG_PIN6) | \ - PIN_MODE_INPUT(GPIOG_PIN7) | \ - PIN_MODE_INPUT(GPIOG_PIN8) | \ - PIN_MODE_INPUT(GPIOG_PIN9) | \ - PIN_MODE_INPUT(GPIOG_PIN10) | \ - PIN_MODE_INPUT(GPIOG_MII_TX_EN) | \ - PIN_MODE_INPUT(GPIOG_PIN12) | \ - PIN_MODE_INPUT(GPIOG_MII_TX_D0) | \ - PIN_MODE_INPUT(GPIOG_MII_TX_D1) | \ - PIN_MODE_INPUT(GPIOG_PIN15)) -#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOG_FSMC_A15) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOG_MII_TX_EN) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOG_MII_TX_D0) | \ - PIN_OTYPE_PUSHPULL(GPIOG_MII_TX_D1) | \ - PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) -#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_100M(GPIOG_PIN0) | \ - PIN_OSPEED_100M(GPIOG_PIN1) | \ - PIN_OSPEED_100M(GPIOG_PIN2) | \ - PIN_OSPEED_100M(GPIOG_PIN3) | \ - PIN_OSPEED_100M(GPIOG_PIN4) | \ - PIN_OSPEED_100M(GPIOG_FSMC_A15) | \ - PIN_OSPEED_100M(GPIOG_PIN6) | \ - PIN_OSPEED_100M(GPIOG_PIN7) | \ - PIN_OSPEED_100M(GPIOG_PIN8) | \ - PIN_OSPEED_100M(GPIOG_PIN9) | \ - PIN_OSPEED_100M(GPIOG_PIN10) | \ - PIN_OSPEED_100M(GPIOG_MII_TX_EN) | \ - PIN_OSPEED_100M(GPIOG_PIN12) | \ - PIN_OSPEED_100M(GPIOG_MII_TX_D0) | \ - PIN_OSPEED_100M(GPIOG_MII_TX_D1) | \ - PIN_OSPEED_100M(GPIOG_PIN15)) -#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN1) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN2) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN3) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOG_FSMC_A15) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOG_MII_TX_EN) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOG_MII_TX_D0) | \ - PIN_PUPDR_FLOATING(GPIOG_MII_TX_D1) | \ - PIN_PUPDR_FLOATING(GPIOG_PIN15)) -#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ - PIN_ODR_HIGH(GPIOG_PIN1) | \ - PIN_ODR_HIGH(GPIOG_PIN2) | \ - PIN_ODR_HIGH(GPIOG_PIN3) | \ - PIN_ODR_HIGH(GPIOG_PIN4) | \ - PIN_ODR_HIGH(GPIOG_FSMC_A15) | \ - PIN_ODR_HIGH(GPIOG_PIN6) | \ - PIN_ODR_HIGH(GPIOG_PIN7) | \ - PIN_ODR_HIGH(GPIOG_PIN8) | \ - PIN_ODR_HIGH(GPIOG_PIN9) | \ - PIN_ODR_HIGH(GPIOG_PIN10) | \ - PIN_ODR_HIGH(GPIOG_MII_TX_EN) | \ - PIN_ODR_HIGH(GPIOG_PIN12) | \ - PIN_ODR_HIGH(GPIOG_MII_TX_D0) | \ - PIN_ODR_HIGH(GPIOG_MII_TX_D1) | \ - PIN_ODR_HIGH(GPIOG_PIN15)) -#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ - PIN_AFIO_AF(GPIOG_PIN1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN2, 0) | \ - PIN_AFIO_AF(GPIOG_PIN3, 0) | \ - PIN_AFIO_AF(GPIOG_PIN4, 0) | \ - PIN_AFIO_AF(GPIOG_FSMC_A15, 0) | \ - PIN_AFIO_AF(GPIOG_PIN6, 0) | \ - PIN_AFIO_AF(GPIOG_PIN7, 0)) -#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ - PIN_AFIO_AF(GPIOG_PIN9, 0) | \ - PIN_AFIO_AF(GPIOG_PIN10, 0) | \ - PIN_AFIO_AF(GPIOG_MII_TX_EN, 0) | \ - PIN_AFIO_AF(GPIOG_PIN12, 0) | \ - PIN_AFIO_AF(GPIOG_MII_TX_D0, 0) | \ - PIN_AFIO_AF(GPIOG_MII_TX_D1, 0) | \ - PIN_AFIO_AF(GPIOG_PIN15, 0)) - -/* - * PH0 - OSC_IN (input floating). - * PH1 - OSC_OUT (input floating). - * PH2 - LED1 (output pushpull maximum). - * PH3 - LED2 (output pushpull maximum). - * PH4 - ULPI_NXT (input floating). - * PH5 - PIN5 (input floating). - * PH6 - PIN6 (input floating). - * PH7 - PIN7 (input floating). - * PH8 - PIN8 (input floating). - * PH9 - PIN9 (input floating). - * PH10 - PIN10 (input floating). - * PH11 - ULPI_RESET (input floating). - * PH12 - PIN12 (input floating). - * PH13 - PIN13 (input floating). - * PH14 - PIN14 (input floating). - * PH15 - PIN15 (input floating). - */ - -#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \ - PIN_MODE_INPUT(GPIOH_OSC_OUT) | \ - PIN_MODE_OUTPUT(GPIOH_LED1) | \ - PIN_MODE_OUTPUT(GPIOH_LED2) | \ - PIN_MODE_INPUT(GPIOH_ULPI_NXT) | \ - PIN_MODE_INPUT(GPIOH_PIN5) | \ - PIN_MODE_INPUT(GPIOH_PIN6) | \ - PIN_MODE_INPUT(GPIOH_PIN7) | \ - PIN_MODE_INPUT(GPIOH_PIN8) | \ - PIN_MODE_INPUT(GPIOH_PIN9) | \ - PIN_MODE_INPUT(GPIOH_PIN10) | \ - PIN_MODE_INPUT(GPIOH_ULPI_RESET) | \ - PIN_MODE_INPUT(GPIOH_PIN12) | \ - PIN_MODE_INPUT(GPIOH_PIN13) | \ - PIN_MODE_INPUT(GPIOH_PIN14) | \ - PIN_MODE_INPUT(GPIOH_PIN15)) -#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \ - PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \ - PIN_OTYPE_PUSHPULL(GPIOH_LED1) | \ - PIN_OTYPE_PUSHPULL(GPIOH_LED2) | \ - PIN_OTYPE_PUSHPULL(GPIOH_ULPI_NXT) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ - PIN_OTYPE_PUSHPULL(GPIOH_ULPI_RESET) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) -#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_100M(GPIOH_OSC_IN) | \ - PIN_OSPEED_100M(GPIOH_OSC_OUT) | \ - PIN_OSPEED_100M(GPIOH_LED1) | \ - PIN_OSPEED_100M(GPIOH_LED2) | \ - PIN_OSPEED_100M(GPIOH_ULPI_NXT) | \ - PIN_OSPEED_100M(GPIOH_PIN5) | \ - PIN_OSPEED_100M(GPIOH_PIN6) | \ - PIN_OSPEED_100M(GPIOH_PIN7) | \ - PIN_OSPEED_100M(GPIOH_PIN8) | \ - PIN_OSPEED_100M(GPIOH_PIN9) | \ - PIN_OSPEED_100M(GPIOH_PIN10) | \ - PIN_OSPEED_100M(GPIOH_ULPI_RESET) | \ - PIN_OSPEED_100M(GPIOH_PIN12) | \ - PIN_OSPEED_100M(GPIOH_PIN13) | \ - PIN_OSPEED_100M(GPIOH_PIN14) | \ - PIN_OSPEED_100M(GPIOH_PIN15)) -#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \ - PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \ - PIN_PUPDR_FLOATING(GPIOH_LED1) | \ - PIN_PUPDR_FLOATING(GPIOH_LED2) | \ - PIN_PUPDR_FLOATING(GPIOH_ULPI_NXT) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN8) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN10) | \ - PIN_PUPDR_FLOATING(GPIOH_ULPI_RESET) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOH_PIN15)) -#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \ - PIN_ODR_HIGH(GPIOH_OSC_OUT) | \ - PIN_ODR_LOW(GPIOH_LED1) | \ - PIN_ODR_LOW(GPIOH_LED2) | \ - PIN_ODR_HIGH(GPIOH_ULPI_NXT) | \ - PIN_ODR_HIGH(GPIOH_PIN5) | \ - PIN_ODR_HIGH(GPIOH_PIN6) | \ - PIN_ODR_HIGH(GPIOH_PIN7) | \ - PIN_ODR_HIGH(GPIOH_PIN8) | \ - PIN_ODR_HIGH(GPIOH_PIN9) | \ - PIN_ODR_HIGH(GPIOH_PIN10) | \ - PIN_ODR_HIGH(GPIOH_ULPI_RESET) | \ - PIN_ODR_HIGH(GPIOH_PIN12) | \ - PIN_ODR_HIGH(GPIOH_PIN13) | \ - PIN_ODR_HIGH(GPIOH_PIN14) | \ - PIN_ODR_HIGH(GPIOH_PIN15)) -#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0) | \ - PIN_AFIO_AF(GPIOH_OSC_OUT, 0) | \ - PIN_AFIO_AF(GPIOH_LED1, 0) | \ - PIN_AFIO_AF(GPIOH_LED2, 0) | \ - PIN_AFIO_AF(GPIOH_ULPI_NXT, 0) | \ - PIN_AFIO_AF(GPIOH_PIN5, 0) | \ - PIN_AFIO_AF(GPIOH_PIN6, 0) | \ - PIN_AFIO_AF(GPIOH_PIN7, 0)) -#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ - PIN_AFIO_AF(GPIOH_PIN9, 0) | \ - PIN_AFIO_AF(GPIOH_PIN10, 0) | \ - PIN_AFIO_AF(GPIOH_ULPI_RESET, 0) | \ - PIN_AFIO_AF(GPIOH_PIN12, 0) | \ - PIN_AFIO_AF(GPIOH_PIN13, 0) | \ - PIN_AFIO_AF(GPIOH_PIN14, 0) | \ - PIN_AFIO_AF(GPIOH_PIN15, 0)) - -/* - * PI0 - TP_CS (input floating). - * PI1 - SPI2_SCK (input floating). - * PI2 - SPI2_MISO (input floating). - * PI3 - SPI2_MOSI (input floating). - * PI4 - PIN4 (input floating). - * PI5 - PIN5 (input floating). - * PI6 - PIN6 (input floating). - * PI7 - PIN7 (input floating). - * PI8 - LED3 (input floating). - * PI9 - PIN9 (input floating). - * PI10 - LED4 (input floating). - * PI11 - ULPI_DIR (input floating). - * PI12 - PIN12 (input floating). - * PI13 - PIN13 (input floating). - * PI14 - PIN14 (input floating). - * PI15 - PIN15 (input floating). - */ - -#define GPIOI_TP_CS 0 -#define GPIOI_SPI2_SCK 1 -#define GPIOI_SPI2_MISO 2 -#define GPIOI_SPI2_MOSI 3 -#define GPIOI_PIN4 4 -#define GPIOI_PIN5 5 -#define GPIOI_PIN6 6 -#define GPIOI_PIN7 7 -#define GPIOI_LED3 8 -#define GPIOI_PIN9 9 -#define GPIOI_LED4 10 -#define GPIOI_ULPI_DIR 11 -#define GPIOI_PIN12 12 -#define GPIOI_PIN13 13 -#define GPIOI_PIN14 14 -#define GPIOI_PIN15 15 - -#define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_TP_CS) | \ - PIN_MODE_INPUT(GPIOI_SPI2_SCK) | \ - PIN_MODE_INPUT(GPIOI_SPI2_MISO) | \ - PIN_MODE_INPUT(GPIOI_SPI2_MOSI) | \ - PIN_MODE_INPUT(GPIOI_PIN4) | \ - PIN_MODE_INPUT(GPIOI_PIN5) | \ - PIN_MODE_INPUT(GPIOI_PIN6) | \ - PIN_MODE_INPUT(GPIOI_PIN7) | \ - PIN_MODE_INPUT(GPIOI_LED3) | \ - PIN_MODE_INPUT(GPIOI_PIN9) | \ - PIN_MODE_INPUT(GPIOI_LED4) | \ - PIN_MODE_INPUT(GPIOI_ULPI_DIR) | \ - PIN_MODE_INPUT(GPIOI_PIN12) | \ - PIN_MODE_INPUT(GPIOI_PIN13) | \ - PIN_MODE_INPUT(GPIOI_PIN14) | \ - PIN_MODE_INPUT(GPIOI_PIN15)) -#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_TP_CS) | \ - PIN_OTYPE_PUSHPULL(GPIOI_SPI2_SCK) | \ - PIN_OTYPE_PUSHPULL(GPIOI_SPI2_MISO) | \ - PIN_OTYPE_PUSHPULL(GPIOI_SPI2_MOSI) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \ - PIN_OTYPE_PUSHPULL(GPIOI_LED3) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \ - PIN_OTYPE_PUSHPULL(GPIOI_LED4) | \ - PIN_OTYPE_PUSHPULL(GPIOI_ULPI_DIR) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \ - PIN_OTYPE_PUSHPULL(GPIOI_PIN15)) -#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_100M(GPIOI_TP_CS) | \ - PIN_OSPEED_100M(GPIOI_SPI2_SCK) | \ - PIN_OSPEED_100M(GPIOI_SPI2_MISO) | \ - PIN_OSPEED_100M(GPIOI_SPI2_MOSI) | \ - PIN_OSPEED_100M(GPIOI_PIN4) | \ - PIN_OSPEED_100M(GPIOI_PIN5) | \ - PIN_OSPEED_100M(GPIOI_PIN6) | \ - PIN_OSPEED_100M(GPIOI_PIN7) | \ - PIN_OSPEED_100M(GPIOI_LED3) | \ - PIN_OSPEED_100M(GPIOI_PIN9) | \ - PIN_OSPEED_100M(GPIOI_LED4) | \ - PIN_OSPEED_100M(GPIOI_ULPI_DIR) | \ - PIN_OSPEED_100M(GPIOI_PIN12) | \ - PIN_OSPEED_100M(GPIOI_PIN13) | \ - PIN_OSPEED_100M(GPIOI_PIN14) | \ - PIN_OSPEED_100M(GPIOI_PIN15)) -#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_TP_CS) | \ - PIN_PUPDR_FLOATING(GPIOI_SPI2_SCK) | \ - PIN_PUPDR_FLOATING(GPIOI_SPI2_MISO) | \ - PIN_PUPDR_FLOATING(GPIOI_SPI2_MOSI) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN4) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN5) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN6) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN7) | \ - PIN_PUPDR_FLOATING(GPIOI_LED3) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN9) | \ - PIN_PUPDR_FLOATING(GPIOI_LED4) | \ - PIN_PUPDR_FLOATING(GPIOI_ULPI_DIR) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN12) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN13) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN14) | \ - PIN_PUPDR_FLOATING(GPIOI_PIN15)) -#define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_TP_CS) | \ - PIN_ODR_HIGH(GPIOI_SPI2_SCK) | \ - PIN_ODR_HIGH(GPIOI_SPI2_MISO) | \ - PIN_ODR_HIGH(GPIOI_SPI2_MOSI) | \ - PIN_ODR_HIGH(GPIOI_PIN4) | \ - PIN_ODR_HIGH(GPIOI_PIN5) | \ - PIN_ODR_HIGH(GPIOI_PIN6) | \ - PIN_ODR_HIGH(GPIOI_PIN7) | \ - PIN_ODR_HIGH(GPIOI_LED3) | \ - PIN_ODR_HIGH(GPIOI_PIN9) | \ - PIN_ODR_HIGH(GPIOI_LED4) | \ - PIN_ODR_HIGH(GPIOI_ULPI_DIR) | \ - PIN_ODR_HIGH(GPIOI_PIN12) | \ - PIN_ODR_HIGH(GPIOI_PIN13) | \ - PIN_ODR_HIGH(GPIOI_PIN14) | \ - PIN_ODR_HIGH(GPIOI_PIN15)) -#define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_TP_CS, 0) | \ - PIN_AFIO_AF(GPIOI_SPI2_SCK, 0) | \ - PIN_AFIO_AF(GPIOI_SPI2_MISO, 0) | \ - PIN_AFIO_AF(GPIOI_SPI2_MOSI, 0) | \ - PIN_AFIO_AF(GPIOI_PIN4, 0) | \ - PIN_AFIO_AF(GPIOI_PIN5, 0) | \ - PIN_AFIO_AF(GPIOI_PIN6, 0) | \ - PIN_AFIO_AF(GPIOI_PIN7, 0)) -#define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_LED3, 0) | \ - PIN_AFIO_AF(GPIOI_PIN9, 0) | \ - PIN_AFIO_AF(GPIOI_LED4, 0) | \ - PIN_AFIO_AF(GPIOI_ULPI_DIR, 0) | \ - PIN_AFIO_AF(GPIOI_PIN12, 0) | \ - PIN_AFIO_AF(GPIOI_PIN13, 0) | \ - PIN_AFIO_AF(GPIOI_PIN14, 0) | \ - PIN_AFIO_AF(GPIOI_PIN15, 0)) - - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif - -#endif diff --git a/stm32-chibios/halconf.h b/stm32-chibios/halconf.h deleted file mode 100644 index 9e74f315..00000000 --- a/stm32-chibios/halconf.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 115200 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios/main.c b/stm32-chibios/main.c deleted file mode 100644 index 5d861a5f..00000000 --- a/stm32-chibios/main.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "hal.h" -#include "nil.h" - -THD_WORKING_AREA(waBlinky, 128); -THD_FUNCTION(blinky, arg) -{ - (void)arg; - for(;;) - { - palSetPad(GPIOH, GPIOH_LED1); - chThdSleepMilliseconds(500); - - palClearPad(GPIOH, GPIOH_LED1); - chThdSleepMilliseconds(500); - } -} - - -THD_WORKING_AREA(waHello, 128); -THD_FUNCTION(hello, arg) -{ - (void)arg; - - palSetPadMode(GPIOC, GPIOC_USART3_TX, PAL_MODE_ALTERNATE(7)); - palSetPadMode(GPIOC, GPIOC_USART3_RX, PAL_MODE_ALTERNATE(7)); - - sdStart(&SD3, NULL); - - for (;;) - { - chnWrite((BaseChannel*)&SD3, "Hello, World!\r\n", sizeof("Hello, World!\r\n")); - chThdSleepMilliseconds(1000); - } -} - -THD_TABLE_BEGIN - THD_TABLE_ENTRY(waBlinky, "blinky", blinky, NULL) - THD_TABLE_ENTRY(waHello, "hello", hello, NULL) -THD_TABLE_END - -int main(void) -{ - halInit(); - chSysInit(); - - for(;;) - { - } -} diff --git a/stm32-chibios/mcuconf.h b/stm32-chibios/mcuconf.h deleted file mode 100644 index 5401d3b8..00000000 --- a/stm32-chibios/mcuconf.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _MCUCONF_H_ -#define _MCUCONF_H_ - -/* - * STM32F4xx drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F4xx_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_CLOCK48_REQUIRED TRUE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_HSE -#define STM32_PLLM_VALUE 8 -#define STM32_PLLN_VALUE 336 -#define STM32_PLLP_VALUE 2 -#define STM32_PLLQ_VALUE 7 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV4 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_RTCSEL STM32_RTCSEL_LSI -#define STM32_RTCPRE_VALUE 8 -#define STM32_MCO1SEL STM32_MCO1SEL_HSI -#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 -#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK -#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 -#define STM32_I2SSRC STM32_I2SSRC_CKIN -#define STM32_PLLI2SN_VALUE 192 -#define STM32_PLLI2SR_VALUE 5 -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 -#define STM32_BKPRAM_ENABLE FALSE - -/* - * ADC driver system settings. - */ -#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_USE_ADC2 FALSE -#define STM32_ADC_USE_ADC3 FALSE -#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) -#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC2_DMA_PRIORITY 2 -#define STM32_ADC_ADC3_DMA_PRIORITY 2 -#define STM32_ADC_IRQ_PRIORITY 6 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 6 -#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 6 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 11 -#define STM32_CAN_CAN2_IRQ_PRIORITY 11 - -/* - * DAC driver system settings. - */ -#define STM32_DAC_DUAL_MODE FALSE -#define STM32_DAC_USE_DAC1_CH1 FALSE -#define STM32_DAC_USE_DAC1_CH2 FALSE -#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 -#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 -#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI21_IRQ_PRIORITY 15 -#define STM32_EXT_EXTI22_IRQ_PRIORITY 15 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM6 FALSE -#define STM32_GPT_USE_TIM7 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_USE_TIM9 FALSE -#define STM32_GPT_USE_TIM11 FALSE -#define STM32_GPT_USE_TIM12 FALSE -#define STM32_GPT_USE_TIM14 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM6_IRQ_PRIORITY 7 -#define STM32_GPT_TIM7_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 -#define STM32_GPT_TIM9_IRQ_PRIORITY 7 -#define STM32_GPT_TIM11_IRQ_PRIORITY 7 -#define STM32_GPT_TIM12_IRQ_PRIORITY 7 -#define STM32_GPT_TIM14_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_USE_I2C3 FALSE -#define STM32_I2C_BUSY_TIMEOUT 50 -#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C3_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_I2C3_DMA_PRIORITY 3 -#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_USE_TIM9 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 -#define STM32_ICU_TIM9_IRQ_PRIORITY 7 - -/* - * MAC driver system settings. - */ -#define STM32_MAC_TRANSMIT_BUFFERS 2 -#define STM32_MAC_RECEIVE_BUFFERS 4 -#define STM32_MAC_BUFFERS_SIZE 1522 -#define STM32_MAC_PHY_TIMEOUT 100 -#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE -#define STM32_MAC_ETH1_IRQ_PRIORITY 13 -#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 FALSE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_USE_TIM9 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 -#define STM32_PWM_TIM9_IRQ_PRIORITY 7 - -/* - * SDC driver system settings. - */ -#define STM32_SDC_SDIO_DMA_PRIORITY 3 -#define STM32_SDC_SDIO_IRQ_PRIORITY 9 -#define STM32_SDC_WRITE_TIMEOUT_MS 250 -#define STM32_SDC_READ_TIMEOUT_MS 25 -#define STM32_SDC_CLOCK_ACTIVATION_DELAY 10 -#define STM32_SDC_SDIO_UNALIGNED_SUPPORT TRUE -#define STM32_SDC_SDIO_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 FALSE -#define STM32_SERIAL_USE_USART3 TRUE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USE_USART6 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 -#define STM32_SERIAL_USART6_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) -#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) -#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") - -/* - * ST driver system settings. - */ -#define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 2 - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USE_UART4 FALSE -#define STM32_UART_USE_UART5 FALSE -#define STM32_UART_USE_USART6 FALSE -#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) -#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) -#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) -#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) -#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) -#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) -#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) -#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) -#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) -#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) -#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_UART4_IRQ_PRIORITY 12 -#define STM32_UART_UART5_IRQ_PRIORITY 12 -#define STM32_UART_USART6_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_UART4_DMA_PRIORITY 0 -#define STM32_UART_UART5_DMA_PRIORITY 0 -#define STM32_UART_USART6_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_OTG1 FALSE -#define STM32_USB_USE_OTG2 FALSE -#define STM32_USB_OTG1_IRQ_PRIORITY 14 -#define STM32_USB_OTG2_IRQ_PRIORITY 14 -#define STM32_USB_OTG1_RX_FIFO_SIZE 512 -#define STM32_USB_OTG2_RX_FIFO_SIZE 1024 -#define STM32_USB_OTG_THREAD_PRIO LOWPRIO -#define STM32_USB_OTG_THREAD_STACK_SIZE 128 -#define STM32_USB_OTGFIFO_FILL_BASEPRI 0 - -#endif /* _MCUCONF_H_ */ diff --git a/stm32-chibios/nilconf.h b/stm32-chibios/nilconf.h deleted file mode 100644 index a63b131c..00000000 --- a/stm32-chibios/nilconf.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file nilconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _NILCONF_H_ -#define _NILCONF_H_ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Number of user threads in the application. - * @note This number is not inclusive of the idle thread which is - * Implicitly handled. - */ -#define NIL_CFG_NUM_THREADS 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name System timer settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define NIL_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @note This value together with the @p NIL_CFG_ST_RESOLUTION - * option defines the maximum amount of time allowed for - * timeouts. - */ -#define NIL_CFG_ST_FREQUENCY 50000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define NIL_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define NIL_CFG_USE_EVENTS TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System assertions. - */ -#define NIL_CFG_ENABLE_ASSERTS FALSE - -/** - * @brief Stack check. - */ -#define NIL_CFG_ENABLE_STACK_CHECK FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System initialization hook. - */ -#if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_INIT_HOOK() { \ -} -#endif - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define NIL_CFG_THREAD_EXT_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - */ -#define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \ - /* Add custom threads initialization code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define NIL_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define NIL_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief System halt hook. - */ -#if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__) -#define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \ -} -#endif - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in nilcore.h). */ -/*===========================================================================*/ - -#endif /* _NILCONF_H_ */ - -/** @} */ diff --git a/stm32-chibios/osalconf.h b/stm32-chibios/osalconf.h deleted file mode 100644 index ed7d75dd..00000000 --- a/stm32-chibios/osalconf.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief Bare-metal OSAL configuration header. - * - * @addtogroup OSAL_CONF - * @{ - */ - -#ifndef _OSALCONF_H_ -#define _OSALCONF_H_ - -/** - * @brief Frequency in Hertz of the system tick. - */ -#if !defined(OSAL_ST_FREQUENCY) || defined(__DOXYGEN__) -#define OSAL_ST_FREQUENCY 1000 -#endif - -/** - * @brief Enables OSAL assertions. - */ -#if !defined(OSAL_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__) -#define OSAL_DBG_ENABLE_ASSERTS FALSE -#endif - -/** - * @brief Enables OSAL functions parameters checks. - */ -#if !defined(OSAL_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__) -#define OSAL_DBG_ENABLE_CHECKS FALSE -#endif - -/** - * @brief OSAL initialization hook. - */ -#if !defined(OSAL_INIT_HOOK) || defined(__DOXYGEN__) -#define OSAL_INIT_HOOK() { \ -} -#endif - -/** - * @brief Idle loop hook macro. - */ -#if !defined(OSAL_IDLE_HOOK) || defined(__DOXYGEN__) -#define OSAL_IDLE_HOOK() { \ -} -#endif - -#endif /* _OSALCONF_H_ */ - -/** @} */ diff --git a/stm32-hal-freertos-uart-tensorflow/.gitignore b/stm32-hal-freertos-uart-tensorflow/.gitignore deleted file mode 100644 index 378eac25..00000000 --- a/stm32-hal-freertos-uart-tensorflow/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/stm32-hal-freertos-uart-tensorflow/CMakeLists.txt b/stm32-hal-freertos-uart-tensorflow/CMakeLists.txt deleted file mode 100644 index 0d8be119..00000000 --- a/stm32-hal-freertos-uart-tensorflow/CMakeLists.txt +++ /dev/null @@ -1,107 +0,0 @@ -PROJECT(STM32F40G_EVAL LANGUAGES C CXX) - -set(CMAKE_BUILD_TYPE Debug) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON ) -CMAKE_MINIMUM_REQUIRED(VERSION 3.3) -ENABLE_LANGUAGE(ASM) - -SET(TARGET stm32f4HAL) -ADD_DEFINITIONS(-DDEBUG_UART_HANDLE=UartHandle) - -# Remove -rdynamic option from linking that is not supported by arm-none-eabi -# Also remove "undefined reference to `_sbrk'" error -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-specs=nano.specs -specs=nosys.specs") -set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) -SET(CMAKE_C_FLAGS "-mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -Wall -mfpu=fpv4-sp-d16 -Wl,-Map=output.map -Wl,--gc-sections -g3") - -set(STM32_CHIP STM32F407IGH6) -set(STM_BOARD STM324xG_EVAL) -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(CMAKE_TOOLCHAIN_FILE ${CMAKE_MODULE_PATH}/gcc_stm32.cmake) -include(${CMAKE_TOOLCHAIN_FILE}) - -FIND_PACKAGE(Git REQUIRED) - -set(CUBE_SOURCE "${CMAKE_BINARY_DIR}/STM32F4-Cube-Firmware") -if(EXISTS ${CUBE_SOURCE}) - message("Cube FW directory exists") -else() - message("Getting Cube Firmware") - set(GIT_REPOSITORY "https://github.com/alxhoff/STM32F4-Cube-Firmware.git") - execute_process(COMMAND ${GIT_EXECUTABLE} clone ${GIT_REPOSITORY} ) -endif() - -set(STM32Cube_DIR ${CUBE_SOURCE}) - -FIND_PACKAGE(TFLite REQUIRED) - -SET(TFLITE_PLATFORM micro) - -set(STM32Cube_DIR ${CUBE_SOURCE}) - -SET(FREERTOS_HEAP_IMPL 1) - -FIND_PACKAGE(FreeRTOS REQUIRED) -FIND_PACKAGE(CMSIS REQUIRED) -FIND_PACKAGE(STM32HAL COMPONENTS sram gpio uart REQUIRED) -FIND_PACKAGE(STM32LL COMPONENTS fsmc sdmmc REQUIRED) -FIND_PACKAGE(STM32BSP COMPONENTS sd sram ts io lcd ili9325 stmpe811 REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - "${PROJECT_SOURCE_DIR}/Inc" - ${STM32HAL_INCLUDE_DIR} - ${STM32LL_INCLUDE_DIR} - ${CMSIS_INCLUDE_DIRS} - ${FreeRTOS_INCLUDE_DIRS} - ${STM32BSP_INCLUDE_DIR} - ${TFLite_INCLUDE_DIRS} - ) - -file(GLOB PROJECT_SOURCES - "Src/*.c" - "Src/*.cc" - "Src/*.cpp" - ) - -SET(STM32_LINKER_SCRIPT ${CMSIS_LINKER_SCRIPT}) - -ADD_EXECUTABLE( - ${CMAKE_PROJECT_NAME}.elf - ${PROJECT_SOURCES} - ${STM32HAL_SOURCES} - ${STM32BSP_SOURCES} - ${STM32LL_SOURCES} - ${FreeRTOS_SOURCES} - ${TFLite_SOURCES} - ${CMSIS_SOURCES} - ) - -TARGET_COMPILE_DEFINITIONS(${CMAKE_PROJECT_NAME}.elf PUBLIC STM_BSP) - -ADD_CUSTOM_TARGET( - flash - COMMAND ${CMAKE_OBJCOPY} -Obinary ${CMAKE_PROJECT_NAME}.elf ${CMAKE_PROJECT_NAME}.bin # TODO - COMMAND st-flash write ${CMAKE_PROJECT_NAME}.bin 0x8000000 - ) - -ADD_DEPENDENCIES(flash ${CMAKE_PROJECT_NAME}.elf) - -IF(NOT OPENOCD_BOARD) - FILE(GLOB OPENOCD_BOARD ${PROJECT_SOURCE_DIR}/*.cfg) -ENDIF() - -ADD_CUSTOM_TARGET( - debug - COMMAND openocd -f ${OPENOCD_BOARD} >/dev/null 2>&1 & sleep 2 - COMMAND ${TARGET_TRIPLET}-gdb -quiet -tui -command=${CMAKE_CURRENT_LIST_DIR}/GDBCommands -se ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.elf - COMMAND killall -15 openocd - ) - -ADD_DEPENDENCIES(debug flash) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}.elf) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}.elf) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}.elf) - -# TODO: also clean .bin file on `make clean` diff --git a/stm32-hal-freertos-uart-tensorflow/GDBCommands b/stm32-hal-freertos-uart-tensorflow/GDBCommands deleted file mode 100644 index ec160997..00000000 --- a/stm32-hal-freertos-uart-tensorflow/GDBCommands +++ /dev/null @@ -1,6 +0,0 @@ -target remote localhost:3333 -monitor reset -load -break main -continue - diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/FreeRTOSConfig.h b/stm32-hal-freertos-uart-tensorflow/Inc/FreeRTOSConfig.h deleted file mode 100644 index aca7a22f..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/FreeRTOSConfig.h +++ /dev/null @@ -1,131 +0,0 @@ -/* USER CODE BEGIN Header */ -/* - * FreeRTOS Kernel V10.0.1 - * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ - /* USER CODE END Header */ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * These parameters and more are described within the 'configuration' section of the - * FreeRTOS API documentation available on the FreeRTOS.org web site. - * - * See http://www.freertos.org/a00110.html - *----------------------------------------------------------*/ - -/* USER CODE BEGIN Includes */ -/* Section where include file can be added */ -/* USER CODE END Includes */ - -/* Ensure definitions are only used by the compiler, and not by the assembler. */ -#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) - #include - extern uint32_t SystemCoreClock; - void xPortSysTickHandler(void); -#endif -#define configUSE_PREEMPTION 1 -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ((TickType_t)1000) -#define configMAX_PRIORITIES ( 7 ) -#define configMINIMAL_STACK_SIZE ((uint16_t)128) -#define configTOTAL_HEAP_SIZE ((size_t)15360) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configUSE_16_BIT_TICKS 0 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 0 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 - -/* Cortex-M specific definitions. */ -#ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS -#else - #define configPRIO_BITS 4 -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" -function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/* The highest interrupt priority that can be used by any interrupt service -routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL -INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER -PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -/* USER CODE BEGIN 1 */ -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} -/* USER CODE END 1 */ - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler - -/* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick, - to prevent overwriting SysTick_Handler defined within STM32Cube HAL */ - -/* #define xPortSysTickHandler SysTick_Handler */ - -/* USER CODE BEGIN Defines */ -/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ -/* USER CODE END Defines */ - -#endif /* FREERTOS_CONFIG_H */ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/color.h b/stm32-hal-freertos-uart-tensorflow/Inc/color.h deleted file mode 100644 index b57bd1d1..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/color.h +++ /dev/null @@ -1,1560 +0,0 @@ -/** - ****************************************************************************** - * @file Display/LCD_Paint/Inc/color.h - * @author MCD Application Team - * @brief This file contains image used for LTDC application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __COLOR_H -#define __COLOR_H - -const unsigned char color[24054]= -{ -0x42,0x4d,0xf6,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00, -0x00,0x00,0x32,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x03,0x00, -0x00,0x00,0xc0,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0xbf,0xf7, -0xbf,0xf7,0xbf,0xf7,0xbf,0xf7,0x9f,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x5d,0xef,0x29,0x4a,0x6e,0x73,0xff,0xff,0x18,0xc6, -0x86,0x31,0x76,0xb5,0xff,0xff,0x55,0xad,0x27,0x42,0x78,0xce,0xff,0xff,0x71,0x94, -0xec,0x62,0x5d,0xef,0xff,0xff,0x4c,0x63,0xf0,0x83,0xff,0xff,0xff,0xff,0x69,0x4a, -0x35,0xad,0xff,0xff,0xfc,0xe6,0x86,0x31,0x97,0xbe,0xff,0xff,0x18,0xa5,0xe4,0x18, -0xff,0xff,0xff,0xff,0xaf,0x7b,0xa2,0x10,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xbe,0xff,0x95,0xbd,0xbf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xee,0x83, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9d,0xef,0x52,0x95,0xbe,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x8a,0x52,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0x5e,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x9b,0xd6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x3d,0xef,0xf0,0x73,0x32,0xce,0x20,0xb2,0x20,0xb4,0xee,0xa3,0x7f,0xef, -0xff,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x20,0x00,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x76,0xee,0x20,0xab,0xf5,0xef,0x92,0xef, -0x8b,0xde,0x80,0xbc,0x24,0xc4,0x8d,0xdd,0x9d,0xef,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xe6, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd0,0xac,0xc0,0xc3,0xf0,0xf7, -0x0a,0xe7,0x0e,0xdf,0x0b,0xe7,0x94,0xef,0x2e,0xe7,0xe9,0xd5,0xa4,0xcc,0xe8,0xb3, -0x36,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0x03,0x83,0xc0,0xdd,0xcb,0xf7, -0x29,0xe7,0x09,0xe7,0x88,0xe5,0x68,0xe7,0x28,0xe7,0x47,0xe7,0xe6,0xe6,0x06,0xe7, -0x0b,0xe7,0x52,0xe7,0x70,0xe7,0xb1,0xef,0xcb,0xde,0x63,0xc4,0x44,0xcc,0xd5,0xdd, -0x7f,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0x40,0x92,0x08,0xf7, -0x2a,0xe7,0x48,0xe7,0x23,0xe6,0xe1,0xe4,0xa9,0xe7,0x08,0xe7,0x29,0xe6,0xe7,0xe5, -0x48,0xe7,0x28,0xe7,0x08,0xe7,0x26,0xe6,0x8a,0xe6,0x2c,0xe7,0x4d,0xe7,0x6e,0xe7, -0x6c,0xe7,0x03,0xce,0xe0,0xbb,0x8c,0xc4,0x9e,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x74,0x9c,0xc5,0xbc, -0xe7,0xf7,0x67,0xee,0x8a,0xe6,0x85,0xe5,0xe0,0xe5,0x8b,0xe7,0x29,0xe7,0x44,0xe6, -0x02,0xe6,0x29,0xe7,0x28,0xe7,0xa9,0xe6,0x87,0xe5,0xa8,0xe6,0x6b,0xe7,0x4d,0xe6, -0x46,0xe6,0x2b,0xe7,0x0b,0xe7,0x50,0xef,0x74,0xef,0xc8,0xe6,0x00,0xb4,0x2c,0xac, -0x3e,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x68, -0x20,0xc8,0x00,0x90,0x63,0x92,0xe5,0xef,0x21,0xef,0x00,0xee,0x0c,0xe7,0x27,0xe7, -0xa0,0xe5,0xa6,0xe5,0x8a,0xe7,0x69,0xe7,0x25,0xe6,0x02,0xe5,0x6a,0xe7,0x08,0xe7, -0xa7,0xe5,0x06,0xe6,0x08,0xe7,0x07,0xe7,0x07,0xe7,0xe9,0xe6,0x09,0xe7,0x0f,0xe7, -0xd2,0xf7,0x4a,0xd6,0x80,0xb3,0x86,0xbb,0x7d,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xee, -0x00,0x58,0xa0,0xf1,0x60,0xea,0x60,0xf2,0xa0,0xe9,0x00,0x90,0xa6,0x91,0x2d,0xad, -0xe2,0xff,0xe1,0xec,0xa6,0xe5,0x0c,0xe7,0x68,0xe6,0x21,0xe5,0x45,0xe5,0xac,0xe7, -0xc6,0xe6,0x40,0xe5,0x85,0xe6,0x89,0xe7,0x49,0xe7,0x29,0xe7,0xe8,0xe6,0x08,0xe7, -0x27,0xe7,0x6c,0xe7,0x0d,0xe7,0x2d,0xef,0xcd,0xef,0xaa,0xe7,0x20,0xb3,0xa7,0xc3, -0xbe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xd3,0xc4,0x00,0x70,0xc0,0xfb,0xc0,0xe1,0x00,0xe2,0xe0,0xe1,0x00,0xe2,0x60,0xea, -0xa0,0xea,0x00,0xb8,0x63,0x88,0x4d,0xb5,0x42,0xef,0x21,0xf7,0x00,0xe5,0x26,0xde, -0xaa,0xe7,0x41,0xe5,0x23,0xe5,0xaa,0xe6,0x4a,0xe7,0xc6,0xe6,0x41,0xe5,0x44,0xe6, -0x49,0xe7,0x69,0xe7,0x86,0xe6,0x00,0xe5,0x65,0xe6,0x67,0xe7,0xce,0xf7,0xe1,0xc3, -0x63,0xab,0x9d,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0x00,0x70,0xa0,0xfc,0xc0,0xd9,0x20,0xe2,0xe0,0xe1,0x00,0xe2, -0x00,0xe2,0x00,0xe2,0xc0,0xe1,0x40,0xea,0x60,0xea,0x81,0xd1,0x01,0xa0,0x63,0x91, -0x07,0xdf,0xe3,0xff,0x60,0xe5,0xa4,0xe5,0x4b,0xe7,0x08,0xe7,0xa2,0xe5,0xe3,0xe5, -0x89,0xe6,0xea,0xe6,0xe7,0xe6,0x82,0xe5,0xe4,0xe5,0x49,0xe7,0xea,0xf7,0x63,0xd6, -0x40,0x8a,0x19,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0x00,0x68,0x00,0x88, -0x44,0xfc,0x67,0xe3,0x60,0xe2,0xc0,0xe1,0x00,0xe3,0xa0,0xe2,0x80,0xe2,0x80,0xe1, -0x20,0xe2,0xa0,0xe2,0x00,0xf2,0x80,0xea,0xe0,0xc0,0x00,0x88,0x08,0xa2,0x8b,0xe6, -0xea,0xf7,0x44,0xe6,0x80,0xe4,0x66,0xe5,0x8a,0xe6,0xc9,0xf7,0xe1,0xc5,0xc3,0x8a, -0x9b,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x3a,0xde,0x00,0x68,0xa0,0xfa,0x80,0xe3,0x80,0xe2,0xc0,0xe1,0xc0,0xe2, -0xa0,0xe2,0xe0,0xe2,0x60,0xe2,0xa0,0xe1,0x60,0xe2,0x40,0xe2,0xc0,0xe2,0xa0,0xfb, -0xa0,0xd2,0x82,0xa8,0x04,0x98,0x88,0xcc,0xeb,0xf7,0xea,0xf7,0x83,0xe6,0x40,0xb3, -0x10,0xd5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xfe,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf7,0xff,0xff,0xff,0xff, -0xff,0xff,0xfd,0xef,0xff,0xff,0x19,0xc6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x50,0xa0,0xfa,0xa0,0xe2, -0xa0,0xe1,0x00,0xe2,0xc0,0xe1,0xa0,0xe1,0x00,0xe2,0xe0,0xe2,0xe0,0xe2,0xe0,0xe2, -0x00,0xe3,0x20,0xe3,0x40,0xeb,0xe0,0xeb,0x20,0xec,0xa0,0xa9,0x64,0xa9,0xc2,0xba, -0x0a,0xac,0x1c,0xef,0xff,0xff,0x52,0x7c,0x92,0x94,0xff,0xff,0xfd,0xf7,0xcd,0x4a, -0x99,0xde,0xff,0xff,0x1b,0xef,0x8c,0x42,0x5c,0xf7,0xff,0xff,0xdb,0xe6,0x0a,0x53, -0xff,0xff,0xff,0xff,0x76,0xb5,0xe9,0x4a,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3b,0xbe,0x00,0x70,0x60,0xf3, -0x20,0xe3,0x80,0xe1,0xe0,0xe2,0x80,0xe3,0xc1,0xec,0xa5,0xe4,0x60,0xec,0x42,0xec, -0xc1,0xe3,0x80,0xe3,0xa0,0xe3,0x20,0xe4,0x00,0xe4,0xc0,0xe3,0x40,0xe4,0x20,0xff, -0xc0,0xdb,0x44,0xa0,0xd9,0xdd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x4f,0xab,0x00,0x98, -0x40,0xfb,0x20,0xe3,0xc0,0xe2,0x40,0xe2,0x80,0xec,0x40,0xe4,0x61,0x98,0xe6,0xb0, -0x00,0xc9,0x40,0xcb,0x81,0xed,0x40,0xe6,0xa0,0xed,0xc0,0xe4,0x80,0xe4,0xc0,0xe5, -0xe0,0xfe,0xa0,0xb1,0x2d,0xaa,0xbf,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x58, -0x00,0xd9,0x20,0xf4,0xe0,0xda,0x80,0xe2,0x80,0xe3,0xe6,0xf5,0xa0,0xe2,0x04,0x90, -0xbf,0xf7,0xff,0xff,0x9f,0xdf,0xf5,0xd3,0x44,0xa0,0xa2,0xb0,0x20,0xb2,0xc1,0xc3, -0x42,0xdd,0x60,0xbb,0x01,0x80,0x16,0xb4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe6,0x88,0x00,0x98, -0x00,0xfd,0x00,0xe3,0xc0,0xe3,0xc0,0xdb,0x02,0xed,0x00,0xe6,0x01,0x68,0x1a,0xbd, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa7,0x90, -0x60,0xca,0xe0,0xfc,0xe0,0xe3,0xe0,0xe3,0x80,0xe4,0x60,0xfe,0x80,0xdc,0x00,0x68, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x00,0x30,0x80,0xff,0x87,0xe5,0x06,0xe4,0xc6,0xee,0xa0,0xf7,0xa0,0x88, -0x4b,0x90,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x04,0x78,0x00,0xab,0x20,0xd5,0x60,0xaa, -0xe9,0x90,0xba,0xbc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xff, -0xff,0xfe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xb7,0xbd, -0x96,0xb5,0x18,0xbe,0x18,0xbe,0x18,0xbe,0x75,0xb5,0x96,0xb5,0x96,0xb5,0xb7,0xbd, -0x96,0xb5,0x96,0xb5,0x96,0xb5,0xb7,0xbd,0x96,0xb5,0xb7,0xbd,0x96,0xb5,0x96,0xb5, -0x75,0xad,0x76,0xb5,0x96,0xb5,0xd7,0xbd,0xb7,0xbd,0xd7,0xbd,0xb7,0xbd,0xd7,0xbd, -0xd7,0xbd,0xf8,0xc5,0xb7,0xbd,0xb7,0xbd,0xd7,0xbd,0xf8,0xc5,0xf8,0xc5,0x18,0xc6, -0x18,0xc6,0x39,0xce,0xf7,0xbd,0xb7,0xb5,0xf8,0xbd,0x9f,0xf7,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xa6,0x31,0xa6,0x31,0x86,0x31,0xa7,0x39,0x86,0x31,0xa7,0x39,0xa6,0x31, -0xc7,0x39,0xa6,0x31,0xc7,0x39,0xa7,0x39,0xe8,0x41,0x08,0x42,0x08,0x42,0xe7,0x39, -0x29,0x4a,0x49,0x4a,0x29,0x4a,0x28,0x42,0x29,0x4a,0x29,0x42,0x49,0x4a,0x49,0x4a, -0x6a,0x4a,0x49,0x4a,0x6a,0x4a,0x6a,0x4a,0x6a,0x52,0x69,0x4a,0x29,0x4a,0x08,0x42, -0x29,0x42,0x28,0x42,0x49,0x4a,0x49,0x4a,0xaa,0x52,0x8a,0x4a,0xe9,0x41,0x45,0x31, -0x59,0xd6,0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x08,0x4a,0x28,0x42,0x29,0x4a,0x08,0x42,0x29,0x4a, -0x29,0x4a,0x49,0x4a,0x28,0x42,0x29,0x4a,0x29,0x4a,0x49,0x4a,0x08,0x42,0x29,0x4a, -0x28,0x4a,0x29,0x4a,0x28,0x4a,0x49,0x4a,0x08,0x42,0x08,0x42,0x08,0x42,0x29,0x42, -0x28,0x42,0x29,0x42,0x28,0x42,0x29,0x4a,0x29,0x4a,0x4a,0x4a,0x49,0x4a,0x4a,0x52, -0x29,0x4a,0x4a,0x4a,0x28,0x42,0x09,0x42,0x08,0x42,0x29,0x4a,0x48,0x4a,0xc7,0x41, -0x86,0x39,0x2c,0x7b,0x97,0xe6,0x7c,0xff,0x5c,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x08,0x42,0x29,0x4a,0x08,0x42, -0x08,0x42,0x08,0x42,0x29,0x4a,0x28,0x42,0x28,0x42,0x28,0x42,0x49,0x4a,0x28,0x42, -0x28,0x42,0x08,0x42,0x29,0x4a,0x08,0x42,0x29,0x4a,0x29,0x42,0x28,0x42,0x07,0x42, -0x08,0x42,0x08,0x3a,0x29,0x42,0x28,0x42,0x49,0x42,0x28,0x42,0x29,0x4a,0x49,0x4a, -0x49,0x4a,0x29,0x4a,0x49,0x4a,0x29,0x42,0x29,0x4a,0xe8,0x41,0x08,0x42,0x28,0x42, -0x49,0x4a,0xa6,0x39,0xa6,0x39,0x2c,0x73,0x98,0xe6,0x5b,0xff,0x5d,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x45,0x29, -0x24,0x21,0x24,0x21,0xe3,0x18,0x24,0x21,0x24,0x29,0x25,0x29,0xe3,0x18,0xc3,0x18, -0x04,0x21,0x24,0x21,0xe4,0x18,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x24,0x21, -0xe3,0x18,0x04,0x21,0x24,0x21,0x66,0x29,0x45,0x21,0x66,0x29,0x45,0x29,0x66,0x29, -0x25,0x29,0x25,0x29,0x45,0x29,0x86,0x31,0x66,0x29,0x86,0x31,0xa6,0x31,0xc7,0x39, -0xa6,0x31,0xa6,0x31,0x24,0x21,0xe3,0x20,0x07,0x4a,0x78,0xde,0xb8,0xee,0x36,0xe6, -0xf6,0xdd,0x58,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x61,0x08,0x61,0x08,0x41,0x00,0x62,0x10,0x61,0x00,0x61,0x08,0x41,0x08, -0x61,0x08,0x61,0x08,0x82,0x08,0x41,0x08,0x41,0x00,0x20,0x00,0x21,0x00,0x20,0x00, -0x21,0x00,0x20,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x20,0x00, -0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x08,0x21,0x00,0x21,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xeb,0x62,0x54,0xc5,0xb8,0xf6, -0x97,0xf6,0x36,0xe6,0x57,0xee,0xd6,0xcd,0xb2,0x9c,0x9e,0xef,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0x86,0x31,0x45,0x21,0xe7,0x39,0x28,0x42,0x08,0x42, -0x08,0x3a,0x08,0x42,0x08,0x42,0x49,0x4a,0x69,0x4a,0x69,0x4a,0xe7,0x39,0x28,0x42, -0x28,0x42,0x49,0x4a,0x69,0x4a,0xcb,0x5a,0xcb,0x5a,0xcb,0x5a,0x0b,0x5b,0x6e,0x6b, -0xeb,0x52,0x8a,0x52,0xcb,0x52,0x0d,0x63,0x2d,0x63,0x2d,0x63,0x0c,0x5b,0x2d,0x63, -0x2d,0x63,0x6d,0x6b,0xae,0x73,0x10,0x7c,0x10,0x7c,0x8e,0x6b,0x49,0x42,0x55,0xb5, -0x7c,0xff,0xb8,0xfe,0x56,0xee,0xb8,0xfe,0xf9,0xfe,0x79,0xe6,0x82,0x10,0x9a,0xd6, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x20,0x00,0x41,0x08,0x41,0x00, -0x62,0x08,0x61,0x08,0xa3,0x10,0x82,0x10,0x82,0x08,0x82,0x08,0x82,0x10,0x61,0x08, -0x82,0x10,0xa3,0x10,0xa2,0x10,0x82,0x08,0x82,0x10,0x82,0x10,0xc3,0x18,0xa2,0x10, -0xe3,0x18,0xe4,0x18,0xe4,0x18,0xc3,0x10,0x04,0x19,0x04,0x19,0x25,0x21,0xe4,0x18, -0xe4,0x18,0x04,0x19,0x45,0x29,0x65,0x29,0x66,0x29,0x65,0x29,0xe7,0x39,0xc7,0x31, -0xe3,0x18,0x71,0x9c,0xfb,0xfe,0xf5,0xe5,0xf4,0xe5,0xb7,0xfe,0xd9,0xfe,0x13,0xb5, -0xe8,0x39,0x04,0x21,0x38,0xc6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x61,0x08, -0x62,0x08,0x41,0x08,0x20,0x00,0x41,0x08,0x61,0x08,0x62,0x08,0x20,0x00,0x61,0x08, -0xc3,0x10,0xe3,0x18,0x62,0x08,0x82,0x10,0xc3,0x18,0xe4,0x18,0xc3,0x10,0xa3,0x10, -0xc3,0x18,0xe4,0x20,0xa2,0x10,0x62,0x08,0x82,0x08,0xa3,0x10,0x41,0x08,0x21,0x08, -0x20,0x00,0x21,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x94,0x37,0xe6,0x73,0xdd,0x71,0xd5,0xb7,0xfe, -0x56,0xee,0x6d,0x83,0xe8,0x39,0x41,0x08,0x08,0x42,0x10,0x84,0x9e,0xf7,0xff,0xff, -0xff,0xff,0x86,0x29,0x86,0x29,0xa6,0x29,0xa7,0x31,0xa6,0x29,0x86,0x29,0x85,0x29, -0xa6,0x31,0xc6,0x31,0xc7,0x31,0xc7,0x31,0xc7,0x31,0xa6,0x29,0xc7,0x31,0xe7,0x39, -0xe7,0x39,0xa6,0x31,0xa6,0x31,0x65,0x29,0xa7,0x31,0xc7,0x31,0xa7,0x31,0x86,0x29, -0xc7,0x31,0xa7,0x31,0xa7,0x31,0xa6,0x31,0xc7,0x31,0xa6,0x31,0xc7,0x31,0xa6,0x29, -0xc7,0x31,0xc7,0x31,0x08,0x3a,0xe7,0x31,0x67,0x21,0x49,0x52,0xce,0x9b,0xb4,0xe5, -0x92,0xdd,0xb7,0xf6,0x97,0xee,0x28,0x52,0x82,0x10,0x18,0xc6,0xbf,0xff,0xbe,0xf7, -0xdf,0xff,0xff,0xff,0xff,0xff,0xa7,0x31,0x86,0x29,0xa7,0x31,0xa6,0x31,0xc7,0x31, -0x65,0x29,0x86,0x29,0xa6,0x31,0xc7,0x31,0xc7,0x31,0xe7,0x39,0xc6,0x31,0xa7,0x31, -0xc7,0x31,0x08,0x3a,0xe7,0x31,0xc7,0x39,0x86,0x31,0x86,0x29,0xa6,0x29,0xe8,0x31, -0xa6,0x29,0xa6,0x31,0xa6,0x31,0xc7,0x39,0xa7,0x31,0xa7,0x31,0xa7,0x31,0xc7,0x31, -0xa7,0x31,0xa7,0x31,0xc6,0x31,0xe8,0x39,0x07,0x3a,0xe7,0x39,0x66,0x19,0x6a,0x5a, -0xce,0x9b,0xd5,0xed,0x92,0xdd,0xd8,0xfe,0x97,0xee,0x48,0x5a,0x82,0x08,0x18,0xc6, -0xbf,0xff,0xdf,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0x41,0x00,0x41,0x08,0x41,0x00, -0x61,0x08,0x62,0x08,0xa3,0x10,0x82,0x08,0x82,0x08,0x81,0x08,0x21,0x00,0x20,0x00, -0x82,0x08,0x82,0x08,0xa2,0x10,0xa2,0x10,0xa2,0x10,0x82,0x08,0x82,0x10,0x81,0x08, -0xa2,0x10,0xa2,0x10,0xc3,0x10,0xc2,0x10,0xc3,0x10,0xa2,0x10,0xa2,0x10,0x82,0x08, -0xe3,0x10,0xc3,0x10,0xc3,0x10,0xa3,0x10,0xe3,0x18,0xe3,0x18,0xa3,0x10,0xa2,0x10, -0x26,0x19,0xc3,0x18,0x85,0x49,0x52,0xcd,0xf4,0xe5,0x35,0xee,0x32,0xcd,0x65,0x39, -0xbb,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x20,0x00, -0x00,0x00,0x00,0x08,0x20,0x00,0x40,0x00,0x40,0x00,0x41,0x08,0x20,0x00,0x20,0x00, -0x40,0x00,0x41,0x08,0x40,0x00,0x41,0x00,0x40,0x00,0x61,0x08,0x41,0x08,0x61,0x08, -0x60,0x08,0x81,0x08,0x40,0x08,0x41,0x08,0x41,0x08,0x61,0x08,0x40,0x08,0x41,0x08, -0x40,0x00,0x61,0x08,0x61,0x08,0x83,0x10,0x82,0x08,0x82,0x08,0x62,0x08,0x82,0x10, -0x62,0x08,0xa2,0x10,0xa3,0x08,0x01,0x00,0xe3,0x20,0xb4,0xcd,0xd4,0xe5,0x50,0xac, -0x30,0xa4,0x59,0xd6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x20,0x00,0x40,0x08,0x20,0x00,0x40,0x00,0x20,0x00,0x40,0x00,0x20,0x00, -0x20,0x00,0x20,0x00,0x40,0x08,0x40,0x00,0x40,0x08,0x40,0x00,0x40,0x00,0x40,0x00, -0x40,0x00,0x20,0x00,0x60,0x00,0x60,0x00,0x40,0x08,0x20,0x08,0x40,0x10,0x40,0x08, -0x41,0x08,0x40,0x00,0x40,0x08,0x40,0x00,0x81,0x08,0x81,0x08,0x82,0x10,0x81,0x08, -0x62,0x08,0x42,0x08,0x62,0x10,0x62,0x08,0xc4,0x10,0x00,0x00,0xc3,0x18,0xf1,0xc4, -0xb1,0xbc,0x39,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x41,0x08,0x20,0x00,0x40,0x08,0x40,0x00,0x61,0x08, -0x40,0x00,0x61,0x08,0x40,0x00,0x41,0x08,0x41,0x08,0x61,0x08,0x40,0x00,0x61,0x08, -0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x61,0x08, -0x40,0x08,0x40,0x08,0x40,0x00,0x40,0x08,0x40,0x00,0x60,0x08,0x60,0x08,0x61,0x08, -0x61,0x08,0x61,0x08,0x40,0x00,0x61,0x08,0x61,0x00,0x81,0x08,0x41,0x00,0x00,0x00, -0xa2,0x18,0x91,0xb4,0x73,0xcd,0x3c,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x20,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x20,0x00, -0x20,0x00,0x20,0x00,0x82,0x08,0x61,0x08,0x41,0x08,0x20,0x00,0x61,0x08,0x41,0x08, -0x41,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x08,0x20,0x00, -0x40,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x20,0x00, -0x40,0x08,0x00,0x00,0x41,0x10,0xef,0x93,0x3c,0xf7,0xdf,0xff,0xdf,0xff,0xde,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x20,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00, -0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x41,0x00,0x20,0x00,0x21,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00,0x00,0x21,0x00,0x21,0x00,0x41,0x00, -0x41,0x00,0x41,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x60,0x00, -0x40,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xc6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x41,0x00,0x41,0x08,0x21,0x08,0x42,0x08,0x41,0x00,0x41,0x08,0x41,0x00, -0x41,0x08,0x41,0x00,0x61,0x08,0x41,0x00,0x41,0x08,0x21,0x00,0x21,0x00,0x21,0x00, -0x41,0x08,0x20,0x00,0x21,0x08,0x21,0x00,0x41,0x00,0x41,0x00,0x62,0x00,0x41,0x00, -0x42,0x00,0x21,0x00,0x42,0x00,0x21,0x00,0x41,0x00,0x40,0x00,0x40,0x00,0x40,0x00, -0x61,0x00,0x40,0x00,0x61,0x00,0x00,0x00,0x61,0x08,0xb2,0x9c,0x9e,0xff,0xff,0xff, -0xff,0xff,0xdf,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x83,0x10,0x63,0x08,0x83,0x10,0x82,0x08,0x63,0x08, -0x63,0x08,0x83,0x08,0x42,0x00,0x63,0x08,0x63,0x08,0x83,0x08,0x62,0x08,0x63,0x08, -0x42,0x00,0x62,0x08,0x62,0x00,0x63,0x08,0x43,0x08,0x63,0x08,0x62,0x00,0x83,0x00, -0x83,0x00,0xa4,0x08,0x83,0x00,0x64,0x08,0x43,0x08,0x63,0x08,0x62,0x08,0x83,0x08, -0x62,0x08,0x83,0x08,0x83,0x00,0xa3,0x08,0xa3,0x08,0x83,0x00,0x61,0x08,0xaf,0x83, -0x59,0xd6,0xdf,0xff,0xdf,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x42,0x00,0x42,0x08,0x22,0x00, -0x62,0x00,0x62,0x00,0x83,0x08,0x62,0x00,0x62,0x00,0x62,0x00,0x42,0x00,0x41,0x00, -0x62,0x00,0x42,0x00,0x42,0x00,0x42,0x00,0x63,0x00,0x63,0x00,0x63,0x00,0x43,0x00, -0x63,0x00,0x63,0x00,0x84,0x00,0x83,0x00,0x63,0x00,0x43,0x00,0xa4,0x08,0xc4,0x08, -0x84,0x08,0x63,0x00,0xa4,0x08,0xa4,0x08,0x84,0x08,0x63,0x00,0x63,0x00,0x84,0x00, -0x84,0x00,0x21,0x00,0x45,0x29,0x38,0xce,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x84,0x10, -0x63,0x08,0x84,0x08,0x83,0x00,0x84,0x08,0x63,0x00,0x63,0x08,0x63,0x00,0x83,0x08, -0xa4,0x08,0xa4,0x10,0x84,0x08,0xa4,0x08,0xc4,0x08,0xc5,0x10,0xa4,0x08,0x84,0x08, -0x63,0x00,0x84,0x08,0x84,0x00,0x84,0x08,0xa4,0x08,0xe5,0x10,0xa5,0x08,0xc5,0x10, -0x84,0x08,0x84,0x08,0xa5,0x10,0xe7,0x18,0x85,0x08,0x65,0x08,0xa5,0x08,0x07,0x11, -0xe6,0x10,0x65,0x08,0x44,0x00,0x05,0x21,0x06,0x4a,0x90,0xbc,0x7d,0xff,0xff,0xff, -0xfe,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xbf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x83,0x00,0x83,0x08,0x83,0x00,0x63,0x00,0x83,0x00,0xc4,0x08,0xa4,0x08, -0xa4,0x08,0xa4,0x08,0xa4,0x08,0x83,0x08,0xa4,0x08,0x83,0x00,0xc4,0x10,0xc4,0x08, -0xc4,0x08,0x84,0x00,0xc5,0x08,0xc5,0x10,0xc5,0x10,0xc5,0x08,0xa5,0x08,0x63,0x00, -0x84,0x00,0x64,0x00,0x84,0x08,0x84,0x00,0x85,0x08,0x45,0x00,0x65,0x00,0x65,0x00, -0xa6,0x08,0xa5,0x08,0xa6,0x08,0xa6,0x08,0x42,0x08,0xe7,0x41,0xce,0x8b,0xf1,0xc4, -0xd1,0xc4,0x3c,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0x64,0x08,0x84,0x08,0xa5,0x08,0x84,0x00,0xa5,0x08, -0x64,0x00,0x84,0x00,0x84,0x00,0xa5,0x08,0x63,0x00,0x64,0x00,0x63,0x00,0x64,0x00, -0x64,0x00,0x84,0x00,0x64,0x00,0x84,0x08,0x84,0x00,0x84,0x08,0x84,0x00,0x84,0x08, -0x64,0x00,0x64,0x00,0x63,0x00,0x84,0x00,0x84,0x00,0xa5,0x08,0x64,0x00,0x45,0x00, -0x65,0x00,0xa6,0x08,0x85,0x08,0x65,0x08,0x64,0x00,0x86,0x00,0x42,0x00,0x2f,0x94, -0x77,0xe6,0x72,0xdd,0x4e,0xb4,0x53,0xc5,0x58,0xde,0xdf,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x84,0x00,0xa4,0x08,0xa4,0x00, -0x84,0x00,0xc5,0x08,0x06,0x11,0xe5,0x10,0xe6,0x10,0xe5,0x10,0x47,0x19,0x47,0x19, -0x47,0x19,0x26,0x19,0x06,0x19,0xe6,0x10,0x06,0x19,0x26,0x19,0x68,0x21,0x88,0x19, -0x68,0x21,0x67,0x21,0x88,0x29,0x67,0x21,0x88,0x29,0xa8,0x29,0x68,0x21,0x26,0x11, -0x88,0x21,0xa9,0x29,0x89,0x21,0x47,0x19,0x47,0x21,0x47,0x21,0x68,0x29,0x43,0x00, -0xc9,0x39,0xf6,0xcd,0x7a,0xff,0x71,0xdd,0xd4,0xed,0xed,0xab,0x4b,0x8b,0xb6,0xbd, -0xff,0xff,0xff,0xff,0xdf,0xff,0xbe,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xc6,0x10, -0xc5,0x10,0xa5,0x10,0xc5,0x08,0xc6,0x10,0xa5,0x08,0xa5,0x08,0xc5,0x08,0xe6,0x10, -0x63,0x00,0x64,0x08,0x84,0x08,0xa5,0x08,0x64,0x00,0x64,0x08,0x63,0x00,0x43,0x00, -0x43,0x00,0x43,0x00,0x42,0x00,0x43,0x00,0x22,0x00,0x23,0x00,0x22,0x00,0x43,0x00, -0x43,0x00,0x43,0x00,0x43,0x00,0x63,0x00,0x63,0x00,0x84,0x00,0x43,0x00,0x43,0x00, -0x22,0x00,0x01,0x00,0x91,0xa4,0x76,0xf6,0xf2,0xed,0xb2,0xed,0x52,0xe5,0x97,0xfe, -0xb4,0xdd,0x24,0x31,0x6e,0x63,0xbf,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x47,0x19,0x88,0x29,0x88,0x29,0xa9,0x29,0xa9,0x29,0xa9,0x29,0x88,0x21, -0xa9,0x29,0xc9,0x29,0x8c,0x42,0x8c,0x42,0x8c,0x42,0xad,0x4a,0xcd,0x4a,0xad,0x4a, -0xcd,0x52,0x2e,0x5b,0xb1,0x6b,0xd1,0x6b,0xd1,0x73,0xb0,0x6b,0xb1,0x73,0xd1,0x73, -0xf2,0x73,0xf1,0x73,0x12,0x74,0x12,0x74,0x52,0x7c,0x72,0x7c,0x72,0x7c,0x31,0x7c, -0x52,0x84,0x51,0x84,0x72,0x8c,0xb0,0x63,0x54,0xc5,0xf2,0xed,0xd1,0xed,0x71,0xd5, -0x52,0xe5,0xf4,0xfd,0xd4,0xed,0x8d,0x7b,0xf1,0x6b,0xc3,0x10,0x72,0x8c,0xba,0xd6, -0xdf,0xff,0xff,0xff,0xff,0xff,0x88,0x29,0xa8,0x29,0xc8,0x31,0xa8,0x29,0xa8,0x31, -0x87,0x29,0x87,0x29,0xa8,0x29,0xa9,0x29,0x88,0x29,0x88,0x29,0x87,0x21,0x88,0x29, -0x47,0x21,0x67,0x21,0x67,0x21,0x68,0x21,0x67,0x21,0x88,0x21,0x67,0x21,0x48,0x21, -0x68,0x29,0xa9,0x29,0x47,0x21,0x47,0x21,0x06,0x19,0x27,0x19,0x26,0x19,0x26,0x19, -0x06,0x19,0x26,0x19,0x05,0x11,0x05,0x19,0xc4,0x10,0xa3,0x10,0x75,0xb5,0x96,0xf6, -0x70,0xd5,0x51,0xd5,0x73,0xe5,0xf9,0xfe,0x57,0xe6,0x08,0x42,0x67,0x19,0x25,0x29, -0x0c,0x63,0xf4,0xa4,0xbe,0xf7,0xff,0xff,0xff,0xff,0x00,0x00,0x01,0x00,0x00,0x00, -0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x01,0x00,0x01,0x00, -0x02,0x00,0x01,0x00,0x43,0x00,0x42,0x00,0x63,0x00,0x43,0x00,0x43,0x00,0x22,0x00, -0x43,0x00,0x43,0x00,0x64,0x00,0x43,0x00,0x64,0x00,0x64,0x00,0x64,0x00,0x43,0x00, -0x84,0x08,0x84,0x00,0x85,0x08,0x64,0x00,0xc4,0x08,0xe4,0x10,0xa4,0x10,0x22,0x00, -0x74,0xb5,0x75,0xe6,0x71,0xd5,0x92,0xd5,0xd4,0xed,0xb8,0xfe,0xd5,0xdd,0xc3,0x18, -0x00,0x00,0x0d,0x6b,0x9e,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa8,0x21, -0x87,0x21,0xa8,0x21,0x88,0x21,0x88,0x29,0x67,0x21,0x88,0x29,0xa9,0x29,0xc9,0x29, -0xc9,0x29,0xc9,0x29,0xa8,0x21,0x88,0x21,0xc9,0x29,0xea,0x31,0xe9,0x29,0xea,0x29, -0xc9,0x29,0xe9,0x29,0xe9,0x29,0x0a,0x3a,0xe9,0x31,0xea,0x31,0xe9,0x31,0xea,0x31, -0xe9,0x31,0xea,0x31,0x0a,0x32,0x2b,0x3a,0x0a,0x32,0x2b,0x3a,0xe9,0x31,0xc9,0x29, -0x88,0x21,0xc5,0x10,0xf5,0xbc,0x77,0xfe,0xf3,0xe5,0x14,0xde,0xb3,0xdd,0xf5,0xe5, -0x12,0xbd,0xa4,0x18,0x00,0x00,0x1c,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xe9,0x29,0xe9,0x29,0xe9,0x29,0xc9,0x31,0xc9,0x29,0xea,0x31,0xe9,0x31, -0xc9,0x29,0xa9,0x21,0xe9,0x29,0xc9,0x29,0xca,0x29,0xc9,0x29,0xa9,0x29,0xa9,0x29, -0xca,0x29,0xc9,0x29,0xca,0x29,0xc9,0x21,0xc9,0x29,0x88,0x21,0xa9,0x21,0xa9,0x21, -0xca,0x29,0xa9,0x29,0xca,0x29,0xa9,0x29,0xc9,0x29,0x88,0x21,0xa9,0x21,0x89,0x21, -0xc9,0x29,0xc9,0x29,0xa8,0x29,0xa5,0x08,0xd1,0x93,0xf6,0xe5,0x15,0xee,0xd2,0xdd, -0x14,0xee,0x94,0xd5,0x30,0x9c,0x24,0x21,0x7a,0xd6,0xff,0xff,0xdf,0xff,0x9e,0xf7, -0xdf,0xff,0xff,0xff,0xff,0xff,0x48,0x19,0x27,0x11,0x47,0x19,0x27,0x11,0x28,0x19, -0x68,0x19,0x68,0x19,0x06,0x11,0x07,0x11,0x27,0x11,0x47,0x19,0x68,0x19,0xaa,0x29, -0x48,0x19,0x49,0x19,0x48,0x19,0x68,0x19,0x48,0x19,0x68,0x19,0x47,0x19,0x48,0x19, -0x47,0x19,0x48,0x19,0xe6,0x10,0xe6,0x10,0xe6,0x08,0x06,0x11,0xc6,0x08,0xc6,0x08, -0xc5,0x08,0xc6,0x08,0xc5,0x08,0xe7,0x10,0xe6,0x08,0xa6,0x00,0x07,0x19,0x35,0xb5, -0x3b,0xff,0xf5,0xfd,0xd4,0xed,0x50,0xac,0x8d,0x83,0x35,0x9d,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x84,0x00,0xa5,0x08,0xa5,0x00, -0x85,0x08,0x85,0x00,0x85,0x08,0x84,0x00,0xc5,0x08,0xc5,0x08,0xe5,0x08,0xc4,0x00, -0xa5,0x00,0x44,0x00,0x85,0x00,0x85,0x00,0xa5,0x00,0x84,0x00,0x85,0x00,0x84,0x00, -0xa4,0x00,0xa4,0x00,0xa5,0x00,0x84,0x00,0xa5,0x00,0x84,0x00,0xa5,0x00,0x84,0x00, -0xa5,0x08,0xa5,0x00,0xc5,0x08,0x84,0x00,0xc6,0x08,0xe6,0x08,0xe7,0x10,0xc6,0x00, -0x63,0x00,0x08,0x3a,0xee,0x8b,0x33,0xdd,0x2f,0xb4,0x79,0xde,0xff,0xff,0xff,0xff, -0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x9e,0xf7,0xff,0xff,0xff,0xff,0x85,0x08, -0x85,0x00,0xa5,0x08,0xa5,0x08,0xa5,0x08,0x84,0x00,0x85,0x08,0x84,0x00,0x84,0x08, -0x84,0x00,0x84,0x00,0x85,0x00,0xc6,0x08,0xa5,0x08,0xc6,0x10,0xc6,0x08,0xe5,0x08, -0xc5,0x08,0xc6,0x08,0xa5,0x00,0xa5,0x00,0xa5,0x00,0xe6,0x10,0xc5,0x08,0xe6,0x08, -0xc5,0x08,0xe6,0x10,0xc5,0x08,0xc5,0x08,0xa5,0x00,0xc5,0x08,0xa5,0x00,0xc6,0x00, -0xc5,0x00,0xc6,0x08,0xe7,0x00,0x01,0x00,0x00,0x00,0xad,0x9b,0x17,0xde,0xbe,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x84,0x00,0xa5,0x00,0x84,0x00,0xa5,0x08,0xa5,0x00,0xa5,0x08,0xa5,0x00, -0x84,0x00,0x84,0x00,0xa4,0x00,0x84,0x00,0xa5,0x00,0x85,0x00,0xa5,0x00,0xa5,0x00, -0xc6,0x00,0xc5,0x00,0xe5,0x00,0xc5,0x00,0xc5,0x00,0xa5,0x00,0xc5,0x00,0xa5,0x00, -0xc6,0x08,0xc5,0x00,0xc5,0x08,0xa5,0x00,0xc5,0x08,0xa5,0x00,0xa5,0x00,0xa5,0x00, -0xc6,0x08,0xc5,0x00,0xe6,0x08,0xa5,0x00,0x64,0x00,0x00,0x00,0x61,0x10,0xd2,0xa4, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa6,0x08,0xa5,0x00,0xc6,0x08,0x64,0x00,0xa5,0x00, -0x85,0x00,0x85,0x00,0x84,0x00,0xa5,0x00,0x43,0x00,0x43,0x00,0x64,0x00,0x86,0x00, -0xa6,0x00,0xc6,0x08,0xa5,0x00,0xa5,0x00,0xa5,0x00,0xa5,0x00,0x85,0x00,0xa5,0x00, -0xa5,0x00,0xa5,0x00,0x84,0x00,0x85,0x00,0x64,0x00,0x64,0x00,0x43,0x00,0x44,0x00, -0x64,0x00,0xa5,0x00,0x64,0x00,0x64,0x00,0x64,0x00,0xe6,0x00,0xa3,0x08,0x44,0x31, -0xea,0x6a,0x1c,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x23,0x00,0x23,0x00,0x02,0x00, -0x24,0x00,0x03,0x00,0x24,0x00,0x23,0x00,0x43,0x00,0x43,0x00,0xc5,0x00,0xa4,0x00, -0x64,0x00,0x24,0x00,0x23,0x00,0x03,0x00,0x23,0x00,0x02,0x00,0x23,0x00,0x02,0x00, -0x22,0x00,0x02,0x00,0x23,0x00,0x22,0x00,0x43,0x00,0x43,0x00,0x84,0x00,0xa4,0x00, -0xa4,0x00,0x84,0x00,0xa5,0x00,0xc5,0x00,0xe5,0x00,0xa5,0x00,0x44,0x00,0xa5,0x00, -0x71,0x3b,0x9f,0xdf,0xff,0xff,0xff,0xff,0xdf,0xf7,0xde,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8a,0x09, -0x69,0x01,0x8a,0x09,0xca,0x09,0xab,0x09,0xaa,0x09,0xcb,0x09,0xea,0x09,0xeb,0x11, -0xaa,0x09,0xcb,0x09,0xcb,0x09,0xeb,0x11,0x0b,0x12,0x0c,0x12,0x2c,0x12,0x4d,0x1a, -0x2c,0x12,0x4d,0x1a,0x2c,0x12,0x4c,0x12,0x2c,0x12,0x4d,0x1a,0x2c,0x12,0x2c,0x12, -0x0b,0x12,0x0c,0x12,0x0c,0x0a,0x0c,0x12,0x0b,0x0a,0xeb,0x11,0x0c,0x0a,0x4d,0x0a, -0x2c,0x0a,0xec,0x09,0xeb,0x01,0x36,0x95,0x7d,0xf7,0xff,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x8e,0x12,0xaf,0x1a,0xaf,0x1a,0x6e,0x12,0x6d,0x12,0x8e,0x12,0x6e,0x12, -0x8f,0x12,0x8e,0x12,0xaf,0x12,0x8e,0x12,0xaf,0x12,0x8e,0x12,0x8e,0x12,0x6e,0x12, -0x8f,0x12,0xaf,0x0a,0xaf,0x12,0xaf,0x12,0xaf,0x12,0xaf,0x0a,0xaf,0x12,0x8f,0x0a, -0xaf,0x12,0x8e,0x0a,0xcf,0x12,0xd0,0x12,0xf0,0x1a,0xf0,0x12,0xd0,0x1a,0xaf,0x12, -0xf0,0x12,0xef,0x12,0x30,0x1b,0x31,0x13,0x0c,0x0a,0x08,0x3a,0x8c,0x83,0xb9,0xde, -0xff,0xff,0xde,0xff,0xde,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x90,0x02,0x90,0x02,0xb1,0x0a,0xf1,0x0a,0xf2,0x0a, -0x11,0x0b,0x12,0x0b,0xf1,0x0a,0xf2,0x0a,0xb0,0x02,0xd1,0x02,0xf1,0x02,0x12,0x0b, -0xf1,0x0a,0xf2,0x0a,0xf1,0x02,0xf2,0x02,0xf2,0x02,0xf2,0x0a,0xf2,0x02,0x12,0x0b, -0xf2,0x02,0xf2,0x02,0xd1,0x02,0xd1,0x02,0xd1,0x02,0xf2,0x02,0xf1,0x02,0x12,0x03, -0xf2,0x02,0x12,0x03,0xf1,0x02,0xf2,0x02,0x12,0x03,0x53,0x03,0x70,0x02,0x34,0x84, -0x54,0xd5,0x6e,0xc4,0x32,0xbd,0x5d,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0x02,0xf2,0x02,0xd0,0x02, -0xd1,0x02,0xd1,0x02,0xf1,0x02,0xd1,0x02,0xd1,0x02,0xb1,0x02,0x12,0x03,0xf2,0x02, -0xd1,0x02,0xd1,0x02,0xf2,0x02,0xd1,0x02,0xf2,0x02,0x13,0x03,0x13,0x03,0xf2,0x02, -0x13,0x03,0x32,0x03,0x13,0x03,0x12,0x03,0x33,0x03,0x33,0x03,0x33,0x03,0x33,0x03, -0x53,0x03,0x53,0x03,0x33,0x03,0x12,0x03,0x32,0x0b,0x32,0x0b,0x74,0x03,0x33,0x03, -0x51,0x3b,0x52,0x94,0x13,0xcd,0xb0,0xc4,0x4e,0xa4,0x94,0xbd,0xba,0xe6,0xff,0xff, -0xff,0xff,0xdf,0xff,0xff,0xff,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x0b, -0x12,0x0b,0x12,0x0b,0x32,0x03,0x12,0x03,0x12,0x03,0x33,0x0b,0x12,0x03,0x13,0x03, -0x32,0x03,0x33,0x0b,0x12,0x03,0x32,0x0b,0x32,0x03,0x53,0x0b,0x33,0x0b,0x33,0x0b, -0x12,0x03,0x13,0x0b,0x33,0x03,0x53,0x0b,0x32,0x03,0x33,0x03,0x33,0x03,0x53,0x03, -0x53,0x03,0x53,0x0b,0x53,0x03,0x74,0x03,0x73,0x03,0x74,0x03,0x32,0x0b,0x32,0x1b, -0x74,0x03,0xb2,0x02,0x10,0x84,0xb0,0xbc,0x6f,0xac,0x71,0xc4,0x11,0xc5,0x2e,0xac, -0x30,0xac,0x7e,0xf7,0xff,0xff,0xff,0xff,0xbe,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x11,0x03,0x32,0x0b,0x32,0x03,0x33,0x03,0x32,0x03,0x33,0x03,0x32,0x03, -0x33,0x03,0x32,0x03,0x53,0x03,0x33,0x03,0x53,0x0b,0x32,0x03,0x53,0x03,0x53,0x03, -0x53,0x0b,0x33,0x03,0x54,0x0b,0x53,0x03,0x54,0x0b,0x53,0x03,0x73,0x0b,0x53,0x03, -0x53,0x03,0x53,0x03,0x53,0x03,0x53,0x03,0x53,0x03,0x53,0x03,0x73,0x03,0x53,0x03, -0x32,0x0b,0x11,0x0b,0x74,0x03,0x34,0x03,0xb1,0xb4,0xce,0xd4,0x4f,0xbc,0x70,0xb4, -0xf1,0xcc,0xf0,0xd4,0x70,0xc4,0x4f,0x63,0xbc,0xc6,0xff,0xff,0xde,0xff,0x9d,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0x33,0x0b,0x33,0x0b,0x53,0x0b,0x53,0x03,0x54,0x0b, -0x33,0x03,0x53,0x03,0x53,0x03,0x54,0x0b,0x53,0x0b,0x74,0x0b,0x73,0x03,0x94,0x0b, -0x74,0x0b,0x74,0x0b,0x53,0x0b,0x74,0x0b,0x95,0x0b,0xb5,0x13,0x94,0x0b,0x74,0x0b, -0x74,0x0b,0xd5,0x13,0xd5,0x13,0xf6,0x1b,0xf6,0x13,0x16,0x14,0x37,0x14,0x58,0x1c, -0x57,0x1c,0x78,0x1c,0x36,0x14,0x15,0x0c,0x16,0x04,0x17,0x24,0xb0,0xbc,0xce,0xec, -0x6f,0xcc,0xb0,0xbc,0xf1,0xc4,0x93,0xf5,0x32,0xe5,0xad,0x5a,0xed,0x01,0x7f,0xdf, -0xff,0xff,0xff,0xff,0x9f,0xff,0xff,0xff,0xff,0xff,0x53,0x03,0x73,0x0b,0x53,0x03, -0x74,0x03,0x73,0x03,0x73,0x03,0x53,0x03,0x73,0x0b,0x73,0x03,0x74,0x0b,0x73,0x03, -0x94,0x03,0x73,0x03,0x94,0x0b,0x93,0x03,0x94,0x0b,0x74,0x03,0x95,0x0b,0x94,0x03, -0x94,0x0b,0x94,0x03,0x95,0x0b,0x94,0x03,0x94,0x03,0x74,0x03,0x74,0x03,0x73,0x03, -0x74,0x03,0x73,0x03,0x74,0x03,0x53,0x03,0xd5,0x03,0x36,0x04,0x17,0x04,0xf5,0x33, -0x4e,0xb4,0x2c,0xe4,0x2e,0xdc,0xae,0xb4,0x11,0xcd,0x10,0xed,0x31,0xed,0x36,0xad, -0x14,0x13,0xd1,0x13,0x59,0xae,0x3c,0xe7,0xdf,0xff,0xff,0xff,0xff,0xff,0x74,0x0b, -0x53,0x03,0x74,0x0b,0x74,0x03,0x94,0x0b,0x73,0x03,0x74,0x0b,0x74,0x03,0x94,0x03, -0x94,0x03,0x95,0x0b,0x74,0x03,0x94,0x03,0x94,0x03,0x94,0x0b,0x94,0x03,0x95,0x0b, -0x74,0x03,0x74,0x03,0x74,0x03,0xb5,0x03,0x74,0x03,0x74,0x03,0x74,0x03,0x94,0x03, -0x94,0x03,0x94,0x03,0x53,0x03,0x33,0x03,0x32,0x03,0x33,0x03,0x74,0x03,0xb5,0x03, -0x74,0x03,0xb5,0x33,0x90,0xb4,0x2d,0xe4,0xcc,0xd3,0xae,0xb4,0xd0,0xc4,0xf0,0xec, -0xef,0xec,0xf5,0xa4,0x19,0x0c,0x4c,0x02,0xb2,0x74,0x79,0xc6,0xdf,0xff,0xff,0xff, -0xff,0xff,0x32,0x03,0x53,0x03,0x32,0x03,0x33,0x03,0x32,0x03,0x33,0x03,0x32,0x03, -0x53,0x03,0x53,0x03,0x53,0x03,0x53,0x03,0x73,0x03,0x53,0x03,0x73,0x03,0x73,0x03, -0x74,0x03,0x73,0x03,0x94,0x03,0x74,0x03,0x94,0x03,0x73,0x03,0x74,0x03,0x73,0x03, -0x74,0x03,0x53,0x03,0x53,0x03,0x53,0x03,0x94,0x03,0x94,0x03,0xb4,0x03,0x94,0x03, -0x95,0x0b,0x75,0x0b,0x96,0x03,0xf1,0x02,0x31,0x74,0x91,0xb4,0x70,0xc4,0x2c,0xb4, -0x4d,0xcc,0x6d,0xd4,0xaf,0xd4,0x72,0x84,0x6d,0x01,0x9e,0xb6,0xff,0xff,0xff,0xff, -0xbe,0xff,0xff,0xff,0xff,0xff,0x53,0x0b,0x32,0x03,0x53,0x03,0x12,0x03,0x33,0x0b, -0x32,0x03,0x33,0x03,0x33,0x03,0x53,0x0b,0x53,0x0b,0x53,0x0b,0x53,0x03,0x53,0x03, -0x53,0x03,0x73,0x0b,0x53,0x03,0x53,0x0b,0x73,0x03,0x94,0x0b,0x73,0x03,0x73,0x03, -0x73,0x03,0x94,0x0b,0x94,0x0b,0x94,0x13,0x94,0x0b,0xb4,0x0b,0x73,0x03,0x53,0x03, -0x53,0x03,0x73,0x03,0x33,0x0b,0x14,0x13,0x34,0x03,0x32,0x03,0x50,0x33,0xd4,0x8c, -0x34,0xb5,0x2e,0xc4,0x4d,0xcc,0x31,0xed,0xb0,0xcc,0xed,0x4a,0x15,0x34,0xdf,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x32,0x03,0x33,0x03,0x32,0x03, -0x32,0x0b,0x32,0x03,0x53,0x0b,0x12,0x03,0x12,0x03,0x11,0x03,0x12,0x03,0x12,0x03, -0x32,0x03,0x12,0x03,0x32,0x03,0x31,0x03,0x32,0x03,0x12,0x03,0x33,0x03,0x12,0x03, -0x32,0x03,0x32,0x03,0x53,0x03,0x32,0x03,0x53,0x03,0x32,0x03,0x53,0x03,0x32,0x03, -0x53,0x03,0x52,0x03,0x53,0x03,0x52,0x03,0x33,0x13,0xf3,0x1a,0x54,0x0b,0x74,0x03, -0xd0,0x0a,0x32,0x54,0x14,0x95,0x2e,0xcc,0xcf,0xdc,0xaf,0xcc,0xef,0xa3,0xed,0x42, -0x5e,0xe7,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd1,0x0a, -0xd0,0x02,0xd1,0x0a,0xb0,0x02,0xd1,0x0a,0xd0,0x0a,0xd1,0x0a,0xb0,0x02,0xb0,0x0a, -0xb0,0x02,0xd1,0x0a,0xd0,0x02,0xf1,0x02,0xd0,0x02,0xf1,0x0a,0xd0,0x02,0xd1,0x02, -0xd0,0x02,0xd1,0x0a,0xd0,0x02,0xd1,0x02,0xd0,0x02,0xf1,0x0a,0xf1,0x02,0xf1,0x02, -0xd0,0x02,0xf1,0x0a,0xf1,0x02,0xf1,0x02,0xf1,0x02,0x11,0x0b,0xd0,0x0a,0xd1,0x12, -0xf2,0x02,0x34,0x03,0xf3,0x02,0xae,0x02,0xeb,0x2a,0xef,0xcb,0x2d,0xcc,0xad,0x9b, -0x30,0x9c,0x3d,0xe7,0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x6e,0x02,0x6e,0x02,0x6e,0x02,0x4e,0x02,0x4e,0x02,0x6e,0x02,0x4e,0x02, -0x6f,0x02,0x6e,0x02,0x8f,0x0a,0x6e,0x0a,0x6f,0x0a,0x8e,0x02,0x8f,0x02,0x6e,0x02, -0x6f,0x02,0x6f,0x02,0x6f,0x02,0x6f,0x02,0x8f,0x0a,0x6e,0x02,0x8f,0x0a,0x6f,0x02, -0x8f,0x0a,0x6f,0x02,0x6f,0x0a,0x6f,0x02,0x8f,0x0a,0x6f,0x02,0x8f,0x0a,0x8f,0x02, -0xaf,0x0a,0xae,0x02,0xb0,0x02,0x72,0x02,0xd4,0x02,0x8e,0x02,0xcc,0x1a,0xf0,0xc3, -0x6a,0xab,0x73,0xbd,0x1d,0xef,0xff,0xff,0xdc,0xff,0xfe,0xff,0xff,0xff,0xdf,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0x2e,0x0a,0x2e,0x02,0x2e,0x02,0x2d,0x02,0x4d,0x0a, -0x2d,0x02,0x4e,0x0a,0x4d,0x0a,0x6e,0x12,0x4d,0x0a,0x4e,0x0a,0x4d,0x0a,0x6e,0x0a, -0x4d,0x0a,0x4e,0x0a,0x4e,0x0a,0x4f,0x12,0x4e,0x0a,0x4f,0x0a,0x4e,0x0a,0x6f,0x0a, -0x6e,0x02,0x6f,0x0a,0x4e,0x0a,0x6f,0x0a,0x4e,0x0a,0x6f,0x12,0x6e,0x0a,0x6f,0x0a, -0x6e,0x0a,0x6f,0x0a,0x8e,0x02,0xae,0x02,0x8f,0x02,0x71,0x0a,0x93,0x02,0x10,0x03, -0x4e,0x23,0x6f,0xb3,0xec,0xab,0xfa,0xe6,0xff,0xff,0xff,0xf7,0xdc,0xff,0xfe,0xff, -0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0xec,0x09,0xec,0x09,0xeb,0x01, -0xeb,0x09,0xeb,0x09,0xec,0x11,0xeb,0x09,0x0c,0x12,0xec,0x11,0xec,0x11,0xeb,0x09, -0x0c,0x12,0x0c,0x0a,0x0c,0x12,0xeb,0x09,0x0c,0x0a,0xec,0x09,0x0d,0x12,0xec,0x09, -0x0c,0x0a,0x0c,0x0a,0x0d,0x0a,0xec,0x09,0xec,0x11,0xec,0x09,0xec,0x11,0xec,0x09, -0x0c,0x12,0xec,0x09,0x0d,0x12,0x0c,0x0a,0x2c,0x0a,0x2c,0x02,0x0c,0x0a,0xee,0x11, -0x30,0x0a,0x0a,0x02,0xe8,0x11,0xcb,0x82,0x1c,0xff,0xff,0xff,0xdf,0xff,0xdf,0xf7, -0xfd,0xff,0xfe,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x29,0x09, -0x08,0x01,0x29,0x09,0x08,0x01,0x28,0x09,0x28,0x09,0x29,0x09,0x08,0x01,0x08,0x09, -0xe7,0x00,0x08,0x01,0x08,0x01,0x28,0x01,0x07,0x01,0x28,0x01,0x08,0x01,0x08,0x01, -0xe7,0x00,0xe8,0x00,0xe8,0x00,0x08,0x01,0xe7,0x00,0xe8,0x00,0xe7,0x00,0xe8,0x00, -0xe7,0x00,0x08,0x01,0xe7,0x00,0xe8,0x00,0x07,0x01,0x08,0x01,0xe8,0x00,0xe9,0x00, -0xc6,0x00,0x63,0x00,0xce,0x4a,0x1d,0xe7,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xff, -0xfe,0xff,0xfe,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0xe7,0x10,0xe7,0x18,0xc7,0x10,0xc7,0x18,0xc6,0x10,0xc7,0x18,0xa6,0x10, -0xa6,0x18,0x85,0x10,0xa6,0x10,0x85,0x10,0x86,0x10,0x85,0x10,0xa5,0x10,0xa5,0x10, -0xa6,0x10,0xa5,0x10,0xa6,0x10,0xa6,0x10,0xa6,0x10,0x85,0x10,0xa6,0x10,0x85,0x10, -0x86,0x18,0x86,0x10,0x86,0x18,0x85,0x10,0x86,0x18,0x85,0x10,0x86,0x18,0x86,0x10, -0xa7,0x18,0x86,0x20,0x86,0x20,0x43,0x18,0x90,0x7b,0x3e,0xe7,0xff,0xff,0xfe,0xff, -0xff,0xf7,0xff,0xf7,0xff,0xff,0xdf,0xf7,0xdf,0xff,0xbf,0xff,0xff,0xff,0xff,0xff, -0xff,0xf7,0xff,0xff,0xff,0xff,0xe7,0x30,0xe7,0x30,0x07,0x31,0x85,0x28,0xc6,0x30, -0xa6,0x30,0xc6,0x30,0xa5,0x30,0xc6,0x30,0xa5,0x30,0xc6,0x38,0xa5,0x30,0xa6,0x38, -0x85,0x30,0xa6,0x38,0xa5,0x38,0xa6,0x40,0xc6,0x40,0xe7,0x40,0xa5,0x38,0x86,0x40, -0xa6,0x40,0xc6,0x40,0xc6,0x40,0xc6,0x40,0xa6,0x38,0xc6,0x40,0xc6,0x40,0xe7,0x50, -0xc7,0x48,0xc7,0x48,0xc6,0x48,0xc7,0x50,0xc7,0x50,0x29,0x61,0x22,0x18,0x30,0x8c, -0x5d,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff,0xdf,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa5,0x38,0xc6,0x40,0xc6,0x38, -0xc6,0x48,0x86,0x48,0x86,0x40,0x85,0x40,0xc6,0x48,0xc6,0x48,0xa6,0x48,0xa5,0x40, -0xc6,0x50,0xc6,0x50,0xe7,0x50,0xe6,0x50,0xe6,0x50,0xa6,0x48,0xa6,0x50,0xa6,0x50, -0xc6,0x50,0xa6,0x48,0xc6,0x50,0xc6,0x48,0xc6,0x50,0xc6,0x50,0xe7,0x50,0xc6,0x50, -0xe7,0x58,0xe6,0x50,0xe7,0x58,0xc6,0x50,0xa6,0x58,0x85,0x58,0xa7,0x58,0x45,0x50, -0x43,0x48,0x29,0x7a,0xef,0xab,0x95,0xc5,0xdf,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xdf,0xff,0xbf,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x51, -0xe6,0x48,0xc7,0x48,0xe7,0x58,0xe7,0x58,0xc6,0x50,0xc7,0x50,0xa6,0x50,0xa6,0x50, -0xa6,0x50,0xc7,0x50,0xa6,0x50,0xa6,0x50,0xc6,0x50,0xe8,0x58,0xc7,0x58,0xa6,0x58, -0x86,0x50,0x86,0x50,0xa6,0x50,0xe7,0x50,0xc6,0x48,0xc6,0x50,0xe7,0x50,0x07,0x59, -0xc6,0x50,0xa6,0x50,0xa6,0x48,0xa6,0x50,0xa6,0x48,0xa6,0x50,0x86,0x50,0xc7,0x60, -0xc7,0x60,0x24,0x48,0x87,0x71,0xcf,0xb3,0x30,0xb4,0x2b,0x93,0x59,0xde,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xa6,0x48,0xa6,0x48,0x65,0x40,0x86,0x50,0xa6,0x48,0xe8,0x58,0xe7,0x58, -0xc7,0x58,0xa6,0x50,0xe7,0x60,0xe7,0x58,0xc7,0x58,0x86,0x50,0x65,0x50,0x65,0x48, -0xa6,0x58,0xc7,0x58,0xc7,0x58,0x86,0x50,0xc7,0x58,0xe7,0x58,0xe7,0x58,0xa7,0x58, -0xa7,0x58,0x86,0x50,0xc6,0x58,0xc7,0x58,0xc7,0x58,0xa6,0x50,0xc7,0x58,0xa6,0x50, -0xe7,0x60,0x07,0x69,0xc8,0x60,0x24,0x48,0x6f,0xab,0x71,0xc4,0xee,0xab,0x6c,0x93, -0x50,0xac,0x5d,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xc7,0x60,0xc7,0x60,0xe8,0x68,0xa7,0x60,0xa7,0x60, -0x66,0x58,0x86,0x58,0xc7,0x60,0xe8,0x70,0xc7,0x68,0xe7,0x68,0xc7,0x60,0xc7,0x60, -0xe7,0x68,0x08,0x69,0xc7,0x60,0xa6,0x60,0x86,0x58,0xa6,0x60,0x86,0x60,0x87,0x70, -0x86,0x68,0xa7,0x68,0xa6,0x68,0xa7,0x70,0xa7,0x70,0xa7,0x70,0x86,0x68,0xa7,0x70, -0x87,0x68,0xa7,0x70,0x86,0x60,0x86,0x58,0x64,0x48,0xea,0x79,0x71,0xc4,0x90,0xcc, -0x0d,0xb4,0x50,0xbc,0x6c,0x9b,0xce,0xab,0xf3,0xcc,0x9f,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x45,0x58,0x25,0x60,0x04,0x58, -0x65,0x58,0x45,0x58,0x65,0x58,0x44,0x50,0x25,0x58,0x04,0x58,0x66,0x60,0x66,0x60, -0x86,0x60,0xa6,0x60,0xc7,0x68,0xc7,0x68,0x29,0x79,0xaa,0x81,0x8b,0x89,0x8a,0x81, -0xaa,0x81,0xaa,0x71,0xcb,0x79,0xeb,0x81,0x0c,0x82,0x0b,0x82,0x4d,0x8a,0x6d,0x92, -0x8e,0x92,0xad,0x8a,0xae,0x92,0x8d,0x8a,0xcf,0xa2,0xaf,0xb2,0x8f,0xa2,0x12,0xc4, -0x70,0xc4,0x6e,0xbc,0x8f,0xc4,0x2e,0xb4,0x2f,0xbc,0xb1,0xcc,0xce,0xa3,0x00,0x00, -0x79,0xce,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x29,0x79, -0x49,0x81,0x6a,0x81,0xab,0x81,0xcb,0x89,0x0c,0x92,0x4d,0x9a,0x2d,0x9a,0x4d,0xa2, -0x8e,0xaa,0xaf,0xaa,0xae,0xa2,0xcf,0xaa,0xaf,0xa2,0xcf,0xaa,0x8e,0xa2,0x4d,0x9a, -0x6d,0x9a,0x8e,0xa2,0x6e,0x9a,0x6e,0x9a,0x6d,0x9a,0xae,0xa2,0x8e,0x9a,0xae,0xa2, -0x8d,0x9a,0x8e,0x9a,0xae,0x9a,0xce,0x9a,0xae,0x92,0xce,0x9a,0x8e,0x9a,0x6e,0xa2, -0x6d,0x92,0x0e,0xa3,0x8f,0xbc,0x10,0xcd,0xf0,0xcc,0x11,0xd5,0xb0,0xc4,0x94,0xe5, -0x33,0xd5,0xe9,0x71,0x01,0x28,0xd4,0xac,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x86,0x60,0x86,0x60,0x86,0x60,0xc6,0x60,0x86,0x58,0x86,0x58,0x65,0x58, -0x86,0x60,0x45,0x58,0x03,0x50,0x03,0x48,0x04,0x50,0x24,0x50,0x24,0x50,0x24,0x50, -0x04,0x48,0x02,0x40,0x03,0x40,0x02,0x40,0x03,0x48,0x03,0x48,0x03,0x50,0x02,0x48, -0x03,0x50,0x02,0x48,0x02,0x48,0x01,0x40,0x02,0x48,0x02,0x48,0x02,0x48,0x02,0x40, -0x03,0x48,0x02,0x40,0x00,0x28,0x45,0x61,0xd0,0xc4,0x30,0xcd,0xae,0xbc,0xcf,0xc4, -0xb0,0xc4,0x52,0xcd,0x53,0xd5,0x2e,0xa3,0x8a,0x79,0x00,0x18,0x72,0x9c,0xfb,0xe6, -0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0x70,0xc7,0x68,0x08,0x71,0x07,0x69,0x28,0x69, -0xe7,0x68,0x08,0x69,0xe7,0x68,0x08,0x71,0x08,0x71,0x28,0x71,0x08,0x69,0x28,0x71, -0x49,0x71,0x49,0x79,0x49,0x71,0x69,0x71,0x69,0x71,0x69,0x71,0x48,0x71,0x69,0x79, -0x69,0x79,0x8a,0x79,0x89,0x71,0x89,0x79,0xaa,0x79,0xeb,0x81,0xcb,0x81,0xeb,0x89, -0xcb,0x81,0xeb,0x81,0xaa,0x89,0xab,0x91,0x8a,0x81,0x47,0x71,0x4f,0xb4,0x52,0xd5, -0xcf,0xbc,0x8f,0xbc,0x11,0xcd,0x15,0xe6,0x12,0xcd,0x26,0x61,0x08,0x69,0x01,0x20, -0xf0,0x8b,0x59,0xd6,0xdf,0xff,0xff,0xff,0xff,0xff,0x48,0x71,0x89,0x79,0x69,0x71, -0x8a,0x79,0x89,0x79,0x89,0x79,0x89,0x79,0x89,0x79,0x89,0x79,0xcb,0x81,0xaa,0x81, -0xaa,0x79,0xaa,0x79,0xaa,0x81,0xaa,0x79,0xaa,0x81,0xaa,0x79,0xcb,0x81,0xaa,0x79, -0xca,0x79,0xca,0x71,0xca,0x71,0xa9,0x69,0xaa,0x71,0xa9,0x71,0xeb,0x79,0xea,0x79, -0xeb,0x79,0xeb,0x79,0x0b,0x7a,0x0a,0x72,0xaa,0x81,0x69,0x89,0x6a,0x81,0x26,0x69, -0x6d,0xa3,0xd1,0xc4,0xf1,0xcc,0x8f,0xbc,0x11,0xc5,0x56,0xee,0x94,0xd5,0xc3,0x40, -0x43,0x38,0x4a,0x5a,0x3d,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x49,0x79, -0x48,0x71,0x28,0x71,0x48,0x71,0x49,0x79,0x48,0x71,0x49,0x79,0x28,0x71,0x49,0x79, -0x69,0x79,0x69,0x79,0x49,0x71,0x49,0x79,0x28,0x69,0x08,0x71,0x49,0x71,0xaa,0x79, -0x69,0x79,0x8a,0x81,0x89,0x71,0xaa,0x71,0x89,0x69,0x69,0x71,0x69,0x69,0x89,0x71, -0x68,0x69,0x69,0x69,0x68,0x69,0x89,0x71,0x69,0x69,0x69,0x69,0x49,0x71,0x6a,0x81, -0x49,0x79,0x48,0x79,0x29,0x82,0x2f,0xbc,0x32,0xd5,0xf1,0xcc,0xb0,0xbc,0x97,0xf6, -0x15,0xe6,0xa2,0x38,0x00,0x08,0x1e,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0x85,0x60,0x85,0x60,0x65,0x58,0x86,0x60,0x85,0x60,0x85,0x60,0x85,0x58, -0x86,0x60,0x85,0x58,0x85,0x60,0x65,0x60,0x65,0x60,0x45,0x58,0xa6,0x68,0x86,0x68, -0x86,0x60,0x45,0x58,0x45,0x58,0x45,0x58,0x45,0x60,0x25,0x60,0x45,0x60,0x04,0x58, -0x25,0x58,0x04,0x58,0x25,0x60,0x24,0x58,0x45,0x60,0x24,0x60,0x45,0x68,0x25,0x60, -0x44,0x58,0x43,0x50,0x65,0x58,0x03,0x50,0x02,0x48,0xa7,0x79,0x4d,0xab,0xd1,0xc4, -0x12,0xcd,0xce,0xab,0xce,0xab,0xd7,0xd5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x24,0x50,0x03,0x50,0x24,0x50,0x03,0x50,0x24,0x58, -0x23,0x58,0x24,0x58,0x04,0x58,0x25,0x58,0x04,0x58,0x24,0x58,0x04,0x58,0x25,0x60, -0x25,0x60,0x25,0x60,0x45,0x60,0x86,0x68,0x66,0x68,0x66,0x68,0x65,0x60,0x86,0x68, -0x45,0x58,0x25,0x58,0x24,0x58,0x45,0x58,0x45,0x58,0x65,0x60,0x45,0x60,0x46,0x60, -0x45,0x60,0x45,0x60,0x65,0x60,0xc6,0x60,0xa7,0x60,0xe8,0x70,0x45,0x60,0xc6,0x70, -0x09,0x8a,0xf2,0xcc,0x4e,0xb4,0x0b,0x9b,0xce,0xab,0x9e,0xff,0xff,0xff,0xdf,0xf7, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x43,0x50,0x43,0x58,0x23,0x50, -0x64,0x58,0x63,0x50,0x84,0x58,0x63,0x50,0x64,0x58,0x44,0x50,0x64,0x58,0x64,0x58, -0x84,0x58,0x84,0x58,0x64,0x58,0x63,0x50,0x64,0x58,0x43,0x58,0x44,0x58,0x44,0x58, -0x64,0x50,0x43,0x50,0x64,0x50,0x64,0x50,0x64,0x58,0x44,0x58,0x64,0x58,0x44,0x58, -0x65,0x58,0x64,0x58,0x64,0x58,0x44,0x58,0x64,0x58,0x63,0x50,0x44,0x50,0x43,0x50, -0x24,0x58,0x02,0x50,0x84,0x58,0xcb,0x9a,0xd2,0xb4,0x9d,0xef,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff,0x83,0x50, -0x62,0x50,0x63,0x58,0xa3,0x48,0xa3,0x50,0xa3,0x48,0xa4,0x50,0x83,0x50,0xa3,0x50, -0x82,0x50,0xa3,0x50,0xa3,0x50,0xa3,0x48,0xa2,0x48,0xa3,0x50,0x83,0x48,0x84,0x50, -0x83,0x50,0x84,0x58,0x83,0x50,0xa4,0x50,0x83,0x48,0x83,0x50,0x63,0x50,0x63,0x50, -0x43,0x50,0x43,0x50,0x43,0x50,0x63,0x58,0x43,0x50,0x64,0x58,0x84,0x58,0xc4,0x60, -0x84,0x58,0x84,0x58,0x23,0x58,0x00,0x28,0x00,0x18,0xed,0x92,0xbf,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0x82,0x50,0xa3,0x50,0x83,0x50,0x83,0x50,0x82,0x48,0xa3,0x50,0xa2,0x50, -0x83,0x50,0x82,0x50,0x82,0x50,0x82,0x50,0xa2,0x50,0x81,0x48,0xa2,0x48,0x81,0x48, -0x82,0x50,0x62,0x50,0x62,0x50,0x62,0x50,0x83,0x50,0x82,0x48,0xa3,0x48,0x82,0x48, -0x83,0x50,0x62,0x50,0x63,0x50,0x63,0x50,0x63,0x50,0x63,0x50,0x83,0x50,0x83,0x50, -0xa3,0x58,0x82,0x50,0x83,0x50,0x82,0x58,0x22,0x48,0x00,0x18,0x65,0x29,0x9a,0xce, -0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xf7,0xff,0xff,0xff,0xff,0x41,0x48,0x41,0x40,0x61,0x48,0x00,0x48,0x21,0x50, -0x21,0x48,0x21,0x50,0x00,0x48,0x21,0x50,0x21,0x50,0x41,0x50,0x20,0x48,0x41,0x50, -0x20,0x48,0x21,0x48,0x20,0x48,0x21,0x50,0x20,0x50,0x21,0x50,0x00,0x50,0x21,0x50, -0x20,0x50,0x41,0x50,0x41,0x48,0x61,0x50,0x41,0x48,0x61,0x50,0x61,0x48,0x62,0x50, -0x41,0x48,0x21,0x48,0x20,0x40,0x20,0x48,0x00,0x40,0x00,0x38,0xa2,0x48,0x93,0xb4, -0x3c,0xf7,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x40,0x40,0x40,0x40,0x40, -0x00,0x50,0x00,0x50,0x21,0x50,0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x48, -0x00,0x50,0x00,0x48,0x00,0x50,0x00,0x48,0x00,0x50,0x00,0x50,0x00,0x58,0x00,0x50, -0x00,0x50,0x00,0x50,0x00,0x58,0x20,0x58,0x20,0x58,0x00,0x50,0x20,0x58,0x00,0x50, -0x20,0x58,0x00,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x40,0x58,0x00,0x40, -0x05,0x89,0x9b,0xfe,0xff,0xff,0xff,0xff,0x9e,0xff,0xbf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xe2,0x80, -0xe2,0x80,0xe3,0x80,0xe3,0x88,0x03,0x89,0x03,0x89,0x04,0x89,0xe3,0x88,0xe3,0x90, -0xe3,0x88,0x03,0x89,0xc3,0x88,0xe3,0x90,0xc2,0x88,0xc3,0x90,0xc2,0x90,0xe2,0x90, -0xe1,0x90,0xe2,0x90,0xe2,0x90,0xe2,0x90,0xe2,0x90,0xe3,0x98,0xc2,0x98,0xe3,0x98, -0xc2,0x98,0xc3,0xa0,0xe3,0xa0,0xe3,0xa0,0xa2,0x98,0x82,0x90,0xa1,0x90,0xc2,0x98, -0xa2,0x98,0xe2,0xa0,0x41,0x90,0x00,0x60,0x00,0x58,0x54,0xc5,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xa1,0x88,0xa2,0x88,0x81,0x88,0xa2,0x88,0xa1,0x80,0xc2,0x88,0xa1,0x80, -0xa2,0x88,0xa1,0x80,0xe3,0x90,0xe3,0x90,0xc2,0x90,0xa2,0x90,0xc2,0x90,0xa2,0x90, -0xc2,0x98,0xc1,0x90,0xe2,0x98,0xc2,0x90,0xe2,0x98,0xc2,0x98,0xc2,0x98,0xc1,0x98, -0xe2,0x98,0xc2,0x98,0xc2,0x98,0xc2,0x98,0xe3,0x98,0xe2,0x98,0xc2,0x98,0xa1,0x90, -0xa2,0x90,0xa1,0x90,0xa1,0x90,0x60,0x88,0x82,0x98,0x02,0x98,0x84,0x98,0xcd,0x9b, -0x7c,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff, -0xbf,0xff,0xff,0xff,0xff,0xff,0xc3,0xa0,0x82,0xa0,0xa2,0xa0,0x81,0x90,0xa2,0x98, -0xc2,0x98,0xc2,0x98,0xa1,0x90,0xa2,0x98,0x81,0x90,0xa2,0x98,0x82,0x90,0xa2,0xa0, -0xa1,0x98,0xa2,0xa0,0xa2,0x98,0xa3,0xa0,0x82,0x98,0xa2,0xa0,0xa2,0x98,0xa2,0xa0, -0x82,0xa0,0xa2,0xa0,0x82,0x98,0xa2,0xa0,0x81,0x98,0x82,0x98,0x81,0x98,0xa2,0xa0, -0xa2,0xa0,0xe3,0xa8,0xe3,0xa0,0x04,0xa9,0xe3,0xa0,0xe3,0xa0,0x82,0xa0,0x00,0xa0, -0x83,0xa0,0x71,0xc4,0x70,0xb4,0x3c,0xf7,0xff,0xff,0xff,0xff,0xde,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x81,0x98,0x82,0xa0,0x61,0x98, -0xc2,0x98,0xa2,0x98,0xa2,0x98,0xa1,0x98,0xa2,0x98,0x82,0x98,0x82,0x98,0x81,0x90, -0x81,0x98,0x81,0xa0,0xc2,0xa0,0xa2,0xa0,0xa3,0xa8,0x82,0xa0,0x82,0xa0,0x41,0x98, -0x62,0xa0,0x62,0xa0,0xa3,0xa8,0x82,0xa0,0xa3,0xa8,0x82,0xa0,0x83,0xa0,0x62,0x98, -0xa3,0xa0,0xa2,0xa0,0x83,0xa0,0x62,0x98,0x82,0xa0,0x62,0x98,0x82,0xa0,0x82,0xa0, -0x82,0xa8,0x00,0x98,0xc3,0xa0,0x13,0xd5,0x91,0xbc,0x12,0xbd,0x57,0xd6,0xff,0xff, -0xdf,0xff,0xdf,0xff,0xff,0xf7,0xde,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0x61,0x98, -0x60,0x90,0x81,0x98,0xa2,0x98,0x82,0xa0,0x60,0x90,0x81,0x98,0xa2,0xa0,0xc2,0xa0, -0xa1,0xa0,0xa2,0xa0,0xa1,0xa0,0xa2,0xa8,0x81,0xa0,0xa2,0xa8,0x82,0xa0,0x83,0xa8, -0x62,0x98,0x42,0xa0,0x42,0xa0,0x83,0xa8,0x83,0xa0,0x83,0xa8,0x63,0xa8,0x63,0xa8, -0x63,0xa8,0xa4,0xb0,0xa3,0xb0,0xa4,0xb0,0x83,0xa8,0x83,0xb0,0x63,0xa8,0x63,0xa8, -0x63,0xa8,0xa4,0xb8,0x62,0xa8,0xe4,0xb0,0x08,0xba,0xf2,0xd4,0xb5,0xe5,0x4b,0x93, -0x09,0x7b,0xfb,0xee,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xc2,0x98,0xe2,0x98,0xc2,0x98,0x82,0xa0,0x81,0xa0,0xc2,0xa0,0xa2,0xa0, -0xc2,0xa8,0xa2,0xa0,0xc3,0xa8,0xa2,0xa0,0xa3,0xa8,0xa2,0xa0,0xa2,0xa8,0xa2,0xa0, -0xa3,0xa8,0x84,0xa0,0xc4,0xa8,0xc4,0xa8,0xc4,0xa8,0xa3,0xa8,0xc4,0xa8,0xa4,0xa8, -0xa4,0xb8,0xa4,0xb0,0x84,0xb8,0x63,0xb0,0x84,0xb8,0x83,0xb0,0x84,0xb8,0x63,0xb0, -0x84,0xb8,0xa4,0xb8,0xa4,0xb8,0x43,0xb0,0x21,0xa0,0x4b,0xcb,0x94,0xf5,0x72,0xcd, -0x54,0xe5,0x52,0xd5,0xd0,0xbc,0xa9,0x92,0xaf,0xb3,0xde,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0x98,0xc2,0x90,0xa2,0x90,0xc3,0xa8,0xc3,0xa8, -0x82,0xa0,0xa2,0xa0,0x82,0xa0,0x82,0xa0,0x62,0xa0,0x82,0xa0,0x61,0xa0,0x82,0xa0, -0x82,0xa0,0xa2,0xa0,0x82,0xa0,0x84,0xa8,0x83,0xa0,0xa4,0xa8,0x63,0xa0,0x63,0xa0, -0x63,0xa0,0x83,0xa0,0x63,0xa0,0x83,0xa8,0x42,0xa0,0x22,0xa0,0x21,0x98,0x22,0xa0, -0x42,0xa0,0x63,0xa0,0x42,0x98,0x22,0xa0,0x22,0x98,0x01,0x98,0x21,0x98,0x2f,0xdc, -0x76,0xee,0x93,0xcd,0x33,0xdd,0xf5,0xed,0x72,0xcd,0x26,0x82,0x00,0x68,0x14,0xcd, -0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0x04,0xa9,0x45,0xb9,0x45,0xb1, -0x65,0xb9,0x45,0xb9,0x45,0xb9,0x45,0xb1,0x86,0xc1,0xa6,0xc1,0xa7,0xc9,0xa6,0xc1, -0xa7,0xc1,0xa7,0xc1,0xe8,0xc9,0xc8,0xc9,0xe8,0xc9,0xe7,0xc9,0xe7,0xc9,0xc7,0xc1, -0x28,0xca,0x69,0xd2,0x8a,0xda,0x89,0xd2,0x8a,0xda,0x89,0xd2,0x89,0xd2,0x48,0xca, -0x49,0xca,0x48,0xca,0x89,0xd2,0x89,0xd2,0x8a,0xd2,0x89,0xd2,0x89,0xd2,0x07,0xca, -0xaa,0xca,0xd1,0xcc,0xf4,0xd5,0xd0,0xd4,0xd0,0xcc,0x32,0xd5,0xf1,0xd4,0x4b,0xcb, -0x09,0xf2,0x61,0x88,0x8d,0x9b,0x94,0xbd,0xbf,0xff,0xff,0xff,0xff,0xff,0xe4,0xb0, -0xc3,0xa8,0xe4,0xb0,0x25,0xb1,0x05,0xb1,0xe3,0xa8,0x04,0xb1,0x04,0xb1,0x05,0xb1, -0x04,0xb1,0x05,0xb1,0x05,0xb1,0x46,0xb1,0x05,0xa9,0x26,0xb1,0x25,0xb1,0x24,0xb1, -0x03,0xa9,0xe4,0xa8,0xe3,0xa8,0x24,0xa9,0x23,0xa9,0x24,0xa9,0x03,0xa9,0x24,0xb1, -0xe3,0xa0,0xc2,0xa0,0xc2,0xa0,0xc3,0xa0,0xc2,0xa0,0xc2,0xa0,0xa2,0x98,0x82,0x98, -0x61,0x98,0x00,0x90,0x24,0x99,0x4f,0xc4,0x73,0xd5,0x70,0xdc,0x8f,0xbc,0x52,0xd5, -0x11,0xd5,0xea,0xca,0x00,0xa8,0x04,0xa1,0x13,0xc5,0xfb,0xe6,0xdf,0xff,0xff,0xff, -0xff,0xff,0xe3,0xa0,0xc4,0xa8,0xa3,0xa0,0xc3,0xa0,0xc3,0x98,0xe4,0xa0,0xe3,0xa0, -0xe4,0xa8,0xc3,0xa8,0xe4,0xa8,0xc3,0xa8,0xe4,0xa8,0xe3,0xa8,0xe4,0xa8,0xe4,0xa8, -0x04,0xa9,0xe4,0xa8,0x04,0xb1,0x04,0xa9,0x04,0xa9,0xe3,0xa0,0x04,0xa9,0x04,0xa9, -0x04,0xa9,0xe3,0xa0,0x24,0xb1,0x24,0xb1,0x25,0xb1,0x04,0xa9,0x04,0xb1,0x04,0xa9, -0x25,0xb1,0x24,0xb1,0x25,0xb1,0xc3,0xb0,0xe7,0xb1,0x4f,0xcc,0x73,0xdd,0xd0,0xc4, -0xf0,0xcc,0x72,0xdd,0xf1,0xdc,0x48,0x92,0x09,0x9a,0x3c,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x45,0xa9,0x25,0xa9,0x45,0xa9,0x44,0xa9,0x45,0xb1, -0x24,0xa9,0x45,0xa9,0x24,0xb1,0x45,0xb1,0x45,0xb1,0x45,0xb9,0x45,0xb1,0x25,0xb9, -0x45,0xb1,0x45,0xb9,0x45,0xb1,0x46,0xb9,0x26,0xb9,0x46,0xb9,0x45,0xb1,0x46,0xb9, -0x46,0xb1,0x46,0xb9,0x45,0xb1,0x46,0xb1,0x25,0xb1,0x46,0xb1,0x25,0xa9,0x25,0xb1, -0x25,0xb1,0x46,0xb1,0x45,0xb1,0x46,0xb9,0x25,0xb9,0x05,0xb9,0xe3,0x88,0x4f,0xcc, -0x15,0xf6,0x31,0xc5,0xd0,0xc4,0xf2,0xdc,0x2f,0xc4,0xe7,0x81,0x97,0xd5,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0x98,0xe4,0xa0,0xe3,0x98, -0x03,0xa1,0xe3,0xa0,0xe4,0xa0,0xe3,0x98,0xe3,0xa0,0xc3,0xa0,0xe3,0xa0,0xc3,0xa0, -0xe3,0xa0,0xc3,0xa0,0xe3,0xa8,0xc3,0xa0,0xe4,0xa8,0xc4,0xa0,0xe4,0xa8,0xc4,0xa0, -0xe4,0xa8,0xc4,0xa0,0xe4,0xa8,0xc3,0xa0,0xe4,0xa0,0xc3,0xa0,0xe4,0xa0,0xc3,0xa0, -0xc4,0xa0,0xc3,0x98,0xc4,0xa0,0xe4,0xa0,0xe4,0xa8,0xc3,0xa0,0xe4,0xa8,0xc3,0xa0, -0x41,0x88,0xea,0xb2,0xf1,0xdc,0xaf,0xb4,0x11,0xc5,0x4b,0x9b,0xa9,0x8a,0x30,0xac, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa3,0x98, -0xa3,0x90,0xa3,0x98,0xa2,0x90,0xc3,0x98,0xc2,0x90,0xa3,0x98,0x82,0x90,0xa2,0x90, -0xa2,0x88,0xa2,0x90,0x82,0x90,0x82,0x90,0x82,0x90,0xa2,0x98,0xa2,0x90,0xa3,0x98, -0x82,0x90,0xa3,0x98,0x83,0x90,0xa3,0x98,0xa2,0x90,0xa3,0x98,0xa2,0x90,0xa3,0x90, -0xa2,0x90,0xa3,0x90,0x82,0x90,0x82,0x90,0x82,0x90,0xa3,0x90,0xa2,0x90,0xa3,0x90, -0xa2,0x88,0xa3,0x90,0x21,0x98,0x81,0x90,0xc5,0x91,0x12,0xdd,0xed,0x9b,0xd0,0xac, -0x36,0xce,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x82,0x88,0x82,0x88,0x62,0x88,0x82,0x90,0x61,0x88,0x82,0x90,0x61,0x88, -0x82,0x88,0x81,0x80,0xa2,0x88,0x82,0x88,0x82,0x88,0x81,0x80,0xa2,0x88,0x81,0x88, -0xa2,0x90,0xa2,0x88,0xa2,0x88,0xa2,0x88,0xa2,0x88,0xa1,0x88,0xa2,0x88,0x82,0x88, -0xa2,0x88,0x81,0x88,0xa2,0x88,0x81,0x88,0x82,0x88,0x61,0x80,0x82,0x88,0x82,0x88, -0xa2,0x88,0x81,0x88,0xa2,0x88,0xa2,0x88,0x41,0x98,0x00,0x70,0x02,0x79,0x0e,0xc4, -0xad,0x9b,0x98,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x82,0x78,0x81,0x70,0x82,0x78,0x61,0x78,0x82,0x80, -0x61,0x78,0x61,0x78,0xa1,0x70,0xc2,0x78,0xa1,0x70,0xa2,0x78,0xa1,0x70,0xa2,0x78, -0xa2,0x78,0xc2,0x78,0xa1,0x78,0xc1,0x78,0xa1,0x78,0xc1,0x78,0xa1,0x78,0xc2,0x78, -0xa1,0x78,0xc1,0x78,0xa1,0x78,0xa2,0x80,0x81,0x78,0xa1,0x78,0xa1,0x78,0xa2,0x80, -0x81,0x78,0xa1,0x80,0xa1,0x78,0xa1,0x78,0xa1,0x70,0xa1,0x78,0x81,0x98,0x00,0x48, -0x00,0x18,0x30,0x9c,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa1,0x70,0xc2,0x78,0x81,0x70, -0xa2,0x78,0x81,0x70,0xa2,0x78,0xa1,0x70,0xa2,0x70,0xa1,0x70,0xa1,0x70,0x81,0x68, -0xa1,0x70,0x81,0x70,0xa1,0x70,0xa1,0x70,0xa1,0x70,0xa0,0x70,0xa1,0x70,0x80,0x68, -0xa0,0x70,0xa0,0x70,0xa1,0x70,0xa0,0x70,0xa1,0x78,0x80,0x78,0x81,0x78,0x80,0x70, -0xa1,0x78,0x80,0x70,0xa1,0x78,0x80,0x70,0x80,0x70,0x60,0x68,0x80,0x70,0x80,0x70, -0x00,0x50,0x81,0x48,0x89,0x72,0x1c,0xe7,0xff,0xff,0xff,0xff,0xdf,0xff,0x9f,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x40,0x58, -0x40,0x58,0x61,0x58,0x40,0x58,0x80,0x58,0x80,0x58,0xa1,0x60,0x60,0x60,0x60,0x60, -0x00,0x50,0x00,0x58,0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x58,0x00,0x50,0x20,0x58, -0x20,0x58,0x40,0x60,0x20,0x58,0x00,0x58,0x00,0x50,0x00,0x58,0x00,0x50,0x00,0x58, -0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x50,0x00,0x58,0x00,0x50,0x00,0x58, -0x00,0x50,0x20,0x40,0xad,0xa3,0x5b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x00,0x38,0x00,0x40,0x00,0x40,0x00,0x48,0x00,0x40,0x00,0x48,0x00,0x40, -0x00,0x48,0x00,0x48,0x40,0x58,0x40,0x58,0x40,0x58,0x20,0x50,0x20,0x58,0x20,0x58, -0x40,0x58,0x40,0x58,0x60,0x60,0x60,0x58,0x80,0x60,0x80,0x60,0x81,0x60,0x60,0x58, -0x81,0x60,0x80,0x60,0x81,0x68,0x80,0x60,0xa1,0x68,0x81,0x60,0x81,0x68,0x81,0x60, -0xc1,0x68,0xc1,0x68,0xc1,0x68,0x20,0x48,0x6c,0xb3,0x9d,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xdf,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x82,0x58,0x81,0x50,0xa1,0x50,0x80,0x58,0x81,0x58, -0xa2,0x58,0xc2,0x60,0xa1,0x60,0xc2,0x60,0xe0,0x68,0xe1,0x68,0xc0,0x68,0xe1,0x70, -0xc1,0x68,0xe1,0x70,0xe1,0x70,0x02,0x71,0x01,0x71,0x02,0x71,0x22,0x71,0x43,0x79, -0x42,0x79,0x63,0x81,0x63,0x81,0x84,0x89,0x83,0x81,0x63,0x81,0x63,0x81,0x84,0x89, -0x83,0x89,0xa4,0x89,0x83,0x81,0xa4,0x89,0x83,0x81,0x42,0x81,0x02,0x69,0xef,0xa3, -0x59,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x63,0x71,0x83,0x79,0xa4,0x71, -0xc4,0x79,0xa3,0x79,0xa3,0x79,0x82,0x79,0x83,0x79,0x62,0x79,0x83,0x79,0x63,0x79, -0x83,0x81,0x64,0x81,0x64,0x81,0x63,0x81,0x84,0x81,0x63,0x81,0x84,0x81,0x83,0x81, -0x63,0x81,0x22,0x79,0x84,0x81,0xa4,0x81,0x84,0x81,0x63,0x79,0x63,0x79,0x43,0x79, -0x63,0x81,0x63,0x79,0x84,0x81,0x83,0x79,0x63,0x81,0x43,0x79,0x63,0x81,0x83,0x81, -0xe2,0x70,0xe3,0x68,0xc7,0x79,0x30,0x9c,0xbe,0xf7,0xff,0xff,0xfe,0xff,0xff,0xff, -0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x42,0x71, -0x42,0x69,0x43,0x71,0x42,0x71,0x63,0x79,0x62,0x71,0x63,0x79,0x22,0x79,0x42,0x79, -0x83,0x81,0xa4,0x89,0x83,0x81,0x84,0x81,0x63,0x81,0x84,0x81,0x83,0x81,0x84,0x81, -0x63,0x81,0x63,0x81,0x63,0x81,0x84,0x89,0x63,0x81,0x63,0x81,0x63,0x81,0x63,0x81, -0x63,0x81,0x83,0x81,0x63,0x81,0x83,0x81,0x63,0x81,0x84,0x89,0x83,0x81,0x84,0x81, -0x83,0x81,0x83,0x81,0x84,0x81,0x89,0x9a,0xca,0x9a,0x69,0x82,0x55,0xc5,0xde,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x43,0x81,0x63,0x89,0x63,0x81,0x83,0x89,0x62,0x89,0x63,0x89,0x62,0x89, -0x83,0x89,0x83,0x81,0x63,0x81,0x42,0x81,0x63,0x81,0x42,0x81,0x62,0x81,0x42,0x81, -0x43,0x81,0x43,0x81,0x63,0x81,0x63,0x81,0x43,0x81,0x22,0x79,0x63,0x89,0x84,0x89, -0x84,0x89,0x63,0x81,0x83,0x81,0x63,0x81,0x63,0x81,0x63,0x81,0x84,0x81,0x63,0x81, -0x84,0x89,0x84,0x89,0x84,0x89,0x02,0x81,0xa7,0xa2,0xcb,0xbb,0x0d,0xcc,0xac,0xc3, -0xe9,0x9a,0x88,0x82,0x8c,0x9b,0xfb,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x63,0x89,0x63,0x81,0x84,0x89,0x63,0x89,0x83,0x89, -0x63,0x89,0x83,0x89,0x83,0x89,0x84,0x89,0x63,0x81,0x63,0x81,0x62,0x81,0x43,0x89, -0x42,0x81,0x62,0x81,0x42,0x81,0x63,0x81,0x63,0x81,0x84,0x89,0x43,0x81,0x23,0x81, -0x63,0x89,0xa4,0x91,0x83,0x81,0x84,0x89,0x83,0x81,0x84,0x89,0x63,0x81,0x84,0x89, -0x83,0x81,0x84,0x89,0x84,0x89,0xa4,0x91,0x84,0x89,0x23,0x81,0x87,0xa2,0xec,0xc3, -0x0d,0xcc,0xcc,0xcb,0xe8,0x9a,0xa8,0x8a,0x8c,0x9b,0x1b,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x63,0x81,0xa4,0x89,0x83,0x89, -0x83,0x91,0x83,0x89,0x83,0x91,0x83,0x89,0xa3,0x89,0x83,0x81,0xa4,0x89,0xa3,0x89, -0xc4,0x91,0xc4,0x91,0xc4,0x91,0xc4,0x91,0xc4,0x91,0xa4,0x89,0xc5,0x91,0xc4,0x91, -0xe5,0x91,0xe5,0x91,0xe5,0x91,0xc4,0x89,0x05,0x9a,0x05,0x9a,0x26,0xa2,0x26,0x9a, -0x26,0x9a,0x05,0x9a,0x26,0x9a,0x05,0x9a,0x26,0x9a,0x05,0x9a,0xc5,0x91,0x67,0xaa, -0x0d,0xd4,0xec,0xcb,0xac,0xc3,0xab,0xbb,0x0c,0xc4,0x6f,0xcc,0xac,0xab,0x40,0x28, -0x8d,0x8b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc4,0x89, -0xc4,0x89,0x05,0x92,0x63,0x81,0xa4,0x91,0xc5,0x91,0xc5,0x99,0xc4,0x89,0xc4,0x89, -0x83,0x81,0xa3,0x81,0x83,0x81,0xa4,0x89,0xa4,0x89,0xa4,0x89,0x84,0x81,0xa4,0x89, -0xc4,0x89,0xe5,0x91,0xc4,0x81,0xc4,0x81,0xe4,0x81,0xc4,0x89,0x42,0x79,0x22,0x79, -0x22,0x79,0x43,0x81,0x22,0x79,0x62,0x79,0x62,0x79,0x63,0x81,0x42,0x79,0xe1,0x70, -0xa0,0x68,0x8b,0xc3,0x4e,0xcc,0x0d,0xc4,0xed,0xcb,0x2f,0xcc,0x6e,0xcc,0xaa,0xab, -0x28,0x9b,0x6b,0x9b,0x64,0x51,0xca,0x7a,0xb9,0xde,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x21,0x71,0x42,0x71,0x42,0x71,0x63,0x81,0x62,0x79,0x22,0x79,0x22,0x71, -0x42,0x71,0x41,0x69,0xc4,0x81,0xc3,0x81,0xa4,0x81,0x84,0x81,0x83,0x81,0x63,0x79, -0xa4,0x81,0xe4,0x81,0xe5,0x89,0xc4,0x89,0x05,0x8a,0x25,0x8a,0x46,0x8a,0x25,0x8a, -0x46,0x92,0x46,0x8a,0x46,0x92,0x46,0x92,0x87,0x92,0x87,0x92,0xc7,0x9a,0xc7,0x9a, -0xc8,0xaa,0xa7,0xa2,0xa8,0xa2,0xab,0xbb,0x4e,0xc4,0xed,0xbb,0xcd,0xc3,0xed,0xc3, -0x4e,0xcc,0x4d,0xc4,0x2c,0xbc,0x8c,0x9b,0xce,0xab,0x20,0x30,0xb5,0xbd,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x67,0x9a,0x67,0x92,0x87,0x9a,0xa8,0xa2,0xe9,0xaa, -0x0a,0xb3,0x2a,0xb3,0x2a,0xab,0x4a,0xb3,0x4a,0xab,0x4b,0xb3,0x2a,0xb3,0x4b,0xbb, -0x6c,0xbb,0x8c,0xbb,0x6c,0xbb,0x8c,0xc3,0x8c,0xbb,0x8c,0xbb,0xac,0xbb,0xed,0xc3, -0xed,0xc3,0x0e,0xc4,0x2e,0xc4,0x6f,0xcc,0x6f,0xc4,0x6f,0xcc,0x6f,0xc4,0x6f,0xcc, -0x2e,0xbc,0x0d,0xb4,0xed,0xbb,0x0e,0xcc,0xcd,0xbb,0x70,0xd4,0x6e,0xc4,0x0d,0xc4, -0xed,0xc3,0x0e,0xc4,0x4e,0xcc,0x53,0xe5,0xf1,0xd4,0xc6,0x69,0xa2,0x40,0x13,0xc5, -0x9e,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x47,0x9a,0x67,0x9a,0x67,0x9a, -0xe6,0x91,0x06,0x92,0x27,0x9a,0x27,0x9a,0x67,0x9a,0x67,0x9a,0x06,0x92,0xe5,0x89, -0x06,0x92,0xe6,0x91,0x06,0x92,0xe6,0x89,0xe6,0x91,0xe6,0x91,0x06,0x92,0x06,0x92, -0x26,0x92,0x26,0x92,0x47,0x9a,0x26,0x92,0x47,0x92,0x26,0x8a,0x47,0x92,0x46,0x8a, -0x46,0x82,0x06,0x82,0x46,0x8a,0x67,0x8a,0x05,0x82,0x83,0x71,0x05,0x82,0xec,0xb3, -0x8e,0xc4,0x2d,0xbc,0x0d,0xc4,0xed,0xc3,0x90,0xd4,0x93,0xed,0xf2,0xdc,0x23,0x51, -0x44,0x51,0x1b,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc5,0x89, -0xc5,0x89,0xe6,0x91,0x43,0x79,0x84,0x81,0x64,0x81,0x64,0x89,0x84,0x81,0x84,0x81, -0x84,0x81,0x84,0x89,0x84,0x81,0x85,0x89,0x64,0x81,0x85,0x89,0x84,0x89,0xa5,0x89, -0xa5,0x89,0xc5,0x91,0xa5,0x89,0xa5,0x89,0x85,0x89,0xa5,0x89,0xa4,0x81,0xc5,0x81, -0xa4,0x81,0xc5,0x81,0xa4,0x81,0xa5,0x81,0xc5,0x81,0x06,0x8a,0xc5,0x79,0xa4,0x71, -0xe5,0x71,0xcd,0xb3,0x6e,0xc4,0x4e,0xc4,0x2e,0xc4,0x2f,0xcc,0x6f,0xcc,0x74,0xed, -0x91,0xcc,0xa2,0x38,0x92,0xa4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x87,0x9a,0x87,0x9a,0x87,0x9a,0xa7,0xa2,0xa7,0x9a,0xc8,0xa2,0xa7,0x9a, -0xa8,0xa2,0x87,0x9a,0xa8,0xa2,0x87,0xa2,0xa8,0xa2,0x87,0xa2,0xa8,0xa2,0xa8,0xa2, -0x88,0xa2,0x67,0x9a,0x88,0xa2,0x87,0x9a,0x87,0xa2,0x66,0x9a,0x67,0x9a,0x67,0x9a, -0x68,0xa2,0x47,0xa2,0x67,0xa2,0x47,0xa2,0x67,0xa2,0x47,0x9a,0x47,0xa2,0x47,0xa2, -0x47,0x9a,0x25,0x82,0x05,0x82,0x49,0xab,0x4e,0xcc,0x8f,0xcc,0xb0,0xd4,0xb0,0xc4, -0x50,0xbc,0xae,0xab,0x71,0xc4,0x9d,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x45,0x82,0x45,0x82,0x45,0x82,0x04,0x7a,0x25,0x82, -0x45,0x82,0x45,0x82,0x04,0x82,0x04,0x82,0x25,0x82,0x45,0x8a,0x25,0x82,0x25,0x8a, -0x25,0x82,0x45,0x8a,0x25,0x82,0x45,0x82,0x25,0x82,0x25,0x82,0x25,0x82,0x25,0x8a, -0x05,0x82,0x25,0x8a,0xe5,0x89,0xe5,0x91,0x05,0x8a,0x05,0x92,0x04,0x8a,0x05,0x8a, -0xe4,0x89,0x05,0x8a,0xe4,0x89,0xe5,0x89,0xa3,0x79,0xa3,0x79,0x2d,0xcc,0x12,0xe5, -0xb0,0xd4,0xb0,0xc4,0x6c,0x9b,0x96,0xd5,0x3c,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa1,0x59,0x82,0x59,0x81,0x59, -0x81,0x59,0x81,0x59,0xc2,0x61,0xc2,0x61,0xc2,0x61,0xc2,0x61,0xc2,0x61,0xc1,0x59, -0xe2,0x61,0xc3,0x61,0xc3,0x61,0xa2,0x61,0xc2,0x61,0xa1,0x59,0xc2,0x59,0xa2,0x59, -0xc2,0x61,0xc2,0x61,0xa2,0x61,0xa2,0x61,0xc3,0x69,0xc3,0x69,0xa3,0x69,0x81,0x61, -0xa2,0x61,0x82,0x61,0x82,0x61,0x81,0x59,0x62,0x69,0x62,0x71,0x63,0x71,0x00,0x59, -0x02,0x61,0x0e,0xbc,0x94,0xdd,0xcd,0x93,0x17,0xd6,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc2,0x61, -0xa2,0x61,0xe2,0x69,0xa2,0x61,0xc2,0x61,0xa2,0x61,0xc2,0x61,0xa2,0x61,0xc2,0x61, -0xa1,0x59,0xa2,0x61,0xc2,0x61,0xe3,0x69,0xc2,0x61,0xe3,0x69,0xc2,0x61,0xc3,0x61, -0xa2,0x59,0xa2,0x59,0x81,0x59,0xc2,0x61,0xa2,0x59,0xa2,0x61,0xa2,0x59,0xa2,0x61, -0xa2,0x59,0xc3,0x61,0xc2,0x59,0xc2,0x59,0xc2,0x59,0xc2,0x59,0x82,0x61,0x83,0x71, -0x82,0x69,0xa2,0x69,0xe0,0x48,0xa4,0x61,0xc9,0x7a,0xd1,0xb4,0x9e,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xc2,0x61,0xa2,0x61,0xa2,0x61,0xc2,0x61,0xa2,0x59,0xa1,0x59,0x81,0x59, -0xa1,0x61,0x61,0x51,0x81,0x59,0x81,0x59,0x82,0x59,0x81,0x51,0x81,0x59,0x61,0x51, -0xa2,0x59,0xe2,0x59,0xe2,0x59,0xc2,0x59,0xe3,0x61,0xc2,0x59,0xe3,0x61,0xc2,0x59, -0xc2,0x51,0xa1,0x49,0xe2,0x51,0xe2,0x51,0xe2,0x51,0xc1,0x49,0xe2,0x51,0xe2,0x49, -0xe2,0x59,0xa2,0x61,0xc2,0x59,0xe1,0x59,0x01,0x41,0x40,0x18,0x63,0x39,0x37,0xd6, -0xff,0xff,0xde,0xff,0xde,0xff,0xdf,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x21,0x21,0x20,0x21,0x21,0x21,0x41,0x21,0x41,0x21, -0x21,0x19,0x21,0x19,0x21,0x19,0x41,0x19,0x21,0x19,0x41,0x19,0x20,0x11,0x41,0x19, -0x41,0x19,0x41,0x19,0x20,0x11,0x21,0x11,0x20,0x11,0x21,0x19,0x20,0x11,0x41,0x11, -0x40,0x11,0x41,0x11,0x60,0x09,0x81,0x11,0x81,0x09,0xa1,0x11,0xa1,0x09,0xc2,0x11, -0xa1,0x09,0xc1,0x11,0xc1,0x09,0xe2,0x09,0xe1,0x01,0xa1,0x01,0x43,0x0a,0x51,0x7d, -0x3a,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x19,0x20,0x21,0x00,0x19, -0x41,0x21,0x20,0x19,0x21,0x21,0x00,0x19,0x41,0x19,0x21,0x19,0x21,0x19,0x20,0x11, -0x21,0x19,0x20,0x19,0x41,0x19,0x20,0x11,0x21,0x11,0x00,0x11,0x20,0x11,0x00,0x11, -0x20,0x11,0x40,0x09,0x40,0x11,0x40,0x09,0x61,0x11,0x60,0x09,0x81,0x11,0xa1,0x09, -0xc1,0x11,0xa1,0x09,0xc1,0x11,0xa1,0x09,0xc1,0x09,0xc1,0x01,0xe2,0x09,0x80,0x01, -0x43,0x0a,0x30,0x75,0x3a,0xc7,0xde,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x67,0x0b, -0x47,0x0b,0x68,0x0b,0x68,0x13,0x88,0x13,0x68,0x13,0x88,0x13,0x88,0x0b,0xa8,0x0b, -0x87,0x03,0xa8,0x0b,0xa8,0x0b,0xc9,0x0b,0xa8,0x0b,0xc9,0x13,0xc9,0x0b,0xe9,0x13, -0xc9,0x0b,0xe9,0x13,0xe9,0x0b,0x2a,0x0c,0x09,0x04,0x0a,0x0c,0xe9,0x0b,0x0a,0x14, -0xe9,0x0b,0xea,0x13,0xe9,0x0b,0x0a,0x14,0xe9,0x0b,0x0a,0x14,0xea,0x0b,0x0a,0x14, -0x0a,0x0c,0x2b,0x14,0x08,0x04,0x05,0x03,0x64,0x02,0x8d,0x63,0x7e,0xef,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xc8,0x0b,0xc8,0x0b,0xc8,0x0b,0x09,0x14,0xc8,0x0b,0xc8,0x0b,0xc8,0x03, -0xe9,0x0b,0x08,0x04,0x09,0x0c,0x08,0x0c,0x09,0x0c,0x09,0x04,0x09,0x0c,0x29,0x0c, -0x09,0x0c,0x08,0x04,0xe9,0x0b,0xe9,0x03,0x09,0x04,0xe8,0x03,0x09,0x04,0x29,0x04, -0x09,0x0c,0xe8,0x03,0x09,0x0c,0x09,0x04,0x09,0x04,0xe8,0x03,0x09,0x04,0x29,0x04, -0x2a,0x0c,0x09,0x04,0x09,0x04,0xe8,0x03,0x08,0x04,0x28,0x04,0xe8,0x03,0x86,0x32, -0x75,0xcd,0xbe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbe,0xf7,0xdf,0xff,0xdf,0xff, -0xff,0xf7,0xff,0xff,0xff,0xff,0xe8,0x03,0xe8,0x03,0xe8,0x0b,0xa7,0x03,0xe9,0x0b, -0x29,0x14,0x29,0x14,0xe8,0x03,0xe8,0x03,0xa7,0x03,0xc8,0x03,0xc8,0x03,0xe8,0x03, -0xe8,0x03,0xe8,0x03,0xe8,0x03,0xe8,0x0b,0x08,0x0c,0x29,0x0c,0x29,0x0c,0x4a,0x0c, -0x09,0x04,0x09,0x04,0x08,0x04,0x09,0x04,0x08,0x04,0x29,0x0c,0x69,0x04,0x8a,0x0c, -0x49,0x04,0x29,0x04,0x29,0x04,0x4a,0x04,0x4a,0x04,0x8b,0x0c,0x6a,0x0c,0x69,0x04, -0x68,0x14,0xac,0x84,0x0a,0xa3,0xd6,0xdd,0xbd,0xf7,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xe8,0x03,0x09,0x0c,0x08,0x04, -0xa7,0x03,0xc8,0x03,0xe8,0x0b,0xe8,0x03,0x09,0x04,0x08,0x04,0x08,0x04,0x08,0x04, -0x09,0x04,0x08,0x04,0x28,0x04,0x08,0x04,0x29,0x04,0xe8,0x03,0x08,0x04,0xe7,0x03, -0x09,0x04,0x29,0x04,0x29,0x04,0x08,0x04,0x29,0x04,0x08,0x04,0x29,0x0c,0x28,0x04, -0x49,0x0c,0x69,0x04,0x6a,0x0c,0x49,0x04,0x6a,0x0c,0x6a,0x0c,0x6a,0x0c,0x4a,0x04, -0x29,0x04,0x27,0x04,0x89,0x14,0xce,0x9c,0x0e,0xcc,0xee,0xa3,0x13,0xad,0xde,0xf7, -0xff,0xff,0xdf,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x09,0x0c, -0x08,0x04,0x29,0x0c,0x09,0x0c,0x09,0x0c,0xa7,0x03,0xc8,0x03,0xe8,0x03,0x08,0x04, -0x29,0x04,0x49,0x0c,0x09,0x04,0x09,0x04,0x09,0x04,0x29,0x0c,0x29,0x04,0x29,0x04, -0x08,0x04,0x09,0x0c,0xe8,0x03,0x29,0x04,0x29,0x04,0x6a,0x0c,0x49,0x0c,0x4a,0x0c, -0x49,0x0c,0x6a,0x14,0x29,0x04,0x29,0x04,0x49,0x04,0x8a,0x14,0x6a,0x0c,0x4a,0x0c, -0x29,0x04,0x4a,0x0c,0x8b,0x0c,0xaa,0x04,0x8a,0x1c,0xef,0xb4,0xb1,0xec,0xee,0xab, -0xcd,0x8b,0xd7,0xcd,0xff,0xff,0xff,0xff,0xbf,0xff,0xbf,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xe8,0x03,0xe8,0x03,0xe7,0x03,0x29,0x0c,0x49,0x0c,0x6a,0x0c,0x49,0x0c, -0x49,0x04,0x28,0x04,0x6a,0x0c,0x69,0x0c,0x6a,0x0c,0x49,0x04,0x69,0x0c,0x49,0x0c, -0x6a,0x0c,0x49,0x04,0x8a,0x0c,0xaa,0x14,0x8a,0x14,0x69,0x0c,0x49,0x0c,0x49,0x04, -0x6a,0x04,0x69,0x04,0x89,0x04,0x69,0x04,0xab,0x0c,0xca,0x0c,0xaa,0x04,0x8a,0x04, -0x8a,0x04,0x49,0x04,0x8a,0x04,0xcb,0x04,0xaa,0x0c,0x6b,0x3c,0xae,0x74,0x8f,0xc4, -0x91,0xe4,0x6f,0xc4,0x2f,0xb4,0x8d,0x9b,0x16,0xbe,0xff,0xff,0xff,0xff,0xbf,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0x09,0x04,0x08,0x04,0x08,0x04,0xe8,0x03,0x29,0x0c, -0x29,0x04,0x49,0x0c,0x6a,0x0c,0x8a,0x14,0x49,0x04,0x49,0x0c,0x69,0x04,0x6a,0x0c, -0x69,0x0c,0x8a,0x0c,0x69,0x0c,0x6a,0x0c,0x49,0x04,0x49,0x04,0x49,0x04,0x6a,0x0c, -0x29,0x0c,0x29,0x0c,0x49,0x04,0x6a,0x04,0x69,0x04,0x6a,0x04,0x49,0x04,0x49,0x04, -0x28,0x04,0x28,0x04,0x29,0x04,0x6a,0x04,0x49,0x04,0x4a,0x04,0xc6,0x03,0x6c,0x64, -0xd0,0xac,0xb1,0xd4,0x6f,0xd4,0x90,0xd4,0xd1,0xd4,0xf2,0xd4,0x09,0x4b,0xdf,0xef, -0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0xaa,0x0c,0xab,0x14,0x8a,0x0c, -0xcb,0x14,0xec,0x1c,0x2d,0x25,0x2c,0x1d,0x0c,0x25,0x0c,0x25,0x6e,0x35,0x8e,0x2d, -0xaf,0x35,0xcf,0x35,0xcf,0x35,0xcf,0x35,0xcf,0x35,0xcf,0x35,0xf0,0x3d,0xcf,0x35, -0xf0,0x3d,0xcf,0x3d,0xf0,0x3d,0xcf,0x3d,0xd0,0x4d,0xb0,0x55,0xb0,0x5d,0xb0,0x55, -0xb1,0x5d,0xb0,0x5d,0xd1,0x65,0xd0,0x5d,0x70,0x5d,0x0f,0x4d,0x2f,0x55,0x2f,0x45, -0xcf,0x45,0xb1,0xbc,0x32,0xfc,0xd0,0xd4,0x8f,0xc4,0x90,0xd4,0xd2,0xec,0x33,0xe5, -0x31,0x85,0x01,0x01,0xd3,0x84,0x1c,0xd7,0xff,0xff,0xff,0xff,0xff,0xff,0x6a,0x0c, -0x69,0x04,0x8a,0x0c,0x8a,0x0c,0xab,0x14,0xaa,0x14,0xcb,0x14,0xab,0x14,0xeb,0x1c, -0x0c,0x1d,0x0c,0x1d,0xec,0x1c,0xec,0x1c,0xcb,0x14,0xcc,0x1c,0xcb,0x1c,0xec,0x1c, -0xcb,0x14,0xec,0x1c,0xcb,0x14,0xcc,0x1c,0x8a,0x14,0x8b,0x14,0x6a,0x14,0x8b,0x1c, -0x6a,0x1c,0x8b,0x24,0x4a,0x1c,0x4a,0x1c,0x4a,0x1c,0x6b,0x1c,0x8b,0x24,0xad,0x2c, -0x6b,0x1c,0x0a,0x0c,0xcc,0x24,0xd2,0xbc,0x32,0xf4,0xcd,0xb3,0xf0,0xcc,0xb0,0xd4, -0x90,0xd4,0xd6,0xf5,0x89,0x43,0xc0,0x00,0x75,0x9d,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x8a,0x14,0xab,0x14,0x8a,0x14,0xab,0x1c,0xab,0x14,0xab,0x14,0x8a,0x14, -0x8b,0x14,0x8a,0x14,0x8a,0x14,0x6a,0x14,0xab,0x14,0xab,0x14,0x0c,0x25,0x0c,0x25, -0x2d,0x25,0x0c,0x25,0x2d,0x25,0x0d,0x25,0x0d,0x25,0x0c,0x25,0x4d,0x2d,0x6d,0x2d, -0x6e,0x2d,0x6d,0x25,0x6e,0x25,0x6d,0x25,0x6d,0x2d,0x4d,0x25,0x6e,0x2d,0x6e,0x2d, -0x0d,0x1d,0xab,0x0c,0x0d,0x1d,0x8e,0x1d,0x4d,0x2d,0xf1,0xac,0x15,0xfd,0xf2,0xdc, -0xb0,0xc4,0xf0,0xc4,0xb4,0xdd,0x94,0xdd,0x60,0x08,0xdb,0xd6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xcc,0x1c,0xcb,0x1c,0xcb,0x1c,0xcb,0x1c,0xec,0x24, -0xcb,0x1c,0xcc,0x24,0xab,0x1c,0xcc,0x24,0xab,0x1c,0xcc,0x24,0xec,0x24,0x0d,0x2d, -0xcc,0x24,0xcc,0x24,0xcc,0x24,0xec,0x2c,0xec,0x24,0x0c,0x25,0xec,0x24,0xed,0x2c, -0xcc,0x24,0xec,0x2c,0xec,0x24,0x0d,0x25,0xec,0x1c,0x0c,0x25,0x2c,0x25,0x2d,0x2d, -0x0d,0x2d,0x2d,0x2d,0x0d,0x25,0x2e,0x2d,0x0d,0x2d,0x0d,0x1d,0xcb,0x14,0x52,0xa5, -0x75,0xfd,0xd2,0xe4,0xd0,0xc4,0x77,0xee,0xd4,0xdd,0xe6,0x59,0x74,0x9d,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x4a,0x0c,0x4a,0x14,0x29,0x0c, -0x6a,0x14,0x49,0x14,0x4a,0x14,0x4a,0x0c,0x4a,0x14,0x4a,0x14,0x6a,0x1c,0x6a,0x14, -0x6a,0x14,0x49,0x14,0x4a,0x14,0x49,0x14,0x6a,0x14,0x4a,0x14,0x6a,0x1c,0x4a,0x14, -0x6a,0x14,0x4a,0x14,0x2a,0x14,0x09,0x0c,0x29,0x0c,0x29,0x04,0x49,0x0c,0x28,0x04, -0x29,0x0c,0x09,0x0c,0x09,0x0c,0xe8,0x03,0x29,0x0c,0x2a,0x0c,0x2a,0x14,0xc8,0x03, -0xe7,0x03,0xee,0x7c,0x53,0xcd,0x50,0xd4,0x12,0xd5,0xf1,0xb4,0x6f,0x9c,0x0e,0x94, -0xff,0xf7,0xff,0xff,0xdf,0xff,0xbf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xa8,0x03, -0x87,0x03,0xa8,0x03,0xa7,0x03,0xa8,0x0b,0xa7,0x03,0xa8,0x03,0x87,0x03,0xa8,0x0b, -0xa7,0x03,0xa8,0x0b,0x87,0x03,0x87,0x03,0xa7,0x03,0xc8,0x0b,0xa8,0x0b,0xc8,0x0b, -0xa8,0x0b,0xc8,0x0b,0xa8,0x03,0xc8,0x0b,0xc8,0x0b,0x09,0x14,0x09,0x04,0x29,0x04, -0x28,0x04,0x29,0x04,0x49,0x04,0x6a,0x0c,0x49,0x04,0x49,0x04,0xe8,0x03,0xc8,0x03, -0xe8,0x03,0x6a,0x04,0x86,0x03,0x09,0x2c,0x8d,0x5c,0xf2,0xd4,0x2f,0xbc,0xd1,0xac, -0xf5,0xbd,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0xdf,0xff,0xbf,0xff,0xff,0xff, -0xff,0xff,0x87,0x03,0x87,0x03,0x67,0x03,0xa8,0x0b,0x87,0x03,0xa7,0x03,0x67,0x03, -0x87,0x03,0x87,0x03,0x87,0x0b,0x87,0x03,0xa8,0x0b,0x87,0x03,0x67,0x03,0x46,0x03, -0x67,0x03,0x66,0x03,0x67,0x03,0x67,0x03,0x67,0x03,0x66,0x03,0x87,0x03,0x87,0x03, -0xc8,0x03,0xc7,0x03,0xc8,0x03,0xa7,0x03,0xc7,0x03,0xa6,0x03,0xa7,0x03,0x86,0x03, -0xc8,0x03,0xc8,0x03,0xc8,0x03,0xa7,0x03,0xa7,0x03,0x45,0x03,0xa8,0x23,0x90,0xb4, -0xcf,0xbb,0x38,0xde,0xff,0xff,0xff,0xff,0xdf,0xf7,0xdf,0xff,0xff,0xff,0xbf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x06,0x03,0x06,0x03,0x26,0x03,0x26,0x03,0x27,0x03, -0x26,0x03,0x26,0x03,0x06,0x03,0x27,0x0b,0x26,0x0b,0x27,0x0b,0xe6,0x02,0xe6,0x02, -0xe6,0x02,0xe6,0x02,0xe5,0x02,0xe6,0x0a,0xe6,0x02,0xe6,0x0a,0xe5,0x02,0x06,0x03, -0x06,0x03,0x06,0x03,0xe6,0x0a,0xe6,0x12,0xc6,0x0a,0xe6,0x12,0xc6,0x0a,0xc6,0x12, -0xc6,0x0a,0xe6,0x0a,0xa5,0x0a,0xa6,0x0a,0x85,0x0a,0xc6,0x0a,0xe6,0x02,0x20,0x01, -0xe1,0x08,0xb5,0xb5,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xa5,0x0a,0xa6,0x12,0xa5,0x0a, -0x85,0x02,0x85,0x0a,0xa6,0x12,0xa5,0x0a,0xa5,0x0a,0x85,0x0a,0xc6,0x12,0xa5,0x0a, -0xa5,0x0a,0xa5,0x0a,0x85,0x0a,0x64,0x0a,0x84,0x0a,0x64,0x02,0x65,0x02,0x64,0x02, -0x65,0x02,0x64,0x02,0x85,0x02,0x64,0x02,0x65,0x0a,0x44,0x0a,0x65,0x12,0x45,0x0a, -0x45,0x0a,0x24,0x0a,0x65,0x12,0x85,0x0a,0x85,0x0a,0x45,0x0a,0x66,0x0a,0x65,0x02, -0xa3,0x09,0xa7,0x3a,0x70,0x84,0x5d,0xe7,0xff,0xff,0xff,0xf7,0xff,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x04,0x12, -0xe4,0x09,0xe4,0x09,0x25,0x0a,0x25,0x12,0xe4,0x01,0x04,0x0a,0xe3,0x01,0x04,0x0a, -0x04,0x02,0x04,0x0a,0x04,0x0a,0x04,0x0a,0x03,0x02,0x24,0x0a,0xe4,0x01,0xe4,0x01, -0xe3,0x01,0x04,0x0a,0xe3,0x01,0xe3,0x01,0xe3,0x01,0xe4,0x01,0xc3,0x01,0xc3,0x01, -0xc3,0x01,0xe4,0x09,0x04,0x0a,0x04,0x0a,0xc3,0x09,0xa3,0x09,0x82,0x09,0x82,0x09, -0x82,0x09,0x21,0x01,0x01,0x09,0x78,0xc6,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x41,0x01,0x41,0x01,0x41,0x01,0xe0,0x00,0x00,0x01,0x41,0x01,0x21,0x01, -0x41,0x01,0x40,0x01,0x61,0x01,0x41,0x01,0x61,0x01,0x41,0x01,0x61,0x01,0x41,0x01, -0x62,0x01,0x82,0x01,0x82,0x01,0x82,0x01,0x83,0x01,0x82,0x01,0xa3,0x01,0x82,0x01, -0x82,0x01,0x62,0x01,0x82,0x01,0x82,0x01,0xa3,0x01,0x82,0x01,0xa3,0x01,0xa3,0x01, -0xc4,0x01,0xc3,0x01,0xc3,0x01,0xa3,0x01,0x83,0x01,0x02,0x09,0x27,0x32,0xfb,0xce, -0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xa2,0x01,0x82,0x01,0x82,0x01,0x82,0x01,0xa3,0x01, -0x82,0x01,0xa2,0x01,0xa2,0x01,0xa2,0x01,0xa2,0x01,0xc3,0x01,0xa2,0x01,0xc3,0x01, -0xc3,0x01,0xc3,0x01,0xe3,0x01,0x04,0x0a,0xe4,0x01,0x04,0x0a,0xe4,0x01,0xe4,0x01, -0xe4,0x01,0x04,0x02,0xe4,0x01,0xe4,0x09,0xe4,0x01,0x04,0x0a,0xe4,0x01,0xe4,0x09, -0x04,0x02,0x25,0x0a,0x25,0x0a,0x46,0x12,0x45,0x0a,0x65,0x0a,0x05,0x0a,0xa1,0x00, -0x60,0x00,0x6d,0xa3,0x5d,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x04,0x0a,0x04,0x0a,0x03,0x02, -0x45,0x12,0x24,0x0a,0x04,0x0a,0x04,0x02,0x24,0x02,0x24,0x02,0x25,0x0a,0x24,0x02, -0x44,0x02,0x24,0x02,0x45,0x0a,0x44,0x0a,0x45,0x0a,0x25,0x02,0x45,0x0a,0x45,0x02, -0x46,0x0a,0x45,0x0a,0x45,0x0a,0x45,0x02,0x66,0x0a,0x45,0x02,0x66,0x0a,0x45,0x0a, -0x66,0x0a,0x66,0x0a,0x45,0x0a,0xe4,0x01,0x04,0x02,0x24,0x02,0x25,0x0a,0x04,0x02, -0x47,0x02,0xe3,0x01,0x03,0x12,0xc8,0x9a,0x52,0xdd,0x7c,0xf7,0xff,0xff,0x9d,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x05,0x0a, -0x04,0x0a,0x25,0x0a,0xc3,0x01,0x04,0x02,0x25,0x0a,0x45,0x12,0x04,0x0a,0x25,0x0a, -0x25,0x0a,0x25,0x0a,0x25,0x0a,0x25,0x0a,0x45,0x0a,0x66,0x12,0x25,0x0a,0x25,0x0a, -0x25,0x02,0x46,0x0a,0x25,0x0a,0x45,0x0a,0x25,0x0a,0x45,0x0a,0x45,0x02,0x45,0x0a, -0x45,0x02,0x66,0x0a,0x45,0x02,0x46,0x0a,0x45,0x0a,0x66,0x12,0x86,0x0a,0xa7,0x12, -0x86,0x0a,0xa6,0x12,0x06,0x0a,0x45,0x02,0x07,0x33,0xaf,0xcc,0xec,0xb3,0x56,0xe6, -0xde,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x24,0x02,0x25,0x02,0x24,0x02,0x45,0x0a,0x25,0x02,0x45,0x02,0x25,0x02, -0x45,0x0a,0x45,0x02,0x66,0x0a,0x65,0x0a,0x66,0x0a,0x45,0x02,0x45,0x02,0x25,0x02, -0x66,0x0a,0x86,0x02,0x86,0x0a,0x66,0x02,0x86,0x0a,0x86,0x0a,0x86,0x0a,0x66,0x0a, -0x87,0x0a,0x86,0x02,0xa6,0x0a,0x86,0x0a,0xa7,0x0a,0xa7,0x0a,0xa7,0x0a,0x86,0x02, -0x86,0x0a,0x66,0x02,0x86,0x0a,0x25,0x02,0x85,0x02,0xd0,0xa4,0x16,0xfe,0x50,0xe5, -0xce,0xcc,0x4d,0xb4,0x0d,0xa4,0xee,0x93,0x9e,0xf7,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x46,0x0a,0x45,0x02,0x66,0x0a,0x05,0x02,0x45,0x0a, -0x45,0x0a,0x66,0x0a,0x45,0x02,0x66,0x0a,0x25,0x02,0x25,0x02,0x45,0x02,0x86,0x0a, -0x45,0x02,0x45,0x02,0x45,0x02,0x66,0x0a,0x66,0x02,0x86,0x0a,0x66,0x02,0x86,0x0a, -0x86,0x0a,0x86,0x0a,0x86,0x02,0xa7,0x0a,0x66,0x02,0x45,0x02,0x65,0x02,0x86,0x0a, -0x66,0x02,0x66,0x02,0x45,0x02,0x66,0x02,0x24,0x02,0xc3,0x01,0xa9,0x3b,0xf1,0xcc, -0x12,0xfd,0x30,0xdd,0x0f,0xcd,0xd3,0xed,0x32,0xd5,0x89,0x6a,0x50,0x7c,0xff,0xff, -0xff,0xff,0xff,0xff,0xbe,0xf7,0xff,0xff,0xff,0xff,0x25,0x02,0x45,0x02,0x45,0x02, -0x45,0x02,0x25,0x02,0x46,0x0a,0x45,0x02,0x25,0x02,0x04,0x02,0x25,0x02,0x04,0x02, -0xe4,0x01,0xc3,0x01,0x25,0x02,0x04,0x02,0x04,0x02,0xe4,0x01,0x05,0x02,0x04,0x02, -0x04,0x02,0xe3,0x01,0xe4,0x01,0xa3,0x01,0xc4,0x01,0xc3,0x01,0x04,0x02,0x04,0x02, -0x24,0x02,0x24,0x02,0x25,0x02,0x24,0x02,0x86,0x0a,0xc7,0x0a,0xa7,0x0a,0x24,0x02, -0x6d,0x74,0x52,0xe5,0x32,0xfd,0x10,0xd5,0x30,0xcd,0xb3,0xed,0xb4,0xed,0xee,0x93, -0x82,0x10,0x34,0xa5,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x86,0x0a, -0x86,0x02,0x87,0x0a,0x86,0x0a,0x86,0x0a,0x86,0x02,0x87,0x0a,0xa7,0x0a,0xe8,0x12, -0x49,0x1b,0x6a,0x23,0x6a,0x23,0x8a,0x23,0x6a,0x23,0x6a,0x2b,0xaa,0x23,0xec,0x2b, -0xab,0x23,0xab,0x2b,0xec,0x2b,0x4e,0x3c,0x6e,0x3c,0x8f,0x44,0x6e,0x44,0x6e,0x44, -0x8e,0x3c,0xd0,0x44,0xcf,0x44,0xcf,0x44,0xf0,0x4c,0x31,0x55,0xaf,0x44,0x6e,0x3c, -0x8e,0x3c,0x8e,0x1c,0x51,0xad,0xb3,0xfd,0xb2,0xf5,0x72,0xdd,0x71,0xd5,0x52,0xe5, -0x72,0xdd,0xb6,0xcd,0xaf,0x63,0x21,0x00,0x8d,0x6b,0xf8,0xbd,0xbf,0xff,0xff,0xff, -0xff,0xff,0x28,0x13,0x29,0x1b,0x29,0x1b,0x29,0x1b,0x28,0x13,0x08,0x1b,0x29,0x1b, -0xab,0x2b,0xab,0x2b,0x49,0x1b,0x29,0x1b,0x6a,0x23,0x8a,0x23,0x49,0x23,0x49,0x1b, -0x49,0x1b,0x08,0x13,0x29,0x1b,0x29,0x1b,0x29,0x1b,0x08,0x13,0x09,0x13,0xe8,0x0a, -0x08,0x13,0x08,0x0b,0xc8,0x12,0x86,0x0a,0xa7,0x12,0xa7,0x0a,0xe8,0x12,0xe8,0x12, -0xa7,0x12,0x45,0x0a,0x86,0x02,0x04,0x02,0x4e,0xac,0x92,0xf5,0x92,0xe5,0x92,0xd5, -0x93,0xdd,0x92,0xe5,0xb4,0xed,0x75,0xc5,0x87,0x29,0x00,0x00,0x10,0x7c,0x59,0xc6, -0xdf,0xff,0xff,0xff,0xff,0xff,0xa7,0x12,0xa6,0x0a,0xc7,0x0a,0x86,0x0a,0xa7,0x12, -0x87,0x0a,0xc7,0x12,0xc7,0x12,0xc8,0x12,0x66,0x0a,0x66,0x0a,0x66,0x0a,0x87,0x0a, -0x86,0x02,0xa7,0x0a,0xa6,0x02,0xc7,0x0a,0xa7,0x02,0xc8,0x0a,0x86,0x02,0x66,0x02, -0x66,0x02,0x86,0x02,0x66,0x02,0x86,0x02,0x66,0x02,0x66,0x02,0x66,0x02,0x66,0x02, -0x66,0x02,0x66,0x02,0x66,0x02,0xa7,0x0a,0x66,0x02,0x04,0x02,0x2d,0x9c,0xb3,0xed, -0xd2,0xdd,0xb4,0xdd,0x93,0xdd,0x36,0xfe,0x36,0xf6,0x71,0x9c,0x62,0x00,0x86,0x29, -0x18,0xc6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x86,0x02,0xa7,0x02,0x86,0x02, -0x87,0x0a,0x86,0x02,0xa7,0x0a,0x86,0x02,0x66,0x02,0x65,0x02,0x08,0x13,0x08,0x13, -0xc7,0x0a,0x86,0x02,0xe8,0x12,0xe7,0x0a,0xe8,0x0a,0xc7,0x02,0xc7,0x02,0x86,0x02, -0xe8,0x0a,0x29,0x13,0x29,0x13,0x08,0x0b,0x09,0x13,0xe8,0x0a,0x29,0x13,0x49,0x13, -0x6a,0x1b,0x49,0x13,0x49,0x13,0x08,0x0b,0x29,0x13,0x29,0x13,0xe8,0x0a,0x66,0x02, -0x90,0x8c,0xf4,0xe5,0x15,0xf6,0xd3,0xdd,0x32,0xd5,0xf9,0xfe,0xfa,0xf6,0x69,0x52, -0x00,0x00,0xba,0xd6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0x0a, -0xa7,0x0a,0xc7,0x0a,0x87,0x0a,0xa7,0x0a,0xa7,0x0a,0xc8,0x12,0x87,0x0a,0x87,0x0a, -0xa7,0x0a,0xa8,0x12,0x87,0x02,0x87,0x0a,0xa7,0x0a,0xc8,0x12,0xa7,0x0a,0xa8,0x0a, -0xa7,0x0a,0xa8,0x0a,0x87,0x0a,0xa7,0x0a,0x87,0x0a,0xa7,0x0a,0x87,0x0a,0xa7,0x0a, -0x87,0x0a,0xa7,0x0a,0x87,0x0a,0x87,0x0a,0x87,0x0a,0xa8,0x12,0xa7,0x0a,0xc7,0x12, -0xe8,0x12,0xc8,0x0a,0xe4,0x01,0xd2,0xa4,0xdb,0xfe,0x35,0xe6,0x52,0xdd,0x12,0xd5, -0x2f,0xac,0x4d,0x73,0xbf,0xf7,0xff,0xff,0xbe,0xf7,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x45,0x02,0x66,0x0a,0x66,0x0a,0x66,0x12,0x46,0x0a,0x66,0x12,0x66,0x0a, -0xa7,0x12,0x87,0x12,0xa7,0x1a,0xa7,0x12,0xa7,0x1a,0x87,0x12,0x87,0x12,0x87,0x12, -0x87,0x12,0x66,0x12,0x67,0x12,0x46,0x12,0x87,0x1a,0xc7,0x1a,0xc7,0x1a,0xa7,0x1a, -0xa7,0x1a,0xa7,0x12,0xc8,0x1a,0xc7,0x1a,0xc8,0x22,0xa7,0x1a,0xc8,0x22,0xa7,0x1a, -0xa7,0x1a,0xa7,0x1a,0xe8,0x22,0xc8,0x1a,0xa3,0x09,0xac,0x6b,0xb4,0xcd,0xf4,0xed, -0x32,0xdd,0xac,0x93,0xcd,0x93,0xba,0xde,0xff,0xf7,0xff,0xff,0xdf,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x67,0x1a,0x67,0x1a,0x87,0x22,0x66,0x1a,0x66,0x22, -0x66,0x1a,0x87,0x22,0x46,0x1a,0x66,0x1a,0x66,0x1a,0x66,0x1a,0x46,0x1a,0x67,0x22, -0x87,0x22,0xa7,0x22,0x87,0x22,0x87,0x2a,0x87,0x2a,0xa7,0x2a,0x66,0x22,0x46,0x22, -0x46,0x22,0x66,0x22,0x45,0x1a,0x66,0x22,0x66,0x1a,0x86,0x22,0x46,0x1a,0x46,0x22, -0x66,0x22,0xa7,0x2a,0x87,0x2a,0xa7,0x2a,0x87,0x2a,0x87,0x22,0xe4,0x19,0xe8,0x42, -0x4d,0x7c,0xf5,0xe5,0xcc,0xab,0x74,0xc5,0x1b,0xef,0xff,0xff,0xff,0xff,0xdf,0xff, -0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0x19,0x05,0x22,0xe5,0x19, -0x04,0x22,0xe4,0x19,0xe4,0x19,0xe4,0x19,0x46,0x2a,0x26,0x22,0x46,0x2a,0x26,0x22, -0x46,0x2a,0x46,0x22,0x05,0x22,0xe4,0x19,0xe5,0x21,0xe5,0x21,0x05,0x2a,0xe5,0x21, -0x26,0x2a,0x46,0x32,0x66,0x32,0x46,0x2a,0x66,0x32,0x66,0x32,0x66,0x32,0x46,0x2a, -0x66,0x32,0x66,0x32,0x26,0x32,0xe4,0x21,0xe4,0x29,0xe4,0x21,0x25,0x2a,0x04,0x22, -0x87,0x32,0x22,0x01,0x01,0x11,0xed,0x9b,0x94,0xdd,0x9e,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xdf,0xff,0xdf,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0x21, -0xa4,0x21,0xc5,0x21,0x05,0x2a,0x05,0x2a,0x05,0x2a,0x26,0x32,0xe5,0x29,0xe5,0x29, -0xe5,0x29,0x05,0x2a,0xe4,0x21,0xe5,0x29,0x05,0x2a,0x06,0x32,0x05,0x2a,0x06,0x32, -0x05,0x32,0x06,0x32,0x05,0x32,0x46,0x3a,0x26,0x32,0x26,0x3a,0x05,0x32,0x26,0x32, -0x25,0x32,0x25,0x32,0x05,0x32,0x26,0x3a,0x05,0x32,0x06,0x3a,0x05,0x32,0x06,0x3a, -0xe5,0x31,0x46,0x42,0x46,0x32,0x63,0x11,0x42,0x11,0x2b,0x83,0xfb,0xee,0xff,0xff, -0xfe,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xc4,0x31,0xc5,0x31,0xa4,0x31,0xe5,0x39,0xe4,0x39,0xe5,0x39,0xe5,0x39, -0xc5,0x39,0xa4,0x31,0xc5,0x39,0xc4,0x31,0xc4,0x39,0xc4,0x31,0xe5,0x39,0xe5,0x39, -0xe5,0x41,0xe5,0x39,0xc5,0x41,0xa4,0x39,0xc5,0x39,0xc5,0x39,0xe5,0x41,0xc4,0x39, -0xc5,0x41,0xe4,0x39,0xe5,0x41,0xa4,0x39,0xc5,0x41,0xc4,0x39,0xe5,0x41,0xc5,0x41, -0xe5,0x41,0xe5,0x41,0xe5,0x41,0xe5,0x49,0x84,0x31,0x40,0x00,0xe3,0x18,0x55,0xb5, -0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa1,0x40,0xa1,0x40,0xc2,0x48,0xa1,0x40,0xc1,0x40, -0xc1,0x40,0xe1,0x48,0xc1,0x40,0xc2,0x48,0xc1,0x40,0xe2,0x48,0xc1,0x40,0xc2,0x48, -0xe2,0x48,0x02,0x51,0xe2,0x48,0x03,0x51,0x02,0x51,0x03,0x51,0x23,0x51,0x64,0x61, -0x63,0x59,0x64,0x61,0x64,0x61,0x64,0x61,0x84,0x61,0xa5,0x69,0x84,0x61,0xa5,0x69, -0xc5,0x69,0x06,0x72,0x06,0x72,0x07,0x7a,0xc5,0x69,0xa5,0x71,0xf2,0xbc,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x68,0x8a,0x89,0x92,0x68,0x8a, -0x0a,0xa3,0xe9,0x9a,0xea,0x9a,0xea,0x9a,0x4b,0xab,0x4b,0xab,0x6c,0xab,0x4b,0xab, -0x4b,0xab,0x4b,0xa3,0x4b,0xab,0x2b,0xa3,0x4b,0xab,0x4b,0xab,0x8d,0xb3,0xac,0xb3, -0x8d,0xb3,0x6c,0xab,0x8c,0xb3,0x6c,0xab,0x6c,0xb3,0x6c,0xb3,0xad,0xbb,0xad,0xbb, -0xcd,0xbb,0xcd,0xbb,0xee,0xc3,0xcd,0xbb,0xee,0xc3,0xee,0xc3,0x2f,0xcc,0xcd,0xc3, -0xa9,0x9a,0x75,0xcd,0xbe,0xff,0xff,0xff,0xdf,0xf7,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8d,0xbb, -0x6c,0xb3,0x6d,0xb3,0x6c,0xbb,0xad,0xbb,0x6c,0xb3,0x8d,0xbb,0x8d,0xbb,0xad,0xbb, -0xad,0xbb,0xcd,0xc3,0xad,0xbb,0xad,0xc3,0xad,0xbb,0xae,0xc3,0x8d,0xbb,0xad,0xc3, -0xad,0xc3,0xae,0xc3,0xad,0xc3,0xad,0xc3,0xad,0xc3,0xce,0xcb,0xad,0xc3,0xce,0xcb, -0xad,0xcb,0xce,0xcb,0xad,0xc3,0xce,0xcb,0xce,0xcb,0xef,0xd3,0xee,0xcb,0xee,0xd3, -0xee,0xcb,0x0f,0xd4,0x8d,0xc3,0x4b,0xa3,0x0e,0xac,0x5d,0xf7,0xff,0xff,0xdf,0xff, -0xbe,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x6c,0xc3,0x8d,0xc3,0x6c,0xc3,0x8d,0xcb,0x8c,0xc3,0x8d,0xc3,0x6c,0xc3, -0x8d,0xcb,0x6c,0xc3,0xad,0xcb,0x6d,0xc3,0x8d,0xcb,0x8d,0xc3,0xad,0xcb,0xad,0xcb, -0xae,0xcb,0xad,0xc3,0xad,0xcb,0xad,0xcb,0xae,0xcb,0xad,0xcb,0xce,0xd3,0xcd,0xcb, -0xce,0xd3,0xae,0xd3,0xce,0xd3,0xad,0xd3,0xae,0xd3,0xad,0xcb,0xce,0xd3,0xce,0xd3, -0xee,0xdb,0xce,0xd3,0xee,0xd3,0xee,0xd3,0xee,0xdb,0xcd,0xc3,0xcd,0xb3,0xee,0xab, -0x3c,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x8d,0xcb,0x8d,0xcb,0xad,0xd3,0xad,0xd3,0xce,0xdb, -0xcd,0xd3,0xce,0xd3,0xcd,0xd3,0xce,0xdb,0xcd,0xd3,0xee,0xdb,0xcd,0xd3,0xee,0xdb, -0xee,0xd3,0xee,0xdb,0xce,0xdb,0xee,0xdb,0xee,0xdb,0xee,0xdb,0xee,0xdb,0xef,0xdb, -0xee,0xdb,0x0f,0xe4,0xee,0xdb,0x0f,0xe4,0xef,0xe3,0x0f,0xe4,0x0f,0xdc,0x0f,0xe4, -0x0f,0xdc,0x0f,0xdc,0x0f,0xdc,0x0f,0xe4,0x0f,0xdc,0x2f,0xe4,0x0e,0xe4,0xf2,0xf4, -0xf1,0xdc,0x2a,0xa3,0x90,0xb4,0x5d,0xf7,0xff,0xff,0xfe,0xff,0xfe,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xad,0xcb,0xce,0xd3,0xad,0xd3, -0xce,0xdb,0xcd,0xd3,0xce,0xdb,0xad,0xd3,0xce,0xdb,0xcd,0xdb,0xee,0xdb,0xee,0xdb, -0xee,0xdb,0xee,0xdb,0x0f,0xdc,0xee,0xdb,0x0f,0xe4,0x0e,0xdc,0x0f,0xe4,0x0e,0xdc, -0x0f,0xe4,0xef,0xdb,0x0f,0xe4,0x0f,0xe4,0x0f,0xe4,0x0f,0xe4,0x2f,0xe4,0x0f,0xe4, -0x30,0xe4,0x0f,0xe4,0x0f,0xe4,0xee,0xdb,0x0f,0xe4,0x0f,0xe4,0x10,0xe4,0x0f,0xe4, -0x0f,0xec,0x90,0xe4,0xd0,0xdc,0x2d,0xc4,0xac,0x9b,0xd5,0xd5,0x7c,0xff,0xff,0xff, -0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xce,0xdb, -0xce,0xd3,0xce,0xdb,0xce,0xdb,0xee,0xdb,0xce,0xdb,0x0e,0xdc,0xee,0xdb,0xee,0xdb, -0xee,0xdb,0x0f,0xe4,0xee,0xdb,0x0f,0xe4,0x0e,0xdc,0x0f,0xe4,0x0f,0xe4,0x2f,0xe4, -0x0f,0xe4,0x2f,0xe4,0x0f,0xe4,0x10,0xe4,0x2f,0xe4,0x30,0xe4,0x2f,0xe4,0x50,0xe4, -0x2f,0xe4,0x50,0xe4,0x30,0xe4,0x50,0xe4,0x2f,0xe4,0x30,0xe4,0x2f,0xe4,0x50,0xe4, -0x2f,0xe4,0x50,0xec,0x91,0xec,0x70,0xd4,0x2d,0xc4,0x2e,0xc4,0xaf,0xc4,0x2e,0xac, -0x4e,0xac,0xd9,0xf6,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x2f,0xdc,0x4f,0xdc,0x0f,0xdc,0x2f,0xe4,0x2f,0xe4,0x2f,0xe4,0x2f,0xe4, -0x50,0xe4,0x2f,0xe4,0x50,0xec,0x4f,0xe4,0x50,0xe4,0x4f,0xe4,0x50,0xec,0x2f,0xe4, -0x50,0xec,0x70,0xe4,0x90,0xec,0x90,0xec,0x91,0xec,0x70,0xe4,0x91,0xec,0x91,0xec, -0x91,0xec,0x90,0xec,0x91,0xec,0x91,0xec,0xb1,0xec,0xb1,0xe4,0xd1,0xec,0xb1,0xec, -0xd2,0xec,0xd1,0xe4,0xf2,0xec,0xf2,0xfc,0xf2,0xe4,0x8f,0xbc,0x6e,0xb4,0xef,0xd4, -0x0e,0xcd,0xef,0xc4,0xd0,0xcc,0xee,0xbb,0xaf,0xc3,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x71,0xec,0x70,0xe4,0x71,0xec,0x70,0xec,0x91,0xf4, -0x70,0xec,0x91,0xec,0x90,0xec,0xb1,0xec,0xb1,0xec,0xb1,0xec,0x91,0xec,0xb2,0xf4, -0x91,0xf4,0xb2,0xf4,0xb1,0xf4,0xd2,0xf4,0xd1,0xf4,0xf2,0xf4,0xb1,0xec,0xd2,0xf4, -0xd2,0xf4,0xf2,0xf4,0xd2,0xf4,0xf2,0xf4,0xd2,0xf4,0xf2,0xf4,0xf2,0xf4,0x13,0xf5, -0x32,0xf5,0x33,0xfd,0x32,0xf5,0x33,0xfd,0x33,0xfd,0x74,0xfd,0xf2,0xdc,0xf2,0xc4, -0xf0,0xc4,0xcf,0xcc,0xcd,0xc4,0xee,0xc4,0xcf,0xcc,0xd1,0xe4,0x8f,0xdb,0xf4,0xcc, -0x5d,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x70,0xec,0x91,0xec,0x90,0xec, -0x91,0xec,0x91,0xf4,0x91,0xf4,0x70,0xec,0x70,0xe4,0x90,0xe4,0xd1,0xf4,0xb1,0xec, -0xb1,0xf4,0x71,0xec,0xd2,0xfc,0xb2,0xf4,0xd2,0xf4,0xd2,0xec,0xd2,0xf4,0xb2,0xec, -0xd2,0xec,0xd2,0xec,0xf2,0xf4,0xd2,0xec,0xf2,0xf4,0xd2,0xf4,0xd2,0xfc,0xd2,0xf4, -0xf2,0xfc,0xf1,0xf4,0xf2,0xfc,0xd1,0xf4,0x12,0xf5,0x12,0xf5,0xf2,0xfc,0xf1,0xf4, -0xf1,0xd4,0x70,0xc4,0x8f,0xc4,0xaf,0xc4,0x30,0xcd,0x0f,0xbd,0x0f,0xcd,0x11,0xe5, -0x92,0xfc,0x2d,0xbb,0xba,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x50,0xec, -0x50,0xe4,0x50,0xec,0x50,0xe4,0x70,0xec,0x50,0xec,0x50,0xec,0x90,0xec,0x91,0xec, -0x70,0xe4,0x90,0xec,0x91,0xec,0x92,0xf4,0x71,0xec,0x71,0xec,0x71,0xe4,0x71,0xe4, -0x71,0xe4,0x91,0xec,0x91,0xec,0xb1,0xec,0x91,0xe4,0xb2,0xec,0x91,0xec,0x91,0xec, -0x91,0xec,0xb2,0xf4,0xb0,0xf4,0xb0,0xf4,0x90,0xec,0xb1,0xf4,0xb0,0xec,0xd1,0xf4, -0x90,0xf4,0x12,0xfd,0x32,0xdd,0xf1,0xcc,0x90,0xc4,0xd0,0xcc,0x71,0xd5,0x92,0xd5, -0x71,0xcd,0x32,0xed,0x6d,0xdb,0x11,0xdc,0x1c,0xf7,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x2f,0xdc,0x50,0xe4,0x50,0xe4,0x70,0xe4,0x6f,0xe4,0x70,0xe4,0x50,0xe4, -0xb1,0xec,0x90,0xec,0x70,0xec,0x50,0xe4,0x90,0xec,0xb0,0xec,0xb1,0xf4,0xb0,0xec, -0xf2,0xf4,0xf2,0xf4,0xd1,0xf4,0xb1,0xec,0xd1,0xf4,0xd1,0xec,0xd1,0xf4,0xd1,0xf4, -0xf1,0xf4,0xd1,0xec,0xd1,0xf4,0xf1,0xf4,0xf2,0xf4,0xf1,0xf4,0xf2,0xf4,0xd1,0xf4, -0x12,0xf5,0xf2,0xf4,0xd1,0xfc,0x12,0xf5,0x52,0xdd,0x72,0xd5,0x93,0xdd,0x10,0xcd, -0x31,0xd5,0x31,0xcd,0x72,0xd5,0x32,0xdd,0x48,0x9a,0x99,0xf6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x91,0xf4,0x91,0xec,0xb2,0xf4,0x91,0xec,0xb2,0xf4, -0xb1,0xf4,0xb1,0xf4,0x70,0xec,0x71,0xf4,0xb2,0xf4,0xd2,0xfc,0x91,0xf4,0x91,0xf4, -0xf1,0xf4,0x12,0xfd,0xb1,0xf4,0x90,0xf4,0xd1,0xfc,0x12,0xfd,0xf2,0xfc,0xf2,0xfc, -0xf1,0xfc,0x12,0xfd,0x11,0xf5,0x12,0xfd,0x11,0xfd,0x32,0xfd,0x12,0xfd,0x13,0xfd, -0x12,0xfd,0x12,0xfd,0x32,0xf5,0x53,0xfd,0xf2,0xfc,0x32,0xfd,0x31,0xdd,0x72,0xd5, -0x51,0xd5,0x30,0xd5,0x72,0xdd,0xb3,0xdd,0x32,0xcd,0x0d,0xac,0xf2,0xe4,0xdf,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x2f,0xdc,0x4f,0xe4,0x4f,0xe4, -0x4f,0xe4,0x4f,0xe4,0x70,0xe4,0x2f,0xe4,0x2f,0xec,0x0f,0xec,0x50,0xf4,0x4f,0xec, -0x4f,0xec,0x4e,0xe4,0x2e,0xdc,0x0d,0xdc,0x2e,0xe4,0x2e,0xec,0x2e,0xec,0x0d,0xe4, -0x0e,0xe4,0x0e,0xe4,0x2e,0xec,0x0e,0xe4,0x2e,0xe4,0x2e,0xdc,0x4e,0xe4,0x2e,0xdc, -0x2f,0xe4,0x0f,0xdc,0x2f,0xe4,0x0e,0xdc,0x2f,0xdc,0x2f,0xdc,0x50,0xec,0x70,0xe4, -0x72,0xdd,0x51,0xd5,0x10,0xcd,0xf0,0xcc,0x73,0xdd,0x12,0xcd,0xd1,0xbc,0xb0,0xb4, -0x9d,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xdf,0xff,0xff,0xff,0xff,0xff,0x6c,0xd3, -0x4c,0xd3,0x6d,0xdb,0x6c,0xd3,0x8c,0xd3,0x6c,0xd3,0x6c,0xdb,0x6d,0xdb,0x8d,0xe3, -0x4c,0xdb,0x4c,0xdb,0x6c,0xdb,0xcc,0xdb,0xec,0xe3,0x0d,0xec,0xed,0xeb,0xed,0xf3, -0xcd,0xeb,0xcd,0xeb,0xcd,0xeb,0xee,0xeb,0xcd,0xeb,0xee,0xeb,0xed,0xe3,0xed,0xe3, -0xed,0xe3,0x0e,0xec,0xee,0xe3,0xef,0xe3,0xee,0xe3,0x0f,0xec,0x0e,0xe4,0x0f,0xec, -0xce,0xe3,0xad,0xdb,0xcc,0xcb,0xf0,0xdc,0x73,0xed,0x53,0xd5,0x6d,0x93,0x74,0xcd, -0x1a,0xf7,0xff,0xff,0xff,0xff,0xff,0xef,0xff,0xf7,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x2b,0xe3,0x4c,0xe3,0x4b,0xe3,0x4c,0xe3,0x4b,0xe3,0x4c,0xe3,0x2b,0xe3, -0x4b,0xe3,0x2a,0xe3,0x4b,0xe3,0x4b,0xe3,0x4b,0xe3,0x2a,0xdb,0x2b,0xe3,0x0a,0xdb, -0x2b,0xe3,0x0a,0xdb,0x2b,0xe3,0x0a,0xdb,0x2b,0xe3,0x0a,0xdb,0x2b,0xdb,0x2b,0xdb, -0x2b,0xdb,0x2a,0xdb,0x4b,0xdb,0x2a,0xdb,0x4b,0xe3,0x2b,0xdb,0x2b,0xe3,0x2b,0xdb, -0x4b,0xdb,0x2b,0xdb,0x0b,0xdb,0x2b,0xdb,0x6b,0xdb,0xac,0xd3,0xee,0xcb,0xce,0xab, -0x55,0xc5,0x5d,0xf7,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xa9,0xda,0x89,0xda,0xc9,0xe2,0xc9,0xda,0xc9,0xe2, -0xa9,0xe2,0xe9,0xe2,0xe9,0xe2,0xe9,0xe2,0xc9,0xda,0xe9,0xe2,0xc9,0xda,0xca,0xe2, -0xa9,0xda,0xc9,0xe2,0xc9,0xe2,0xea,0xe2,0xa9,0xda,0xc9,0xe2,0xa9,0xda,0xa9,0xda, -0xa9,0xda,0xc9,0xda,0xc9,0xda,0xea,0xe2,0xa9,0xda,0xa9,0xda,0xc9,0xe2,0x0a,0xeb, -0xc9,0xe2,0xc9,0xe2,0xa8,0xda,0xc9,0xe2,0xc9,0xe2,0x0a,0xe3,0x88,0xe2,0x68,0xd2, -0x69,0xba,0x8f,0xb3,0x5d,0xf7,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xe5,0xc9,0x06,0xd2,0x06,0xca, -0x06,0xd2,0x06,0xd2,0x68,0xda,0x47,0xda,0x67,0xda,0x66,0xd2,0x87,0xda,0x66,0xd2, -0x67,0xda,0x47,0xda,0x47,0xda,0x26,0xd2,0x47,0xd2,0x47,0xd2,0x88,0xda,0x87,0xda, -0xa8,0xda,0xa8,0xda,0xa9,0xda,0x88,0xda,0x68,0xda,0x47,0xda,0x68,0xe2,0x88,0xda, -0x47,0xda,0x25,0xd2,0x46,0xda,0x46,0xd2,0x67,0xda,0x66,0xd2,0x47,0xda,0x46,0xca, -0x46,0xe2,0xe2,0xb0,0x65,0xa1,0x17,0xe6,0xff,0xff,0xff,0xf7,0xff,0xf7,0xff,0xf7, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xd1, -0xe4,0xd1,0xe5,0xd9,0xe5,0xd1,0xe5,0xd9,0xc5,0xd1,0xe5,0xd9,0xe4,0xd1,0x04,0xd2, -0x03,0xca,0x04,0xd2,0xe4,0xd1,0xc5,0xd9,0xe5,0xd1,0xe6,0xd9,0xe6,0xd1,0x26,0xd2, -0xe5,0xc9,0xe6,0xd1,0xe5,0xc9,0xc5,0xc9,0xc5,0xc1,0xe5,0xc9,0xe5,0xd1,0x06,0xda, -0xc5,0xd1,0xc5,0xd1,0xa4,0xc9,0xc3,0xd1,0xc3,0xc9,0x04,0xda,0xe4,0xd1,0x05,0xd2, -0xe4,0xd1,0x83,0xd1,0x42,0xb9,0xb0,0xdc,0x1b,0xf7,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x60,0xa8,0x80,0xb0,0x80,0xb0,0xa0,0xb8,0x60,0xa8,0x00,0xa8,0x00,0xa0, -0x40,0xa0,0x60,0x98,0x60,0xa0,0x40,0xa0,0x40,0xa8,0x00,0xa0,0x00,0xa0,0x00,0xa0, -0x00,0x98,0x20,0x90,0x40,0x98,0x20,0x98,0x40,0xa0,0x60,0xa0,0x80,0xa0,0x60,0xa0, -0x60,0xa8,0x40,0xa0,0x60,0xa8,0x60,0xa8,0xa0,0xb0,0xa0,0xa8,0x80,0xa8,0x40,0xa0, -0x40,0xa8,0x40,0xa0,0x60,0xa8,0x00,0xa0,0xa0,0xa0,0x2f,0xe5,0xfb,0xff,0xff,0xff, -0xff,0xf7,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa2,0xd9,0xc2,0xd1,0xe3,0xd9,0xc1,0xd1,0xe3,0xd9, -0x44,0xea,0x64,0xea,0x43,0xe2,0x43,0xe2,0x23,0xe2,0x43,0xe2,0x22,0xe2,0x44,0xea, -0x44,0xea,0x64,0xea,0x63,0xe2,0x84,0xea,0x64,0xea,0x84,0xea,0x63,0xe2,0x44,0xe2, -0x43,0xe2,0x64,0xe2,0x63,0xe2,0x83,0xea,0x63,0xe2,0x63,0xea,0x63,0xe2,0x84,0xea, -0x83,0xea,0x83,0xea,0x62,0xe2,0x83,0xea,0x63,0xea,0xa4,0xf2,0x41,0xf2,0xa0,0xb0, -0xc1,0x90,0x14,0xcd,0xff,0xff,0xff,0xff,0xde,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x02,0xe2,0x23,0xe2,0x43,0xe2, -0x63,0xea,0x42,0xe2,0x22,0xe2,0x01,0xda,0x01,0xe2,0x01,0xe2,0x01,0xea,0x01,0xe2, -0x21,0xe2,0x40,0xda,0x41,0xe2,0x41,0xda,0x41,0xe2,0x41,0xea,0x82,0xf2,0x82,0xf2, -0x82,0xf2,0x61,0xe2,0x82,0xea,0x81,0xea,0x61,0xe2,0x40,0xda,0x81,0xe2,0xa1,0xe2, -0x61,0xe2,0x20,0xda,0x61,0xe2,0x81,0xe2,0x81,0xea,0x61,0xe2,0x81,0xe2,0x40,0xe2, -0x40,0xf2,0x00,0xda,0x83,0xca,0xec,0xcb,0xf4,0xc4,0x3d,0xef,0xff,0xff,0xff,0xff, -0xff,0xff,0xfe,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x42,0xe2, -0x41,0xda,0x42,0xe2,0x22,0xe2,0x42,0xea,0x42,0xe2,0x42,0xea,0x41,0xea,0x41,0xea, -0x41,0xea,0x42,0xea,0x41,0xe2,0x61,0xe2,0x40,0xe2,0x61,0xea,0x40,0xea,0x61,0xea, -0x40,0xea,0x61,0xf2,0x40,0xea,0x60,0xea,0x60,0xea,0x81,0xea,0x80,0xea,0xc1,0xea, -0xa0,0xe2,0xa0,0xea,0xc1,0xea,0xe2,0xea,0xc1,0xea,0xc1,0xea,0xa1,0xe2,0xc1,0xea, -0xc1,0xe2,0xc2,0xf2,0x81,0xea,0xe4,0xea,0x87,0xe3,0x8e,0xdc,0xcd,0xab,0x14,0xd5, -0x79,0xf6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x60,0xe2,0x61,0xe2,0x40,0xda,0x41,0xea,0x41,0xea,0x61,0xea,0x61,0xea, -0x61,0xea,0x60,0xea,0x81,0xea,0x81,0xea,0x61,0xea,0x40,0xe2,0x60,0xea,0x40,0xe2, -0x81,0xea,0x80,0xea,0xa0,0xf2,0xa0,0xea,0xa1,0xea,0x80,0xea,0xa1,0xf2,0xa0,0xea, -0xe1,0xf2,0xe0,0xea,0xc0,0xea,0xa0,0xe2,0xc1,0xea,0xc1,0xe2,0xc1,0xe2,0xa0,0xe2, -0xc1,0xe2,0xc0,0xe2,0xc0,0xe2,0xa0,0xe2,0xc1,0xe2,0x68,0xeb,0x0d,0xec,0x8d,0xc4, -0x4c,0xc4,0x09,0xb3,0x6c,0xbb,0xba,0xee,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xf7, -0xbf,0xff,0xff,0xff,0xff,0xff,0x82,0xe2,0xa1,0xe2,0xe2,0xea,0x61,0xea,0x61,0xf2, -0x41,0xea,0x61,0xea,0x81,0xea,0xa2,0xf2,0x82,0xea,0xa2,0xf2,0xa1,0xea,0xa2,0xea, -0xa1,0xea,0xc2,0xea,0x80,0xe2,0x60,0xe2,0x60,0xe2,0x80,0xea,0x60,0xe2,0x80,0xea, -0x80,0xea,0xa1,0xea,0xa0,0xe2,0xa0,0xe2,0xa0,0xe2,0xe1,0xea,0xc1,0xe2,0xc1,0xe2, -0xc1,0xe2,0xe1,0xea,0xe1,0xe2,0x01,0xeb,0xe1,0xea,0xe1,0xea,0xc0,0xda,0xcb,0xeb, -0x70,0xe4,0xcf,0xcc,0x6c,0xc4,0x4d,0xd4,0xed,0xcb,0xad,0xc3,0x9e,0xff,0xff,0xff, -0xdf,0xf7,0xdf,0xf7,0xbf,0xff,0xff,0xff,0xff,0xff,0x60,0xda,0x60,0xe2,0x60,0xda, -0x40,0xda,0x40,0xda,0x61,0xe2,0x60,0xe2,0x60,0xe2,0x40,0xda,0x81,0xe2,0x60,0xda, -0x80,0xe2,0x80,0xda,0x80,0xe2,0x80,0xda,0xa0,0xe2,0xa0,0xe2,0xa1,0xe2,0xa0,0xe2, -0xa1,0xe2,0xa0,0xe2,0xa1,0xe2,0x80,0xe2,0xc1,0xe2,0xa0,0xe2,0xc1,0xea,0xc1,0xe2, -0xe1,0xe2,0xc1,0xda,0xe2,0xe2,0x01,0xe3,0x02,0xeb,0x02,0xe3,0x23,0xeb,0xe1,0xe2, -0xa1,0xe2,0x4d,0xdc,0x75,0xdd,0xd2,0xcc,0x6f,0xc4,0xf0,0xd4,0x8f,0xd4,0x26,0x9a, -0xaf,0xdc,0xfe,0xff,0xff,0xff,0xdf,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0x60,0xe2, -0x60,0xda,0x81,0xea,0x02,0xeb,0xc2,0xe2,0x80,0xda,0x81,0xe2,0xc2,0xea,0x02,0xeb, -0xc2,0xea,0xe2,0xea,0x02,0xeb,0x22,0xeb,0x02,0xeb,0x02,0xeb,0x43,0xf3,0x85,0xfb, -0x44,0xf3,0x64,0xfb,0x44,0xf3,0x64,0xfb,0x85,0xfb,0xc6,0xfb,0x84,0xfb,0x64,0xf3, -0xa4,0xfb,0x06,0xfc,0xe6,0xfb,0xe6,0xfb,0xe6,0xfb,0x27,0xfc,0x07,0xfc,0x27,0xfc, -0x27,0xfc,0x26,0xfc,0xe7,0xfb,0x4d,0xcc,0x92,0xac,0xd4,0xd4,0x12,0xd5,0xf1,0xcc, -0xd0,0xcc,0xed,0xd3,0xc0,0x90,0xf7,0xf6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x84,0xfb,0xa5,0xfb,0xa5,0xfb,0x06,0xfc,0x06,0xfc,0x67,0xfc,0x47,0xfc, -0x26,0xfc,0x05,0xfc,0x26,0xfc,0x06,0xfc,0x26,0xfc,0x46,0xfc,0x66,0xfc,0x66,0xfc, -0x47,0xfc,0xe6,0xfb,0x27,0xfc,0x06,0xfc,0x07,0xfc,0x06,0xfc,0x06,0xfc,0xc5,0xfb, -0x06,0xfc,0x26,0xfc,0x05,0xfc,0xa5,0xfb,0x06,0xfc,0x26,0xfc,0x06,0xfc,0xe5,0xfb, -0x06,0xfc,0x06,0xfc,0x06,0xfc,0xe5,0xfb,0xe6,0xfb,0x4c,0xcc,0xd1,0xb4,0xf3,0xd4, -0xd2,0xd4,0xd0,0xc4,0xf0,0xcc,0x8e,0xec,0x27,0xf3,0xa0,0xa1,0xb9,0xee,0xff,0xff, -0xff,0xf7,0xff,0xff,0xff,0xff,0xe2,0xea,0xc1,0xea,0x03,0xf3,0xe1,0xda,0x02,0xe3, -0x23,0xeb,0x43,0xeb,0x02,0xe3,0x02,0xeb,0x02,0xeb,0x22,0xeb,0x02,0xe3,0x42,0xe3, -0x21,0xe3,0x22,0xe3,0x42,0xe3,0x84,0xf3,0x63,0xeb,0x64,0xeb,0x63,0xeb,0x84,0xf3, -0x43,0xeb,0x43,0xeb,0x43,0xeb,0x63,0xf3,0x43,0xeb,0x43,0xeb,0x42,0xe3,0x43,0xeb, -0x43,0xe3,0x43,0xeb,0x43,0xe3,0x44,0xeb,0x44,0xeb,0x44,0xeb,0xe1,0xea,0x09,0xec, -0xef,0xe4,0x2f,0xc5,0x6f,0xcc,0x70,0xbc,0xb0,0xbc,0x52,0xed,0x24,0xd2,0xa2,0xd9, -0x8f,0xd4,0x57,0xde,0xdf,0xff,0xff,0xff,0xff,0xff,0x03,0xeb,0x03,0xf3,0xe2,0xea, -0x63,0xf3,0x43,0xeb,0x44,0xeb,0x23,0xeb,0x43,0xf3,0x43,0xf3,0x63,0xfb,0x63,0xf3, -0x43,0xf3,0x42,0xe3,0x63,0xeb,0x42,0xeb,0x43,0xeb,0x22,0xe3,0x42,0xeb,0x22,0xe3, -0x42,0xeb,0x42,0xeb,0x43,0xeb,0x22,0xe3,0x42,0xeb,0x22,0xeb,0x63,0xf3,0x62,0xf3, -0x63,0xf3,0x22,0xeb,0x63,0xf3,0x62,0xeb,0x63,0xf3,0x63,0xeb,0x63,0xf3,0x42,0xeb, -0x41,0xe3,0xa7,0xeb,0x6d,0xec,0x2e,0xc5,0xb0,0xcc,0x90,0xcc,0x12,0xcd,0x52,0xdd, -0x08,0xd3,0x6e,0xe4,0x5c,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xa1,0xe2, -0xc1,0xe2,0xe2,0xea,0xa1,0xe2,0xe2,0xea,0xa2,0xe2,0xc2,0xea,0xc1,0xea,0xe2,0xea, -0xc2,0xea,0xe2,0xf2,0xe1,0xea,0x02,0xeb,0xe1,0xe2,0x02,0xeb,0xe1,0xe2,0x02,0xeb, -0x02,0xeb,0x02,0xeb,0x01,0xeb,0x01,0xeb,0x01,0xe3,0x01,0xeb,0x01,0xeb,0x21,0xf3, -0x01,0xeb,0x02,0xf3,0x01,0xeb,0x21,0xf3,0x21,0xeb,0x42,0xf3,0x21,0xeb,0x22,0xf3, -0x01,0xeb,0x01,0xf3,0x40,0xdb,0x46,0xe3,0x8a,0xeb,0x70,0xdd,0xf1,0xd4,0x33,0xe5, -0x53,0xd5,0xb1,0xbc,0x12,0xdd,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x60,0xda,0x81,0xda,0x61,0xda,0x61,0xda,0x60,0xda,0x61,0xda,0x61,0xda, -0x81,0xe2,0x60,0xda,0xa1,0xe2,0x80,0xe2,0xa1,0xe2,0xc1,0xe2,0xc2,0xea,0xc1,0xe2, -0xe1,0xea,0x00,0xe3,0x01,0xeb,0xe1,0xe2,0xe1,0xea,0xe0,0xe2,0x01,0xeb,0xe0,0xe2, -0xe0,0xea,0xc0,0xe2,0xc0,0xe2,0x80,0xda,0xa0,0xe2,0xa0,0xe2,0xa0,0xe2,0x80,0xda, -0xe0,0xea,0x01,0xeb,0xe1,0xea,0xe0,0xea,0x40,0xdb,0x62,0xca,0x65,0xd2,0xad,0xcc, -0xd0,0xcc,0x33,0xdd,0x33,0xd5,0x0f,0x9c,0x1b,0xf7,0xff,0xff,0xff,0xff,0xbf,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xc2,0xe2,0xa1,0xda,0xa2,0xda,0x81,0xe2,0x82,0xe2, -0x81,0xe2,0xa1,0xe2,0xa1,0xe2,0xa2,0xea,0x82,0xe2,0xa2,0xea,0x81,0xe2,0x81,0xe2, -0x81,0xe2,0xa1,0xe2,0x80,0xda,0xa1,0xe2,0xa0,0xe2,0xa1,0xe2,0xa0,0xe2,0xc0,0xe2, -0xc0,0xe2,0xc1,0xea,0xc0,0xe2,0xe1,0xea,0xe1,0xea,0x01,0xf3,0xe0,0xea,0x01,0xeb, -0xe0,0xea,0xe0,0xea,0xc0,0xe2,0xe0,0xea,0xc0,0xe2,0xe0,0xea,0xe0,0xe2,0x21,0xda, -0xe3,0xd9,0xeb,0xeb,0xf0,0xcc,0xee,0xab,0xee,0xab,0x59,0xd6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xbf,0xff,0xff,0xff,0xff,0xff,0x82,0xda,0xa2,0xda,0x81,0xd2, -0x82,0xe2,0x81,0xe2,0x82,0xe2,0x62,0xda,0x82,0xe2,0x81,0xe2,0x82,0xe2,0x81,0xe2, -0xa2,0xe2,0xc2,0xe2,0xc2,0xea,0xc2,0xe2,0xc2,0xea,0xc1,0xe2,0xc2,0xea,0xc1,0xe2, -0xc1,0xea,0xc1,0xe2,0x02,0xf3,0x01,0xeb,0xc1,0xea,0xa0,0xe2,0xe1,0xea,0x21,0xeb, -0x22,0xf3,0x21,0xeb,0x21,0xf3,0xe0,0xea,0xc0,0xea,0xa0,0xe2,0xc0,0xe2,0xc0,0xe2, -0xc0,0xea,0x41,0xe2,0x43,0xe2,0xe7,0xe2,0x2e,0xb4,0x30,0xa4,0xf4,0xc4,0xbe,0xff, -0xff,0xff,0xff,0xf7,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xc3,0xe2, -0xc3,0xe2,0xe4,0xea,0xc4,0xe2,0xe3,0xe2,0xc3,0xe2,0xc3,0xe2,0xe3,0xe2,0xe4,0xe2, -0xe3,0xe2,0xe4,0xe2,0xc3,0xe2,0xc3,0xe2,0xc2,0xe2,0xc3,0xe2,0xa2,0xe2,0xc3,0xe2, -0xc3,0xe2,0xc3,0xe2,0xc2,0xe2,0xe2,0xe2,0xc2,0xe2,0xe3,0xea,0x02,0xeb,0x23,0xeb, -0x02,0xe3,0xe3,0xe2,0xe2,0xe2,0xe2,0xea,0xe2,0xe2,0x02,0xe3,0xe1,0xe2,0x01,0xe3, -0xe1,0xe2,0x22,0xeb,0xe1,0xe2,0xe2,0xc1,0x21,0x99,0x65,0x81,0xfb,0xee,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x82,0xda,0x82,0xda,0x62,0xda,0x83,0xda,0x62,0xd2,0x82,0xda,0x62,0xd2, -0x83,0xd2,0x82,0xca,0x82,0xd2,0x62,0xca,0xa3,0xda,0xc2,0xda,0xc3,0xda,0xa3,0xda, -0xc3,0xda,0x83,0xda,0xa3,0xda,0xa3,0xda,0xa3,0xda,0xa2,0xda,0xa3,0xda,0xa2,0xda, -0xa2,0xda,0x82,0xd2,0xa2,0xd2,0xa2,0xd2,0xa2,0xda,0xa1,0xd2,0xa2,0xda,0xa2,0xda, -0xa1,0xda,0x80,0xd2,0xa0,0xd2,0xe0,0xe2,0xa2,0xc2,0xe1,0x78,0x65,0x79,0x78,0xe6, -0xff,0xff,0xff,0xff,0xfe,0xff,0xdf,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa0,0xb1,0x80,0xb1,0x80,0xb1,0xa0,0xa9,0xa0,0xa9, -0x80,0xa9,0x80,0xa9,0x80,0xa1,0xa0,0xa9,0x80,0xa1,0x80,0xa1,0x80,0xa1,0x60,0xa9, -0x60,0xa1,0x60,0xa9,0x60,0xa1,0x60,0xa9,0x60,0xa1,0x60,0xa1,0x60,0xa1,0x80,0xa9, -0x60,0xa1,0x60,0xa1,0x80,0xa1,0xa0,0xa9,0xe0,0xb1,0x40,0xba,0x20,0xb2,0x20,0xba, -0x40,0xba,0x40,0xba,0x60,0xc2,0xa0,0xca,0x80,0xc2,0x40,0xc2,0xe1,0xba,0x91,0xf5, -0x3b,0xff,0xff,0xff,0xdf,0xf7,0xff,0xff,0xfe,0xf7,0xdf,0xff,0xbe,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xaa,0xe1,0xaa,0xe1,0xaa, -0x21,0xab,0x40,0xab,0x81,0xbb,0xa1,0xbb,0xa0,0xc3,0xa0,0xc3,0xe1,0xcb,0xe0,0xcb, -0xe1,0xcb,0xe0,0xcb,0x21,0xd4,0x20,0xcc,0x61,0xd4,0x80,0xdc,0x80,0xdc,0x60,0xd4, -0xa0,0xdc,0xc0,0xe4,0x01,0xed,0x21,0xed,0x21,0xed,0x01,0xe5,0x21,0xed,0x21,0xed, -0x41,0xed,0x41,0xed,0x82,0xf5,0x82,0xf5,0xa3,0xfd,0x83,0xfd,0x83,0xfd,0x80,0xf5, -0xa1,0xf5,0xb2,0xf6,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff, -0xdf,0xff,0xbf,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x06,0xfe, -0xe6,0xf5,0x27,0xfe,0xc5,0xed,0xc5,0xf5,0xa5,0xe5,0xa5,0xed,0xc3,0xf5,0xe3,0xfd, -0xe4,0xfd,0x04,0xfe,0x04,0xfe,0x24,0xfe,0xe3,0xf5,0xe4,0xfd,0x03,0xfe,0x22,0xfe, -0x02,0xfe,0x02,0xfe,0xc1,0xf5,0xc0,0xed,0xc0,0xed,0x01,0xf6,0xe1,0xf5,0xe1,0xf5, -0xe1,0xf5,0xe1,0xf5,0xe0,0xf5,0xe0,0xf5,0xe0,0xed,0x00,0xf6,0xe0,0xf5,0xe1,0xf5, -0xc1,0xed,0x00,0xf6,0x40,0xee,0x48,0xbc,0x8f,0xab,0x7a,0xe6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0x9f,0xff,0xde,0xff,0xff,0xff,0xdf,0xff,0xff,0xff, -0xff,0xff,0x61,0xe5,0x61,0xe5,0x21,0xe5,0xc2,0xed,0x81,0xe5,0x81,0xe5,0x60,0xe5, -0x82,0xed,0x81,0xed,0x82,0xed,0x81,0xed,0xa2,0xed,0x81,0xed,0x81,0xed,0x61,0xe5, -0x81,0xed,0x80,0xe5,0xa1,0xed,0xa1,0xed,0xc1,0xed,0xc1,0xed,0xc1,0xf5,0xc1,0xed, -0xe1,0xf5,0xc1,0xed,0xc1,0xf5,0xc1,0xed,0xe1,0xf5,0xe0,0xed,0xe0,0xed,0xc0,0xed, -0xc0,0xed,0xa0,0xed,0xc0,0xed,0xc0,0xed,0x40,0xf6,0xa9,0xe5,0xaf,0xcc,0x6c,0x93, -0x17,0xce,0xdf,0xff,0xff,0xff,0xdf,0xff,0xfe,0xff,0xfd,0xff,0xfe,0xff,0xfe,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xed,0x60,0xe5,0x60,0xe5,0xa0,0xed,0xc1,0xed, -0xc0,0xed,0xc1,0xed,0xc1,0xed,0xc2,0xf5,0xa1,0xed,0xa1,0xed,0xa1,0xed,0xa1,0xf5, -0xc2,0xf5,0xe2,0xf5,0xc1,0xed,0xa1,0xed,0x80,0xe5,0x80,0xed,0x80,0xe5,0xc1,0xed, -0xa0,0xed,0xc1,0xed,0xc0,0xed,0xc1,0xed,0xa0,0xed,0xc1,0xed,0xe1,0xed,0x01,0xf6, -0xe0,0xed,0xe1,0xed,0xc0,0xed,0xc0,0xf5,0xc0,0xed,0x00,0xee,0x40,0xee,0xca,0xed, -0x0f,0xd5,0x0d,0xa4,0x2c,0xa4,0x78,0xde,0x9e,0xff,0xff,0xff,0xfe,0xff,0xfe,0xff, -0xfe,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0x80,0xe5,0x80,0xe5,0x80,0xe5, -0xe0,0xed,0xa0,0xe5,0xc0,0xe5,0xa0,0xe5,0xc0,0xe5,0xc0,0xe5,0xc0,0xe5,0xc0,0xe5, -0xc0,0xe5,0xc0,0xe5,0xc0,0xe5,0xa0,0xe5,0xa0,0xe5,0x80,0xdd,0xa0,0xe5,0xa0,0xdd, -0xc0,0xe5,0xe0,0xe5,0xe1,0xed,0xe0,0xe5,0x01,0xee,0xe1,0xe5,0x01,0xee,0xe1,0xed, -0xe0,0xe5,0xc0,0xdd,0xe0,0xe5,0xe0,0xe5,0x00,0xee,0xe0,0xe5,0x20,0xee,0x20,0xe6, -0x21,0xee,0x89,0xdd,0xf0,0xdc,0xd1,0xcc,0xcf,0xc4,0x8e,0xa3,0x4c,0x93,0xe6,0xac, -0xd9,0xff,0xff,0xff,0xff,0xff,0xdf,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0x80,0xdd, -0x80,0xdd,0x81,0xe5,0xa0,0xe5,0xa0,0xe5,0xa0,0xe5,0xa0,0xe5,0xc0,0xe5,0xe0,0xe5, -0xe0,0xe5,0xe0,0xe5,0xe0,0xe5,0xe0,0xe5,0xc0,0xdd,0xc0,0xe5,0xe0,0xe5,0x00,0xee, -0xe0,0xe5,0xc0,0xe5,0xa0,0xdd,0xe1,0xe5,0xe0,0xe5,0x01,0xee,0xe1,0xe5,0x01,0xee, -0xe1,0xe5,0x01,0xee,0x00,0xe6,0x00,0xe6,0x00,0xe6,0x01,0xee,0x00,0xe6,0x00,0xee, -0x00,0xe6,0x20,0xee,0x44,0xee,0x0b,0xd5,0x4f,0xbc,0x14,0xd5,0x8f,0xc4,0x72,0xc4, -0x50,0xbc,0xa1,0xa4,0x4a,0xe6,0xfd,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff, -0xff,0xff,0x81,0xe5,0xc1,0xed,0xc2,0xed,0x80,0xdd,0x60,0xdd,0xa1,0xe5,0xa1,0xe5, -0xc0,0xe5,0xc0,0xdd,0xe0,0xe5,0xe0,0xe5,0xe0,0xe5,0xe0,0xdd,0xe0,0xe5,0xc0,0xe5, -0xe0,0xe5,0xe0,0xdd,0x01,0xe6,0x20,0xee,0xe1,0xe5,0x80,0xd5,0xc0,0xdd,0xc0,0xdd, -0xe0,0xe5,0xc0,0xdd,0xe0,0xe5,0xc0,0xdd,0x01,0xe6,0x00,0xe6,0x01,0xe6,0x00,0xe6, -0x01,0xe6,0xe0,0xe5,0x00,0xe6,0x00,0xde,0x28,0xee,0x6f,0xdd,0xd3,0xcc,0x93,0xc4, -0x8f,0xc4,0x12,0xb4,0x51,0xbc,0xa2,0xd5,0x22,0xc5,0xb3,0xee,0xde,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa2,0xe5,0xa1,0xe5,0xa2,0xe5,0xc1,0xe5,0xe2,0xed, -0xc2,0xe5,0xc2,0xed,0xc1,0xdd,0xe1,0xe5,0xc1,0xdd,0xe1,0xe5,0xc0,0xdd,0x01,0xe6, -0xe1,0xe5,0x01,0xe6,0x00,0xde,0x01,0xe6,0xe0,0xdd,0x01,0xe6,0x00,0xde,0x01,0xe6, -0x01,0xe6,0x22,0xee,0x01,0xe6,0x22,0xee,0x01,0xe6,0x01,0xe6,0x21,0xe6,0x42,0xee, -0x21,0xe6,0x21,0xe6,0x22,0xe6,0x43,0xee,0x21,0xe6,0x61,0xee,0xeb,0xdd,0x75,0xdd, -0x37,0xd5,0x56,0xd5,0x10,0xcd,0x76,0xcc,0x76,0xcc,0x0a,0xf6,0x45,0xfe,0x63,0xcd, -0x38,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xe5,0xc2,0xe5,0xa1,0xe5, -0xe2,0xe5,0xc1,0xe5,0xc2,0xe5,0xc1,0xe5,0x22,0xe6,0x22,0xe6,0x22,0xe6,0x02,0xe6, -0x22,0xe6,0x22,0xe6,0x43,0xee,0x22,0xe6,0x42,0xee,0x41,0xe6,0x62,0xee,0x62,0xee, -0x83,0xf6,0x63,0xee,0x63,0xee,0x42,0xee,0x63,0xee,0x42,0xee,0x63,0xee,0x63,0xee, -0x63,0xee,0x42,0xee,0x42,0xee,0x42,0xe6,0x44,0xee,0x65,0xee,0x83,0xf6,0xa3,0xf6, -0x0e,0xe6,0x36,0xcd,0x17,0xcd,0x74,0xcd,0x31,0xcd,0x56,0xc4,0x76,0xcc,0xa7,0xe5, -0xc0,0xf5,0x80,0xd5,0x57,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xee, -0xe1,0xe5,0xe2,0xe5,0x01,0xe6,0x01,0xe6,0x00,0xe6,0x01,0xee,0x22,0xe6,0x43,0xee, -0x22,0xe6,0x23,0xee,0x23,0xe6,0x43,0xee,0x23,0xe6,0x43,0xee,0x42,0xe6,0x62,0xee, -0x82,0xee,0x83,0xf6,0x83,0xee,0x84,0xf6,0x63,0xee,0x63,0xee,0x63,0xee,0x84,0xf6, -0xa4,0xf6,0xc5,0xfe,0x84,0xf6,0x84,0xf6,0x64,0xf6,0xa4,0xf6,0x44,0xee,0x45,0xee, -0x83,0xee,0xc4,0xf6,0x10,0xe6,0x37,0xcd,0xf6,0xc4,0x52,0xcd,0x32,0xc5,0xd8,0xcc, -0xf5,0xd4,0x25,0xf6,0x80,0xe5,0xa0,0xc4,0x17,0xef,0xff,0xff,0xff,0xf7,0xff,0xff, -0xff,0xff,0xc0,0xdd,0xe1,0xe5,0xe1,0xe5,0x21,0xe6,0x00,0xe6,0x21,0xee,0x01,0xe6, -0xe2,0xe5,0xe2,0xdd,0xe2,0xe5,0xe2,0xdd,0x02,0xe6,0x01,0xde,0x02,0xe6,0x02,0xe6, -0x02,0xe6,0x01,0xde,0x22,0xe6,0x22,0xe6,0x22,0xee,0x22,0xe6,0x23,0xe6,0x02,0xe6, -0x22,0xe6,0x02,0xde,0x22,0xe6,0x22,0xe6,0x22,0xe6,0x02,0xe6,0x02,0xe6,0x02,0xe6, -0x04,0xe6,0x04,0xe6,0x42,0xe6,0x43,0xee,0xb0,0xdd,0x16,0xc5,0xf5,0xc4,0x2f,0xbd, -0xd2,0xbc,0xf5,0xc4,0x52,0xd5,0x42,0xc5,0xc0,0xcc,0x6f,0xee,0xbd,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xe2,0xe5,0xc1,0xe5,0xe2,0xe5,0xe2,0xdd,0x02,0xe6, -0xe1,0xdd,0x02,0xe6,0x22,0xe6,0x43,0xee,0x22,0xee,0x23,0xee,0x22,0xe6,0x43,0xee, -0x42,0xee,0x42,0xee,0x43,0xee,0x44,0xee,0x23,0xe6,0x23,0xee,0x23,0xe6,0x24,0xee, -0x43,0xee,0x44,0xee,0x23,0xe6,0x24,0xee,0x03,0xe6,0x23,0xe6,0x23,0xe6,0x24,0xee, -0x23,0xee,0x23,0xee,0x24,0xe6,0x45,0xee,0x41,0xe6,0x64,0xee,0x90,0xdd,0x35,0xd5, -0x34,0xcd,0x94,0xd5,0x55,0xd5,0xcc,0xa3,0x88,0x93,0x32,0xd6,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xe2,0xe5,0xe2,0xe5,0xc1,0xdd, -0xe2,0xe5,0xe1,0xdd,0xe2,0xe5,0xe1,0xdd,0x22,0xee,0x22,0xe6,0x23,0xee,0x22,0xe6, -0x42,0xee,0x22,0xe6,0x42,0xee,0x42,0xee,0x43,0xee,0x23,0xe6,0x23,0xee,0x03,0xe6, -0x23,0xe6,0x23,0xe6,0x44,0xee,0x43,0xe6,0x23,0xe6,0x03,0xe6,0x23,0xe6,0x03,0xe6, -0x23,0xe6,0x23,0xe6,0x24,0xee,0x03,0xe6,0x24,0xee,0x24,0xe6,0x42,0xe6,0x63,0xe6, -0xb0,0xdd,0x14,0xcd,0x34,0xd5,0x73,0xd5,0x55,0xd5,0xac,0xa3,0xa9,0x93,0x12,0xce, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa2,0xdd, -0xa2,0xdd,0xc3,0xe5,0xc3,0xdd,0xc3,0xe5,0xc3,0xdd,0xe3,0xe5,0xc2,0xdd,0xe2,0xdd, -0xc1,0xdd,0xc2,0xdd,0xc1,0xdd,0xc2,0xdd,0xc2,0xdd,0xc2,0xe5,0xc2,0xdd,0xc3,0xdd, -0xc3,0xdd,0xe3,0xe5,0xe3,0xdd,0xe4,0xe5,0xc3,0xdd,0xc3,0xdd,0xa2,0xdd,0xc2,0xdd, -0xc2,0xdd,0xe3,0xe5,0xa2,0xdd,0xa2,0xdd,0xa2,0xdd,0xc3,0xe5,0xc2,0xdd,0xc2,0xe5, -0xe0,0xdd,0xe2,0xdd,0xad,0xe5,0xd7,0xed,0x77,0xdd,0x50,0xac,0xcf,0x9b,0xfc,0xee, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xde,0xff,0xff,0xff, -0xff,0xff,0x82,0xd5,0xa3,0xd5,0xa2,0xd5,0xc3,0xdd,0x82,0xd5,0x82,0xd5,0x82,0xd5, -0xa3,0xdd,0xa4,0xdd,0x83,0xdd,0x83,0xdd,0xa4,0xdd,0x84,0xdd,0x84,0xdd,0x84,0xdd, -0xa4,0xdd,0xa4,0xdd,0xc4,0xe5,0xc4,0xdd,0xa4,0xdd,0x84,0xdd,0xa5,0xdd,0xa4,0xdd, -0xe4,0xe5,0xc3,0xdd,0xc4,0xe5,0xc3,0xdd,0xc4,0xdd,0xa3,0xd5,0xc4,0xdd,0xc4,0xdd, -0xc4,0xe5,0xc2,0xdd,0xc3,0xe5,0xc2,0xd5,0x29,0xe6,0x53,0xcd,0x75,0xb4,0xce,0x8b, -0xfb,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xa4,0xdd,0xa3,0xd5,0x83,0xd5,0x83,0xd5,0x84,0xdd, -0xa4,0xd5,0xa4,0xdd,0x63,0xd5,0x84,0xdd,0xc4,0xdd,0xe5,0xe5,0xc4,0xdd,0xc5,0xe5, -0xa5,0xdd,0xa5,0xdd,0xc4,0xdd,0x05,0xe6,0xe4,0xe5,0x05,0xe6,0xe5,0xe5,0xe6,0xe5, -0xc5,0xdd,0xc5,0xe5,0x05,0xe6,0x26,0xee,0x06,0xe6,0x26,0xee,0x26,0xe6,0x47,0xe6, -0x06,0xde,0x06,0xe6,0xe5,0xe5,0x05,0xee,0x05,0xe6,0x24,0xe6,0x49,0xe6,0x50,0xb4, -0x93,0x93,0x38,0xd6,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xfe,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc4,0xd5,0xe5,0xdd,0xe4,0xd5, -0xe5,0xdd,0x05,0xde,0x67,0xee,0x46,0xe6,0x45,0xe6,0x44,0xe6,0x44,0xe6,0x04,0xde, -0x24,0xe6,0xe3,0xdd,0x04,0xe6,0x04,0xde,0xe3,0xdd,0xa2,0xcd,0xc3,0xd5,0xc3,0xd5, -0xe4,0xdd,0xe3,0xdd,0xe4,0xdd,0xe3,0xd5,0xe5,0xdd,0xa5,0xd5,0xc6,0xd5,0xa5,0xd5, -0xc6,0xdd,0xc6,0xdd,0xc6,0xdd,0xc5,0xd5,0xc6,0xdd,0xc5,0xdd,0xe6,0xdd,0x05,0xde, -0x68,0xc5,0xd1,0xb4,0x38,0xc5,0x5e,0xf7,0xff,0xff,0xdf,0xf7,0xff,0xf7,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xa4,0xb4, -0xa4,0xb4,0xa5,0xb4,0xc5,0xb4,0xa4,0xb4,0x63,0xac,0x63,0xac,0x63,0xac,0x64,0xac, -0x84,0xac,0xa4,0xb4,0xa5,0xb4,0xe6,0xbc,0xe5,0xbc,0xe6,0xbc,0xc5,0xb4,0xc5,0xb4, -0xc5,0xb4,0xc6,0xbc,0xe5,0xb4,0x06,0xbd,0xe5,0xbc,0xe6,0xbc,0xc7,0xbc,0xe8,0xbc, -0xc8,0xbc,0xe8,0xbc,0xe8,0xbc,0x09,0xbd,0x09,0xbd,0x2a,0xc5,0x49,0xc5,0x6a,0xcd, -0x4a,0xc5,0x6a,0xcd,0xca,0xac,0x57,0xd6,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x17,0xff,0x38,0xff,0x37,0xff,0x38,0xff,0x38,0xff,0x99,0xff,0x79,0xff, -0x9a,0xff,0x9a,0xff,0x9a,0xff,0x5a,0xff,0x7a,0xff,0x39,0xff,0x59,0xff,0x39,0xff, -0x5a,0xff,0x39,0xff,0x5a,0xff,0x39,0xff,0x5a,0xff,0x39,0xff,0x5a,0xff,0x59,0xff, -0x5a,0xff,0x39,0xff,0x39,0xff,0x39,0xff,0x5a,0xff,0x5a,0xff,0x5a,0xff,0x19,0xf7, -0x39,0xff,0x19,0xf7,0x3a,0xff,0x3a,0xf7,0x1a,0xef,0xbe,0xff,0x1c,0xf7,0x4b,0x83, -0x96,0xcd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x38,0xff,0x38,0xff,0x38,0xff,0x38,0xff,0x59,0xff, -0x78,0xff,0x99,0xff,0x9a,0xff,0xbb,0xff,0x7a,0xff,0x7a,0xff,0x7a,0xff,0x5a,0xff, -0x59,0xff,0x5a,0xff,0x3a,0xff,0x5a,0xff,0x39,0xff,0x5a,0xff,0x59,0xff,0x5a,0xff, -0x59,0xff,0x7a,0xff,0x39,0xff,0x5a,0xff,0x39,0xff,0x3a,0xff,0x5a,0xff,0x7b,0xff, -0x3a,0xff,0x3a,0xff,0x19,0xf7,0x3a,0xff,0x3a,0xf7,0x5b,0xff,0x19,0xef,0xbf,0xff, -0x1c,0xf7,0x6b,0x8b,0x95,0xcd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd9,0xee,0xd9,0xee,0xb8,0xee, -0xd9,0xee,0xb9,0xee,0xd9,0xf6,0xd8,0xee,0xb8,0xe6,0xd7,0xe6,0xf9,0xee,0xf8,0xee, -0xf9,0xee,0xf8,0xee,0xf8,0xee,0xd8,0xee,0xf9,0xee,0x1a,0xef,0x1a,0xef,0xf9,0xee, -0x19,0xef,0xf8,0xee,0xf8,0xee,0xd7,0xe6,0x19,0xef,0x19,0xef,0x39,0xf7,0x19,0xef, -0x19,0xef,0x19,0xef,0x3a,0xf7,0x39,0xef,0x3a,0xef,0x1a,0xe7,0x3a,0xef,0x3a,0xe7, -0xbd,0xff,0xda,0xee,0xd6,0xd5,0x0d,0xa4,0xeb,0x92,0xad,0xa3,0x32,0xcd,0xbe,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xee, -0xf8,0xe6,0xf8,0xee,0xd8,0xe6,0xf8,0xee,0xf8,0xee,0x19,0xef,0x38,0xef,0x39,0xef, -0x18,0xe7,0x39,0xef,0x18,0xef,0x19,0xef,0x18,0xef,0x39,0xef,0x19,0xef,0x39,0xef, -0x19,0xe7,0x19,0xef,0x19,0xef,0x59,0xef,0x39,0xef,0x5a,0xef,0x39,0xef,0x3a,0xef, -0x1a,0xef,0x3a,0xef,0x3a,0xef,0x5b,0xef,0x3a,0xef,0x1a,0xef,0x1a,0xe7,0x3b,0xe7, -0x3a,0xe7,0x5b,0xef,0xbe,0xff,0x34,0xc5,0x8b,0x93,0x0c,0xb4,0x70,0xcc,0xad,0xab, -0x6c,0x9b,0x35,0xc5,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xd9,0xe6,0xf9,0xe6,0xd9,0xe6,0xf9,0xe6,0xf9,0xe6,0x19,0xef,0xf9,0xe6, -0x1a,0xef,0x19,0xe7,0x1a,0xef,0x19,0xe7,0x1a,0xef,0xfa,0xe6,0x1a,0xef,0x1a,0xe7, -0x3a,0xef,0x1a,0xe7,0x1a,0xe7,0x1a,0xe7,0x1b,0xef,0x3a,0xe7,0x3a,0xef,0x3a,0xe7, -0x3b,0xef,0x3b,0xe7,0x3b,0xef,0x1b,0xe7,0x3b,0xef,0x3b,0xe7,0x3b,0xe7,0x1b,0xe7, -0x3c,0xef,0x3b,0xe7,0x1b,0xe7,0x9c,0xef,0xfb,0xee,0x4f,0xac,0x29,0x93,0x2c,0xbc, -0x70,0xd4,0xed,0xbb,0xee,0xb3,0xf3,0xbc,0x7e,0xf7,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xee,0xfa,0xe6,0xfa,0xee,0xfa,0xee,0x1b,0xef, -0xda,0xee,0xfb,0xee,0x1b,0xe7,0x1c,0xef,0xfc,0xe6,0x1c,0xef,0x1c,0xe7,0x3d,0xef, -0x1c,0xef,0x3c,0xef,0x1c,0xe7,0x1d,0xef,0x1d,0xe7,0x1d,0xef,0x1c,0xe7,0x3d,0xef, -0x1c,0xef,0x3d,0xef,0x3c,0xef,0x3d,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xe7,0x3d,0xef, -0x3d,0xef,0x5d,0xef,0x5d,0xe7,0x5e,0xef,0x3d,0xe7,0xdf,0xff,0x75,0xcd,0x0e,0xb4, -0x2d,0xbc,0x8e,0xcc,0x6f,0xd4,0x8c,0xb3,0xcd,0xb3,0xdb,0xfe,0x7f,0xf7,0x9e,0xf7, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xe6,0x1c,0xef,0xfb,0xe6, -0x1c,0xef,0xfc,0xe6,0xfc,0xee,0xfc,0xe6,0x1c,0xef,0x1c,0xe7,0x3c,0xef,0x1c,0xef, -0x1c,0xef,0xfc,0xe6,0x1d,0xef,0xfc,0xee,0x3d,0xef,0x3c,0xe7,0x3d,0xef,0x1c,0xe7, -0x3d,0xef,0x3d,0xef,0x3d,0xef,0x3c,0xe7,0x5c,0xef,0x5b,0xef,0x5c,0xef,0x5b,0xef, -0x5c,0xef,0x5c,0xef,0x7c,0xef,0x7c,0xef,0x9d,0xef,0x7c,0xef,0x9d,0xf7,0xbd,0xf7, -0xb1,0xbc,0xed,0xb3,0xaf,0xcc,0x6f,0xc4,0x2e,0xc4,0x6b,0xb3,0xed,0xbb,0x98,0xee, -0xbe,0xf7,0x5d,0xe7,0xbf,0xff,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1d,0xef, -0x1d,0xe7,0x1d,0xef,0x1d,0xef,0x3e,0xef,0x1e,0xe7,0x1e,0xef,0x1c,0xef,0x3c,0xef, -0x3c,0xef,0x5c,0xf7,0x3c,0xef,0x3c,0xef,0x3c,0xef,0x3d,0xf7,0x3c,0xef,0x5c,0xef, -0x5c,0xef,0x5c,0xef,0x5c,0xef,0x7d,0xf7,0x5c,0xef,0x5d,0xf7,0x5b,0xef,0x7b,0xef, -0x7a,0xef,0x7b,0xf7,0x7b,0xef,0x9b,0xf7,0x9b,0xef,0x9c,0xf7,0x9c,0xf7,0x9c,0xf7, -0xbc,0xf7,0xfd,0xff,0x6f,0xb4,0x0d,0xb4,0xd0,0xcc,0x70,0xc4,0xed,0xb3,0x6b,0xab, -0xed,0xb3,0xd9,0xf6,0xdf,0xf7,0x7e,0xef,0x9e,0xf7,0xdf,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xfc,0xe6,0xfd,0xee,0xfd,0xe6,0x1d,0xef,0x1d,0xe7,0x3e,0xef,0x3d,0xef, -0x1c,0xef,0x3b,0xef,0x5c,0xef,0x3c,0xef,0x5c,0xef,0x3c,0xef,0x5c,0xef,0x5c,0xef, -0x5c,0xf7,0x5c,0xe7,0x5c,0xef,0x3c,0xef,0x5d,0xef,0x5c,0xef,0x5d,0xef,0x5c,0xef, -0x7c,0xef,0x5b,0xef,0x7c,0xef,0x7b,0xef,0x7c,0xef,0x7c,0xef,0x9c,0xef,0x7c,0xef, -0x7c,0xef,0x7c,0xef,0xdd,0xff,0xdd,0xff,0x4e,0xb4,0xcc,0xab,0xb1,0xcc,0x50,0xb4, -0x0d,0xb4,0x4a,0xa3,0xed,0xb3,0x77,0xee,0xff,0xff,0x5d,0xe7,0xbe,0xf7,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0x5c,0xef,0x3b,0xe7,0x5c,0xef,0x5c,0xef,0x5c,0xf7, -0x3c,0xef,0x5c,0xf7,0x3c,0xef,0x5c,0xf7,0x5c,0xf7,0x5d,0xf7,0x5c,0xef,0x5d,0xf7, -0x5c,0xf7,0x7d,0xf7,0x5c,0xef,0x7d,0xf7,0x5c,0xf7,0x5d,0xf7,0x5c,0xef,0x7d,0xf7, -0x5c,0xf7,0x7d,0xf7,0x5d,0xef,0x5e,0xf7,0x5e,0xf7,0x7e,0xf7,0x7e,0xf7,0x7f,0xff, -0x5e,0xf7,0x5e,0xf7,0x5e,0xf7,0x7e,0xf7,0x7e,0xf7,0xdf,0xff,0xb0,0xb4,0x0e,0xb4, -0x91,0xbc,0x50,0xb4,0xaf,0xc4,0x2e,0xbc,0x2e,0xb4,0xf6,0xd5,0xfb,0xe6,0xbf,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1b,0xe7,0x3c,0xe7,0x1c,0xe7, -0x1c,0xef,0x1b,0xef,0x1c,0xef,0x1b,0xe7,0x3c,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef, -0x3c,0xef,0x1c,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef,0x1b,0xef, -0x3c,0xef,0x3c,0xef,0x3c,0xef,0x3b,0xef,0x3c,0xef,0x1c,0xef,0x3c,0xef,0x3c,0xef, -0x3c,0xef,0x3b,0xef,0x3c,0xef,0x1b,0xe7,0x3c,0xef,0x1c,0xef,0x5c,0xef,0x9d,0xef, -0x18,0xde,0x91,0xb4,0x50,0xb4,0x8f,0xbc,0x6f,0xc4,0x70,0xbc,0xb2,0xbc,0x35,0xc5, -0x7e,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1c,0xe7, -0x1c,0xe7,0x3c,0xe7,0xfb,0xe6,0xfc,0xee,0xfb,0xe6,0x1c,0xef,0x1c,0xef,0x3c,0xef, -0x1c,0xef,0x3c,0xef,0x1c,0xef,0x1c,0xef,0x1c,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef, -0x1b,0xe7,0x1c,0xef,0x1b,0xe7,0x1c,0xef,0x1b,0xef,0x3c,0xef,0x3c,0xef,0x3c,0xef, -0x1b,0xef,0x3c,0xef,0x1b,0xe7,0xfb,0xe6,0xfb,0xe6,0xfb,0xee,0xfb,0xe6,0x1b,0xef, -0xfb,0xe6,0x3d,0xef,0x3c,0xf7,0x34,0xc5,0x0e,0xa4,0xf1,0xc4,0xb0,0xc4,0x70,0xb4, -0xb1,0xb4,0x59,0xe6,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xfb,0xde,0xfc,0xe6,0xdb,0xde,0xfb,0xe6,0xda,0xe6,0xdb,0xe6,0xda,0xe6, -0xfb,0xe6,0xfb,0xe6,0x1b,0xe7,0xfb,0xe6,0xfb,0xe6,0xfa,0xe6,0x1b,0xe7,0xfb,0xe6, -0x1c,0xef,0xfb,0xe6,0xfb,0xe6,0xdb,0xe6,0xfb,0xe6,0xdb,0xe6,0xfb,0xee,0xfb,0xe6, -0x1c,0xef,0xfb,0xe6,0x1b,0xe7,0xfb,0xe6,0xfb,0xee,0xfb,0xe6,0xfb,0xe6,0xfb,0xe6, -0xfb,0xee,0xfb,0xe6,0x1b,0xe7,0x1b,0xe7,0x9e,0xff,0xb5,0xc5,0x50,0xac,0x90,0xb4, -0x6f,0xb4,0x12,0xbd,0x17,0xd6,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xe6,0xbb,0xde,0xdb,0xde,0xba,0xde,0xda,0xe6, -0xba,0xde,0xbb,0xde,0xda,0xde,0xdb,0xe6,0xba,0xde,0xdb,0xe6,0xda,0xde,0xdb,0xe6, -0xda,0xe6,0xfb,0xe6,0xda,0xde,0xdb,0xe6,0xdb,0xe6,0x1b,0xe7,0xfb,0xe6,0xfb,0xe6, -0xfb,0xe6,0xfb,0xe6,0xfb,0xe6,0xfb,0xe6,0xdb,0xde,0xfb,0xe6,0x1b,0xe7,0x3c,0xef, -0x1c,0xef,0x1c,0xef,0x1c,0xef,0x3c,0xef,0x1c,0xef,0x3c,0xef,0x3c,0xf7,0x1b,0xff, -0x78,0xe6,0x70,0xac,0x53,0xc5,0x9d,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xba,0xde,0xbb,0xde,0xba,0xd6, -0xdb,0xde,0xba,0xde,0xba,0xde,0x9a,0xd6,0xba,0xde,0xba,0xde,0xdb,0xe6,0xda,0xde, -0xda,0xde,0xba,0xde,0xdb,0xde,0xda,0xde,0xdb,0xe6,0xba,0xde,0xdb,0xe6,0xda,0xde, -0xdb,0xe6,0xbb,0xde,0xdb,0xe6,0xdb,0xde,0xfb,0xe6,0xdb,0xde,0xfb,0xe6,0xda,0xde, -0xfb,0xe6,0xfb,0xe6,0xfb,0xe6,0xdb,0xde,0xfb,0xe6,0xfb,0xe6,0x1c,0xe7,0xfb,0xde, -0xfb,0xee,0x5c,0xf7,0xda,0xee,0xb1,0xac,0xb9,0xe6,0xff,0xff,0xff,0xff,0xff,0xff, -0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0xde, -0xba,0xd6,0xbb,0xde,0xda,0xde,0xdb,0xe6,0xba,0xde,0xdb,0xe6,0xda,0xde,0xfb,0xe6, -0xdb,0xde,0xfb,0xe6,0xdb,0xde,0xdb,0xe6,0xdb,0xde,0xfb,0xe6,0xdb,0xe6,0xfb,0xe6, -0xdb,0xde,0xfb,0xe6,0xdb,0xde,0xdb,0xde,0xdb,0xde,0xfc,0xe6,0xfb,0xe6,0xfb,0xe6, -0xfb,0xe6,0xfc,0xe6,0xdb,0xde,0xba,0xde,0xba,0xde,0xdb,0xe6,0xda,0xde,0xdb,0xe6, -0xdb,0xde,0xdb,0xe6,0xba,0xde,0xfb,0xee,0x99,0xe6,0x95,0xcd,0x5d,0xf7,0xff,0xff, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -0xff,0xff,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef,0xbf,0xf7,0x9f,0xef, -0xbf,0xf7,0x9f,0xef,0xff,0xff -}; - -#endif /* __COLOR_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/constants.h b/stm32-hal-freertos-uart-tensorflow/Inc/constants.h deleted file mode 100644 index d030d461..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/constants.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_CONSTANTS_H_ -#define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_CONSTANTS_H_ - -// This constant represents the range of x values our model was trained on, -// which is from 0 to (2 * Pi). We approximate Pi to avoid requiring additional -// libraries. -const float PI = 3.14159265359f; -const float kXrange = 2.f * PI; - -// This constant determines the number of inferences to perform across the range -// of x values defined above. Since each inference takes time, the higher this -// number, the more time it will take to run through the entire range. The value -// of this constant can be tuned so that one full cycle takes a desired amount -// of time. Since different devices take different amounts of time to perform -// inference, this value should be defined per-device. -extern const int kInferencesPerCycle; - -#endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_CONSTANTS_H_ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/data_types.h b/stm32-hal-freertos-uart-tensorflow/Inc/data_types.h deleted file mode 100644 index 647c0851..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/data_types.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __DATA_TYPES_H__ -#define __DATA_TYPES_H__ - -#include - -typedef struct{ - float x; - float y; - uint32_t size; -} circle_t; - -#endif diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/ffconf.h b/stm32-hal-freertos-uart-tensorflow/Inc/ffconf.h deleted file mode 100644 index f80ab75d..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/ffconf.h +++ /dev/null @@ -1,326 +0,0 @@ -/** - * - * Portions COPYRIGHT 2017 STMicroelectronics - * Copyright (C) 2017, ChaN, all right reserved. - * - ****************************************************************************** - * - *

© Copyright (c) 2017 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/*---------------------------------------------------------------------------/ -/ FatFs - FAT file system module configuration file -/---------------------------------------------------------------------------*/ - -#define _FFCONF 68300 /* Revision ID */ - -/*---------------------------------------------------------------------------/ -/ Function Configurations -/---------------------------------------------------------------------------*/ - -#define _FS_READONLY 0 -/* This option switches read-only configuration. (0:Read/Write or 1:Read-only) -/ Read-only configuration removes writing API functions, f_write(), f_sync(), -/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() -/ and optional writing functions as well. */ - - -#define _FS_MINIMIZE 0 -/* This option defines minimization level to remove some basic API functions. -/ -/ 0: All basic functions are enabled. -/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() -/ are removed. -/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. -/ 3: f_lseek() function is removed in addition to 2. */ - - -#define _USE_STRFUNC 0 -/* This option switches string functions, f_gets(), f_putc(), f_puts() and -/ f_printf(). -/ -/ 0: Disable string functions. -/ 1: Enable without LF-CRLF conversion. -/ 2: Enable with LF-CRLF conversion. */ - - -#define _USE_FIND 0 -/* This option switches filtered directory read functions, f_findfirst() and -/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ - - -#define _USE_MKFS 1 -/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ - - -#define _USE_FASTSEEK 1 -/* This option switches fast seek function. (0:Disable or 1:Enable) */ - - -#define _USE_EXPAND 0 -/* This option switches f_expand function. (0:Disable or 1:Enable) */ - - -#define _USE_CHMOD 0 -/* This option switches attribute manipulation functions, f_chmod() and f_utime(). -/ (0:Disable or 1:Enable) Also _FS_READONLY needs to be 0 to enable this option. */ - - -#define _USE_LABEL 0 -/* This option switches volume label functions, f_getlabel() and f_setlabel(). -/ (0:Disable or 1:Enable) */ - - -#define _USE_FORWARD 0 -/* This option switches f_forward() function. (0:Disable or 1:Enable) */ - - -/*---------------------------------------------------------------------------/ -/ Locale and Namespace Configurations -/---------------------------------------------------------------------------*/ - -#define _CODE_PAGE 850 -/* This option specifies the OEM code page to be used on the target system. -/ Incorrect setting of the code page can cause a file open failure. -/ -/ 1 - ASCII (No extended character. Non-LFN cfg. only) -/ 437 - U.S. -/ 720 - Arabic -/ 737 - Greek -/ 771 - KBL -/ 775 - Baltic -/ 850 - Latin 1 -/ 852 - Latin 2 -/ 855 - Cyrillic -/ 857 - Turkish -/ 860 - Portuguese -/ 861 - Icelandic -/ 862 - Hebrew -/ 863 - Canadian French -/ 864 - Arabic -/ 865 - Nordic -/ 866 - Russian -/ 869 - Greek 2 -/ 932 - Japanese (DBCS) -/ 936 - Simplified Chinese (DBCS) -/ 949 - Korean (DBCS) -/ 950 - Traditional Chinese (DBCS) -*/ - - -#define _USE_LFN 3 -#define _MAX_LFN 255 -/* The _USE_LFN switches the support of long file name (LFN). -/ -/ 0: Disable support of LFN. _MAX_LFN has no effect. -/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. -/ 2: Enable LFN with dynamic working buffer on the STACK. -/ 3: Enable LFN with dynamic working buffer on the HEAP. -/ -/ To enable the LFN, Unicode handling functions (option/unicode.c) must be added -/ to the project. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and -/ additional 608 bytes at exFAT enabled. _MAX_LFN can be in range from 12 to 255. -/ It should be set 255 to support full featured LFN operations. -/ When use stack for the working buffer, take care on stack overflow. When use heap -/ memory for the working buffer, memory management functions, ff_memalloc() and -/ ff_memfree(), must be added to the project. */ - - -#define _LFN_UNICODE 0 -/* This option switches character encoding on the API. (0:ANSI/OEM or 1:UTF-16) -/ To use Unicode string for the path name, enable LFN and set _LFN_UNICODE = 1. -/ This option also affects behavior of string I/O functions. */ - - -#define _STRF_ENCODE 3 -/* When _LFN_UNICODE == 1, this option selects the character encoding ON THE FILE to -/ be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf(). -/ -/ 0: ANSI/OEM -/ 1: UTF-16LE -/ 2: UTF-16BE -/ 3: UTF-8 -/ -/ This option has no effect when _LFN_UNICODE == 0. */ - - -#define _FS_RPATH 0 -/* This option configures support of relative path. -/ -/ 0: Disable relative path and remove related functions. -/ 1: Enable relative path. f_chdir() and f_chdrive() are available. -/ 2: f_getcwd() function is available in addition to 1. -*/ - - -/*---------------------------------------------------------------------------/ -/ Drive/Volume Configurations -/---------------------------------------------------------------------------*/ - -#define _VOLUMES 2 -/* Number of volumes (logical drives) to be used. */ - - -#define _STR_VOLUME_ID 0 -#define _VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" -/* _STR_VOLUME_ID switches string support of volume ID. -/ When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive -/ number in the path name. _VOLUME_STRS defines the drive ID strings for each -/ logical drives. Number of items must be equal to _VOLUMES. Valid characters for -/ the drive ID strings are: A-Z and 0-9. */ - - -#define _MULTI_PARTITION 0 -/* This option switches support of multi-partition on a physical drive. -/ By default (0), each logical drive number is bound to the same physical drive -/ number and only an FAT volume found on the physical drive will be mounted. -/ When multi-partition is enabled (1), each logical drive number can be bound to -/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() -/ funciton will be available. */ - - -#define _MIN_SS 512 -#define _MAX_SS 512 -/* These options configure the range of sector size to be supported. (512, 1024, -/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and -/ harddisk. But a larger value may be required for on-board flash memory and some -/ type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured -/ to variable sector size and GET_SECTOR_SIZE command must be implemented to the -/ disk_ioctl() function. */ - - -#define _USE_TRIM 0 -/* This option switches support of ATA-TRIM. (0:Disable or 1:Enable) -/ To enable Trim function, also CTRL_TRIM command should be implemented to the -/ disk_ioctl() function. */ - - -#define _FS_NOFSINFO 0 -/* If you need to know correct free space on the FAT32 volume, set bit 0 of this -/ option, and f_getfree() function at first time after volume mount will force -/ a full FAT scan. Bit 1 controls the use of last allocated cluster number. -/ -/ bit0=0: Use free cluster count in the FSINFO if available. -/ bit0=1: Do not trust free cluster count in the FSINFO. -/ bit1=0: Use last allocated cluster number in the FSINFO if available. -/ bit1=1: Do not trust last allocated cluster number in the FSINFO. -*/ - - - -/*---------------------------------------------------------------------------/ -/ System Configurations -/---------------------------------------------------------------------------*/ - -#define _FS_TINY 0 -/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) -/ At the tiny configuration, size of file object (FIL) is reduced _MAX_SS bytes. -/ Instead of private sector buffer eliminated from the file object, common sector -/ buffer in the file system object (FATFS) is used for the file data transfer. */ - - -#define _FS_EXFAT 0 -/* This option switches support of exFAT file system. (0:Disable or 1:Enable) -/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1) -/ Note that enabling exFAT discards C89 compatibility. */ - - -#define _FS_NORTC 0 -#define _NORTC_MON 1 -#define _NORTC_MDAY 1 -#define _NORTC_YEAR 2016 -/* The option _FS_NORTC switches timestamp functiton. If the system does not have -/ any RTC function or valid timestamp is not needed, set _FS_NORTC = 1 to disable -/ the timestamp function. All objects modified by FatFs will have a fixed timestamp -/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR in local time. -/ To enable timestamp function (_FS_NORTC = 0), get_fattime() function need to be -/ added to the project to get current time form real-time clock. _NORTC_MON, -/ _NORTC_MDAY and _NORTC_YEAR have no effect. -/ These options have no effect at read-only configuration (_FS_READONLY = 1). */ - - -#define _FS_LOCK 2 -/* The option _FS_LOCK switches file lock function to control duplicated file open -/ and illegal operation to open objects. This option must be 0 when _FS_READONLY -/ is 1. -/ -/ 0: Disable file lock function. To avoid volume corruption, application program -/ should avoid illegal open, remove and rename to the open objects. -/ >0: Enable file lock function. The value defines how many files/sub-directories -/ can be opened simultaneously under file lock control. Note that the file -/ lock control is independent of re-entrancy. */ - -#define _FS_REENTRANT 0 - -#if _FS_REENTRANT -#include "cmsis_os.h" -#define _FS_TIMEOUT 1000 -#define _SYNC_t osSemaphoreId -#endif -/* The option _FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs -/ module itself. Note that regardless of this option, file access to different -/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs() -/ and f_fdisk() function, are always not re-entrant. Only file/directory access -/ to the same volume is under control of this function. -/ -/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect. -/ 1: Enable re-entrancy. Also user provided synchronization handlers, -/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() -/ function, must be added to the project. Samples are available in -/ option/syscall.c. -/ -/ The _FS_TIMEOUT defines timeout period in unit of time tick. -/ The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, -/ SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be -/ included somewhere in the scope of ff.h. */ - -/* #include // O/S definitions */ - -#if _USE_LFN == 3 -#if !defined(ff_malloc) || !defined(ff_free) -#include -#endif - -#if !defined(ff_malloc) -#define ff_malloc malloc -#endif - -#if !defined(ff_free) -#define ff_free free -#endif -#endif -/*--- End of configuration options ---*/ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/main.h b/stm32-hal-freertos-uart-tensorflow/Inc/main.h deleted file mode 100644 index d35d1ae0..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/main.h +++ /dev/null @@ -1,309 +0,0 @@ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32f4xx_hal.h" - -#include "stm324xg_eval.h" -#include "stm324xg_eval_lcd.h" -#include "stm324xg_eval_ts.h" -#include "stm324xg_eval_sram.h" -#include -#include - -#define USARTx USART3 -#define USARTx_CLK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE(); -#define USARTx_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() -#define USARTx_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() - -#define USARTx_FORCE_RESET() __HAL_RCC_USART3_FORCE_RESET() -#define USARTx_RELEASE_RESET() __HAL_RCC_USART3_RELEASE_RESET() - -/* Definition for USARTx Pins */ -#define USARTx_TX_PIN GPIO_PIN_10 -#define USARTx_TX_GPIO_PORT GPIOC -#define USARTx_TX_AF GPIO_AF7_USART3 -#define USARTx_RX_PIN GPIO_PIN_11 -#define USARTx_RX_GPIO_PORT GPIOC -#define USARTx_RX_AF GPIO_AF7_USART3 - -void Error_Handler(void); - -void Touchscreen_Calibration(void); -uint16_t Calibration_GetX(uint16_t x); -uint16_t Calibration_GetY(uint16_t y); -uint8_t IsCalibrationDone(void); - -#define A19_Pin GPIO_PIN_3 -#define A19_GPIO_Port GPIOE -#define TRACE_CLK_Pin GPIO_PIN_2 -#define TRACE_CLK_GPIO_Port GPIOE -#define FSMC_NBL1_Pin GPIO_PIN_1 -#define FSMC_NBL1_GPIO_Port GPIOE -#define FSMC_NBL0_Pin GPIO_PIN_0 -#define FSMC_NBL0_GPIO_Port GPIOE -#define MII_TXD3_Pin GPIO_PIN_8 -#define MII_TXD3_GPIO_Port GPIOB -#define ULPI_D7_Pin GPIO_PIN_5 -#define ULPI_D7_GPIO_Port GPIOB -#define MII_TXD1_Pin GPIO_PIN_14 -#define MII_TXD1_GPIO_Port GPIOG -#define MII_TXD0_Pin GPIO_PIN_13 -#define MII_TXD0_GPIO_Port GPIOG -#define TRST_Pin GPIO_PIN_4 -#define TRST_GPIO_Port GPIOB -#define TDO_SWO_Pin GPIO_PIN_3 -#define TDO_SWO_GPIO_Port GPIOB -#define FSMC_NE1_Pin GPIO_PIN_7 -#define FSMC_NE1_GPIO_Port GPIOD -#define MicroSDCard_CLK_Pin GPIO_PIN_12 -#define MicroSDCard_CLK_GPIO_Port GPIOC -#define TDI_Pin GPIO_PIN_15 -#define TDI_GPIO_Port GPIOA -#define TCK_SWCLK_Pin GPIO_PIN_14 -#define TCK_SWCLK_GPIO_Port GPIOA -#define TMS_SWDIO_Pin GPIO_PIN_13 -#define TMS_SWDIO_GPIO_Port GPIOA -#define A20_Pin GPIO_PIN_4 -#define A20_GPIO_Port GPIOE -#define TRACE_D2_Pin GPIO_PIN_5 -#define TRACE_D2_GPIO_Port GPIOE -#define TRACE_D3_Pin GPIO_PIN_6 -#define TRACE_D3_GPIO_Port GPIOE -#define I2C1_SDA_Pin GPIO_PIN_9 -#define I2C1_SDA_GPIO_Port GPIOB -#define FSMC_NL_Pin GPIO_PIN_7 -#define FSMC_NL_GPIO_Port GPIOB -#define I2C1_SCL_Pin GPIO_PIN_6 -#define I2C1_SCL_GPIO_Port GPIOB -#define User_Button_Pin GPIO_PIN_15 -#define User_Button_GPIO_Port GPIOG -#define SmartCard_CMDVCC_Pin GPIO_PIN_12 -#define SmartCard_CMDVCC_GPIO_Port GPIOG -#define MII_TX_EN_Pin GPIO_PIN_11 -#define MII_TX_EN_GPIO_Port GPIOG -#define FSMC_NE3_Pin GPIO_PIN_10 -#define FSMC_NE3_GPIO_Port GPIOG -#define FSMC_NWAIT_Pin GPIO_PIN_6 -#define FSMC_NWAIT_GPIO_Port GPIOD -#define D2_Pin GPIO_PIN_0 -#define D2_GPIO_Port GPIOD -#define DCMI_D7_Pin GPIO_PIN_7 -#define DCMI_D7_GPIO_Port GPIOI -#define DCMI_D6_Pin GPIO_PIN_6 -#define DCMI_D6_GPIO_Port GPIOI -#define DCMI_VSYNC_Pin GPIO_PIN_5 -#define DCMI_VSYNC_GPIO_Port GPIOI -#define FSMC_NE2_Pin GPIO_PIN_9 -#define FSMC_NE2_GPIO_Port GPIOG -#define FSMC_NWE_Pin GPIO_PIN_5 -#define FSMC_NWE_GPIO_Port GPIOD -#define D3_Pin GPIO_PIN_1 -#define D3_GPIO_Port GPIOD -#define I2S_SD_Pin GPIO_PIN_3 -#define I2S_SD_GPIO_Port GPIOI -#define IO_Expander_INT_Pin GPIO_PIN_2 -#define IO_Expander_INT_GPIO_Port GPIOI -#define USB_FS_DM_Pin GPIO_PIN_11 -#define USB_FS_DM_GPIO_Port GPIOA -#define Anti_Tamper_Pin GPIO_PIN_13 -#define Anti_Tamper_GPIO_Port GPIOC -#define LED3_Pin GPIO_PIN_9 -#define LED3_GPIO_Port GPIOI -#define DCMI_D5_Pin GPIO_PIN_4 -#define DCMI_D5_GPIO_Port GPIOI -#define FSMC_NOE_Pin GPIO_PIN_4 -#define FSMC_NOE_GPIO_Port GPIOD -#define FSMC_CLK_Pin GPIO_PIN_3 -#define FSMC_CLK_GPIO_Port GPIOD -#define MicroSDCard_CMD_Pin GPIO_PIN_2 -#define MicroSDCard_CMD_GPIO_Port GPIOD -#define SmartCard_3_5V_Pin GPIO_PIN_15 -#define SmartCard_3_5V_GPIO_Port GPIOH -#define USB_FS_ID_Pin GPIO_PIN_10 -#define USB_FS_ID_GPIO_Port GPIOA -#define PC14_OSC32_IN_Pin GPIO_PIN_14 -#define PC14_OSC32_IN_GPIO_Port GPIOC -#define A0_Pin GPIO_PIN_0 -#define A0_GPIO_Port GPIOF -#define MII_RX_ER_Pin GPIO_PIN_10 -#define MII_RX_ER_GPIO_Port GPIOI -#define ULPI_DIR_Pin GPIO_PIN_11 -#define ULPI_DIR_GPIO_Port GPIOI -#define MicroSDCard_Detect_Pin GPIO_PIN_13 -#define MicroSDCard_Detect_GPIO_Port GPIOH -#define DCMI_D4_Pin GPIO_PIN_14 -#define DCMI_D4_GPIO_Port GPIOH -#define I2S_WS_Pin GPIO_PIN_0 -#define I2S_WS_GPIO_Port GPIOI -#define VBUS_FS_Pin GPIO_PIN_9 -#define VBUS_FS_GPIO_Port GPIOA -#define PC15_OSC32_OUT_Pin GPIO_PIN_15 -#define PC15_OSC32_OUT_GPIO_Port GPIOC -#define MII_CRS_Pin GPIO_PIN_2 -#define MII_CRS_GPIO_Port GPIOH -#define MicroSDCard_D1_Pin GPIO_PIN_9 -#define MicroSDCard_D1_GPIO_Port GPIOC -#define MCO_Pin GPIO_PIN_8 -#define MCO_GPIO_Port GPIOA -#define PH0_OSC_IN_Pin GPIO_PIN_0 -#define PH0_OSC_IN_GPIO_Port GPIOH -#define MII_COL_Pin GPIO_PIN_3 -#define MII_COL_GPIO_Port GPIOH -#define MicroSDCard_D0_Pin GPIO_PIN_8 -#define MicroSDCard_D0_GPIO_Port GPIOC -#define LED4_Pin GPIO_PIN_7 -#define LED4_GPIO_Port GPIOC -#define PH1_OSC_OUT_Pin GPIO_PIN_1 -#define PH1_OSC_OUT_GPIO_Port GPIOH -#define A2_Pin GPIO_PIN_2 -#define A2_GPIO_Port GPIOF -#define A1_Pin GPIO_PIN_1 -#define A1_GPIO_Port GPIOF -#define ULPI_NXT_Pin GPIO_PIN_4 -#define ULPI_NXT_GPIO_Port GPIOH -#define LED2_Pin GPIO_PIN_8 -#define LED2_GPIO_Port GPIOG -#define A3_Pin GPIO_PIN_3 -#define A3_GPIO_Port GPIOF -#define A4_Pin GPIO_PIN_4 -#define A4_GPIO_Port GPIOF -#define OTG_FS_PowerSwitchOn_Pin GPIO_PIN_5 -#define OTG_FS_PowerSwitchOn_GPIO_Port GPIOH -#define SmartCard_CLK_Pin GPIO_PIN_7 -#define SmartCard_CLK_GPIO_Port GPIOG -#define LED1_Pin GPIO_PIN_6 -#define LED1_GPIO_Port GPIOG -#define SmartCard_RST_Pin GPIO_PIN_7 -#define SmartCard_RST_GPIO_Port GPIOF -#define SmartCard_OFF_Pin GPIO_PIN_6 -#define SmartCard_OFF_GPIO_Port GPIOF -#define A5_Pin GPIO_PIN_5 -#define A5_GPIO_Port GPIOF -#define DCMI_D3_Pin GPIO_PIN_12 -#define DCMI_D3_GPIO_Port GPIOH -#define A15_Pin GPIO_PIN_5 -#define A15_GPIO_Port GPIOG -#define A14_Pin GPIO_PIN_4 -#define A14_GPIO_Port GPIOG -#define A13_Pin GPIO_PIN_3 -#define A13_GPIO_Port GPIOG -#define Audio_IN_Pin GPIO_PIN_10 -#define Audio_IN_GPIO_Port GPIOF -#define Potentiometer_Pin GPIO_PIN_9 -#define Potentiometer_GPIO_Port GPIOF -#define DCMI_D2_Pin GPIO_PIN_11 -#define DCMI_D2_GPIO_Port GPIOH -#define DCMI_D1_Pin GPIO_PIN_10 -#define DCMI_D1_GPIO_Port GPIOH -#define D1_Pin GPIO_PIN_15 -#define D1_GPIO_Port GPIOD -#define A12_Pin GPIO_PIN_2 -#define A12_GPIO_Port GPIOG -#define ULPI_STP_Pin GPIO_PIN_0 -#define ULPI_STP_GPIO_Port GPIOC -#define MII_MDC_Pin GPIO_PIN_1 -#define MII_MDC_GPIO_Port GPIOC -#define MII_TXD2_Pin GPIO_PIN_2 -#define MII_TXD2_GPIO_Port GPIOC -#define MII_TX_CLK_Pin GPIO_PIN_3 -#define MII_TX_CLK_GPIO_Port GPIOC -#define SW1_Pin GPIO_PIN_2 -#define SW1_GPIO_Port GPIOB -#define A11_Pin GPIO_PIN_1 -#define A11_GPIO_Port GPIOG -#define MII_RXD2_Pin GPIO_PIN_6 -#define MII_RXD2_GPIO_Port GPIOH -#define DCMI_HSYNC_Pin GPIO_PIN_8 -#define DCMI_HSYNC_GPIO_Port GPIOH -#define DCMI_D0_Pin GPIO_PIN_9 -#define DCMI_D0_GPIO_Port GPIOH -#define D0_Pin GPIO_PIN_14 -#define D0_GPIO_Port GPIOD -#define A18_Pin GPIO_PIN_13 -#define A18_GPIO_Port GPIOD -#define MII_RX_CLK_RMII_REF_CLK_Pin GPIO_PIN_1 -#define MII_RX_CLK_RMII_REF_CLK_GPIO_Port GPIOA -#define WAKEUP_Pin GPIO_PIN_0 -#define WAKEUP_GPIO_Port GPIOA -#define Audio_DAC_OUT_Pin GPIO_PIN_4 -#define Audio_DAC_OUT_GPIO_Port GPIOA -#define MII_RXD0_Pin GPIO_PIN_4 -#define MII_RXD0_GPIO_Port GPIOC -#define A7_Pin GPIO_PIN_13 -#define A7_GPIO_Port GPIOF -#define A10_Pin GPIO_PIN_0 -#define A10_GPIO_Port GPIOG -#define D10_Pin GPIO_PIN_13 -#define D10_GPIO_Port GPIOE -#define MII_RXD3_Pin GPIO_PIN_7 -#define MII_RXD3_GPIO_Port GPIOH -#define A17_Pin GPIO_PIN_12 -#define A17_GPIO_Port GPIOD -#define A16_Pin GPIO_PIN_11 -#define A16_GPIO_Port GPIOD -#define D15_Pin GPIO_PIN_10 -#define D15_GPIO_Port GPIOD -#define MII_MDIO_Pin GPIO_PIN_2 -#define MII_MDIO_GPIO_Port GPIOA -#define DCMI_PIXCK_Pin GPIO_PIN_6 -#define DCMI_PIXCK_GPIO_Port GPIOA -#define ULPI_CLK_Pin GPIO_PIN_5 -#define ULPI_CLK_GPIO_Port GPIOA -#define MII_RXD1_Pin GPIO_PIN_5 -#define MII_RXD1_GPIO_Port GPIOC -#define A6_Pin GPIO_PIN_12 -#define A6_GPIO_Port GPIOF -#define A9_Pin GPIO_PIN_15 -#define A9_GPIO_Port GPIOF -#define D5_Pin GPIO_PIN_8 -#define D5_GPIO_Port GPIOE -#define D6_Pin GPIO_PIN_9 -#define D6_GPIO_Port GPIOE -#define D8_Pin GPIO_PIN_11 -#define D8_GPIO_Port GPIOE -#define D11_Pin GPIO_PIN_14 -#define D11_GPIO_Port GPIOE -#define ULPI_D5_Pin GPIO_PIN_12 -#define ULPI_D5_GPIO_Port GPIOB -#define ULPI_D6_Pin GPIO_PIN_13 -#define ULPI_D6_GPIO_Port GPIOB -#define D14_Pin GPIO_PIN_9 -#define D14_GPIO_Port GPIOD -#define D13_Pin GPIO_PIN_8 -#define D13_GPIO_Port GPIOD -#define ULPI_D0_Pin GPIO_PIN_3 -#define ULPI_D0_GPIO_Port GPIOA -#define MII_RX_DV_RMII_CRSDV_Pin GPIO_PIN_7 -#define MII_RX_DV_RMII_CRSDV_GPIO_Port GPIOA -#define ULPI_D2_Pin GPIO_PIN_1 -#define ULPI_D2_GPIO_Port GPIOB -#define ULPI_D1_Pin GPIO_PIN_0 -#define ULPI_D1_GPIO_Port GPIOB -#define OTG_FS_OverCurrent_Pin GPIO_PIN_11 -#define OTG_FS_OverCurrent_GPIO_Port GPIOF -#define A8_Pin GPIO_PIN_14 -#define A8_GPIO_Port GPIOF -#define D4_Pin GPIO_PIN_7 -#define D4_GPIO_Port GPIOE -#define D7_Pin GPIO_PIN_10 -#define D7_GPIO_Port GPIOE -#define D9_Pin GPIO_PIN_12 -#define D9_GPIO_Port GPIOE -#define D12_Pin GPIO_PIN_15 -#define D12_GPIO_Port GPIOE -#define ULPI_D3_Pin GPIO_PIN_10 -#define ULPI_D3_GPIO_Port GPIOB -#define ULPI_D4_Pin GPIO_PIN_11 -#define ULPI_D4_GPIO_Port GPIOB -#define MII_INT_Pin GPIO_PIN_14 -#define MII_INT_GPIO_Port GPIOB - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/main_functions.h b/stm32-hal-freertos-uart-tensorflow/Inc/main_functions.h deleted file mode 100644 index de807844..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/main_functions.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ -#define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ - -#include "data_types.h" - -// Expose a C friendly interface for main functions. -#ifdef __cplusplus -extern "C" { -#endif - -// Initializes all data needed for the example. The name is important, and needs -// to be setup() for Arduino compatibility. -void setup(); - -// Runs one iteration of data gathering and inference. This should be called -// repeatedly from the application code. The name needs to be loop() for Arduino -// compatibility. -circle_t *loop(); - -#ifdef __cplusplus -} -#endif - -#endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/output_handler.h b/stm32-hal-freertos-uart-tensorflow/Inc/output_handler.h deleted file mode 100644 index 14e9d707..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/output_handler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ -#define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ - -#include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/micro_error_reporter.h" - -// Called by the main loop to produce some output based on the x and y values -void HandleOutput(tflite::ErrorReporter* error_reporter, float x_value, - float y_value); - -#endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_OUTPUT_HANDLER_H_ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/sd_diskio.h b/stm32-hal-freertos-uart-tensorflow/Inc/sd_diskio.h deleted file mode 100644 index 0a243d73..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/sd_diskio.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - ****************************************************************************** - * @file sd_diskio.h - * @author MCD Application Team - * @brief Header for sd_diskio.c module. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __SD_DISKIO_H -#define __SD_DISKIO_H - -/* Includes ------------------------------------------------------------------*/ -#include "stm324xg_eval_sd.h" -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -extern const Diskio_drvTypeDef SD_Driver; - -#endif /* __SD_DISKIO_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/sine_model_quantized.h b/stm32-hal-freertos-uart-tensorflow/Inc/sine_model_quantized.h deleted file mode 100644 index d5d053a8..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/sine_model_quantized.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __TENSORFLOW_SINE_MODEL_QUANITZED_H__ -#define __TENSORFLOW_SINE_MODEL_QUANTIZED_H__ - -extern const unsigned char sine_model_quantized_tflite[]; -extern const unsigned int sine_model_quantized_tflite_len; - -#endif diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_it.h b/stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_it.h deleted file mode 100644 index ebbe2fe6..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_it.h +++ /dev/null @@ -1,67 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_IT_H -#define __STM32F4xx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void NMI_Handler(void); -void HardFault_Handler(void); -void MemManage_Handler(void); -void BusFault_Handler(void); -void UsageFault_Handler(void); -void DebugMon_Handler(void); -void SysTick_Handler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/LICENSE b/stm32-hal-freertos-uart-tensorflow/LICENSE deleted file mode 100644 index f288702d..00000000 --- a/stm32-hal-freertos-uart-tensorflow/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/stm32-hal-freertos-uart-tensorflow/README.md b/stm32-hal-freertos-uart-tensorflow/README.md deleted file mode 100644 index fc3484f3..00000000 --- a/stm32-hal-freertos-uart-tensorflow/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# STM3240G-EVAL TensorFlow Lite Micro Hello World -[Hello world](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples/hello_world) TensorFlow Lite Micro example implemented to run on the STM3240G Evaluation board using FreeRTOS and the STM32 HAL libraries to drive the touch display and the UART. diff --git a/stm32-hal-freertos-uart-tensorflow/Src/constants.cc b/stm32-hal-freertos-uart-tensorflow/Src/constants.cc deleted file mode 100644 index bc32fc3f..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/constants.cc +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#include "constants.h" - -// This is a small number so that it's easy to read the logs -const int kInferencesPerCycle = 20; diff --git a/stm32-hal-freertos-uart-tensorflow/Src/freertos.c b/stm32-hal-freertos-uart-tensorflow/Src/freertos.c deleted file mode 100644 index 4d54340a..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/freertos.c +++ /dev/null @@ -1,107 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : freertos.c - * Description : Code for freertos applications - ****************************************************************************** - * This notice applies to any and all portions of this file - * that are not between comment pairs USER CODE BEGIN and - * USER CODE END. Other portions of this file, whether - * inserted by the user or by software development tools - * are owned by their respective copyright owners. - * - * Copyright (c) 2020 STMicroelectronics International N.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "FreeRTOS.h" -#include "task.h" -#include "main.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN Variables */ - -/* USER CODE END Variables */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN FunctionPrototypes */ - -/* USER CODE END FunctionPrototypes */ - -/* GetIdleTaskMemory prototype (linked to static allocation support) */ -void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ); - -/* USER CODE BEGIN GET_IDLE_TASK_MEMORY */ -static StaticTask_t xIdleTaskTCBBuffer; -static StackType_t xIdleStack[configMINIMAL_STACK_SIZE]; - -void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) -{ - *ppxIdleTaskTCBBuffer = &xIdleTaskTCBBuffer; - *ppxIdleTaskStackBuffer = &xIdleStack[0]; - *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; - /* place for user code */ -} -/* USER CODE END GET_IDLE_TASK_MEMORY */ - -/* Private application code --------------------------------------------------*/ -/* USER CODE BEGIN Application */ - -/* USER CODE END Application */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/Src/main.c b/stm32-hal-freertos-uart-tensorflow/Src/main.c deleted file mode 100644 index 53e2fbc7..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/main.c +++ /dev/null @@ -1,296 +0,0 @@ -#include -#include "main.h" -#include "cmsis_os.h" -#include "data_types.h" -#include "main_functions.h" -#include "constants.h" -#include "color.h" - -void SystemClock_Config(void); -static void MX_GPIO_Init(void); -void inferenceTask(void const *argument); -void blinkTask(void const *argument); -void UARTTask(void const *argument); - -osThreadId defaultTaskHandle; -osThreadId UARTTaskHandle; -osThreadId blinkTaskHandle; - -UART_HandleTypeDef UartHandle; - -void UARTTask(void const *argument) -{ - char *hello_string = "Hello World\n"; - volatile HAL_StatusTypeDef err; - - while (1) { - HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, GPIO_PIN_SET); - HAL_Delay(500); - err = HAL_UART_Transmit(&UartHandle, (uint8_t *)hello_string, - sizeof(hello_string) + 1, - HAL_MAX_DELAY); - if (err == HAL_OK) - HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, - GPIO_PIN_RESET); - HAL_Delay(500); - } -} - -void inferenceTask(void const *argument) -{ - circle_t *tmp_circle; - int count = 0; - uint16_t screen_height = BSP_LCD_GetYSize(); - uint16_t screen_width = BSP_LCD_GetXSize(); - uint16_t x_pos, y_pos; - setup(); - - for (;;) { - tmp_circle = loop(); - if (tmp_circle) { - x_pos = (uint16_t)(tmp_circle->x * screen_width / - (2 * PI)); - y_pos = (uint16_t)((screen_height / 2) + - tmp_circle->y * screen_height / 2); - BSP_LCD_FillCircle(x_pos, y_pos, tmp_circle->size); - } - count++; - if (count == 40) - vTaskSuspend(NULL); - else - HAL_Delay(100); - } -} - -void blinkTask(void const *argument) -{ - int count = 0; - - HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET); - HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET); - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET); - HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, GPIO_PIN_RESET); - - for (;;) { - count %= 10; - - switch (count++) { - case 0: - HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, - GPIO_PIN_SET); - break; - case 1: - HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, - GPIO_PIN_SET); - break; - case 2: - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, - GPIO_PIN_SET); - break; - case 3: - break; - case 5: - HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, - GPIO_PIN_RESET); - break; - case 6: - HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, - GPIO_PIN_RESET); - break; - case 7: - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, - GPIO_PIN_RESET); - break; - case 8: - break; - default: - break; - } - - HAL_Delay(100); - } -} - -int main(void) -{ - HAL_Init(); - - BSP_LCD_Init(); - BSP_LCD_DisplayOn(); - BSP_LCD_Clear(LCD_COLOR_WHITE); - - BSP_LCD_Clear(LCD_COLOR_WHITE); - - SystemClock_Config(); - - UartHandle.Instance = USARTx; - UartHandle.Init.BaudRate = 9600; - UartHandle.Init.WordLength = UART_WORDLENGTH_8B; - UartHandle.Init.StopBits = UART_STOPBITS_1; - UartHandle.Init.Parity = UART_PARITY_ODD; - UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; - UartHandle.Init.Mode = UART_MODE_TX_RX; - UartHandle.Init.OverSampling = UART_OVERSAMPLING_16; - - if (HAL_UART_Init(&UartHandle) != HAL_OK) { - Error_Handler(); - } - - MX_GPIO_Init(); - - osThreadDef(defaultTask, inferenceTask, osPriorityNormal, 0, 256); - defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL); - - osThreadDef(UARTTaskHandle, UARTTask, osPriorityNormal, 0, 256); - UARTTaskHandle = osThreadCreate(osThread(UARTTaskHandle), NULL); - - osThreadDef(blinkTaskHandle, blinkTask, osPriorityNormal, 0, 256); - blinkTaskHandle = osThreadCreate(osThread(blinkTaskHandle), NULL); - - /* Start scheduler */ - osKernelStart(); - - while (1) { - } -} - -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = { 0 }; - RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 }; - - /** Configure the main internal regulator output voltage - * */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - /** Initializes the CPU, AHB and APB busses clocks - * */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 168; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB busses clocks - * */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_SYSCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != - HAL_OK) { - Error_Handler(); - } -} - -static void MX_GPIO_Init(void) -{ - GPIO_InitTypeDef GPIO_InitStruct = { 0 }; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOI_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOG, LED2_Pin | LED1_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pins : FSMC_NE1_Pin FSMC_NWAIT_Pin D2_Pin FSMC_NWE_Pin - D3_Pin FSMC_NOE_Pin FSMC_CLK_Pin D1_Pin - D0_Pin A18_Pin A17_Pin A16_Pin - D15_Pin D14_Pin D13_Pin */ - GPIO_InitStruct.Pin = FSMC_NE1_Pin | FSMC_NWAIT_Pin | D2_Pin | - FSMC_NWE_Pin | D3_Pin | FSMC_NOE_Pin | - FSMC_CLK_Pin | D1_Pin | D0_Pin | A18_Pin | - A17_Pin | A16_Pin | D15_Pin | D14_Pin | D13_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_FSMC; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); - - /*Configure GPIO pin : FSMC_NL_Pin */ - GPIO_InitStruct.Pin = FSMC_NL_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_FSMC; - HAL_GPIO_Init(FSMC_NL_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : User_Button_Pin */ - GPIO_InitStruct.Pin = User_Button_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_EVT_RISING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(User_Button_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : LED2_Pin LED1_Pin */ - GPIO_InitStruct.Pin = LED2_Pin | LED1_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); - - /*Configure GPIO pins : FSMC_NE3_Pin FSMC_NE2_Pin A15_Pin A14_Pin - A13_Pin A12_Pin A11_Pin A10_Pin */ - GPIO_InitStruct.Pin = FSMC_NE3_Pin | FSMC_NE2_Pin | A15_Pin | A14_Pin | - A13_Pin | A12_Pin | A11_Pin | A10_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF12_FSMC; - HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); - - /*Configure GPIO pin : LED3_Pin */ - GPIO_InitStruct.Pin = LED3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED3_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : LED4_Pin */ - GPIO_InitStruct.Pin = LED4_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED4_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : SW1_Pin */ - GPIO_InitStruct.Pin = SW1_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(SW1_GPIO_Port, &GPIO_InitStruct); -} - -void Error_Handler(void) -{ - while (1) { - } -} - -#ifdef USE_FULL_ASSERT -void assert_failed(uint8_t *file, uint32_t line) -{ -} -#endif /* USE_FULL_ASSERT */ diff --git a/stm32-hal-freertos-uart-tensorflow/Src/main_functions.cc b/stm32-hal-freertos-uart-tensorflow/Src/main_functions.cc deleted file mode 100644 index f4c13e47..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/main_functions.cc +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ -#include "tensorflow/lite/micro/all_ops_resolver.h" -#include "tensorflow/lite/micro/micro_error_reporter.h" -#include "tensorflow/lite/micro/micro_interpreter.h" -#include "tensorflow/lite/schema/schema_generated.h" -#include "tensorflow/lite/version.h" - -#include "sine_model_quantized.h" - -#include "main_functions.h" -#include "data_types.h" -#include "constants.h" - -// extern const unsigned char sine_model_quantized_tflite[]; -// extern const unsigned int sine_model_quantized_tflite_len; -// Globals, used for compatibility with Arduino-style sketches. -namespace -{ -tflite::ErrorReporter *error_reporter = nullptr; -const tflite::Model *model = nullptr; -tflite::MicroInterpreter *interpreter = nullptr; -TfLiteTensor *input = nullptr; -TfLiteTensor *output = nullptr; -int inference_count = 0; - -// Create an area of memory to use for input, output, and intermediate arrays. -// Finding the minimum value for your model may require some trial and error. -const int kModelArenaSize = 2468; -const int kExtraArenaSize = 560 + 16 + 100; -const int kTensorArenaSize = kModelArenaSize + kExtraArenaSize; -uint8_t tensor_arena[kTensorArenaSize]; -} // namespace - -// The name of this function is important for Arduino compatibility. -void setup() -{ - // Set up logging. Google style is to avoid globals or statics because of - // lifetime uncertainty, but since this has a trivial destructor it's okay. - // NOLINTNEXTLINE(runtime-global-variables) - static tflite::MicroErrorReporter micro_error_reporter; - error_reporter = µ_error_reporter; - - error_reporter->Report("Hello from the error reporter"); - - // Map the model into a usable data structure. This doesn't involve any - // copying or parsing, it's a very lightweight operation. - model = tflite::GetModel(sine_model_quantized_tflite); - if (model->version() != TFLITE_SCHEMA_VERSION) { - error_reporter->Report( - "Model provided is schema version %d not equal " - "to supported version %d.", - model->version(), TFLITE_SCHEMA_VERSION); - return; - } - - // This pulls in all the operation implementations we need. - // NOLINTNEXTLINE(runtime-global-variables) - static tflite::AllOpsResolver resolver; - - // Build an interpreter to run the model with. - static tflite::MicroInterpreter static_interpreter( - model, resolver, tensor_arena, kTensorArenaSize, error_reporter, - nullptr); - interpreter = &static_interpreter; - - // Allocate memory from the tensor_arena for the model's tensors. - TfLiteStatus allocate_status = interpreter->AllocateTensors(); - if (allocate_status != kTfLiteOk) { - error_reporter->Report("AllocateTensors() failed"); - return; - } - - // Obtain pointers to the model's input and output tensors. - input = interpreter->input(0); - output = interpreter->output(0); - - // Keep track of how many inferences we have performed. - inference_count = 0; -} - -// The name of this function is important for Arduino compatibility. -circle_t *loop() -{ - static circle_t ret; - ret.size = 4; - // Calculate an x value to feed into the model. We compare the current - // inference_count to the number of inferences per cycle to determine - // our position within the range of possible x values the model was - // trained on, and use this to calculate a value. - float position = static_cast(inference_count) / - static_cast(kInferencesPerCycle); - float x_val = position * kXrange; - - // Place our calculated x value in the model's input tensor - input->data.f[0] = x_val; - - // Run inference, and report any error - TfLiteStatus invoke_status = interpreter->Invoke(); - if (invoke_status != kTfLiteOk) { - error_reporter->Report("Invoke failed on x_val: %f\n", - static_cast(x_val)); - return NULL; - } - - // Read the predicted y value from the model's output tensor - float y_val = output->data.f[0]; - - ret.x = x_val; - ret.y = y_val; - - // Increment the inference_counter, and reset it if we have reached - // the total number per cycle - inference_count++; - if (inference_count >= kInferencesPerCycle) - inference_count = 0; - - return &ret; -} diff --git a/stm32-hal-freertos-uart-tensorflow/Src/sine_model_quantized.cc b/stm32-hal-freertos-uart-tensorflow/Src/sine_model_quantized.cc deleted file mode 100644 index ea2e9ea8..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/sine_model_quantized.cc +++ /dev/null @@ -1,218 +0,0 @@ -#include "sine_model_quantized.h" - -alignas(8) const unsigned char sine_model_quantized_tflite[] = { - 0x08, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x32, 0xfa, 0xff, 0xff, - 0x03, 0x00, 0x00, 0x00, 0xc8, 0x09, 0x00, 0x00, 0xb8, 0x05, 0x00, 0x00, - 0xa0, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, - 0x90, 0x05, 0x00, 0x00, 0x88, 0x05, 0x00, 0x00, 0x38, 0x05, 0x00, 0x00, - 0xe0, 0x04, 0x00, 0x00, 0xcc, 0x04, 0x00, 0x00, 0x7c, 0x04, 0x00, 0x00, - 0x6c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa0, 0xf6, 0xff, 0xff, - 0xa4, 0xf6, 0xff, 0xff, 0xa8, 0xf6, 0xff, 0xff, 0xfe, 0xfa, 0xff, 0xff, - 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x8f, 0x8a, 0x19, 0x3f, - 0x86, 0x18, 0xbb, 0xbe, 0x50, 0xfd, 0xe1, 0xbe, 0xa8, 0x18, 0x72, 0xbe, - 0x9e, 0x7f, 0xec, 0xbe, 0x60, 0x68, 0x96, 0x3d, 0xb7, 0x5c, 0x8b, 0xbe, - 0xca, 0x9f, 0x8e, 0xbf, 0xdd, 0x4e, 0x72, 0xbd, 0x31, 0xbf, 0xe1, 0x3e, - 0x1c, 0x4e, 0x35, 0x3f, 0x17, 0x32, 0x3e, 0x3f, 0xb7, 0xbf, 0x73, 0x3e, - 0xb6, 0x55, 0x9a, 0xbe, 0x49, 0xf5, 0xb0, 0x3e, 0x1d, 0x38, 0xc4, 0x3f, - 0x4a, 0xfb, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0xb4, 0x5c, 0xab, 0xbe, 0xd0, 0x41, 0xc9, 0xbc, 0x78, 0x72, 0xb1, 0x3e, - 0xf0, 0xcb, 0x08, 0xbe, 0x31, 0x5c, 0x9b, 0xbe, 0x8d, 0x1d, 0x87, 0x3e, - 0x2f, 0x58, 0xad, 0xbe, 0x7a, 0x21, 0x8f, 0xbe, 0x5b, 0x44, 0x81, 0x3e, - 0xfa, 0x11, 0x5c, 0xbf, 0xdc, 0x67, 0xa1, 0x3d, 0xb6, 0xf8, 0x0a, 0xbf, - 0xde, 0x52, 0x87, 0xbe, 0x5f, 0x63, 0x95, 0x3e, 0xd6, 0x71, 0xae, 0x3c, - 0x0b, 0x91, 0xb0, 0x3e, 0xfc, 0x1a, 0xd4, 0x3d, 0xc6, 0x30, 0x5d, 0x3e, - 0xd9, 0x9f, 0x42, 0x3e, 0x3a, 0x82, 0x3f, 0xbe, 0x96, 0x49, 0x81, 0xbd, - 0xbb, 0xb1, 0xa2, 0x3e, 0xf0, 0xeb, 0xaf, 0x3c, 0x34, 0x2c, 0xf2, 0xbe, - 0x08, 0xb5, 0x60, 0xbe, 0x15, 0x73, 0x9b, 0x3e, 0x77, 0xfd, 0xb3, 0x3e, - 0x9a, 0x6a, 0x83, 0xbd, 0xe6, 0x74, 0x79, 0x3e, 0x8e, 0x08, 0x82, 0xbe, - 0xdc, 0x31, 0x8e, 0x3e, 0xda, 0x7b, 0x5d, 0x3e, 0xf4, 0x77, 0x32, 0xbe, - 0x2f, 0xaa, 0xc4, 0xbe, 0x2e, 0x35, 0x26, 0x3e, 0x1e, 0x85, 0x39, 0x3b, - 0xb1, 0xcb, 0x48, 0xbe, 0x98, 0xc1, 0x3c, 0xbc, 0x6c, 0xa1, 0xc3, 0xbe, - 0x00, 0x6d, 0xe4, 0xba, 0xec, 0x34, 0x8a, 0xbd, 0x93, 0x3e, 0x18, 0x3e, - 0xef, 0x37, 0x56, 0x3e, 0xf4, 0x97, 0x6a, 0x3e, 0xfb, 0xe9, 0xc6, 0x3e, - 0xed, 0xc5, 0x94, 0x3e, 0x13, 0x85, 0x99, 0x3e, 0x02, 0xe0, 0x8d, 0xbe, - 0x1a, 0x2f, 0x04, 0x3e, 0x36, 0x80, 0x39, 0x3e, 0xd6, 0x09, 0x15, 0x3e, - 0x08, 0xa9, 0xc4, 0xbe, 0x48, 0xd3, 0x54, 0xbd, 0x87, 0xb0, 0xa4, 0x3e, - 0x73, 0xef, 0x9d, 0x3e, 0x33, 0x97, 0xd4, 0xbe, 0xa2, 0x5d, 0x72, 0x3e, - 0x8a, 0x8a, 0x84, 0xbe, 0xd0, 0x7f, 0x95, 0xbe, 0xfc, 0x8d, 0xa8, 0xbd, - 0xb4, 0xe8, 0xee, 0x3d, 0x40, 0xa7, 0x24, 0x3c, 0x20, 0xe9, 0xd7, 0xbe, - 0xc8, 0xb5, 0xf7, 0xbd, 0xa0, 0x6f, 0xd6, 0xbd, 0xea, 0xba, 0x7c, 0x3e, - 0xeb, 0x3a, 0x2d, 0xbe, 0x03, 0x3f, 0xdb, 0xbd, 0xe4, 0xd3, 0xa6, 0xbe, - 0xd0, 0xe3, 0x9d, 0x3e, 0x3e, 0x04, 0x1d, 0x3e, 0x00, 0x52, 0x8f, 0x3e, - 0x5a, 0x4c, 0x32, 0xbe, 0x71, 0xf6, 0xa8, 0xbe, 0xc8, 0x92, 0x10, 0x3e, - 0x46, 0x02, 0x27, 0x3e, 0xa7, 0xeb, 0xa1, 0x3e, 0x70, 0x67, 0xeb, 0x3c, - 0x18, 0x3d, 0xd0, 0x3e, 0x98, 0x76, 0xbb, 0xbe, 0x8a, 0xe2, 0xd0, 0xbe, - 0x63, 0x5e, 0xd3, 0x3e, 0x05, 0x2d, 0x79, 0xbe, 0x39, 0x4e, 0xd1, 0xbe, - 0xe0, 0x31, 0x7f, 0x3c, 0x90, 0xfe, 0x2b, 0x3d, 0x8d, 0x81, 0xdc, 0xbe, - 0x45, 0xc4, 0x53, 0xbe, 0xfe, 0x16, 0x87, 0xbe, 0x17, 0xc5, 0xca, 0x3e, - 0x1d, 0x10, 0xb7, 0x3e, 0xc2, 0x13, 0xca, 0xbe, 0xaf, 0xa1, 0xd0, 0x3e, - 0x9c, 0xaf, 0xdd, 0x3d, 0x70, 0x68, 0x99, 0xbe, 0x28, 0xd0, 0x71, 0xbd, - 0x80, 0xd0, 0x9c, 0xbe, 0x29, 0x9e, 0x9c, 0x3e, 0xed, 0x87, 0xc3, 0x3e, - 0x62, 0xbf, 0x15, 0xbf, 0x8f, 0x69, 0x8a, 0xbe, 0x31, 0x2d, 0x80, 0x3d, - 0x06, 0xc6, 0x53, 0x3e, 0x28, 0x55, 0x07, 0xbe, 0x7e, 0x77, 0x52, 0x3e, - 0x27, 0xdb, 0x55, 0x3e, 0x3e, 0x7e, 0xce, 0x3e, 0x8a, 0xb4, 0xdf, 0xbe, - 0xfb, 0x8d, 0xbe, 0x3e, 0xb5, 0xb2, 0xd1, 0xbe, 0x01, 0x15, 0xd8, 0x3e, - 0xc0, 0xd2, 0x6b, 0xbd, 0x40, 0xd3, 0x56, 0xbc, 0xae, 0xfb, 0x21, 0xbe, - 0xf2, 0x67, 0x9c, 0xbf, 0xa0, 0xf9, 0x8d, 0xbd, 0xec, 0x8a, 0xb7, 0xbe, - 0x42, 0xec, 0x38, 0x3e, 0x28, 0xb4, 0x68, 0xbe, 0x36, 0xd3, 0x11, 0x3f, - 0x73, 0xe4, 0xce, 0x3e, 0x71, 0x9b, 0x68, 0x3f, 0xe2, 0x61, 0x06, 0xbf, - 0xa4, 0x15, 0xef, 0xbc, 0x1c, 0x8f, 0xd3, 0xbd, 0xbe, 0x80, 0x5d, 0x3e, - 0xb7, 0x51, 0x82, 0x3f, 0x62, 0x1e, 0x07, 0xbe, 0xf0, 0x47, 0xbf, 0xbd, - 0x10, 0xbe, 0x54, 0xbe, 0x4f, 0x55, 0xac, 0x3e, 0x27, 0x4d, 0xdc, 0x3d, - 0x6c, 0xcb, 0xb7, 0xbe, 0x0f, 0xc9, 0xa9, 0xbd, 0x84, 0xd1, 0x99, 0x3d, - 0xe9, 0x31, 0x8a, 0x3e, 0x5e, 0x05, 0x59, 0x3e, 0x3c, 0xff, 0xd0, 0xbd, - 0xc8, 0x3e, 0x0c, 0xbe, 0xd2, 0x91, 0x09, 0xbe, 0x1a, 0x21, 0x36, 0xbe, - 0x88, 0x1c, 0x4d, 0x3d, 0x08, 0xb5, 0x24, 0xbc, 0x9f, 0x09, 0xb8, 0x3e, - 0xda, 0x61, 0x1e, 0x3e, 0x59, 0x76, 0xb2, 0x3e, 0xbc, 0x7f, 0xa3, 0x3d, - 0x78, 0xf1, 0x05, 0x3f, 0x66, 0xce, 0x56, 0xbe, 0x2d, 0x59, 0x2a, 0x3e, - 0xe0, 0xd8, 0xa4, 0xbe, 0xe6, 0xe5, 0x88, 0x3e, 0x31, 0x06, 0xb4, 0x3e, - 0x6b, 0xeb, 0xac, 0x3e, 0xa5, 0x1e, 0xcc, 0xbc, 0x1b, 0xb6, 0x88, 0xbd, - 0x92, 0x3f, 0x6e, 0x3e, 0x00, 0xe2, 0xd1, 0x3b, 0x69, 0xc4, 0xce, 0xbe, - 0x66, 0xb5, 0x2a, 0xbe, 0x19, 0xcc, 0xba, 0x3e, 0xae, 0x6d, 0x0a, 0x3e, - 0x18, 0x7c, 0xd4, 0x3e, 0xa3, 0xa2, 0x20, 0x3f, 0xdf, 0x98, 0x41, 0xbd, - 0xcb, 0xab, 0x0f, 0xbf, 0x05, 0x4d, 0xd4, 0x3e, 0xff, 0xb1, 0xf2, 0x3d, - 0xe2, 0x39, 0x00, 0xbe, 0x82, 0xfb, 0x80, 0x3e, 0x1c, 0xff, 0x04, 0x3d, - 0x42, 0xc5, 0xcd, 0x3e, 0xb1, 0x0d, 0xca, 0x3e, 0x5e, 0xb0, 0x13, 0xbe, - 0xf1, 0x03, 0x45, 0xbf, 0xbd, 0x1d, 0xdc, 0x3e, 0x80, 0x25, 0x5d, 0xbd, - 0x14, 0xeb, 0xbf, 0xbd, 0xf4, 0x20, 0x87, 0xbd, 0xcb, 0x73, 0x3a, 0x3f, - 0x75, 0x73, 0x93, 0x3d, 0x29, 0x23, 0x94, 0x3e, 0xc0, 0x5c, 0x3e, 0x3d, - 0x3f, 0x8d, 0xe0, 0x3d, 0xcb, 0xfa, 0xc2, 0x3e, 0x87, 0x1b, 0xc7, 0x3e, - 0xb0, 0x11, 0x23, 0xbe, 0x67, 0x44, 0x0a, 0xbd, 0x2d, 0x41, 0xc1, 0xbe, - 0xdf, 0x32, 0xd5, 0x3e, 0xec, 0xbc, 0x12, 0xbf, 0x3e, 0x4d, 0x12, 0xbe, - 0x7d, 0x10, 0xd0, 0x3e, 0x2e, 0xf8, 0x3c, 0x3e, 0x4d, 0xfe, 0x8b, 0xbe, - 0x1c, 0x2a, 0x16, 0xbe, 0x95, 0x4f, 0x68, 0x3d, 0xb5, 0xea, 0xae, 0x3e, - 0xd4, 0x8b, 0x80, 0x3d, 0x38, 0x47, 0xc6, 0xbe, 0xf5, 0xb3, 0xb8, 0xbe, - 0x70, 0x72, 0x9e, 0xbe, 0xa7, 0xdc, 0xb1, 0xbe, 0x8a, 0x5b, 0x1e, 0xbe, - 0x5e, 0x84, 0x40, 0x3e, 0x1f, 0x7c, 0xd1, 0xbe, 0xbf, 0x85, 0x88, 0xbe, - 0x3c, 0x23, 0x19, 0xbe, 0x6c, 0x78, 0x9f, 0x3d, 0xda, 0x15, 0x6c, 0x3e, - 0xff, 0x75, 0x64, 0xbe, 0x2b, 0xf6, 0xc0, 0x3e, 0x48, 0x12, 0x2d, 0xbd, - 0xa0, 0xf5, 0x4a, 0xbd, 0x83, 0xa3, 0xcc, 0x3e, 0x3a, 0x01, 0xd6, 0xbe, - 0x84, 0x88, 0x7a, 0xbe, 0x82, 0xa4, 0x65, 0xbe, 0x6c, 0x80, 0x9f, 0xbe, - 0x54, 0x5e, 0xa6, 0xbe, 0x03, 0xd0, 0xc0, 0x3e, 0xa0, 0xfa, 0x21, 0xbc, - 0x04, 0xd2, 0x50, 0xbe, 0x35, 0xeb, 0xcf, 0x3e, 0x25, 0x27, 0xbc, 0x3e, - 0xd8, 0x36, 0x42, 0xbd, 0xf2, 0x22, 0xc3, 0x3e, 0x3c, 0x99, 0xd0, 0xbb, - 0xfe, 0xfc, 0x2b, 0x3e, 0x4c, 0x33, 0x15, 0xbd, 0x27, 0xa6, 0xb2, 0xbe, - 0x49, 0x11, 0xfd, 0x3e, 0x7a, 0xe4, 0x9a, 0xbe, 0x39, 0x86, 0x50, 0x3d, - 0x71, 0xeb, 0x29, 0x3d, 0x4c, 0x51, 0xbb, 0xbe, 0xba, 0x71, 0x1f, 0x3e, - 0x81, 0x85, 0xc8, 0x3e, 0x89, 0x3d, 0x5c, 0xbf, 0x7d, 0x3b, 0xbb, 0xbe, - 0xd0, 0x0a, 0xbf, 0x3c, 0xe0, 0x46, 0xf1, 0xbd, 0xd2, 0xb4, 0x37, 0xbe, - 0x02, 0x02, 0xa3, 0xbf, 0x76, 0xda, 0x02, 0xbe, 0x38, 0x9a, 0x04, 0x3f, - 0xd8, 0x90, 0x33, 0xbd, 0x31, 0xa7, 0x72, 0xbe, 0xcc, 0x85, 0x47, 0xbe, - 0xdb, 0xe2, 0xc0, 0xbe, 0xb4, 0xf1, 0x4c, 0x3e, 0xd7, 0x6f, 0xb4, 0xbe, - 0x26, 0x03, 0x4d, 0x3e, 0x00, 0xf0, 0xa7, 0x3b, 0x2f, 0x1d, 0x75, 0x3f, - 0x50, 0x31, 0x48, 0xbd, 0x56, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x98, 0x7a, 0xa6, 0xbe, 0x56, 0x9e, 0x73, 0xbe, - 0x31, 0x08, 0xea, 0x3e, 0xca, 0xd2, 0x4b, 0x3e, 0x1d, 0x10, 0xea, 0x3e, - 0xe5, 0x34, 0x8f, 0x3e, 0x00, 0x1a, 0x96, 0xbe, 0x23, 0xbf, 0xda, 0x3e, - 0xa8, 0x32, 0x94, 0xbd, 0x00, 0xbd, 0x78, 0x3e, 0xf1, 0x6b, 0xad, 0x3e, - 0x37, 0xf4, 0xd4, 0x3e, 0xd4, 0x5f, 0x7e, 0xbe, 0xf6, 0x8d, 0x0e, 0xbf, - 0x3f, 0xe0, 0x8a, 0xbd, 0xae, 0x3f, 0x03, 0xbf, 0xa2, 0xff, 0xff, 0xff, - 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xc1, 0x09, 0xa3, 0xbe, - 0xb2, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0xf1, 0x6d, 0x1f, 0xbd, 0x1d, 0x64, 0x7a, 0x3e, 0x90, 0x97, 0x67, 0x3e, - 0x00, 0x00, 0x00, 0x00, 0xc4, 0xee, 0x86, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x20, 0x9b, 0x3e, 0xf1, 0x7d, 0x24, 0x3f, 0x25, 0x28, 0xaa, 0xbc, - 0x30, 0xa9, 0xda, 0xbe, 0x74, 0x0c, 0xfd, 0xbe, 0xbc, 0xe1, 0xe2, 0xbe, - 0x8c, 0x66, 0x14, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x62, 0x67, 0xde, 0xbe, - 0xcc, 0xf1, 0x4e, 0x3f, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0c, 0x5a, 0xbb, - 0x5b, 0x01, 0x03, 0xbf, 0x4f, 0x1d, 0x35, 0xbe, 0xa2, 0xa5, 0x07, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0xa6, 0x68, 0xf5, 0xbe, 0x00, 0x00, 0x00, 0x00, - 0x5b, 0x75, 0xce, 0xbe, 0x91, 0xe0, 0xb9, 0x3e, 0x8e, 0x1a, 0x71, 0xbe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x84, 0x6b, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x04, 0xfc, 0xff, 0xff, - 0x0f, 0x00, 0x00, 0x00, 0x4d, 0x4c, 0x49, 0x52, 0x20, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x2e, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x04, 0x00, - 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0e, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, - 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x90, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0xce, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7c, 0xfc, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x00, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, - 0x07, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, - 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0xba, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, - 0x16, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x10, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x24, 0x00, 0x00, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, - 0x08, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, - 0x4c, 0x02, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, - 0x5c, 0x01, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, - 0x84, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x86, 0xfd, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x78, 0xfd, 0xff, 0xff, - 0x08, 0x00, 0x00, 0x00, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0xba, 0xfd, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, - 0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0xac, 0xfd, 0xff, 0xff, 0x19, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, - 0x73, 0x65, 0x5f, 0x33, 0x2f, 0x52, 0x65, 0x6c, 0x75, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0xfe, 0xfd, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xf0, 0xfd, 0xff, 0xff, - 0x19, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x32, - 0x2f, 0x52, 0x65, 0x6c, 0x75, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x42, 0xfe, 0xff, 0xff, - 0x34, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x34, 0xfe, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x31, - 0x2f, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x34, 0x2f, 0x4d, 0x61, 0x74, - 0x4d, 0x75, 0x6c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x86, 0xfe, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x78, 0xfe, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, - 0x73, 0x65, 0x5f, 0x33, 0x2f, 0x4d, 0x61, 0x74, 0x4d, 0x75, 0x6c, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0xca, 0xfe, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xbc, 0xfe, 0xff, 0xff, - 0x1b, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x32, - 0x2f, 0x4d, 0x61, 0x74, 0x4d, 0x75, 0x6c, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xff, 0xff, - 0x44, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2b, 0x00, 0x00, 0x00, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x31, - 0x2f, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x34, 0x2f, 0x42, 0x69, 0x61, - 0x73, 0x41, 0x64, 0x64, 0x2f, 0x52, 0x65, 0x61, 0x64, 0x56, 0x61, 0x72, - 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x5e, 0xff, 0xff, 0xff, 0x44, 0x00, 0x00, 0x00, - 0x03, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x50, 0xff, 0xff, 0xff, 0x2b, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, - 0x73, 0x65, 0x5f, 0x33, 0x2f, 0x42, 0x69, 0x61, 0x73, 0x41, 0x64, 0x64, - 0x2f, 0x52, 0x65, 0x61, 0x64, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x4f, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0xae, 0xff, 0xff, 0xff, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa0, 0xff, 0xff, 0xff, - 0x2b, 0x00, 0x00, 0x00, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x32, - 0x2f, 0x42, 0x69, 0x61, 0x73, 0x41, 0x64, 0x64, 0x2f, 0x52, 0x65, 0x61, - 0x64, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, - 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x64, 0x65, 0x6e, 0x73, - 0x65, 0x5f, 0x32, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, - 0x0c, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x09, 0x03, 0x00, 0x00, 0x00 -}; -const unsigned int sine_model_quantized_tflite_len = 2552; diff --git a/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_hal_msp.c b/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_hal_msp.c deleted file mode 100644 index 60389f3e..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_hal_msp.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "main.h" - -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - GPIO_InitTypeDef GPIO_init; - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - //UART - USARTx_TX_GPIO_CLK_ENABLE(); - USARTx_RX_GPIO_CLK_ENABLE(); - - USARTx_CLK_ENABLE(); - - GPIO_init.Pin = USARTx_TX_PIN; - GPIO_init.Mode = GPIO_MODE_AF_PP; - GPIO_init.Pull = GPIO_PULLUP; - GPIO_init.Speed = GPIO_SPEED_FAST; - GPIO_init.Alternate = USARTx_TX_AF; - - HAL_GPIO_Init(USARTx_TX_GPIO_PORT, &GPIO_init); - - GPIO_init.Pin = USARTx_RX_PIN; - GPIO_init.Alternate = USARTx_RX_AF; - - HAL_GPIO_Init(USARTx_RX_GPIO_PORT, &GPIO_init); - - /* System interrupt init*/ - /* PendSV_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); -} diff --git a/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_it.c b/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_it.c deleted file mode 100644 index 424b286b..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/stm32f4xx_it.c +++ /dev/null @@ -1,187 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f4xx_it.h" -#include "FreeRTOS.h" -#include "task.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Pre-fetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); -#if (INCLUDE_xTaskGetSchedulerState == 1 ) - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - { -#endif /* INCLUDE_xTaskGetSchedulerState */ - xPortSysTickHandler(); -#if (INCLUDE_xTaskGetSchedulerState == 1 ) - } -#endif /* INCLUDE_xTaskGetSchedulerState */ - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/Src/syscalls.c b/stm32-hal-freertos-uart-tensorflow/Src/syscalls.c deleted file mode 100644 index 914f768c..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/syscalls.c +++ /dev/null @@ -1,207 +0,0 @@ -/** -***************************************************************************** -** -** File : syscalls.c -** -** Author : Auto-generated by System workbench for STM32 -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2019 STMicroelectronics

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of STMicroelectronics nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Includes */ -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Variables */ -//#undef errno -extern int errno; -extern int __io_putchar(int ch) __attribute__((weak)); -extern int __io_getchar(void) __attribute__((weak)); - -register char * stack_ptr asm("sp"); - -char *__env[1] = { 0 }; -char **environ = __env; - - -/* Functions */ -void initialise_monitor_handles() -{ -} - -int _getpid(void) -{ - return 1; -} - -int _kill(int pid, int sig) -{ - errno = EINVAL; - return -1; -} - -void _exit (int status) -{ - _kill(status, -1); - while (1) {} /* Make sure we hang here */ -} - -__attribute__((weak)) int _read(int file, char *ptr, int len) -{ - int DataIdx; - - for (DataIdx = 0; DataIdx < len; DataIdx++) - { - *ptr++ = __io_getchar(); - } - -return len; -} - -__attribute__((weak)) int _write(int file, char *ptr, int len) -{ - int DataIdx; - - for (DataIdx = 0; DataIdx < len; DataIdx++) - { - __io_putchar(*ptr++); - } - return len; -} - -caddr_t _sbrk(int incr) -{ - extern char end asm("end"); - static char *heap_end; - char *prev_heap_end; - - if (heap_end == 0) - heap_end = &end; - - prev_heap_end = heap_end; - if (heap_end + incr > stack_ptr) - { -// write(1, "Heap and stack collision\n", 25); -// abort(); - errno = ENOMEM; - return (caddr_t) -1; - } - - heap_end += incr; - - return (caddr_t) prev_heap_end; -} - -int _close(int file) -{ - return -1; -} - - -int _fstat(int file, struct stat *st) -{ - st->st_mode = S_IFCHR; - return 0; -} - -int _isatty(int file) -{ - return 1; -} - -int _lseek(int file, int ptr, int dir) -{ - return 0; -} - -int _open(char *path, int flags, ...) -{ - /* Pretend like we always fail */ - return -1; -} - -int _wait(int *status) -{ - errno = ECHILD; - return -1; -} - -int _unlink(char *name) -{ - errno = ENOENT; - return -1; -} - -int _times(struct tms *buf) -{ - return -1; -} - -int _stat(char *file, struct stat *st) -{ - st->st_mode = S_IFCHR; - return 0; -} - -int _link(char *old, char *new) -{ - errno = EMLINK; - return -1; -} - -int _fork(void) -{ - errno = EAGAIN; - return -1; -} - -int _execve(char *name, char **argv, char **env) -{ - errno = ENOMEM; - return -1; -} diff --git a/stm32-hal-freertos-uart-tensorflow/Src/ts_calibration.c b/stm32-hal-freertos-uart-tensorflow/Src/ts_calibration.c deleted file mode 100644 index a440edba..00000000 --- a/stm32-hal-freertos-uart-tensorflow/Src/ts_calibration.c +++ /dev/null @@ -1,237 +0,0 @@ -/** - ****************************************************************************** - * @file Display/LCD_Paint/Src/ts_calibration.c - * @author MCD Application Team - * @brief This application code shows how to calibrate the touchscreen. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics International N.V. - * All rights reserved.

- * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted, provided that the following conditions are met: - * - * 1. Redistribution of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of other - * contributors to this software may be used to endorse or promote products - * derived from this software without specific written permission. - * 4. This software, including modifications and/or derivative works of this - * software, must execute solely and exclusively on microcontroller or - * microprocessor devices manufactured by or for STMicroelectronics. - * 5. Redistribution and use of this software other than as permitted under - * this license is void and will automatically terminate your rights under - * this license. - * - * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY - * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT - * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/** @addtogroup STM32F4xx_HAL_Applications - * @{ - */ - -/** @addtogroup LCD_Paint - * @{ - */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -static TS_StateTypeDef TS_State; -static uint8_t Calibration_Done = 0; -static int16_t A1, A2, B1, B2; -static int16_t aPhysX[2], aPhysY[2], aLogX[2], aLogY[2]; -/* Private function prototypes -----------------------------------------------*/ -static void TouchscreenCalibration_SetHint(void); -static void GetPhysValues(int16_t LogX, int16_t LogY, int16_t * pPhysX, int16_t * pPhysY); -static void WaitForPressedState(uint8_t Pressed); -/* Private functions ---------------------------------------------------------*/ - -/** - * @brief Performs the TS calibration - * @param None - * @retval None - */ -void Touchscreen_Calibration(void) -{ - uint8_t status = 0; - uint8_t i = 0; - - TouchscreenCalibration_SetHint(); - - status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); - - if (status != TS_OK) - { - BSP_LCD_SetBackColor(LCD_COLOR_WHITE); - BSP_LCD_SetTextColor(LCD_COLOR_RED); - BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 95, (uint8_t*)"ERROR", CENTER_MODE); - BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 80, (uint8_t*)"Touchscreen cannot be initialized", CENTER_MODE); - } - - while (1) - { - if (status == TS_OK) - { - aLogX[0] = 15; - aLogY[0] = 15; - aLogX[1] = BSP_LCD_GetXSize() - 15; - aLogY[1] = BSP_LCD_GetYSize() - 15; - - for (i = 0; i < 2; i++) - { - GetPhysValues(aLogX[i], aLogY[i], &aPhysX[i], &aPhysY[i]); - } - A1 = (1000 * ( aLogX[1] - aLogX[0]))/ ( aPhysX[1] - aPhysX[0]); - B1 = (1000 * aLogX[0]) - A1 * aPhysX[0]; - - A2 = (1000 * ( aLogY[1] - aLogY[0]))/ ( aPhysY[1] - aPhysY[0]); - B2 = (1000 * aLogY[0]) - A2 * aPhysY[0]; - - Calibration_Done = 1; - return; - } - - HAL_Delay(5); - } -} - -/** - * @brief Display calibration hint - * @param None - * @retval None - */ -static void TouchscreenCalibration_SetHint(void) -{ - /* Clear the LCD */ - BSP_LCD_Clear(LCD_COLOR_WHITE); - - /* Set Touchscreen Demo description */ - BSP_LCD_SetTextColor(LCD_COLOR_BLACK); - BSP_LCD_SetBackColor(LCD_COLOR_WHITE); - - BSP_LCD_SetFont(&Font12); - BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 27, (uint8_t*)"Before using the Touchscreen", CENTER_MODE); - BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 12, (uint8_t*)"you need to calibrate it.", CENTER_MODE); - BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 3, (uint8_t*)"Press on the black circles", CENTER_MODE); -} - - -/** - * @brief Get Physical position - * @param LogX : logical X position - * @param LogY : logical Y position - * @param pPhysX : Physical X position - * @param pPhysY : Physical Y position - * @retval None - */ -static void GetPhysValues(int16_t LogX, int16_t LogY, int16_t * pPhysX, int16_t * pPhysY) -{ - /* Draw the ring */ - BSP_LCD_SetTextColor(LCD_COLOR_BLACK); - BSP_LCD_FillCircle(LogX, LogY, 5); - BSP_LCD_SetTextColor(LCD_COLOR_WHITE); - BSP_LCD_FillCircle(LogX, LogY, 2); - - /* Wait until touch is pressed */ - WaitForPressedState(1); - - BSP_TS_GetState(&TS_State); - *pPhysX = TS_State.x; - *pPhysY = TS_State.y; - - /* Wait until touch is released */ - WaitForPressedState(0); - BSP_LCD_SetTextColor(LCD_COLOR_WHITE); - BSP_LCD_FillCircle(LogX, LogY, 5); -} - -/** - * @brief wait for touch detected - * @param Pressed: touch pressed. - * @retval None - */ -static void WaitForPressedState(uint8_t Pressed) -{ - TS_StateTypeDef State; - - do - { - BSP_TS_GetState(&State); - HAL_Delay(10); - if (State.TouchDetected == Pressed) - { - uint16_t TimeStart = HAL_GetTick(); - do { - BSP_TS_GetState(&State); - HAL_Delay(10); - if (State.TouchDetected != Pressed) - { - break; - } else if ((HAL_GetTick() - 100) > TimeStart) - { - return; - } - } while (1); - } - } while (1); -} - -/** - * @brief Calibrate X position - * @param x : X position - * @retval calibrated x - */ -uint16_t Calibration_GetX(uint16_t x) -{ - return (((A1 * x) + B1)/1000); -} - -/** - * @brief Calibrate Y position - * @param y : Y position - * @retval calibrated y - */ -uint16_t Calibration_GetY(uint16_t y) -{ - return (((A2 * y) + B2)/1000); -} - -/**check if the TS is calibrated - * @param None -* @retval calibration state (1 : calibrated / 0: no) - */ -uint8_t IsCalibrationDone(void) -{ - return (Calibration_Done); -} - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/cmake b/stm32-hal-freertos-uart-tensorflow/cmake deleted file mode 120000 index 8e8a460f..00000000 --- a/stm32-hal-freertos-uart-tensorflow/cmake +++ /dev/null @@ -1 +0,0 @@ -../cmake/ \ No newline at end of file diff --git a/stm32-hal-freertos-uart-tensorflow/stm32f40g_eval.cfg b/stm32-hal-freertos-uart-tensorflow/stm32f40g_eval.cfg deleted file mode 100644 index 2a60aa2f..00000000 --- a/stm32-hal-freertos-uart-tensorflow/stm32f40g_eval.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# This is an STM3240G-EVAL board with a single STM32F407IGHx chip -# -# Generated by System Workbench for STM32 -# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s) - -source [find interface/stlink.cfg] - -set WORKAREASIZE 0x8000 - -transport select "hla_swd" - -set CHIPNAME STM32F407IGHx -set BOARDNAME STM3240G-EVAL - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STlink Debug clock frequency -set CLOCK_FREQ 4000 - -# use hardware reset, connect under reset -# connect_assert_srst needed if low power mode application running (WFI...) -reset_config srst_only srst_nogate connect_assert_srst -set CONNECT_UNDER_RESET 1 - -source [find target/stm32f4x.cfg] diff --git a/stm32-newlib/CMakeLists.txt b/stm32-newlib/CMakeLists.txt deleted file mode 100644 index cf92fc8c..00000000 --- a/stm32-newlib/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -PROJECT(stm32-newlib) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -ENABLE_LANGUAGE(ASM) - -FIND_PACKAGE(CMSIS REQUIRED) -FIND_PACKAGE(STM32HAL COMPONENTS gpio uart REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMSIS_INCLUDE_DIRS} - ${STM32HAL_INCLUDE_DIR} -) - -SET(PROJECT_SOURCES - main.c - newlib.c -) - -ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES} ${CMSIS_SOURCES} ${STM32HAL_SOURCES}) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}) \ No newline at end of file diff --git a/stm32-newlib/main.c b/stm32-newlib/main.c deleted file mode 100644 index 206974e3..00000000 --- a/stm32-newlib/main.c +++ /dev/null @@ -1,266 +0,0 @@ -#if defined STM32F1 -# include -#elif defined STM32F2 -# include -#elif defined STM32F4 -# include -#elif defined STM32G0 -#include -#endif - -#include -#include - -UART_HandleTypeDef UART_Handle; -uint64_t virtualTimer; - -void SysTick_Handler(void) -{ - HAL_IncTick(); - virtualTimer++; -} - -void initGPIO() -{ - GPIO_InitTypeDef GPIO_Config; -#if defined STM32F1 - __GPIOA_CLK_ENABLE(); - - /* USART1 */ - GPIO_Config.Mode = GPIO_MODE_AF_PP; - GPIO_Config.Pin = GPIO_PIN_9; - GPIO_Config.Pull = GPIO_NOPULL; - GPIO_Config.Speed = GPIO_SPEED_HIGH; - - HAL_GPIO_Init(GPIOA, &GPIO_Config); - - GPIO_Config.Mode = GPIO_MODE_INPUT; - GPIO_Config.Pin = GPIO_PIN_10; - - HAL_GPIO_Init(GPIOA, &GPIO_Config); -#elif defined STM32F2 - __GPIOB_CLK_ENABLE(); - - /* USART1 */ - GPIO_Config.Alternate = GPIO_AF7_USART1; - GPIO_Config.Mode = GPIO_MODE_AF_PP; - GPIO_Config.Pin = GPIO_PIN_6 | GPIO_PIN_7; - GPIO_Config.Pull = GPIO_NOPULL; - GPIO_Config.Speed = GPIO_SPEED_FAST; - - HAL_GPIO_Init(GPIOB, &GPIO_Config); -#elif defined STM32F4 - __GPIOC_CLK_ENABLE(); - - /* USART3 */ - GPIO_Config.Alternate = GPIO_AF7_USART3; - GPIO_Config.Mode = GPIO_MODE_AF_PP; - GPIO_Config.Pin = GPIO_PIN_10 | GPIO_PIN_11; - GPIO_Config.Pull = GPIO_NOPULL; - GPIO_Config.Speed = GPIO_SPEED_FAST; - - HAL_GPIO_Init(GPIOC, &GPIO_Config); -#elif defined STM32G0 - __HAL_RCC_GPIOA_CLK_ENABLE(); - - GPIO_Config.Pin = GPIO_PIN_2|GPIO_PIN_3; - GPIO_Config.Mode = GPIO_MODE_AF_PP; - GPIO_Config.Pull = GPIO_PULLUP; - GPIO_Config.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_Config.Alternate = GPIO_AF1_USART2; - - HAL_GPIO_Init(GPIOA, &GPIO_Config); -#endif -} - -void initUART() -{ -#if defined STM32F1 - __USART1_CLK_ENABLE(); - UART_Handle.Instance = USART1; -#elif defined STM32F2 - __USART1_CLK_ENABLE(); - UART_Handle.Instance = USART1; -#elif defined STM32F4 - __USART3_CLK_ENABLE(); - UART_Handle.Instance = USART3; -#elif defined STM32G0 - __HAL_RCC_USART1_CLK_ENABLE(); - UART_Handle.Instance = USART1; - -#endif - - UART_Handle.Init.BaudRate = 115200; - UART_Handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; - UART_Handle.Init.Mode = UART_MODE_TX_RX; - UART_Handle.Init.OverSampling = UART_OVERSAMPLING_16; - UART_Handle.Init.Parity = UART_PARITY_NONE; - UART_Handle.Init.StopBits = UART_STOPBITS_1; - UART_Handle.Init.WordLength = UART_WORDLENGTH_8B; - - HAL_UART_Init(&UART_Handle); -} - -void initClock(void) -{ - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - -#if defined STM32F1 - __HAL_RCC_PWR_CLK_ENABLE(); - uint8_t fLatency; - - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.LSEState = RCC_LSE_ON; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.HSICalibrationValue = 0; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - -# if (defined STM32F100xB) || (defined STM32F100xE) - // 8 MHz * 3 = 24 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL3; - fLatency = FLASH_LATENCY_0; -# elif (defined STM32F101x6) || (defined STM32F101xB) || (defined STM32F101xE) || (defined STM32F101xG) - // 8 MHz / 2 * 9 = 36 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV2; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_1; -# elif (defined STM32F102x6) || (defined STM32F102xB) - // 8 MHz * 6 = 48 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; - fLatency = FLASH_LATENCY_1; -# elif (defined STM32F103x6) || (defined STM32F103xB) || (defined STM32F103xE) || (defined STM32F103xG) - // 8 MHz * 9 = 72 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_2; -# elif (defined STM32F105xC) || (defined STM32F107xC) - // 8 MHz * 9 = 72 MHz SYSCLK - RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; - fLatency = FLASH_LATENCY_2; -# endif - - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, fLatency); - -#elif defined STM32F2 - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 25; - RCC_OscInitStruct.PLL.PLLN = 240; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 5; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); - -#elif defined STM32F4 - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - // 8 MHz * 336 / 8 / 2 = 168 MHz SYSCLK - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); - - if (HAL_GetREVID() == 0x1001) - { - __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); - } -#elif defined STM32G0 - RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; - - HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); - - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - |RCC_CLOCKTYPE_PCLK1; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0); - - PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1; - PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK1; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit); - -#endif -} - -void setTime(uint32_t time) -{ - virtualTimer = (uint64_t)time * 1000; -} - -void initAll(void) -{ - HAL_Init(); - - initClock(); - initGPIO(); - initUART(); -} - -int main(void) -{ - initAll(); - for (;;) - { - char c = 0; - time_t t; - scanf("%c", &c); - switch (c) - { - case 's': - scanf("%d", &t); - setTime(t); - printf("Current time changed: %d - %s\r", t, ctime(&t)); - break; - default: - t = time(0); - printf("Current time: %d - %s\r", t, ctime(&t)); - break; - } - } - return 0; -} diff --git a/stm32-newlib/newlib.c b/stm32-newlib/newlib.c deleted file mode 100644 index 305c6fc4..00000000 --- a/stm32-newlib/newlib.c +++ /dev/null @@ -1,174 +0,0 @@ -#include -#include -#include -#include -#include - -#if defined STM32F1 -# include -#elif defined STM32F2 -# include -#elif defined STM32F4 -# include -#elif defined STM32G0 -# include -#endif - -extern uint32_t __get_MSP(void); -extern UART_HandleTypeDef UART_Handle; -extern uint64_t virtualTimer; - -#undef errno -extern int errno; - -char *__env[1] = { 0 }; -char **environ = __env; - -int _write(int file, char *ptr, int len); - -void _exit(int status) -{ - while (1); -} - -int _close(int file) -{ - return -1; -} - -int _execve(char *name, char **argv, char **env) -{ - errno = ENOMEM; - return -1; -} - -int _fork() -{ - errno = EAGAIN; - return -1; -} - -int _fstat(int file, struct stat *st) -{ - st->st_mode = S_IFCHR; - return 0; -} - -int _getpid() -{ - return 1; -} - -int _gettimeofday(struct timeval *tv, struct timezone *tz) -{ - tv->tv_sec = virtualTimer / 1000; - tv->tv_usec = (virtualTimer % 1000) * 1000; - return 0; -} - -int _isatty(int file) -{ - switch (file) - { - case STDOUT_FILENO: - case STDERR_FILENO: - case STDIN_FILENO: - return 1; - default: - //errno = ENOTTY; - errno = EBADF; - return 0; - } -} - -int _kill(int pid, int sig) -{ - errno = EINVAL; - return (-1); -} - -int _link(char *old, char *new) -{ - errno = EMLINK; - return -1; -} - -int _lseek(int file, int ptr, int dir) -{ - return 0; -} - -caddr_t _sbrk(int incr) -{ - extern char _ebss; - static char *heap_end= &_ebss; - char *prev_heap_end; - - prev_heap_end = heap_end; - - char * stack = (char*) __get_MSP(); - if (heap_end + incr > stack) - { - _write(STDERR_FILENO, "Heap and stack collision\n", 25); - errno = ENOMEM; - return (caddr_t) - 1; - //abort (); - } - - heap_end += incr; - return (caddr_t) prev_heap_end; - -} - -int _read(int file, char *ptr, int len) -{ - switch (file) - { - case STDIN_FILENO: - HAL_UART_Receive(&UART_Handle, (uint8_t *)ptr, 1, HAL_MAX_DELAY); - return 1; - default: - errno = EBADF; - return -1; - } -} - -int _stat(const char *filepath, struct stat *st) -{ - st->st_mode = S_IFCHR; - return 0; -} - -clock_t _times(struct tms *buf) -{ - return -1; -} - -int _unlink(char *name) -{ - errno = ENOENT; - return -1; -} - -int _wait(int *status) -{ - errno = ECHILD; - return -1; -} - -int _write(int file, char *ptr, int len) -{ - switch (file) - { - case STDOUT_FILENO: /*stdout*/ - HAL_UART_Transmit(&UART_Handle, (uint8_t*)ptr, len, HAL_MAX_DELAY); - break; - case STDERR_FILENO: /* stderr */ - HAL_UART_Transmit(&UART_Handle, (uint8_t*)ptr, len, HAL_MAX_DELAY); - break; - default: - errno = EBADF; - return -1; - } - return len; -} diff --git a/stm32-template/CMakeLists.txt b/stm32-template/CMakeLists.txt deleted file mode 100644 index b9fefc5d..00000000 --- a/stm32-template/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -PROJECT(stm32-template) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -ENABLE_LANGUAGE(ASM) - -FIND_PACKAGE(CMSIS REQUIRED) -FIND_PACKAGE(STM32HAL REQUIRED) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMSIS_INCLUDE_DIRS} - ${STM32HAL_INCLUDE_DIR} -) - -SET(PROJECT_SOURCES - main.c -) - -SET(STM32_LINKER_SCRIPT ${CMSIS_LINKER_SCRIPT}) - -ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES} ${CMSIS_SOURCES} ${STM32HAL_SOURCES}) - -STM32_SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME}) -STM32_ADD_HEX_BIN_TARGETS(${CMAKE_PROJECT_NAME}) -STM32_PRINT_SIZE_OF_TARGETS(${CMAKE_PROJECT_NAME}) diff --git a/stm32-template/main.c b/stm32-template/main.c deleted file mode 100644 index 3ef68571..00000000 --- a/stm32-template/main.c +++ /dev/null @@ -1,15 +0,0 @@ -#if defined STM32F1 -# include -#elif defined STM32F2 -# include -#elif defined STM32F4 -# include -#elif defined STM32G0 -# include -#endif - -int main(void) -{ - for (;;); - return 0; -} diff --git a/tests/bsp/CMakeLists.txt b/tests/bsp/CMakeLists.txt new file mode 100644 index 00000000..30005e70 --- /dev/null +++ b/tests/bsp/CMakeLists.txt @@ -0,0 +1,75 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +if(NOT TEST_FAMILIES) + # Can't test H7 because it needs some non-free components + set(TEST_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 L0 L1 L4) +endif() + +# Nucleo boards can have different devices on it +set(DEVICE_STM32F0xx_Nucleo_32 F031K6) +set(DEVICE_STM32F0xx_Nucleo F030R8) +set(DEVICE_STM32F1xx_Nucleo F103RB) +set(DEVICE_STM32F2xx_Nucleo_144 F207ZG) +set(DEVICE_STM32F3xx_Nucleo_32 F303K8) +set(DEVICE_STM32F3xx_Nucleo F334R8) +set(DEVICE_STM32F3xx_Nucleo_144 F303ZE) +set(DEVICE_STM32F4xx_Nucleo_144 F429ZI) +set(DEVICE_STM32F4xx_Nucleo F446RE) +set(DEVICE_STM32F7xx_Nucleo_144 F746ZG) +set(DEVICE_STM32G0xx_Nucleo G070RB) +set(DEVICE_STM32G0xx_Nucleo_32 G031K8) +set(DEVICE_STM32G4xx_Nucleo G474RE) +set(DEVICE_STM32L0xx_Nucleo L053R8) +set(DEVICE_STM32L0xx_Nucleo_32 L011K4) +set(DEVICE_STM32L1xx_Nucleo L152RE) +set(DEVICE_STM32L4xx_Nucleo L412RB) +set(DEVICE_STM32L4xx_Nucleo_32 L412KB) +set(DEVICE_STM32L4xx_Nucleo_144 L496ZG) +set(DEFINES_STM32469I_EVAL USE_IOEXPANDER) +set(DEFINES_STM32F769I_EVAL USE_IOEXPANDER) +set(DEFINES_STM32L476G_EVAL USE_IOEXPANDER) +set(DEFINES_STM32L4R9I_EVAL USE_ROCKTECH_480x272) + +# Ban some boards because their BSP need non-free components +set(BANNED_BOARDS STM32756G_EVAL) + +project(bsp-test C ASM) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +find_package(CMSIS REQUIRED) +find_package(HAL REQUIRED) +find_package(BSP REQUIRED) + +set(SOURCES main.c) + +foreach(FAMILY ${TEST_FAMILIES}) + foreach(BOARD ${BSP_${FAMILY}_BOARDS}) + string(REPLACE "-" "_" BOARD ${BOARD}) + + if(BOARD IN_LIST BANNED_BOARDS) + continue() + endif() + + add_executable(bsp-test-${BOARD} ${SOURCES}) + target_link_libraries(bsp-test-${BOARD} + BSP::STM32::${BOARD} + HAL::STM32::${FAMILY} + STM32::NoSys + ) + if(DEVICE_${BOARD}) + target_link_libraries(bsp-test-${BOARD} CMSIS::STM32::${DEVICE_${BOARD}}) + endif() + if(DEFINES_${BOARD}) + target_compile_definitions(bsp-test-${BOARD} PRIVATE ${DEFINES_${BOARD}}) + endif() + foreach(COMP ${BSP_${FAMILY}_COMPONENTS}) + string(TOUPPER ${COMP} COMP) + # Workaround - F3 has both CS43L22 and CS43L52 that conflicts + if((FAMILY STREQUAL F3) AND (COMP STREQUAL CS43L22)) + continue() + endif() + target_link_libraries(bsp-test-${BOARD} BSP::STM32::${FAMILY}::${COMP}) + endforeach() + endforeach() +endforeach() diff --git a/tests/bsp/b_g474e_dpow1_conf.h b/tests/bsp/b_g474e_dpow1_conf.h new file mode 100755 index 00000000..31cd4ef0 --- /dev/null +++ b/tests/bsp/b_g474e_dpow1_conf.h @@ -0,0 +1,90 @@ +/** + ****************************************************************************** + * @file b_g474e_dpow1_conf_template.h + * @author MCD Application Team + * @brief B-G474E-DPOW1 board configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef B_G474E_DPOW1_CONF_H +#define B_G474E_DPOW1_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32g4xx_hal.h" + +/** @addtogroup BSP + * @{ + */ + +/** @addtogroup B-G474E-DPOW1 + * @{ + */ + +/** @addtogroup B-G474E-DPOW1_CONFIG + * @{ + */ + +/** @addtogroup B-G474E-DPOW1_CONFIG_Exported_Constants Exported Constants + * @{ + */ + +/* JOYstick define */ +#define USE_BSP_JOY_FEATURE 1U + +/* COM define */ +#define USE_BSP_COM_FEATURE 0U + +/* COM LOG define */ +#define USE_COM_LOG 0U + +/* USBPD BSP PWR TRACE define */ +#define USE_BSP_PWR_TRACE 0U + +#if (USE_BSP_PWR_TRACE > 0u) +#define USBPD_PWR_TRACE(_PORT_,...) UTIL_ADV_TRACE_FSend(__VA_ARGS__) +#else +#define USBPD_PWR_TRACE(_PORT_,...) +#endif /* USE_BSP_PWR_TRACE */ + +/* IRQ priorities */ +#define BSP_JOY_SEL_IT_PRIORITY 15U + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* B_G474E_DPOW1_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/main.c b/tests/bsp/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/tests/bsp/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/tests/bsp/stm32f0xx_hal_conf.h b/tests/bsp/stm32f0xx_hal_conf.h new file mode 100755 index 00000000..f1b16481 --- /dev/null +++ b/tests/bsp/stm32f0xx_hal_conf.h @@ -0,0 +1,321 @@ +/** + ****************************************************************************** + * @file stm32f0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F0xx_HAL_CONF_H +#define __STM32F0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ######################### Oscillator Values adaptation ################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT 5000U /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator for ADC (HSI14) value. + */ +#if !defined (HSI14_VALUE) + #define HSI14_VALUE 14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI14_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ + /* Warning: Must be set to higher priority for HAL_Delay() */ + /* and HAL_GetTick() usage under interrupt context */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f0xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/tests/bsp/stm32f1xx_hal_conf.h b/tests/bsp/stm32f1xx_hal_conf.h new file mode 100755 index 00000000..df420ff4 --- /dev/null +++ b/tests/bsp/stm32f1xx_hal_conf.h @@ -0,0 +1,399 @@ +/** + ****************************************************************************** + * @file stm32f1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F1xx_HAL_CONF_H +#define __STM32F1xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#if defined(USE_STM3210C_EVAL) +#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#else +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32f1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32f1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32f1xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32f1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED +#include "stm32f1xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED +#include "stm32f1xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32f1xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32f1xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32f1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32f1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32f1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32f1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32f1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32f1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32f1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32f1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32f1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32f1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32f1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32f1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED +#include "stm32f1xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED +#include "stm32f1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32f1xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32f1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32f1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32f1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32f1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32f1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32f1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32f1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32f1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED +#include "stm32f1xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED +#include "stm32f1xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t* file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-blinky/stm32f2xx_hal_conf.h b/tests/bsp/stm32f2xx_hal_conf.h old mode 100644 new mode 100755 similarity index 53% rename from stm32-blinky/stm32f2xx_hal_conf.h rename to tests/bsp/stm32f2xx_hal_conf.h index 65042ce1..c26dc66d --- a/stm32-blinky/stm32f2xx_hal_conf.h +++ b/tests/bsp/stm32f2xx_hal_conf.h @@ -1,376 +1,422 @@ -/** - ****************************************************************************** - * @file stm32f2xx_hal_conf.h - * @author MCD Application Team - * @version V1.1.0 - * @date 13-March-2014 - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F2xx_HAL_CONF_H -#define __STM32F2xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -#define HAL_DMA_MODULE_ENABLED -/* #define HAL_ETH_MODULE_ENABLED */ -#define HAL_FLASH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ - #define HAL_TIM_MODULE_ENABLED -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ - #define HAL_CORTEX_MODULE_ENABLED -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ - - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1 - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) - -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ - -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - -#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ - -#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ - -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f2xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f2xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f2xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f2xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f2xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f2xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f2xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f2xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f2xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f2xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f2xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f2xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f2xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f2xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f2xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f2xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f2xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f2xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f2xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f2xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f2xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f2xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f2xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f2xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f2xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f2xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f2xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f2xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f2xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f2xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f2xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f2xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f2xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0) -#endif /* USE_FULL_ASSERT */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F2xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32f2xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f2xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F2xx_HAL_CONF_H +#define __STM32F2xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f2xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f2xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f2xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f2xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f2xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f2xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f2xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f2xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f2xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f2xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f2xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f2xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f2xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f2xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f2xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f2xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f2xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f2xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f2xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f2xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f2xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f2xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f2xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f2xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f2xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f2xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f2xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f2xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f2xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f2xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f2xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f2xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f2xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f2xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f2xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f2xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F2xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32f3xx_hal_conf.h b/tests/bsp/stm32f3xx_hal_conf.h new file mode 100755 index 00000000..a5f7ad39 --- /dev/null +++ b/tests/bsp/stm32f3xx_hal_conf.h @@ -0,0 +1,357 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_CONF_H +#define __STM32F3xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SDADC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (8000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT (5000U) /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (40000U) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + * - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal) + * - External clock not generated on EVAL 373 + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE (8000000U) /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SDADC_REGISTER_CALLBACKS 0U /* SDADC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f3xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f3xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f3xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f3xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f3xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f3xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f3xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f3xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f3xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f3xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f3xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f3xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f3xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f3xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f3xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f3xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f3xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32f3xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f3xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f3xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f3xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f3xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32f3xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f3xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f3xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f3xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SDADC_MODULE_ENABLED + #include "stm32f3xx_hal_sdadc.h" +#endif /* HAL_SDADC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f3xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f3xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f3xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f3xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f3xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f3xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f3xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f3xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-blinky/stm32f4xx_hal_conf.h b/tests/bsp/stm32f4xx_hal_conf.h old mode 100644 new mode 100755 similarity index 51% rename from stm32-blinky/stm32f4xx_hal_conf.h rename to tests/bsp/stm32f4xx_hal_conf.h index e366b5bc..3a0dae6b --- a/stm32-blinky/stm32f4xx_hal_conf.h +++ b/tests/bsp/stm32f4xx_hal_conf.h @@ -1,36 +1,20 @@ /** ****************************************************************************** - * @file BSP/Inc/stm32f4xx_hal_conf.h + * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @version V1.2.1 - * @date 13-March-2015 - * @brief HAL configuration file + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2015 STMicroelectronics

+ *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ @@ -50,44 +34,55 @@ /** * @brief This is the list of modules to be used in the HAL driver */ -#define HAL_MODULE_ENABLED -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED #define HAL_DMA_MODULE_ENABLED -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED #define HAL_FLASH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED #define HAL_GPIO_MODULE_ENABLED -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED #define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED #define HAL_CORTEX_MODULE_ENABLED -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_FMPI2C_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED /* ########################## HSE/HSI Values adaptation ##################### */ /** @@ -96,11 +91,11 @@ * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */ /** @@ -109,31 +104,35 @@ * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ #if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ /** * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + /** * @brief External clock source for I2S peripheral * This value is used by the I2S HAL module to compute the I2S clock source * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ #endif /* EXTERNAL_CLOCK_VALUE */ /* Tip: To avoid modifying this file each time you need to use different HSE, @@ -143,55 +142,93 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used - STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */ -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1 +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ /* ########################## Assert Selection ############################## */ /** * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ -/* #define USE_FULL_ASSERT 1 */ +/* #define USE_FULL_ASSERT 1U */ /* ################## Ethernet peripheral configuration ##################### */ /* Section 1 : Ethernet peripheral configuration */ /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U /* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ /* Section 2: PHY configuration section */ /* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 +#define DP83848_PHY_ADDRESS 0x01U /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) +#define PHY_RESET_DELAY 0x000000FFU /* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) +#define PHY_CONFIG_DELAY 0x00000FFFU -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU /* Section 3: Common PHY Registers */ -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ #define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ @@ -210,9 +247,9 @@ /* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ #define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ #define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ @@ -224,6 +261,15 @@ #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ #define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + /* Includes ------------------------------------------------------------------*/ /** * @brief Include module's header file @@ -237,6 +283,10 @@ #include "stm32f4xx_hal_gpio.h" #endif /* HAL_GPIO_MODULE_ENABLED */ +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ @@ -253,6 +303,10 @@ #include "stm32f4xx_hal_can.h" #endif /* HAL_CAN_MODULE_ENABLED */ +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + #ifdef HAL_CRC_MODULE_ENABLED #include "stm32f4xx_hal_crc.h" #endif /* HAL_CRC_MODULE_ENABLED */ @@ -299,7 +353,7 @@ #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -309,6 +363,10 @@ #include "stm32f4xx_hal_i2c.h" #endif /* HAL_I2C_MODULE_ENABLED */ +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + #ifdef HAL_I2S_MODULE_ENABLED #include "stm32f4xx_hal_i2s.h" #endif /* HAL_I2S_MODULE_ENABLED */ @@ -377,21 +435,53 @@ #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function + * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else - #define assert_param(expr) ((void)0) + #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ @@ -400,6 +490,6 @@ #endif #endif /* __STM32F4xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32f7xx_hal_conf.h b/tests/bsp/stm32f7xx_hal_conf.h new file mode 100755 index 00000000..b27f66e4 --- /dev/null +++ b/tests/bsp/stm32f7xx_hal_conf.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U /* To enable prefetch */ +#define ART_ACCLERATOR_ENABLE 1U /* To enable ART Accelerator */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11U) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12U) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001U) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002U) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001U) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020U) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000U) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f7xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-newlib/stm32g0xx_hal_conf.h b/tests/bsp/stm32g0xx_hal_conf.h old mode 100644 new mode 100755 similarity index 68% rename from stm32-newlib/stm32g0xx_hal_conf.h rename to tests/bsp/stm32g0xx_hal_conf.h index 3e7d462b..f1a7aba3 --- a/stm32-newlib/stm32g0xx_hal_conf.h +++ b/tests/bsp/stm32g0xx_hal_conf.h @@ -1,326 +1,314 @@ -/** - ****************************************************************************** - * @file stm32g0xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration template file. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2019 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef STM32G0xx_HAL_CONF_H -#define STM32G0xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_COMP_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## Register Callbacks selection ############################## */ -/** - * @brief This is the list of modules where register callback can be used - */ -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_CEC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_DAC_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_I2S_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) -#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations -in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S1 peripheral - * This value is used by the RCC HAL module to compute the I2S1 clock source - * frequency. - */ -#if !defined (EXTERNAL_I2S1_CLOCK_VALUE) -#define EXTERNAL_I2S1_CLOCK_VALUE 48000U /*!< Value of the I2S1 External clock source in Hz*/ -#endif /* EXTERNAL_I2S1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* ################## CRYP peripheral configuration ########################## */ - -#define USE_HAL_CRYP_SUSPEND_RESUME 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32g0xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32g0xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32g0xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32g0xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32g0xx_hal_adc.h" -#include "stm32g0xx_hal_adc_ex.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32g0xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32g0xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32g0xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32g0xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32g0xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32g0xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32g0xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32g0xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32g0xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32g0xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32g0xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32g0xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32g0xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32g0xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32g0xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32g0xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32g0xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32g0xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32g0xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32g0xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32g0xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32g0xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for functions parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ -void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* STM32G0xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32g0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2018 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G0xx_HAL_CONF_H +#define STM32G0xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_CEC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_DAC_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_I2S_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations +in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S1 peripheral + * This value is used by the RCC HAL module to compute the I2S1 clock source + * frequency. + */ +#if !defined (EXTERNAL_I2S1_CLOCK_VALUE) +#define EXTERNAL_I2S1_CLOCK_VALUE (48000UL) /*!< Value of the I2S1 External clock source in Hz*/ +#endif /* EXTERNAL_I2S1_CLOCK_VALUE */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* ################## CRYP peripheral configuration ########################## */ + +#define USE_HAL_CRYP_SUSPEND_RESUME 1U + + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include modules header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g0xx_hal_adc.h" +#include "stm32g0xx_hal_adc_ex.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32g0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for functions parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32g474e_eval_conf.h b/tests/bsp/stm32g474e_eval_conf.h new file mode 100755 index 00000000..d3c4d1dd --- /dev/null +++ b/tests/bsp/stm32g474e_eval_conf.h @@ -0,0 +1,115 @@ +/** + ****************************************************************************** + * @file stm32g474e_eval_conf_template.h + * @author MCD Application Team + * @brief STM32G474E-EVAL board configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G474E_EVAL_CONF_H +#define STM32G474E_EVAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32g4xx_hal.h" +#include "stm32g474e_eval_errno.h" +/** @addtogroup BSP + * @{ + */ + +/** @addtogroup STM32G474E-EVAL + * @{ + */ + +/** @defgroup STM32G474E-EVAL_CONFIG STM32G474E-EVAL CONFIG + * @{ + */ + +/** @defgroup STM32G474E-EVAL_CONFIG_Exported_Constants Exported Constants + * @{ + */ + +/* COM define */ +#define USE_BSP_COM_FEATURE 1U + +/* COM LOG define */ +#define USE_COM_LOG 0U + +/* POT define */ +#define USE_BSP_POT_FEATURE 1U + +/* COMP define : + depends on SB8 and SB10 configuration : refer to UM */ +#define USE_BSP_POT_COMP_FEATURE 0U + +/* IO Expander define */ +#define USE_BSP_IO_CLASS 1U + +/* JOY define */ +#define USE_BSP_JOY_FEATURE 1U + +/* USBPD BSP PWR TRACE define */ +#define USE_BSP_PWR_TRACE 0U + +#if (USE_BSP_PWR_TRACE > 0u) +#define USBPD_PWR_TRACE(_PORT_,...) UTIL_ADV_TRACE_FSend(__VA_ARGS__) +#else +#define USBPD_PWR_TRACE(_PORT_,...) +#endif /* USE_BSP_PWR_TRACE */ + +/* IRQ priorities */ +#define BSP_SRAM_IT_PRIORITY 15U +#define BSP_IOEXPANDER_IT_PRIORITY 14U +#define BSP_BUTTON_USER_IT_PRIORITY 15U +#define BSP_AUDIO_OUT_IT_PRIORITY 13U +#define BSP_AUDIO_IN_IT_PRIORITY 12U + +/* Audio codecs defines */ +#define USE_AUDIO_CODEC_WM8994 1U + +/* Default Audio IN internal buffer size */ +#define DEFAULT_AUDIO_IN_BUFFER_SIZE 2048U + +/* I2C3 Frequency in Hz */ +#define BUS_I2C3_FREQUENCY 100000U /* Frequency of I2C3 = 100 kHz*/ + +/* SPI2 Baud rate in bps */ +#define BUS_SPI2_BAUDRATE 12500000U /* baud rate of SPIn = 12.5 Mbps */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G474E_EVAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32g4xx_hal_conf.h b/tests/bsp/stm32g4xx_hal_conf.h new file mode 100755 index 00000000..e5183918 --- /dev/null +++ b/tests/bsp/stm32g4xx_hal_conf.h @@ -0,0 +1,382 @@ +/** + ****************************************************************************** + * @file stm32g4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G4xx_HAL_CONF_H +#define STM32G4xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORDIC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_FMAC_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CORDIC_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_EXTI_REGISTER_CALLBACKS 0U +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U +#define USE_HAL_FMAC_REGISTER_CALLBACKS 0U +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE (48000000UL) /*!< Value of the Internal High Speed oscillator for USB FS/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +/*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations in voltage and temperature.*/ +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S and SAI peripherals + * This value is used by the I2S and SAI HAL modules to compute the I2S and SAI clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) +#define EXTERNAL_CLOCK_VALUE (48000UL) /*!< Value of the External clock source in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x0FUL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORDIC_MODULE_ENABLED +#include "stm32g4xx_hal_cordic.h" +#endif /* HAL_CORDIC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED +#include "stm32g4xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_FMAC_MODULE_ENABLED +#include "stm32g4xx_hal_fmac.h" +#endif /* HAL_FMAC_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED +#include "stm32g4xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32g4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32g4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32g4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32g4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32g4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32g4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32g4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32g4xx_nucleo_conf.h b/tests/bsp/stm32g4xx_nucleo_conf.h new file mode 100755 index 00000000..8b97fc25 --- /dev/null +++ b/tests/bsp/stm32g4xx_nucleo_conf.h @@ -0,0 +1,80 @@ +/** + ****************************************************************************** + * @file stm32g4xx_nucleo_conf_template.h + * @author MCD Application Team + * @brief STM32G4xx_Nucleo board configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G4XX_NUCLEO_CONF_H +#define STM32G4XX_NUCLEO_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32g4xx_hal.h" + +/** @addtogroup BSP + * @{ + */ + +/** @addtogroup STM32G4XX_NUCLEO + * @{ + */ + +/** @defgroup STM32G4XX_NUCLEO_CONFIG Config + * @{ + */ + +/** @defgroup STM32G4XX_NUCLEO_CONFIG_Exported_Constants Exported Constants + * @{ + */ +/* Uncomment one of the board define below */ +/* #define USE_NUCLEO_32 */ +#define USE_NUCLEO_64 + +/* COM usage define */ +#define USE_BSP_COM_FEATURE 0U + +/* COM log define */ +#define USE_COM_LOG 0U + +/* IRQ priorities */ +#define BSP_BUTTON_USER_IT_PRIORITY 15U +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G4XX_NUCLEO_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32h7xx_hal_conf.h b/tests/bsp/stm32h7xx_hal_conf.h new file mode 100755 index 00000000..70d54f87 --- /dev/null +++ b/tests/bsp/stm32h7xx_hal_conf.h @@ -0,0 +1,501 @@ +/** + ****************************************************************************** + * @file stm32h7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32h7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32H7xx_HAL_CONF_H +#define STM32H7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DTS_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_OTFDEC_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RAMECC_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal oscillator (CSI) default value. + * This value is the default CSI value after Reset. + */ +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */ +#define USE_SPI_CRC 1U /*!< use CRC in SPI */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################### Ethernet Configuration ######################### */ +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ + +#define ETH_MAC_ADDR0 ((uint8_t)0x02) +#define ETH_MAC_ADDR1 ((uint8_t)0x00) +#define ETH_MAC_ADDR2 ((uint8_t)0x00) +#define ETH_MAC_ADDR3 ((uint8_t)0x00) +#define ETH_MAC_ADDR4 ((uint8_t)0x00) +#define ETH_MAC_ADDR5 ((uint8_t)0x00) + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32h7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32h7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32h7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_MDMA_MODULE_ENABLED + #include "stm32h7xx_hal_mdma.h" +#endif /* HAL_MDMA_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32h7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32h7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32h7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32h7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32h7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DTS_MODULE_ENABLED + #include "stm32h7xx_hal_dts.h" +#endif /* HAL_DTS_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32h7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32h7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32h7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32h7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED + #include "stm32h7xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32h7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32h7xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32h7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32h7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32h7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32h7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32h7xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32h7xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32h7xx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32h7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32h7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32h7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32h7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32h7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32h7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32h7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32h7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32h7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32h7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32h7xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32h7xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_OTFDEC_MODULE_ENABLED +#include "stm32h7xx_hal_otfdec.h" +#endif /* HAL_OTFDEC_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32h7xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32h7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32h7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RAMECC_MODULE_ENABLED + #include "stm32h7xx_hal_ramecc.h" +#endif /* HAL_RAMECC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32h7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32h7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32h7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32h7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32h7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32h7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32h7xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32h7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32h7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32h7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32h7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32h7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32h7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32h7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32h7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32h7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32H7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-blinky/stm32l0xx_hal_conf.h b/tests/bsp/stm32l0xx_hal_conf.h old mode 100644 new mode 100755 similarity index 80% rename from stm32-blinky/stm32l0xx_hal_conf.h rename to tests/bsp/stm32l0xx_hal_conf.h index 3d10ff8c..bb6f1314 --- a/stm32-blinky/stm32l0xx_hal_conf.h +++ b/tests/bsp/stm32l0xx_hal_conf.h @@ -1,316 +1,338 @@ -/** - ****************************************************************************** - * @file stm32l0xx_hal_conf.h - * @author MCD Application Team - * @version V1.8.0 - * @date 25-November-2016 - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32l0xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32L0xx_HAL_CONF_H -#define __STM32L0xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -#define HAL_COMP_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_CRYP_MODULE_ENABLED -#define HAL_DAC_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FIREWALL_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -#define HAL_IWDG_MODULE_ENABLED -#define HAL_LCD_MODULE_ENABLED -#define HAL_LPTIM_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_TSC_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -#define HAL_IRDA_MODULE_ENABLED -#define HAL_SMARTCARD_MODULE_ENABLED -#define HAL_SMBUS_MODULE_ENABLED -#define HAL_WWDG_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_PCD_MODULE_ENABLED - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined (MSI_VALUE) - #define MSI_VALUE ((uint32_t)2000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal High Speed oscillator for USB (HSI48) value. - */ -#if !defined (HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. - The real value may vary depending on the variations - in voltage and temperature. */ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -/** - * @brief Time out for LSE start up value in ms. - */ -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define PREREAD_ENABLE 0U -#define BUFFER_CACHE_DISABLE 0U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32l0xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32l0xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32l0xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32l0xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32l0xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32l0xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32l0xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32l0xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32l0xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FIREWALL_MODULE_ENABLED - #include "stm32l0xx_hal_firewall.h" -#endif /* HAL_FIREWALL_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32l0xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32l0xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32l0xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32l0xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED - #include "stm32l0xx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32l0xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32l0xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32l0xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32l0xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32l0xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32l0xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED - #include "stm32l0xx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32l0xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32l0xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32l0xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32l0xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32l0xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32l0xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32l0xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32L0xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define PREREAD_ENABLE 0U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/tests/bsp/stm32l1xx_hal_conf.h b/tests/bsp/stm32l1xx_hal_conf.h new file mode 100755 index 00000000..c37ed86e --- /dev/null +++ b/tests/bsp/stm32l1xx_hal_conf.h @@ -0,0 +1,319 @@ +/** + ****************************************************************************** + * @file stm32l1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L1xx_HAL_CONF_H +#define __STM32L1xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE (2097000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x000FU) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SDMMC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l1xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l1xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l1xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l1xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/bsp/stm32l4xx_hal_conf.h b/tests/bsp/stm32l4xx_hal_conf.h new file mode 100755 index 00000000..ca41261f --- /dev/null +++ b/tests/bsp/stm32l4xx_hal_conf.h @@ -0,0 +1,480 @@ +/** + ****************************************************************************** + * @file stm32l4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32L4xx_HAL_CONF_H +#define STM32L4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/** + * @brief External clock source for SAI2 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI2_CLOCK_VALUE) + #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/ +#endif /* EXTERNAL_SAI2_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l4xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32l4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32l4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32l4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32l4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32l4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32l4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32l4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32l4xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l4xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32l4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32l4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l4xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32l4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32l4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32l4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32l4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32l4xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32l4xx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32l4xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32l4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32l4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32l4xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l4xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32L4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/cmsis/CMakeLists.txt b/tests/cmsis/CMakeLists.txt new file mode 100644 index 00000000..bd667f69 --- /dev/null +++ b/tests/cmsis/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +if(NOT TEST_FAMILIES) + set(TEST_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4) +endif() + +project(cmsis-test C ASM) + +find_package(CMSIS REQUIRED) + +set(SOURCES main.c) + +include(stm32/devices) + +foreach(FAMILY ${TEST_FAMILIES}) + stm32_get_devices_by_family(DEVICES FAMILY ${FAMILY}) + stm32_get_cores(CORES FAMILY ${FAMILY}) + foreach(DEVICE ${DEVICES}) + stm32_get_chip_type(${FAMILY} ${DEVICE} TYPE) + + if(NOT CORES) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} FLASH SIZE FLASH_SIZE) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} RAM SIZE RAM_SIZE) + message(STATUS "STM32${DEVICE}: ${FAMILY} family, type ${TYPE}, ${FLASH_SIZE} flash, ${RAM_SIZE} RAM") + add_executable(cmsis-test-${DEVICE} ${SOURCES}) + target_link_libraries(cmsis-test-${DEVICE} CMSIS::STM32::${DEVICE} STM32::NoSys) + else() + stm32_get_cores(CORES FAMILY ${FAMILY} DEVICE ${DEVICE}) + foreach(CORE ${DEV_CORES}) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} FLASH SIZE FLASH_SIZE) + stm32_get_memory_info(FAMILY ${FAMILY} DEVICE ${DEVICE} CORE ${CORE} RAM SIZE RAM_SIZE) + message(STATUS "STM32${DEVICE}: ${FAMILY} family, type ${TYPE}, core ${CORE}, ${FLASH_SIZE} flash, ${RAM_SIZE} RAM") + add_executable(cmsis-test-${DEVICE}-${CORE} ${SOURCES}) + target_link_libraries(cmsis-test-${DEVICE}-${CORE} CMSIS::STM32::${DEVICE}::${CORE} STM32::NoSys) + endforeach() + endif() + endforeach() +endforeach() diff --git a/tests/cmsis/main.c b/tests/cmsis/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/tests/cmsis/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/tests/fetch/CMakeLists.txt b/tests/fetch/CMakeLists.txt new file mode 100644 index 00000000..9a691fb9 --- /dev/null +++ b/tests/fetch/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +if(NOT TEST_FAMILIES) + set(TEST_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4) +endif() + +project(fetch-test C ASM) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +stm32_fetch_cmsis(${TEST_FAMILIES}) +stm32_fetch_hal(${TEST_FAMILIES}) + +find_package(CMSIS REQUIRED) +find_package(HAL REQUIRED) + +set(SOURCES main.c) + +foreach(FAMILY ${TEST_FAMILIES}) + stm32_get_devices_by_family(DEVICES FAMILY ${FAMILY}) + list(GET DEVICES 0 DEVICE) + stm32_get_cores(CORES FAMILY ${FAMILY} DEVICE ${DEVICE}) + + if(CORES) + list(GET CORES 0 CORE) + set(CORE "::${CORE}") + else() + unset(CORE) + endif() + + add_executable(fetch-test-${FAMILY} ${SOURCES}) + target_link_libraries(fetch-test-${FAMILY} STM32::NoSys HAL::STM32::${FAMILY}${CORE}::CORTEX CMSIS::STM32::${DEVICE}${CORE}) +endforeach() diff --git a/tests/fetch/main.c b/tests/fetch/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/tests/fetch/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/tests/fetch/stm32f0xx_hal_conf.h b/tests/fetch/stm32f0xx_hal_conf.h new file mode 100644 index 00000000..0e9a50ef --- /dev/null +++ b/tests/fetch/stm32f0xx_hal_conf.h @@ -0,0 +1,321 @@ +/** + ****************************************************************************** + * @file stm32f0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F0xx_HAL_CONF_H +#define __STM32F0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ######################### Oscillator Values adaptation ################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT 5000U /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator for ADC (HSI14) value. + */ +#if !defined (HSI14_VALUE) + #define HSI14_VALUE 14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI14_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ + /* Warning: Must be set to higher priority for HAL_Delay() */ + /* and HAL_GetTick() usage under interrupt context */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f0xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/stm32-newlib/stm32f1xx_hal_conf.h b/tests/fetch/stm32f1xx_hal_conf.h similarity index 51% rename from stm32-newlib/stm32f1xx_hal_conf.h rename to tests/fetch/stm32f1xx_hal_conf.h index c7651596..097720be 100644 --- a/stm32-newlib/stm32f1xx_hal_conf.h +++ b/tests/fetch/stm32f1xx_hal_conf.h @@ -1,367 +1,399 @@ -/** - ****************************************************************************** - * @file stm32f1xx_hal_conf.h - * @author MCD Application Team - * @version V1.0.0 - * @date 15-December-2014 - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f1xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F1xx_HAL_CONF_H -#define __STM32F1xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -// #define HAL_ADC_MODULE_ENABLED -// #define HAL_CAN_MODULE_ENABLED -// #define HAL_CEC_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -// #define HAL_CRC_MODULE_ENABLED -// #define HAL_DAC_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -// #define HAL_ETH_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -// #define HAL_HCD_MODULE_ENABLED -// #define HAL_I2C_MODULE_ENABLED -// #define HAL_I2S_MODULE_ENABLED -// #define HAL_IRDA_MODULE_ENABLED -// #define HAL_IWDG_MODULE_ENABLED -// #define HAL_NAND_MODULE_ENABLED -// #define HAL_NOR_MODULE_ENABLED -// #define HAL_PCCARD_MODULE_ENABLED -// #define HAL_PCD_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -// #define HAL_RTC_MODULE_ENABLED -// #define HAL_SD_MODULE_ENABLED -// #define HAL_SMARTCARD_MODULE_ENABLED -// #define HAL_SPI_MODULE_ENABLED -// #define HAL_SRAM_MODULE_ENABLED -// #define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -// #define HAL_USART_MODULE_ENABLED -// #define HAL_WWDG_MODULE_ENABLED - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#if defined(USE_STM3210C_EVAL) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#else - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x000F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/*#define USE_FULL_ASSERT 1*/ - - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)8) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) - -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ - -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - -#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ - -#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ - -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ - - - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f1xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f1xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f1xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f1xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f1xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f1xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f1xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f1xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f1xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f1xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f1xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f1xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f1xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f1xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f1xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f1xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f1xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f1xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f1xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f1xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f1xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f1xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f1xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f1xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f1xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f1xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f1xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f1xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f1xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f1xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F1xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32f1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F1xx_HAL_CONF_H +#define __STM32F1xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#if defined(USE_STM3210C_EVAL) +#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#else +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32f1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32f1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32f1xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32f1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED +#include "stm32f1xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED +#include "stm32f1xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32f1xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32f1xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32f1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32f1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32f1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32f1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32f1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32f1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32f1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32f1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32f1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32f1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32f1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32f1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED +#include "stm32f1xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED +#include "stm32f1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32f1xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32f1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32f1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32f1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32f1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32f1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32f1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32f1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32f1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED +#include "stm32f1xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED +#include "stm32f1xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t* file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-newlib/stm32f2xx_hal_conf.h b/tests/fetch/stm32f2xx_hal_conf.h similarity index 53% rename from stm32-newlib/stm32f2xx_hal_conf.h rename to tests/fetch/stm32f2xx_hal_conf.h index cf86cc1d..c26dc66d 100644 --- a/stm32-newlib/stm32f2xx_hal_conf.h +++ b/tests/fetch/stm32f2xx_hal_conf.h @@ -1,376 +1,422 @@ -/** - ****************************************************************************** - * @file stm32f2xx_hal_conf.h - * @author MCD Application Team - * @version V1.1.0 - * @date 13-March-2014 - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F2xx_HAL_CONF_H -#define __STM32F2xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -#define HAL_DMA_MODULE_ENABLED -/* #define HAL_ETH_MODULE_ENABLED */ -#define HAL_FLASH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ - // #define HAL_TIM_MODULE_ENABLED - #define HAL_UART_MODULE_ENABLED - // #define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ - #define HAL_CORTEX_MODULE_ENABLED -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ - - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1 - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FF) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF) - -#define PHY_READ_TO ((uint32_t)0x0000FFFF) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFF) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ - -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - -#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ - -#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ - -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f2xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f2xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f2xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f2xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f2xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f2xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f2xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f2xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f2xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f2xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f2xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f2xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f2xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f2xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f2xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f2xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f2xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f2xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f2xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f2xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f2xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f2xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f2xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f2xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f2xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f2xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f2xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f2xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f2xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f2xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f2xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f2xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f2xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0) -#endif /* USE_FULL_ASSERT */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F2xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32f2xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f2xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F2xx_HAL_CONF_H +#define __STM32F2xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f2xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f2xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f2xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f2xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f2xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f2xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f2xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f2xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f2xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f2xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f2xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f2xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f2xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f2xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f2xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f2xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f2xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f2xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f2xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f2xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f2xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f2xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f2xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f2xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f2xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f2xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f2xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f2xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f2xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f2xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f2xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f2xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f2xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f2xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f2xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f2xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F2xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32f3xx_hal_conf.h b/tests/fetch/stm32f3xx_hal_conf.h new file mode 100644 index 00000000..a5f7ad39 --- /dev/null +++ b/tests/fetch/stm32f3xx_hal_conf.h @@ -0,0 +1,357 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_CONF_H +#define __STM32F3xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SDADC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (8000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT (5000U) /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (40000U) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + * - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal) + * - External clock not generated on EVAL 373 + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE (8000000U) /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SDADC_REGISTER_CALLBACKS 0U /* SDADC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f3xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f3xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f3xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f3xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f3xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f3xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f3xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f3xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f3xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f3xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f3xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f3xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f3xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f3xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f3xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f3xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f3xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32f3xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f3xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f3xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f3xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f3xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32f3xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f3xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f3xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f3xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SDADC_MODULE_ENABLED + #include "stm32f3xx_hal_sdadc.h" +#endif /* HAL_SDADC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f3xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f3xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f3xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f3xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f3xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f3xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f3xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f3xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_hal_conf.h b/tests/fetch/stm32f4xx_hal_conf.h similarity index 72% rename from stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_hal_conf.h rename to tests/fetch/stm32f4xx_hal_conf.h index 3080e287..37c8780f 100644 --- a/stm32-hal-freertos-uart-tensorflow/Inc/stm32f4xx_hal_conf.h +++ b/tests/fetch/stm32f4xx_hal_conf.h @@ -1,457 +1,495 @@ -/** - ****************************************************************************** - * @file Display/LCD_Paint/Inc/stm32f4xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2017 STMicroelectronics

> - * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -#define HAL_DCMI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -#define HAL_FLASH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_CORTEX_MODULE_ENABLED -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE (25000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE (32000U) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE (12288000U) /*!< Value of the external oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY (0x0FU) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used - STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */ -#define INSTRUCTION_CACHE_ENABLE 1 -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2 -#define MAC_ADDR1 0 -#define MAC_ADDR2 0 -#define MAC_ADDR3 0 -#define MAC_ADDR4 0 -#define MAC_ADDR5 0 - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB (4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB (4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848 PHY Address*/ -#define DP83848_PHY_ADDRESS 0x01 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY (0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY (0x00000FFFU) - -#define PHY_READ_TO (0x0000FFFFU) -#define PHY_WRITE_TO (0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ - -#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */ -#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */ -#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */ - -#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ -#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ - -#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ -#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ - -#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020U) /*!< Enable Interrupt on change of link status */ -#define PHY_LINK_INTERRUPT ((uint16_t)0x2000U) /*!< PHY link status interrupt mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 1U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED - #include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_FMPI2C_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32f7xx_hal_conf.h b/tests/fetch/stm32f7xx_hal_conf.h new file mode 100644 index 00000000..b27f66e4 --- /dev/null +++ b/tests/fetch/stm32f7xx_hal_conf.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U /* To enable prefetch */ +#define ART_ACCLERATOR_ENABLE 1U /* To enable ART Accelerator */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11U) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12U) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001U) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002U) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001U) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020U) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000U) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f7xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/stm32-blinky/stm32g0xx_hal_conf.h b/tests/fetch/stm32g0xx_hal_conf.h similarity index 68% rename from stm32-blinky/stm32g0xx_hal_conf.h rename to tests/fetch/stm32g0xx_hal_conf.h index 99b9fcd5..f1a7aba3 100644 --- a/stm32-blinky/stm32g0xx_hal_conf.h +++ b/tests/fetch/stm32g0xx_hal_conf.h @@ -1,326 +1,314 @@ -/** - ****************************************************************************** - * @file stm32g0xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration template file. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2019 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef STM32G0xx_HAL_CONF_H -#define STM32G0xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -/* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_COMP_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -#define HAL_TIM_MODULE_ENABLED -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## Register Callbacks selection ############################## */ -/** - * @brief This is the list of modules where register callback can be used - */ -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_CEC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_DAC_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_I2S_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) -#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations -in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S1 peripheral - * This value is used by the RCC HAL module to compute the I2S1 clock source - * frequency. - */ -#if !defined (EXTERNAL_I2S1_CLOCK_VALUE) -#define EXTERNAL_I2S1_CLOCK_VALUE 48000U /*!< Value of the I2S1 External clock source in Hz*/ -#endif /* EXTERNAL_I2S1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* ################## CRYP peripheral configuration ########################## */ - -#define USE_HAL_CRYP_SUSPEND_RESUME 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32g0xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32g0xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32g0xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32g0xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32g0xx_hal_adc.h" -#include "stm32g0xx_hal_adc_ex.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32g0xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32g0xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32g0xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32g0xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32g0xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32g0xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32g0xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32g0xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32g0xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32g0xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32g0xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32g0xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32g0xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32g0xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32g0xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32g0xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32g0xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32g0xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32g0xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32g0xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32g0xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32g0xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for functions parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ -void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* STM32G0xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32g0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2018 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G0xx_HAL_CONF_H +#define STM32G0xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_CEC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_DAC_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_I2S_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations +in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S1 peripheral + * This value is used by the RCC HAL module to compute the I2S1 clock source + * frequency. + */ +#if !defined (EXTERNAL_I2S1_CLOCK_VALUE) +#define EXTERNAL_I2S1_CLOCK_VALUE (48000UL) /*!< Value of the I2S1 External clock source in Hz*/ +#endif /* EXTERNAL_I2S1_CLOCK_VALUE */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* ################## CRYP peripheral configuration ########################## */ + +#define USE_HAL_CRYP_SUSPEND_RESUME 1U + + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include modules header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g0xx_hal_adc.h" +#include "stm32g0xx_hal_adc_ex.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32g0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for functions parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32g4xx_hal_conf.h b/tests/fetch/stm32g4xx_hal_conf.h new file mode 100644 index 00000000..e5183918 --- /dev/null +++ b/tests/fetch/stm32g4xx_hal_conf.h @@ -0,0 +1,382 @@ +/** + ****************************************************************************** + * @file stm32g4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G4xx_HAL_CONF_H +#define STM32G4xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORDIC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_FMAC_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CORDIC_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_EXTI_REGISTER_CALLBACKS 0U +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U +#define USE_HAL_FMAC_REGISTER_CALLBACKS 0U +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE (48000000UL) /*!< Value of the Internal High Speed oscillator for USB FS/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +/*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations in voltage and temperature.*/ +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S and SAI peripherals + * This value is used by the I2S and SAI HAL modules to compute the I2S and SAI clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) +#define EXTERNAL_CLOCK_VALUE (48000UL) /*!< Value of the External clock source in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x0FUL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORDIC_MODULE_ENABLED +#include "stm32g4xx_hal_cordic.h" +#endif /* HAL_CORDIC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED +#include "stm32g4xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_FMAC_MODULE_ENABLED +#include "stm32g4xx_hal_fmac.h" +#endif /* HAL_FMAC_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED +#include "stm32g4xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32g4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32g4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32g4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32g4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32g4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32g4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32g4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32h7xx_hal_conf.h b/tests/fetch/stm32h7xx_hal_conf.h new file mode 100644 index 00000000..70d54f87 --- /dev/null +++ b/tests/fetch/stm32h7xx_hal_conf.h @@ -0,0 +1,501 @@ +/** + ****************************************************************************** + * @file stm32h7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32h7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32H7xx_HAL_CONF_H +#define STM32H7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DTS_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_OTFDEC_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RAMECC_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal oscillator (CSI) default value. + * This value is the default CSI value after Reset. + */ +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */ +#define USE_SPI_CRC 1U /*!< use CRC in SPI */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################### Ethernet Configuration ######################### */ +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ + +#define ETH_MAC_ADDR0 ((uint8_t)0x02) +#define ETH_MAC_ADDR1 ((uint8_t)0x00) +#define ETH_MAC_ADDR2 ((uint8_t)0x00) +#define ETH_MAC_ADDR3 ((uint8_t)0x00) +#define ETH_MAC_ADDR4 ((uint8_t)0x00) +#define ETH_MAC_ADDR5 ((uint8_t)0x00) + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32h7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32h7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32h7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_MDMA_MODULE_ENABLED + #include "stm32h7xx_hal_mdma.h" +#endif /* HAL_MDMA_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32h7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32h7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32h7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32h7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32h7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DTS_MODULE_ENABLED + #include "stm32h7xx_hal_dts.h" +#endif /* HAL_DTS_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32h7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32h7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32h7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32h7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED + #include "stm32h7xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32h7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32h7xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32h7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32h7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32h7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32h7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32h7xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32h7xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32h7xx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32h7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32h7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32h7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32h7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32h7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32h7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32h7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32h7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32h7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32h7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32h7xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32h7xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_OTFDEC_MODULE_ENABLED +#include "stm32h7xx_hal_otfdec.h" +#endif /* HAL_OTFDEC_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32h7xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32h7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32h7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RAMECC_MODULE_ENABLED + #include "stm32h7xx_hal_ramecc.h" +#endif /* HAL_RAMECC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32h7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32h7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32h7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32h7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32h7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32h7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32h7xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32h7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32h7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32h7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32h7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32h7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32h7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32h7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32h7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32h7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32H7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32l0xx_hal_conf.h b/tests/fetch/stm32l0xx_hal_conf.h new file mode 100644 index 00000000..bb6f1314 --- /dev/null +++ b/tests/fetch/stm32l0xx_hal_conf.h @@ -0,0 +1,338 @@ +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define PREREAD_ENABLE 0U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/tests/fetch/stm32l1xx_hal_conf.h b/tests/fetch/stm32l1xx_hal_conf.h new file mode 100644 index 00000000..c37ed86e --- /dev/null +++ b/tests/fetch/stm32l1xx_hal_conf.h @@ -0,0 +1,319 @@ +/** + ****************************************************************************** + * @file stm32l1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L1xx_HAL_CONF_H +#define __STM32L1xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE (2097000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x000FU) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SDMMC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l1xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l1xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l1xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l1xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/fetch/stm32l4xx_hal_conf.h b/tests/fetch/stm32l4xx_hal_conf.h new file mode 100644 index 00000000..ca41261f --- /dev/null +++ b/tests/fetch/stm32l4xx_hal_conf.h @@ -0,0 +1,480 @@ +/** + ****************************************************************************** + * @file stm32l4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32L4xx_HAL_CONF_H +#define STM32L4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/** + * @brief External clock source for SAI2 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI2_CLOCK_VALUE) + #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/ +#endif /* EXTERNAL_SAI2_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l4xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32l4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32l4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32l4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32l4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32l4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32l4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32l4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32l4xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l4xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32l4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32l4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l4xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32l4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32l4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32l4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32l4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32l4xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32l4xx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32l4xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32l4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32l4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32l4xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l4xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32L4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/CMakeLists.txt b/tests/hal/CMakeLists.txt new file mode 100644 index 00000000..df85d9be --- /dev/null +++ b/tests/hal/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.13) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake) + +if(NOT TEST_FAMILIES) + set(TEST_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4) +endif() + +project(hal-test C ASM) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +find_package(CMSIS REQUIRED) +find_package(HAL REQUIRED) + +set(SOURCES main.c) + +foreach(FAMILY ${TEST_FAMILIES}) + stm32_get_devices_by_family(DEVICES FAMILY ${FAMILY}) + list(GET DEVICES 0 DEVICE) + stm32_get_cores(CORES FAMILY ${FAMILY} DEVICE ${DEVICE}) + + if(CORES) + list(GET CORES 0 CORE) + set(CORE "::${CORE}") + else() + unset(CORE) + endif() + + add_executable(hal-test-${FAMILY} ${SOURCES}) + + foreach(DRIVER ${HAL_DRIVERS_${FAMILY}}) + string(TOUPPER ${DRIVER} DRIVER) + target_link_libraries(hal-test-${FAMILY} HAL::STM32::${FAMILY}${CORE}::${DRIVER}) + endforeach() + foreach(DRIVER ${HAL_EX_DRIVERS_${FAMILY}}) + string(TOUPPER ${DRIVER} DRIVER) + target_link_libraries(hal-test-${FAMILY} HAL::STM32::${FAMILY}${CORE}::${DRIVER}Ex) + endforeach() + foreach(DRIVER ${HAL_LL_DRIVERS_${FAMILY}}) + string(TOUPPER ${DRIVER} DRIVER) + target_link_libraries(hal-test-${FAMILY} HAL::STM32::${FAMILY}${CORE}::LL_${DRIVER}) + endforeach() + target_link_libraries(hal-test-${FAMILY} STM32::NoSys CMSIS::STM32::${DEVICE}${CORE}) +endforeach() diff --git a/tests/hal/main.c b/tests/hal/main.c new file mode 100644 index 00000000..5cfc8e89 --- /dev/null +++ b/tests/hal/main.c @@ -0,0 +1,5 @@ +int main(void) +{ + for (;;); + return 0; +} diff --git a/tests/hal/stm32f0xx_hal_conf.h b/tests/hal/stm32f0xx_hal_conf.h new file mode 100755 index 00000000..f1b16481 --- /dev/null +++ b/tests/hal/stm32f0xx_hal_conf.h @@ -0,0 +1,321 @@ +/** + ****************************************************************************** + * @file stm32f0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F0xx_HAL_CONF_H +#define __STM32F0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ######################### Oscillator Values adaptation ################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT 5000U /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator for ADC (HSI14) value. + */ +#if !defined (HSI14_VALUE) + #define HSI14_VALUE 14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI14_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ + /* Warning: Must be set to higher priority for HAL_Delay() */ + /* and HAL_GetTick() usage under interrupt context */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f0xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/tests/hal/stm32f1xx_hal_conf.h b/tests/hal/stm32f1xx_hal_conf.h new file mode 100755 index 00000000..df420ff4 --- /dev/null +++ b/tests/hal/stm32f1xx_hal_conf.h @@ -0,0 +1,399 @@ +/** + ****************************************************************************** + * @file stm32f1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F1xx_HAL_CONF_H +#define __STM32F1xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#if defined(USE_STM3210C_EVAL) +#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#else +#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32f1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32f1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32f1xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32f1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED +#include "stm32f1xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED +#include "stm32f1xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32f1xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32f1xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32f1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32f1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32f1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32f1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32f1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32f1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32f1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32f1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32f1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32f1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32f1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32f1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED +#include "stm32f1xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED +#include "stm32f1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32f1xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32f1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32f1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32f1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32f1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32f1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32f1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32f1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32f1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED +#include "stm32f1xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED +#include "stm32f1xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t* file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32f2xx_hal_conf.h b/tests/hal/stm32f2xx_hal_conf.h new file mode 100755 index 00000000..c26dc66d --- /dev/null +++ b/tests/hal/stm32f2xx_hal_conf.h @@ -0,0 +1,422 @@ +/** + ****************************************************************************** + * @file stm32f2xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f2xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F2xx_HAL_CONF_H +#define __STM32F2xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f2xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f2xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f2xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f2xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f2xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f2xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f2xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f2xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f2xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f2xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f2xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f2xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f2xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f2xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f2xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f2xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f2xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f2xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f2xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f2xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f2xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f2xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f2xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f2xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f2xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f2xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f2xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f2xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f2xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f2xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f2xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f2xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f2xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f2xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f2xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f2xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F2xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32f3xx_hal_conf.h b/tests/hal/stm32f3xx_hal_conf.h new file mode 100755 index 00000000..a5f7ad39 --- /dev/null +++ b/tests/hal/stm32f3xx_hal_conf.h @@ -0,0 +1,357 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_CONF_H +#define __STM32F3xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SDADC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (8000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT (5000U) /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (40000U) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + * - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal) + * - External clock not generated on EVAL 373 + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE (8000000U) /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U +#define USE_SPI_CRC 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SDADC_REGISTER_CALLBACKS 0U /* SDADC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f3xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f3xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f3xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f3xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f3xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f3xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f3xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f3xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f3xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f3xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f3xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f3xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f3xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f3xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f3xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f3xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f3xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32f3xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f3xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f3xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f3xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f3xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32f3xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f3xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f3xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f3xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SDADC_MODULE_ENABLED + #include "stm32f3xx_hal_sdadc.h" +#endif /* HAL_SDADC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f3xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f3xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f3xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f3xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f3xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f3xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f3xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f3xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32f4xx_hal_conf.h b/tests/hal/stm32f4xx_hal_conf.h new file mode 100755 index 00000000..3a0dae6b --- /dev/null +++ b/tests/hal/stm32f4xx_hal_conf.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CRC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_PCCARD_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_FMPI2C_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32f7xx_hal_conf.h b/tests/hal/stm32f7xx_hal_conf.h new file mode 100755 index 00000000..b27f66e4 --- /dev/null +++ b/tests/hal/stm32f7xx_hal_conf.h @@ -0,0 +1,495 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_CEC_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED + + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U /* To enable prefetch */ +#define ART_ACCLERATOR_ENABLE 1U /* To enable ART Accelerator */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848 PHY Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ + +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ +#define PHY_MICR ((uint16_t)0x11U) /*!< MII Interrupt Control Register */ +#define PHY_MISR ((uint16_t)0x12U) /*!< MII Interrupt Status and Misc. Control Register */ + +#define PHY_LINK_STATUS ((uint16_t)0x0001U) /*!< PHY Link mask */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +#define PHY_MICR_INT_EN ((uint16_t)0x0002U) /*!< PHY Enable interrupts */ +#define PHY_MICR_INT_OE ((uint16_t)0x0001U) /*!< PHY Enable output interrupt events */ + +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020U) /*!< Enable Interrupt on change of link status */ +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000U) /*!< PHY link status interrupt mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f7xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32g0xx_hal_conf.h b/tests/hal/stm32g0xx_hal_conf.h new file mode 100755 index 00000000..f1a7aba3 --- /dev/null +++ b/tests/hal/stm32g0xx_hal_conf.h @@ -0,0 +1,314 @@ +/** + ****************************************************************************** + * @file stm32g0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2018 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G0xx_HAL_CONF_H +#define STM32G0xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_CEC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_DAC_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_I2S_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations +in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S1 peripheral + * This value is used by the RCC HAL module to compute the I2S1 clock source + * frequency. + */ +#if !defined (EXTERNAL_I2S1_CLOCK_VALUE) +#define EXTERNAL_I2S1_CLOCK_VALUE (48000UL) /*!< Value of the I2S1 External clock source in Hz*/ +#endif /* EXTERNAL_I2S1_CLOCK_VALUE */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 1U + +/* ################## CRYP peripheral configuration ########################## */ + +#define USE_HAL_CRYP_SUSPEND_RESUME 1U + + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include modules header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g0xx_hal_adc.h" +#include "stm32g0xx_hal_adc_ex.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED +#include "stm32g0xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g0xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for functions parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32g4xx_hal_conf.h b/tests/hal/stm32g4xx_hal_conf.h new file mode 100755 index 00000000..e5183918 --- /dev/null +++ b/tests/hal/stm32g4xx_hal_conf.h @@ -0,0 +1,382 @@ +/** + ****************************************************************************** + * @file stm32g4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32g4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32G4xx_HAL_CONF_H +#define STM32G4xx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORDIC_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_FMAC_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Register Callbacks selection ############################## */ +/** + * @brief This is the list of modules where register callback can be used + */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CORDIC_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_EXTI_REGISTER_CALLBACKS 0U +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U +#define USE_HAL_FMAC_REGISTER_CALLBACKS 0U +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE (48000000UL) /*!< Value of the Internal High Speed oscillator for USB FS/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) +/*!< Value of the Internal Low Speed oscillator in Hz +The real value may vary depending on the variations in voltage and temperature.*/ +#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S and SAI peripherals + * This value is used by the I2S and SAI HAL modules to compute the I2S and SAI clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) +#define EXTERNAL_CLOCK_VALUE (48000UL) /*!< Value of the External clock source in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x0FUL) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32g4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32g4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32g4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32g4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32g4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32g4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORDIC_MODULE_ENABLED +#include "stm32g4xx_hal_cordic.h" +#endif /* HAL_CORDIC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32g4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32g4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED +#include "stm32g4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32g4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED +#include "stm32g4xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32g4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_FMAC_MODULE_ENABLED +#include "stm32g4xx_hal_fmac.h" +#endif /* HAL_FMAC_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED +#include "stm32g4xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32g4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32g4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32g4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED +#include "stm32g4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32g4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED +#include "stm32g4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED +#include "stm32g4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32g4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32g4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32g4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32g4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32g4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32g4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32g4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32g4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32g4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32g4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED +#include "stm32g4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32g4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32g4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32g4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32g4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t *file, uint32_t line); +#else +#define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32G4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32h7xx_hal_conf.h b/tests/hal/stm32h7xx_hal_conf.h new file mode 100755 index 00000000..70d54f87 --- /dev/null +++ b/tests/hal/stm32h7xx_hal_conf.h @@ -0,0 +1,501 @@ +/** + ****************************************************************************** + * @file stm32h7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32h7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32H7xx_HAL_CONF_H +#define STM32H7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CEC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DTS_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_ETH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FDCAN_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_HRTIM_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_JPEG_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MDIOS_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_OTFDEC_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RAMECC_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SDRAM_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPDIFRX_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal oscillator (CSI) default value. + * This value is the default CSI value after Reset. + */ +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define USE_RTOS 0 +#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */ +#define USE_SPI_CRC 1U /*!< use CRC in SPI */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################### Ethernet Configuration ######################### */ +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ + +#define ETH_MAC_ADDR0 ((uint8_t)0x02) +#define ETH_MAC_ADDR1 ((uint8_t)0x00) +#define ETH_MAC_ADDR2 ((uint8_t)0x00) +#define ETH_MAC_ADDR3 ((uint8_t)0x00) +#define ETH_MAC_ADDR4 ((uint8_t)0x00) +#define ETH_MAC_ADDR5 ((uint8_t)0x00) + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32h7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32h7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32h7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_MDMA_MODULE_ENABLED + #include "stm32h7xx_hal_mdma.h" +#endif /* HAL_MDMA_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32h7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32h7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32h7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32h7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32h7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DTS_MODULE_ENABLED + #include "stm32h7xx_hal_dts.h" +#endif /* HAL_DTS_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32h7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32h7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32h7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32h7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED + #include "stm32h7xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32h7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32h7xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32h7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32h7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32h7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32h7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32h7xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32h7xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32h7xx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32h7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32h7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32h7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32h7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32h7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32h7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32h7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32h7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32h7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32h7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32h7xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32h7xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_OTFDEC_MODULE_ENABLED +#include "stm32h7xx_hal_otfdec.h" +#endif /* HAL_OTFDEC_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32h7xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32h7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32h7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RAMECC_MODULE_ENABLED + #include "stm32h7xx_hal_ramecc.h" +#endif /* HAL_RAMECC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32h7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32h7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32h7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32h7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32h7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32h7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32h7xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32h7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32h7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32h7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32h7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32h7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32h7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32h7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32h7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32h7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32H7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32l0xx_hal_conf.h b/tests/hal/stm32l0xx_hal_conf.h new file mode 100755 index 00000000..bb6f1314 --- /dev/null +++ b/tests/hal/stm32l0xx_hal_conf.h @@ -0,0 +1,338 @@ +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l0xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define PREREAD_ENABLE 0U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/tests/hal/stm32l1xx_hal_conf.h b/tests/hal/stm32l1xx_hal_conf.h new file mode 100755 index 00000000..c37ed86e --- /dev/null +++ b/tests/hal/stm32l1xx_hal_conf.h @@ -0,0 +1,319 @@ +/** + ****************************************************************************** + * @file stm32l1xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l1xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L1xx_HAL_CONF_H +#define __STM32L1xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE (2097000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE (16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE (37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE (3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY (0x000FU) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 0U +#define DATA_CACHE_ENABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/*#define USE_FULL_ASSERT 1U*/ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l0xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SDMMC_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l1xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l1xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l1xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l1xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l1xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l1xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l1xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l1xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l1xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l1xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l1xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l1xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l1xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l1xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l1xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l1xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l1xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l1xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l1xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l1xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l1xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l1xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l1xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l1xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l1xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l1xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l1xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l1xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L1xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/tests/hal/stm32l4xx_hal_conf.h b/tests/hal/stm32l4xx_hal_conf.h new file mode 100755 index 00000000..ca41261f --- /dev/null +++ b/tests/hal/stm32l4xx_hal_conf.h @@ -0,0 +1,480 @@ +/** + ****************************************************************************** + * @file stm32l4xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32l4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32L4xx_HAL_CONF_H +#define STM32L4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CAN_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_COMP_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_DAC_MODULE_ENABLED +#define HAL_DCMI_MODULE_ENABLED +#define HAL_DFSDM_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_DMA2D_MODULE_ENABLED +#define HAL_DSI_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_FIREWALL_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GFXMMU_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_HASH_MODULE_ENABLED +#define HAL_HCD_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IRDA_MODULE_ENABLED +#define HAL_IWDG_MODULE_ENABLED +#define HAL_LCD_MODULE_ENABLED +#define HAL_LPTIM_MODULE_ENABLED +#define HAL_LTDC_MODULE_ENABLED +#define HAL_MMC_MODULE_ENABLED +#define HAL_NAND_MODULE_ENABLED +#define HAL_NOR_MODULE_ENABLED +#define HAL_OPAMP_MODULE_ENABLED +#define HAL_OSPI_MODULE_ENABLED +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +#define HAL_PSSI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +#define HAL_SAI_MODULE_ENABLED +#define HAL_SD_MODULE_ENABLED +#define HAL_SMARTCARD_MODULE_ENABLED +#define HAL_SMBUS_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_SRAM_MODULE_ENABLED +#define HAL_SWPMI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_TSC_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +#define HAL_WWDG_MODULE_ENABLED + + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG. + * This internal oscillator is mainly dedicated to provide a high precision clock to + * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. + * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency + * which is subject to manufacturing process variations. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz. + The real value my vary depending on manufacturing process variations.*/ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/** + * @brief External clock source for SAI2 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI2_CLOCK_VALUE) + #define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/ +#endif /* EXTERNAL_SAI2_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Register callback feature configuration ############### */ +/** + * @brief Set below the peripheral configuration to "1U" to add the support + * of HAL callback registration/deregistration feature for the HAL + * driver(s). This allows user application to provide specific callback + * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting + * the default weak callback functions (see each stm32l4xx_hal_ppp.h file + * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef + * for each PPP peripheral). + */ +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U +#define USE_HAL_SD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U +#define USE_HAL_UART_REGISTER_CALLBACKS 0U +#define USE_HAL_USART_REGISTER_CALLBACKS 0U +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 1U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32l4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32l4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "Legacy/stm32l4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l4xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32l4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32l4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32l4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32l4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32l4xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l4xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32l4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32l4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l4xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32l4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32l4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32l4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32l4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32l4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32l4xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32l4xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32l4xx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32l4xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32l4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32l4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32l4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32l4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32l4xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l4xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32L4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/