modules: hal_ambiq: fix cmake warning when no BLE
Added CONFIG_AMBIQ_COMPONENT_USE_BT and CONFIG_SOC_AMBIQ_BT_SUPPORTED to fix empty zephyr_library() warning when BLE is not needed for compile. Added CMake message if BT related Ambiq specific Kconfig is overriden for not supported SoC. Signed-off-by: Swift Tian <swift.tian@ambiq.com>
This commit is contained in:
parent
a5beac9ac2
commit
681bc1aa82
9 changed files with 147 additions and 75 deletions
|
@ -224,6 +224,7 @@ config BT_AMBIQ_HCI
|
||||||
select GPIO if SOC_SERIES_APOLLO4X
|
select GPIO if SOC_SERIES_APOLLO4X
|
||||||
select CLOCK_CONTROL if SOC_SERIES_APOLLO4X
|
select CLOCK_CONTROL if SOC_SERIES_APOLLO4X
|
||||||
select BT_HCI_SETUP
|
select BT_HCI_SETUP
|
||||||
|
select AMBIQ_COMPONENT_USE_BT
|
||||||
help
|
help
|
||||||
Supports Ambiq Bluetooth SoC using SPI as the communication protocol.
|
Supports Ambiq Bluetooth SoC using SPI as the communication protocol.
|
||||||
HCI packets are sent and received as single Byte transfers.
|
HCI packets are sent and received as single Byte transfers.
|
||||||
|
|
|
@ -1,78 +1,7 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||||
|
# Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
|
||||||
|
|
||||||
config AMBIQ_HAL
|
rsource "Kconfig.hal"
|
||||||
bool "Ambiq HAL drivers support"
|
rsource "Kconfig.components"
|
||||||
depends on SOC_SERIES_APOLLO4X || SOC_SERIES_APOLLO3X
|
|
||||||
help
|
|
||||||
Use the Ambiq HAL
|
|
||||||
|
|
||||||
if AMBIQ_HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_ADC
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the ADC driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_GPIO
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the GPIO driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_STIMER
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the STIMER driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_TIMER
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the TIMER driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_WDT
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the WDT driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_I2C
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the I2C driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_SPIC
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the SPI Controller driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_SPID
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the SPI Device driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_MSPI
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the MSPI driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_HWINFO
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the HWINFO driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_BLEIF
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the BLEIF driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_ADC
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the ADC driver from Ambiq HAL
|
|
||||||
|
|
||||||
config AMBIQ_HAL_USE_USB
|
|
||||||
bool
|
|
||||||
help
|
|
||||||
Use the USB driver from Ambiq HAL
|
|
||||||
|
|
||||||
endif # AMBIQ_HAL
|
|
||||||
|
|
10
modules/hal_ambiq/Kconfig.components
Normal file
10
modules/hal_ambiq/Kconfig.components
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||||
|
# Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
|
||||||
|
|
||||||
|
config AMBIQ_COMPONENT_USE_BT
|
||||||
|
bool
|
||||||
|
depends on SOC_AMBIQ_BT_SUPPORTED
|
||||||
|
help
|
||||||
|
Use Bluetooth component from Ambiq
|
114
modules/hal_ambiq/Kconfig.hal
Normal file
114
modules/hal_ambiq/Kconfig.hal
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 Antmicro <www.antmicro.com>
|
||||||
|
# Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
|
||||||
|
|
||||||
|
config AMBIQ_HAL
|
||||||
|
bool "Ambiq HAL drivers support"
|
||||||
|
depends on SOC_SERIES_APOLLO3X || SOC_SERIES_APOLLO4X
|
||||||
|
help
|
||||||
|
Use the Ambiq HAL
|
||||||
|
|
||||||
|
if AMBIQ_HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_ADC
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the ADC driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_ITM
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the ITM HAL from Ambiq
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_TPIU
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the TPIU HAL from Ambiq
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_DCU
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the DCU HAL from Ambiq
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_GPIO
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the GPIO driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_STIMER
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the STIMER driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_TIMER
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the TIMER driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_WDT
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the WDT driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_I2C
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the I2C driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_SPIC
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the SPI Controller driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_SPID
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the SPI Device driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_MSPI
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the MSPI driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_HWINFO
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the HWINFO driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_BLEIF
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the BLEIF driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_ADC
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the ADC driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_USB
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the USB driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_SDIO
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the SDIO driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_ADC
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the ADC driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_DSI
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the DSI driver from Ambiq HAL
|
||||||
|
|
||||||
|
config AMBIQ_HAL_USE_USB
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Use the USB driver from Ambiq HAL
|
||||||
|
|
||||||
|
endif # AMBIQ_HAL
|
|
@ -5,3 +5,15 @@
|
||||||
add_subdirectory(${SOC_SERIES})
|
add_subdirectory(${SOC_SERIES})
|
||||||
|
|
||||||
zephyr_include_directories(.)
|
zephyr_include_directories(.)
|
||||||
|
|
||||||
|
if(CONFIG_SOC_AMBIQ_BT_SUPPORTED)
|
||||||
|
if(CONFIG_SOC_APOLLO4P)
|
||||||
|
if(CONFIG_AMBIQ_COMPONENT_USE_BT)
|
||||||
|
message(FATAL_ERROR "AMBIQ_COMPONENT_USE_BT is set to ${CONFIG_AMBIQ_COMPONENT_USE_BT} \
|
||||||
|
for not supported SoC ${CONFIG_SOC}")
|
||||||
|
else()
|
||||||
|
message(WARNING "SOC_AMBIQ_BT_SUPPORTED is set to ${CONFIG_SOC_AMBIQ_BT_SUPPORTED} \
|
||||||
|
for not supported SoC ${CONFIG_SOC}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
|
@ -8,4 +8,7 @@ config SOC_FAMILY_AMBIQ
|
||||||
config SOC_FAMILY
|
config SOC_FAMILY
|
||||||
default "ambiq" if SOC_FAMILY_AMBIQ
|
default "ambiq" if SOC_FAMILY_AMBIQ
|
||||||
|
|
||||||
|
config SOC_AMBIQ_BT_SUPPORTED
|
||||||
|
bool
|
||||||
|
|
||||||
rsource "*/Kconfig.soc"
|
rsource "*/Kconfig.soc"
|
||||||
|
|
|
@ -11,12 +11,14 @@ config SOC_SERIES_APOLLO3X
|
||||||
config SOC_APOLLO3P_BLUE
|
config SOC_APOLLO3P_BLUE
|
||||||
bool
|
bool
|
||||||
select SOC_SERIES_APOLLO3X
|
select SOC_SERIES_APOLLO3X
|
||||||
|
select SOC_AMBIQ_BT_SUPPORTED
|
||||||
help
|
help
|
||||||
Apollo3P Blue
|
Apollo3P Blue
|
||||||
|
|
||||||
config SOC_APOLLO3_BLUE
|
config SOC_APOLLO3_BLUE
|
||||||
bool
|
bool
|
||||||
select SOC_SERIES_APOLLO3X
|
select SOC_SERIES_APOLLO3X
|
||||||
|
select SOC_AMBIQ_BT_SUPPORTED
|
||||||
help
|
help
|
||||||
Apollo3 Blue
|
Apollo3 Blue
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ config SOC_APOLLO4P
|
||||||
config SOC_APOLLO4P_BLUE
|
config SOC_APOLLO4P_BLUE
|
||||||
bool
|
bool
|
||||||
select SOC_SERIES_APOLLO4X
|
select SOC_SERIES_APOLLO4X
|
||||||
|
select SOC_AMBIQ_BT_SUPPORTED
|
||||||
help
|
help
|
||||||
Apollo4 Blue Plus
|
Apollo4 Blue Plus
|
||||||
|
|
||||||
|
|
2
west.yml
2
west.yml
|
@ -152,7 +152,7 @@ manifest:
|
||||||
groups:
|
groups:
|
||||||
- hal
|
- hal
|
||||||
- name: hal_ambiq
|
- name: hal_ambiq
|
||||||
revision: 87a188b91aca22ce3ce7deb4a1cbf7780d784673
|
revision: 77d99efc16c7de7c17e9507693e4e3d8be1a5cb7
|
||||||
path: modules/hal/ambiq
|
path: modules/hal/ambiq
|
||||||
groups:
|
groups:
|
||||||
- hal
|
- hal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue