Ravago Jones | b83957c | 2021-12-29 19:57:34 -0800 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 3.12) |
| 2 | |
| 3 | # Pull in SDK (must be before project) |
| 4 | include(pico_sdk_import.cmake) |
| 5 | |
| 6 | project(ADIS16505_communication C CXX ASM) |
| 7 | set(CMAKE_C_STANDARD 11) |
| 8 | set(CMAKE_CXX_STANDARD 17) |
| 9 | |
| 10 | if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.0") |
| 11 | message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.3.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}") |
| 12 | endif() |
| 13 | |
| 14 | # Initialize the SDK |
| 15 | pico_sdk_init() |
| 16 | |
| 17 | add_compile_options(-Wall |
| 18 | -Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int |
| 19 | -Wno-unused-function # we have some for the docs that aren't called |
| 20 | -Wno-maybe-uninitialized |
| 21 | ) |
| 22 | |
| 23 | add_executable(pico_imu_board) |
| 24 | |
| 25 | pico_generate_pio_header(pico_imu_board ${CMAKE_CURRENT_LIST_DIR}/quadrature_encoder.pio) |
| 26 | |
| 27 | target_sources(pico_imu_board PRIVATE ADIS16505.cc) |
| 28 | |
| 29 | # pull in common dependencies |
| 30 | target_link_libraries(pico_imu_board |
| 31 | pico_stdlib |
| 32 | hardware_spi |
| 33 | hardware_dma |
| 34 | hardware_irq |
| 35 | hardware_pwm |
| 36 | hardware_pio |
| 37 | hardware_timer |
| 38 | pico_bootrom |
| 39 | pico_double |
| 40 | ) |
| 41 | |
| 42 | # enable usb output, disable uart output |
| 43 | pico_enable_stdio_usb(pico_imu_board 1) |
| 44 | pico_enable_stdio_uart(pico_imu_board 1) |
| 45 | |
| 46 | # create map/bin/hex file etc. |
| 47 | pico_add_extra_outputs(pico_imu_board) |