1#
2# Copyright (c) 2021, Telink
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7zephyr_library()
8
9zephyr_include_directories(common)
10zephyr_include_directories(drivers/B91/compatibility_pack)
11zephyr_include_directories(drivers/B91/reg_include)
12zephyr_include_directories(drivers/B91)
13
14# soc.c referance sources
15zephyr_library_sources_ifndef(CONFIG_BT_B91 drivers/B91/sys.c)
16zephyr_library_sources(drivers/B91/pm.c)
17zephyr_library_sources(drivers/B91/clock.c)
18zephyr_library_sources(drivers/B91/analog.c)
19
20# Flash driver reference sources
21zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_TELINK_B91 drivers/B91/flash.c)
22zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_TELINK_B91 drivers/B91/plic.c)
23zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_TELINK_B91 drivers/B91/stimer.c)
24
25# PWM driver reference sources
26zephyr_library_sources_ifdef(CONFIG_PWM_TELINK_B91 drivers/B91/pwm.c)
27
28# SPI driver reference sources
29zephyr_library_sources_ifdef(CONFIG_SPI_TELINK_B91 drivers/B91/gpio.c)
30
31# I2C driver reference sources
32zephyr_library_sources_ifdef(CONFIG_I2C_TELINK_B91 drivers/B91/i2c.c)
33
34# RF driver reference sources
35zephyr_library_sources_ifdef(CONFIG_IEEE802154_TELINK_B91 drivers/B91/stimer.c)
36zephyr_library_sources_ifdef(CONFIG_IEEE802154_TELINK_B91 drivers/B91/rf.c)
37
38# Entropy driver reference sources
39zephyr_library_sources_ifdef(CONFIG_ENTROPY_TELINK_B91_TRNG drivers/B91/trng.c)
40
41# ADC driver reference sources
42zephyr_library_sources_ifdef(CONFIG_ADC_TELINK_B91 drivers/B91/adc.c)
43zephyr_library_sources_ifdef(CONFIG_ADC_TELINK_B91 drivers/B91/gpio.c)
44
45# BLE reference sources
46if (CONFIG_BT_B91)
47
48zephyr_include_directories(
49	ble
50	ble/vendor/controller
51)
52
53zephyr_library_sources(
54	drivers/B91/pke.c
55	drivers/B91/aes.c
56	drivers/B91/flash.c
57	drivers/B91/plic.c
58	drivers/B91/stimer.c
59	drivers/B91/ext_driver/software_pa.c
60	ble/common/utility.c
61	ble/vendor/controller/b91_bt.c
62	ble/vendor/controller/b91_bt_init.c
63	ble/vendor/controller/b91_bt_buffer.c
64)
65
66if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "zephyr")
67	zephyr_link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/ble/proj_lib/lib/liblt_9518_zephyr.a)
68else()
69	zephyr_link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/ble/proj_lib/lib/liblt_9518.a)
70endif()
71
72endif() # CONFIG_BT_B91
73