Skip to content

Commit 8afb429

Browse files
committed
Merge branch 'feat/add_spi_bus' into 'master'
feat(spi_bus): Separate spi from bus components Closes AEG-1906 See merge request ae_group/esp-iot-solution!1087
2 parents 903df42 + e1c3dc6 commit 8afb429

File tree

20 files changed

+505
-120
lines changed

20 files changed

+505
-120
lines changed

.github/workflows/upload_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
components/sensors/humiture/aht20;
6363
components/sensors/ntc_driver;
6464
components/sensors/radar/at581x;
65+
components/spi_bus;
6566
components/touch/touch_proximity_sensor;
6667
components/usb/esp_msc_ota;
6768
components/usb/esp_tinyuf2;

.gitlab/ci/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,14 @@ build_components_sensors_radar_at581x_test_apps:
11741174
variables:
11751175
EXAMPLE_DIR: components/sensors/radar/at581x/test_apps
11761176

1177+
build_components_spi_bus_test_apps:
1178+
extends:
1179+
- .build_examples_template
1180+
- .rules:build:components_spi_bus_test_apps
1181+
- .build_idf_active_release_version
1182+
variables:
1183+
EXAMPLE_DIR: components/spi_bus/test_apps
1184+
11771185
build_components_touch_touch_proximity_sensor_test_apps:
11781186
extends:
11791187
- .build_examples_template

.gitlab/ci/rules.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@
239239
.patterns-components_sensors_sensor_hub: &patterns-components_sensors_sensor_hub
240240
- "components/sensors/sensor_hub/**/*"
241241

242+
.patterns-components_spi_bus: &patterns-components_spi_bus
243+
- "components/spi_bus/**/*"
244+
- "components/tools/cmake_utilities/package_manager.cmake"
245+
242246
.patterns-components_storage_eeprom_at24c02: &patterns-components_storage_eeprom_at24c02
243247
- "components/storage/eeprom/at24c02/**/*"
244248

@@ -320,7 +324,6 @@
320324
- "components/bluetooth/ble_services/hrs/include/esp_hrs.h"
321325
- "components/bluetooth/ble_services/hts/include/esp_hts.h"
322326
- "components/bluetooth/ble_services/tps/include/esp_tps.h"
323-
- "components/bus/include/spi_bus.h"
324327
- "components/button/include/iot_button.h"
325328
- "components/display/screen/interface_driver/scr_interface_driver.h"
326329
- "components/display/screen/screen_driver.h"
@@ -344,6 +347,7 @@
344347
- "components/sensors/sensor_hub/include/hal/light_sensor_hal.h"
345348
- "components/sensors/sensor_hub/include/iot_sensor_hub.h"
346349
- "components/sensors/sensor_hub/include/sensor_type.h"
350+
- "components/spi_bus/include/spi_bus.h"
347351
- "components/touch/touch_proximity_sensor/include/touch_proximity_sensor.h"
348352
- "components/usb/esp_msc_ota/include/esp_msc_ota.h"
349353
- "components/usb/esp_tinyuf2/esp_tinyuf2.h"
@@ -2007,6 +2011,17 @@
20072011
- <<: *if-dev-push
20082012
changes: *patterns-components_sensors_sensor_hub
20092013

2014+
.rules:build:components_spi_bus_test_apps:
2015+
rules:
2016+
- <<: *if-protected
2017+
- <<: *if-label-build
2018+
- <<: *if-label-target_test
2019+
- <<: *if-trigger-job
2020+
- <<: *if-dev-push
2021+
changes: *patterns-build_system
2022+
- <<: *if-dev-push
2023+
changes: *patterns-components_spi_bus
2024+
20102025
.rules:build:components_storage_eeprom_at24c02_test:
20112026
rules:
20122027
- <<: *if-protected

components/bus/test/CMakeLists.txt

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

components/bus/test/test_spi_bus.c

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

components/display/screen/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ set(SCREEN_DIR "controller_driver/ili9341"
1818
idf_component_register(SRC_DIRS "${SCREEN_DIR}" "screen_utility" "interface_driver" "."
1919
INCLUDE_DIRS "${SCREEN_DIR}" "interface_driver" "."
2020
PRIV_INCLUDE_DIRS "screen_utility"
21-
REQUIRES bus i2c_bus
21+
REQUIRES bus i2c_bus spi_bus
2222
)

components/display/touch_panel/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set(TOUCH_DIR "xpt2046" "ft5x06" "ns2016")
44
idf_component_register(SRC_DIRS "." "${TOUCH_DIR}" "calibration" "calibration/basic_painter" "calibration/basic_painter/fonts"
55
INCLUDE_DIRS "." "${TOUCH_DIR}" "calibration/basic_painter" "calibration/basic_painter/fonts"
66
PRIV_INCLUDE_DIRS "calibration"
7-
PRIV_REQUIRES bus nvs_flash
7+
PRIV_REQUIRES i2c_bus spi_bus nvs_flash
88
REQUIRES screen)

components/spi_bus/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## v1.0.0 - 2024-10-16
4+
5+
First release version.
6+
7+
- Support SPI bus

components/spi_bus/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
idf_component_register(SRC_DIRS "."
2+
INCLUDE_DIRS "include"
3+
REQUIRES driver)
4+
include(package_manager)
5+
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})

components/spi_bus/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Component: SPI BUS
2+
3+
The SPI bus component (Bus) is a set of application-layer code built on top of the ESP-IDF peripheral driver code, It is mainly used for bus communication between ESP chips and external devices. From the point of application development, this component has the following features:
4+
5+
1. Simplified peripheral initialization processes
6+
2. Thread-safe device operations
7+
3. Simple and flexible RW operations
8+
9+
This component abstracts the following concepts:
10+
11+
1. Bus: the resource and configuration option shared between devices during communication
12+
2. Device: device specific resource and configuration option during communication
13+
14+
Each physical peripheral bus can mount one or more devices if the electrical condition allows, with the SPI bus addressing devices based on CS pins, thus achieving software independence between different devices on the same bus.
15+
16+
## Add component to your project
17+
18+
Please use the component manager command `add-dependency` to add the `spi_bus` to your project's dependency, during the `CMake` step the component will be downloaded automatically
19+
20+
```
21+
idf.py add-dependency "espressif/spi_bus=*"
22+
```
23+
24+
## How to use
25+
[spi_bus user guide](https://docs.espressif.com/projects/esp-iot-solution/en/latest/basic/bus/spi_bus.html)

0 commit comments

Comments
 (0)