Skip to content

Commit ed78d81

Browse files
committed
modules: hal_bouffalolab: Make sdk-independant
Reorganize and update hal_bouffalolab files for SDK-independance Signed-off-by: Camille BAUD <mail@massdriver.space>
1 parent e79a788 commit ed78d81

File tree

8 files changed

+4
-199
lines changed

8 files changed

+4
-199
lines changed
Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,9 @@
11
# Copyright (c) 2021-2025 Gerson Fernando Budke <nandojve@gmail.com>
2+
# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
23
#
34
# SPDX-License-Identifier: Apache-2.0
45

56
if(CONFIG_SOC_FAMILY_BFLB)
6-
zephyr_library_named(hal_bouffalolab)
7-
8-
zephyr_library_compile_definitions(
9-
BFLB_USE_HAL_DRIVER
10-
BFLB_USE_CUSTOM_LD_SECTIONS
11-
)
12-
13-
set(bflb_soc bl602)
14-
set(bflb_drv_dir ${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/drivers/${bflb_soc}_driver)
15-
set(bflb_common_dir ${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/common)
16-
set(bflb_drv_src_dir ${bflb_drv_dir}/std_drv/src)
17-
18-
# Global includes
19-
zephyr_include_directories(
20-
include
21-
${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/include
22-
23-
${bflb_drv_dir}/regs
24-
${bflb_drv_dir}/startup
25-
${bflb_drv_dir}/std_drv/inc
26-
27-
${bflb_common_dir}/misc
28-
)
29-
30-
zephyr_library_include_directories(
31-
${bflb_common_dir}/soft_crc
32-
)
33-
34-
zephyr_library_sources(
35-
${bflb_drv_src_dir}/${bflb_soc}_aon.c
36-
${bflb_drv_src_dir}/${bflb_soc}_ef_ctrl.c
37-
${bflb_drv_src_dir}/${bflb_soc}_glb.c
38-
${bflb_drv_src_dir}/${bflb_soc}_hbn.c
39-
${bflb_drv_src_dir}/${bflb_soc}_l1c.c
40-
${bflb_drv_src_dir}/${bflb_soc}_pds.c
41-
${bflb_drv_src_dir}/${bflb_soc}_romapi.c
42-
43-
${bflb_common_dir}/soft_crc/softcrc.c
44-
)
45-
46-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_ACOMP ${bflb_drv_src_dir}/${bflb_soc}_acomp.c)
47-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_ADC ${bflb_drv_src_dir}/${bflb_soc}_adc.c)
48-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_DAC ${bflb_drv_src_dir}/${bflb_soc}_dac.c)
49-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_DMA ${bflb_drv_src_dir}/${bflb_soc}_dma.c)
50-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_I2C ${bflb_drv_src_dir}/${bflb_soc}_i2c.c)
51-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_IR ${bflb_drv_src_dir}/${bflb_soc}_ir.c)
52-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_PWM ${bflb_drv_src_dir}/${bflb_soc}_pwm.c)
53-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_SPI ${bflb_drv_src_dir}/${bflb_soc}_spi.c)
54-
zephyr_library_sources_ifdef(CONFIG_USE_BFLB_UART ${bflb_drv_src_dir}/${bflb_soc}_uart.c)
7+
zephyr_include_directories(${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/include)
8+
zephyr_include_directories(${ZEPHYR_HAL_BOUFFALOLAB_MODULE_DIR}/include/bouffalolab/${SOC_SERIES})
559
endif() # SOC_FAMILY_BFLB

modules/hal_bouffalolab/Kconfig

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,7 @@
11
# Copyright (c) 2021-2025 Gerson Fernando Budke <nandojve@gmail.com>
2+
# Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
23
#
34
# SPDX-License-Identifier: Apache-2.0
45

56
config ZEPHYR_HAL_BOUFFALOLAB_MODULE
67
bool
7-
8-
config HAS_BFLB_HAL
9-
bool
10-
11-
if HAS_BFLB_HAL
12-
13-
config USE_BFLB_ACOMP
14-
bool
15-
help
16-
Enable BFLB Analog Comparator (ACOMP) HAL module driver
17-
18-
config USE_BFLB_ADC
19-
bool
20-
help
21-
Enable BFLB Analog-to-Digital Converter (ADC) HAL module driver
22-
23-
config USE_BFLB_DAC
24-
bool
25-
help
26-
Enable BFLB Digital-to-Analog Converter (DAC) HAL module driver
27-
28-
config USE_BFLB_DMA
29-
bool
30-
help
31-
Enable BFLB Direct Memory Access controller (DMA) HAL module driver
32-
33-
config USE_BFLB_I2C
34-
bool
35-
help
36-
Enable BFLB Inter-Integrated Circuit Interface (I2C) HAL module driver
37-
38-
config USE_BFLB_IR
39-
bool
40-
help
41-
Enable BFLB Infrared Remote controller (IR) HAL module driver
42-
43-
config USE_BFLB_PWM
44-
bool
45-
help
46-
Enable BFLB Pulse Width Modulation (PMU) HAL module driver
47-
48-
config USE_BFLB_SPI
49-
bool
50-
help
51-
Enable BFLB Serial Peripheral Interface(SPI) HAL module driver
52-
53-
config USE_BFLB_UART
54-
bool
55-
help
56-
Enable BFLB Universal Asynchronous Receiver/Transmitter (UART)
57-
HAL module driver
58-
59-
endif # HAS_BFLB_HAL

modules/hal_bouffalolab/include/bflb_glb.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

modules/hal_bouffalolab/include/bflb_gpio.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

modules/hal_bouffalolab/include/bflb_hbn.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

modules/hal_bouffalolab/include/bflb_pinctrl.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

modules/hal_bouffalolab/include/bflb_uart.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

modules/hal_bouffalolab/include/bl_ld_sections.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)