2023-04-07 03:53:39 +08:00
|
|
|
# Copyright (c) 2023 Cypress Semiconductor Corporation (an Infineon company) or
|
|
|
|
# an affiliate of Cypress Semiconductor Corporation
|
2022-05-23 18:57:50 +08:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2023-07-26 12:44:44 +08:00
|
|
|
set(hal_dir ${ZEPHYR_HAL_INFINEON_MODULE_DIR}/mtb-hal-cat1)
|
|
|
|
set(hal_cat1a_dir ${hal_dir}/COMPONENT_CAT1A)
|
2024-05-10 05:07:58 +08:00
|
|
|
set(hal_cat1b_dir ${hal_dir}/COMPONENT_CAT1B)
|
2022-05-23 18:57:50 +08:00
|
|
|
|
2024-10-18 04:39:12 +08:00
|
|
|
# PSOC 6 family defines
|
2023-01-31 19:02:40 +08:00
|
|
|
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1A COMPONENT_CAT1A)
|
2024-05-10 05:07:58 +08:00
|
|
|
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1B COMPONENT_CAT1B)
|
2023-01-31 19:02:40 +08:00
|
|
|
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1 COMPONENT_CAT1)
|
|
|
|
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1 CY_USING_HAL)
|
|
|
|
|
2022-05-23 18:57:50 +08:00
|
|
|
# Add mtb-hal-cat1
|
|
|
|
zephyr_include_directories(${hal_dir}/include)
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_include_directories(${hal_dir}/include_pvt)
|
|
|
|
zephyr_include_directories_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1A ${hal_cat1a_dir}/include)
|
2024-05-10 05:07:58 +08:00
|
|
|
zephyr_include_directories_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1B ${hal_cat1b_dir}/include)
|
2022-05-23 18:57:50 +08:00
|
|
|
|
|
|
|
# Packages sources
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_104_M_CSP_BLE
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_104_m_csp_ble.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_104_M_CSP_BLE_USB
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_104_m_csp_ble_usb.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_116_BGA_BLE
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_116_bga_ble.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_116_BGA_USB
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_116_bga_usb.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_124_BGA
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_124_bga.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_124_BGA_SIP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_124_bga_sip.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_68_QFN_BLE
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_68_qfn_ble.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_01_80_WLCSP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_01_80_wlcsp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_02_100_WLCSP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_02_100_wlcsp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_02_124_BGA
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_02_124_bga.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_02_128_TQFP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_02_128_tqfp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_02_68_QFN
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_02_68_qfn.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_03_100_TQFP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_03_100_tqfp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_03_49_WLCSP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_03_49_wlcsp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_03_68_QFN
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_03_68_qfn.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_04_64_TQFP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_04_64_tqfp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_04_68_QFN
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_04_68_qfn.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_PSOC6_04_80_TQFP
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/pin_packages/cyhal_psoc6_04_80_tqfp.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
|
2024-05-10 05:07:58 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_PACKAGE_CYW20829_56_QFN
|
|
|
|
${hal_cat1b_dir}/source/pin_packages/cyhal_cyw20829_56_qfn.c)
|
|
|
|
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_DIE_CYW20829
|
|
|
|
${hal_cat1b_dir}/source/triggers/cyhal_triggers_cyw20829.c)
|
|
|
|
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_DIE_PSOC6_01
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/triggers/cyhal_triggers_psoc6_01.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_DIE_PSOC6_02
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/triggers/cyhal_triggers_psoc6_02.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_DIE_PSOC6_03
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/triggers/cyhal_triggers_psoc6_03.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_SOC_DIE_PSOC6_04
|
2023-07-26 12:44:44 +08:00
|
|
|
${hal_cat1a_dir}/source/triggers/cyhal_triggers_psoc6_04.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
|
|
|
|
# High level interface for interacting with CAT1 hardware
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_ADC ${hal_dir}/source/cyhal_adc_sar.c)
|
2024-06-04 08:05:27 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_ADC ${hal_dir}/source/cyhal_analog_common.c)
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_FLASH ${hal_dir}/source/cyhal_nvm.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_I2C ${hal_dir}/source/cyhal_i2c.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_LPTIMER ${hal_dir}/source/cyhal_lptimer.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_RTC ${hal_dir}/source/cyhal_rtc.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_SDIO ${hal_dir}/source/cyhal_sdhc.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_SPI ${hal_dir}/source/cyhal_spi.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_TIMER ${hal_dir}/source/cyhal_timer.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_TRNG ${hal_dir}/source/cyhal_trng.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_UART ${hal_dir}/source/cyhal_uart.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_USE_INFINEON_WDT ${hal_dir}/source/cyhal_wdt.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
|
2024-06-04 08:05:27 +08:00
|
|
|
if(CONFIG_USE_INFINEON_ADC OR CONFIG_USE_INFINEON_SMIF)
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_dma.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_dma_dmac.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_dma_dw.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_USE_INFINEON_TIMER)
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_tcpwm_common.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_USE_INFINEON_UART OR CONFIG_USE_INFINEON_I2C OR CONFIG_USE_INFINEON_SPI)
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_scb_common.c)
|
2022-05-23 18:57:50 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Common part
|
2023-07-26 12:44:44 +08:00
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_clock.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_gpio.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_hwmgr.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_interconnect.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_syspm.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_system.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_utils.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_utils_impl.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_wdt.c)
|
|
|
|
zephyr_library_sources(${hal_dir}/source/cyhal_irq_impl.c)
|