Skip to content

Commit

Permalink
Update with ICM20948 chip support
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Teslia committed Aug 3, 2023
1 parent c82b005 commit f753a12
Show file tree
Hide file tree
Showing 45 changed files with 11,084 additions and 10,168 deletions.
52 changes: 27 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
set(COMPONENT_SRCS
"src/MPU.cpp")
set(COMPONENT_ADD_INCLUDEDIRS "include")
set(COMPONENT_REQUIRES "I2Cbus")

register_component()

component_compile_options(PUBLIC -DMPU_COMPONENT_TRUE=1)

## Defines needed for library code implementation
# MPU9250 is the same as MPU6500 + AK8963
# MPU9150 is the same as MPU6050 + AK8975
# MPU6000 code is the same as MPU6050 code
# MPU6555 equals MPU6500, MPU9255 equals MPU9250
if(${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9250")
component_compile_options(PUBLIC -DCONFIG_MPU6500)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9150")
component_compile_options(PUBLIC -DCONFIG_MPU6050)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU6000")
component_compile_options(PUBLIC -DCONFIG_MPU6050)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU6555")
component_compile_options(PUBLIC -DCONFIG_MPU6500)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9255")
component_compile_options(PUBLIC -DCONFIG_MPU9250 -DCONFIG_MPU6500)
endif()
set(COMPONENT_SRCS
"src/MPU.cpp")
set(COMPONENT_ADD_INCLUDEDIRS "include")
set(COMPONENT_REQUIRES "I2Cbus")

register_component()

component_compile_options(PUBLIC -DMPU_COMPONENT_TRUE=1)

## Defines needed for library code implementation
# MPU9250 is the same as MPU6500 + AK8963
# MPU9150 is the same as MPU6050 + AK8975
# MPU6000 code is the same as MPU6050 code
# MPU6555 equals MPU6500, MPU9255 equals MPU9250
if(${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9250")
component_compile_options(PUBLIC -DCONFIG_MPU6500)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "ICM20948")
component_compile_options(PUBLIC -DCONFIG_MPU6500)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9150")
component_compile_options(PUBLIC -DCONFIG_MPU6050)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU6000")
component_compile_options(PUBLIC -DCONFIG_MPU6050)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU6555")
component_compile_options(PUBLIC -DCONFIG_MPU6500)
elseif (${CONFIG_MPU_CHIP_MODEL} STREQUAL "MPU9255")
component_compile_options(PUBLIC -DCONFIG_MPU9250 -DCONFIG_MPU6500)
endif()
Loading

0 comments on commit f753a12

Please sign in to comment.