1## 2## ______ _ 3## / _____) _ | | 4## ( (____ _____ ____ _| |_ _____ ____| |__ 5## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6## _____) ) ____| | | || |_| ____( (___| | | | 7## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8## (C)2013-2017 Semtech 9## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13## embedded.connectivity.solutions.============== 14## 15## License: Revised BSD License, see LICENSE.TXT file included in the project 16## Authors: Johannes Bruder (STACKFORCE), Miguel Luis (Semtech) 17## 18project(NucleoL476) 19cmake_minimum_required(VERSION 3.6) 20enable_language(ASM) 21 22#--------------------------------------------------------------------------------------- 23# Target 24#--------------------------------------------------------------------------------------- 25 26list(APPEND ${PROJECT_NAME}_SOURCES 27 "${CMAKE_CURRENT_SOURCE_DIR}/adc-board.c" 28 "${CMAKE_CURRENT_SOURCE_DIR}/board.c" 29 "${CMAKE_CURRENT_SOURCE_DIR}/delay-board.c" 30 "${CMAKE_CURRENT_SOURCE_DIR}/eeprom-board.c" 31 "${CMAKE_CURRENT_SOURCE_DIR}/gpio-board.c" 32 "${CMAKE_CURRENT_SOURCE_DIR}/i2c-board.c" 33 "${CMAKE_CURRENT_SOURCE_DIR}/lpm-board.c" 34 "${CMAKE_CURRENT_SOURCE_DIR}/rtc-board.c" 35 "${CMAKE_CURRENT_SOURCE_DIR}/spi-board.c" 36 "${CMAKE_CURRENT_SOURCE_DIR}/sysIrqHandlers.c" 37 "${CMAKE_CURRENT_SOURCE_DIR}/uart-board.c" 38 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/utilities.c" 39 "${CMAKE_CURRENT_SOURCE_DIR}/cmsis/arm-gcc/startup_stm32l476xx.s" 40 "${CMAKE_CURRENT_SOURCE_DIR}/cmsis/system_stm32l4xx.c" 41 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c" 42 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c" 43 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c" 44 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c" 45 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c" 46 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c" 47 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c" 48 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c" 49 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c" 50 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c" 51 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c" 52 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c" 53 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c" 54 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c" 55 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c" 56 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c" 57 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c" 58 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c" 59 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c" 60 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c" 61 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/EEPROM_Emul/Core/eeprom_emul.c" 62 "${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/EEPROM_Emul/Porting/STM32L4/flash_interface.c" 63) 64 65if(MBED_RADIO_SHIELD STREQUAL SX1272MB2DAS) 66 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1272mb2das-board.c") 67elseif(MBED_RADIO_SHIELD STREQUAL SX1276MB1LAS) 68 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1276mb1las-board.c") 69elseif(MBED_RADIO_SHIELD STREQUAL SX1276MB1MAS) 70 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1276mb1mas-board.c") 71elseif(MBED_RADIO_SHIELD STREQUAL SX1261MBXBAS) 72 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1261mbxbas-board.c") 73elseif(MBED_RADIO_SHIELD STREQUAL SX1262MBXCAS) 74 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1262mbxcas-board.c") 75elseif(MBED_RADIO_SHIELD STREQUAL SX1262MBXDAS) 76 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sx1262mbxdas-board.c") 77elseif(MBED_RADIO_SHIELD STREQUAL LR1110MB1XXS) 78 list(APPEND ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/lr1110mb1xxs-board.c") 79else() 80 message(STATUS " Please specify the MBED_RADIO_SHIELD !\nPossible values are: SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261MBXBAS, SX1262MBXCAS, SX1262MBXDAS and LR1110MB1XXS.") 81endif() 82 83add_library(${PROJECT_NAME} OBJECT EXCLUDE_FROM_ALL ${${PROJECT_NAME}_SOURCES}) 84 85target_compile_definitions(${PROJECT_NAME} PUBLIC -DUSE_HAL_DRIVER -DSTM32L476xx -D${MBED_RADIO_SHIELD}) 86 87# Add define if debbuger support is enabled 88target_compile_definitions(${PROJECT_NAME} PUBLIC $<$<BOOL:${USE_DEBUGGER}>:USE_DEBUGGER>) 89 90# Add define if radio debug pins support is enabled 91target_compile_definitions(${PROJECT_NAME} PUBLIC $<$<BOOL:${USE_RADIO_DEBUG}>:USE_RADIO_DEBUG>) 92 93target_include_directories(${PROJECT_NAME} PUBLIC 94 ${CMAKE_CURRENT_SOURCE_DIR} 95 ${CMAKE_CURRENT_SOURCE_DIR}/cmsis 96 ${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32 97 ${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/cmsis 98 ${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/STM32L4xx_HAL_Driver/Inc 99 ${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/EEPROM_Emul/Core 100 ${CMAKE_CURRENT_SOURCE_DIR}/../mcu/stm32/EEPROM_Emul/Porting/STM32L4 101 $<TARGET_PROPERTY:board,INTERFACE_INCLUDE_DIRECTORIES> 102 $<TARGET_PROPERTY:system,INTERFACE_INCLUDE_DIRECTORIES> 103 $<TARGET_PROPERTY:radio,INTERFACE_INCLUDE_DIRECTORIES> 104 $<TARGET_PROPERTY:peripherals,INTERFACE_INCLUDE_DIRECTORIES> 105) 106 107set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11) 108