Skip to content

Commit 4e8ee55

Browse files
authored
feat: idf-component-manager support (#419)
* move externals into their respective components * rebase main * WIP #312 starting to add some idf component files for testing * update idf component * update idf-component files * add _all_ the component manifest files which are hopefully correct. add github action for triggering upload * fix tags * remove unused component manifest * fix manifests some more * fix yaml for seed-studio-round-display * remove top level component manifest file * update gfps component files * fix yml and lib build * fix upload to remove commented lines that messed up * change namespace * turn off component manager for CI builds * Add component readmes - copied and modified from the docs * update readme * add example paths to relevant component manifests * add back specific targets for the BSP components * use espp namespace now that we have it * remove esp_littlefs from upload * Revert "add back specific targets for the BSP components" This reverts commit 7f91184. * update gh action to dry run except on releases and target proper branch name; move idf component versions over to 0.21.0 in prep for release
1 parent 279283f commit 4e8ee55

File tree

194 files changed

+3851
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+3851
-49
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,5 @@ jobs:
176176
esp_idf_version: release-v5.4
177177
target: ${{ matrix.test.target }}
178178
path: ${{ matrix.test.path }}
179+
# do not do CI build using component manager
180+
command: IDF_COMPONENT_MANAGER=0 idf.py build
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Push component to https://components.espressif.com
2+
on:
3+
# For pull requests: perform upload with "--dry-run" argument,
4+
# i.e. validate that the component passes all checks for being uploaded.
5+
pull_request:
6+
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
# only upload components on tagged commits
12+
- v*
13+
jobs:
14+
upload_components:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: "recursive"
20+
- name: Upload component to the component registry
21+
uses: espressif/upload-components-ci-action@v2
22+
with:
23+
# Please try to keep the directories list sorted.
24+
#
25+
# Do note, however, that if you are updating two components in the same PR
26+
# and one depends on the other, the new version of the 2nd component won't
27+
# be found in the registry when the 1st component is uploaded.
28+
#
29+
# This is only a problem if you are adding two components for the first time,
30+
# or if the 2nd component depends on the exact (new) version of the first one.
31+
#
32+
components: |
33+
components/adc
34+
components/ads1x15
35+
components/ads7138
36+
components/as5600
37+
components/aw9523
38+
components/base_component
39+
components/base_peripheral
40+
components/binary-log
41+
components/bldc_driver
42+
components/bldc_haptics
43+
components/bldc_motor
44+
components/ble_gatt_server
45+
components/bm8563
46+
components/button
47+
components/chsc6x
48+
components/cli
49+
components/codec
50+
components/color
51+
components/controller
52+
components/cst816
53+
components/csv
54+
components/display
55+
components/display_drivers
56+
components/drv2605
57+
components/encoder
58+
components/esp-box
59+
components/esp32-timer-cam
60+
components/event_manager
61+
components/file_system
62+
components/filters
63+
components/format
64+
components/ft5x06
65+
components/ftp
66+
components/gfps_service
67+
components/gt911
68+
components/hid_service
69+
components/hid-rp
70+
components/i2c
71+
components/icm20948
72+
components/icm42607
73+
components/input_drivers
74+
components/interrupt
75+
components/joystick
76+
components/kts1622
77+
components/led
78+
components/led_strip
79+
components/logger
80+
components/math
81+
components/matouch-rotary-display
82+
components/max1704x
83+
components/mcp23x17
84+
components/monitor
85+
components/motorgo-mini
86+
components/mt6701
87+
components/ndef
88+
components/neopixel
89+
components/nvs
90+
components/pid
91+
components/qtpy
92+
components/qwiicnes
93+
components/rmt
94+
components/rtsp
95+
components/runqueue
96+
components/seeed-studio-round-display
97+
components/serialization
98+
components/socket
99+
components/st25dv
100+
components/state_machine
101+
components/t_keyboard
102+
components/t-deck
103+
components/t-dongle-s3
104+
components/tabulate
105+
components/task
106+
components/thermistor
107+
components/timer
108+
components/tla2528
109+
components/tt21100
110+
components/utils
111+
components/vl53l
112+
components/wifi
113+
components/wrover-kit
114+
namespace: "espp"
115+
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
116+
dry_run: ${{ github.ref_name != 'main' || github.repository_owner != 'esp-cpp' || ! (github.event.release && github.event.action == 'published') }}

.gitmodules

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[submodule "external/fmt"]
2-
path = external/fmt
2+
path = components/format/detail/fmt
33
url = https://github.com/fmtlib/fmt
44
[submodule "external/alpaca"]
5-
path = external/alpaca
5+
path = components/serialization/detail/alpaca
66
url = https://github.com/p-ranav/alpaca
77
[submodule "components/esp_littlefs"]
88
path = components/esp_littlefs
@@ -14,28 +14,28 @@
1414
path = components/esp-dsp
1515
url = https://github.com/espressif/esp-dsp
1616
[submodule "external/csv2"]
17-
path = external/csv2
17+
path = components/csv/detail/csv2
1818
url = https://github.com/p-ranav/csv2
1919
[submodule "external/cli"]
20-
path = external/cli
20+
path = components/cli/detail/cli
2121
url = https://github.com/daniele77/cli
2222
[submodule "external/tabulate"]
23-
path = external/tabulate
23+
path = components/tabulate/detail/tabulate
2424
url = https://github.com/p-ranav/tabulate
2525
[submodule "lib/pybind11"]
2626
path = lib/pybind11
2727
url = https://github.com/pybind/pybind11
2828
[submodule "external/magic_enum"]
29-
path = external/magic_enum
29+
path = components/state_machine/detail/magic_enum
3030
url = https://github.com/neargye/magic_enum
3131
[submodule "components/esp-nimble-cpp"]
3232
path = components/esp-nimble-cpp
3333
url = https://github.com/esp-cpp/esp-nimble-cpp
3434
[submodule "external/hid-rp"]
35-
path = external/hid-rp
35+
path = components/hid-rp/detail/hid-rp
3636
url = https://github.com/intergatedcircuits/hid-rp
3737
[submodule "external/nearby"]
38-
path = external/nearby
38+
path = components/gfps_service/detail/nearby
3939
url = https://github.com/google/nearby
4040
[submodule "components/binary-log/detail"]
4141
path = components/binary-log/detail

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you have questions or would like to chat, feel free to hop over to our discor
2828
## Getting Started
2929

3030
The components in this repository are targeted towards ESP-IDF >=5.0, though
31-
they are mainly tested against 5.2 right now.
31+
they are mainly tested against 5.4 right now.
3232

3333
To use the components in this repository, you have a few options:
3434

@@ -38,7 +38,31 @@ To use the components in this repository, you have a few options:
3838
submodule, along with the appropriate configuration in the top-level
3939
CMakeLists.txt.
4040

41-
2. If you have an existing project with a `components` directory, then you can
41+
1. You can add dependencies on the components you want using the `idf component
42+
manager`. All `espp` components are published to the [ESP Component
43+
Registry](https://components.espressif.com) under the namespace `esp-cpp`.
44+
45+
For example, if you want to use the `task` component and the
46+
`ble_gatt_server` components, you could run:
47+
48+
```console
49+
idf.py add-dependency "esp-cpp/task^0.21.0"
50+
idf.py add-dependency "esp-cpp/ble_gatt_server^0.21.0"
51+
```
52+
53+
Alternatively, you could add the following dependencies to your
54+
`main/idf_component.yml`:
55+
56+
```yaml
57+
dependencies:
58+
esp-cpp/ble_gatt_server:
59+
version: '>=0.21.0'
60+
esp-cpp/task:
61+
version: '>=0.21.0'
62+
# other dependencies here...
63+
```
64+
65+
1. If you have an existing project with a `components` directory, then you can
4266
clone `espp` as a submodule within that directory e.g. `git submodule add
4367
https://github.com/esp-cpp/espp components/espp`, then make sure to run `git
4468
submodule update --init --recursive`. Afterwards, simply update your
@@ -51,13 +75,10 @@ To use the components in this repository, you have a few options:
5175
)
5276
```
5377

54-
3. You can clone espp somewhere on your computer and then point your project to
78+
1. You can clone espp somewhere on your computer and then point your project to
5579
its `components` directory to use any of the components it contains, similar
5680
to the step above.
5781

58-
In the future (as part of #312), we may publish espp components (or even the
59-
whole espp repo) as an IDF component via the idf-component-registry.
60-
6182
## Additional Information and Links
6283

6384
* [Documentation](https://esp-cpp.github.io/espp/) - github hosted version of

components/adc/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ADC (Analog to Digital Converter) Component
2+
3+
This component provides some classes which encapsulate analog value sampling
4+
using the ESP's built-in ADC hardware and peripheral drivers.
5+
6+
## Oneshot ADC
7+
8+
The `OneshotAdc` allows the user a simple, low-resource way to sporadically (and
9+
with moderate frequency needs) measure an analog voltage for multiple channels
10+
on a single ADC UNIT. It does not start or manage any tasks and does not perform
11+
any filtering on the data. Each time the user calls `read_raw(adc_channel_t)` or
12+
`read_mv(adc_channel_t)`, it block and trigger an analog read for the associated
13+
channel (if it was configured to do so).
14+
15+
## Continuous ADC
16+
17+
The `ContinuousAdc` provides a mechanism for high-frequency, continuous,
18+
deterministic sampling of analog voltages for multiple channels (potentially
19+
across multiple ADC units, depending on the ESP32 chip used). It does this be
20+
enabling the continuous ADC DMA mode and then running its own task which
21+
retrieves the data and filters it. When the user calls `get_mv(adc_channel_t)`,
22+
it simply returns the most recent filtered value for that channel, if it was
23+
configured.
24+
25+
## Example
26+
27+
There is an [example](./example) which shows the use of the `espp::OneshotAdc`
28+
and the `espp::ContinuousAdc` components.

components/adc/idf_component.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## IDF Component Manager Manifest File
2+
version: "0.21.0"
3+
license: "MIT"
4+
description: "ADC (oneshot and continuous) component for ESP-IDF"
5+
url: "https://github.com/esp-cpp/espp/tree/main/components/adc"
6+
repository: "git://github.com/esp-cpp/espp.git"
7+
maintainers:
8+
- William Emfinger <waemfinger@gmail.com>
9+
documentation: "https://esp-cpp.github.io/espp/adc/index.html"
10+
examples:
11+
- path: example
12+
tags:
13+
- cpp
14+
- Component
15+
- ADC
16+
- Oneshot
17+
- Continuous
18+
dependencies:
19+
idf:
20+
version: '>=5.0'
21+
espp/base_component:
22+
version: '>=0.21.0'
23+
espp/task:
24+
version: '>=0.21.0'

components/ads1x15/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ads1x15 I2C ADC Expander
2+
3+
The `ADS1x15` provides a class for communicating with the ADS1x15 (ADS1015 and
4+
ADS1115) family of I2C ADC chips with configurable gain and sampling rate.
5+
6+
## Example
7+
8+
The [example](./example) shows the use of the `Ads1x15` component to communicate
9+
with an ADS1015 I2C analog to digital converter using the I2C peripheral of the
10+
ESP32.
11+
12+
It uses the `task` component to periodically read two channels of analog data
13+
from the ADS1015 and print them in CSV format using the `format` component.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## IDF Component Manager Manifest File
2+
version: "0.21.0"
3+
license: "MIT"
4+
description: "ADS1x15 I2C ADC Expander component for ESP-IDF"
5+
url: "https://github.com/esp-cpp/espp/tree/main/components/ads1x15"
6+
repository: "git://github.com/esp-cpp/espp.git"
7+
maintainers:
8+
- William Emfinger <waemfinger@gmail.com>
9+
documentation: "https://esp-cpp.github.io/espp/adc/ads1x15.html"
10+
examples:
11+
- path: example
12+
tags:
13+
- cpp
14+
- Component
15+
- ADC
16+
- I2C
17+
- Peripheral
18+
- Expander
19+
dependencies:
20+
idf:
21+
version: '>=5.0'
22+
espp/base_peripheral:
23+
version: '>=0.21.0'

components/ads7138/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ads7138 I2C ADC Expander
2+
3+
The `Ads7138` class implements support for the Texas Instruments ADS7138 12-bit
4+
8-channel ADC. The ADS7138 is a 12-bit, 8-channel, low-power, successive
5+
approximation register (SAR) analog-to-digital converter (ADC) which can
6+
configure any of its 8 channels as single-ended analog inputs, digital inputs,
7+
or digital outputs. It has an operating mode that allows the user to configure
8+
the device for a single conversion, or to automatically convert on a continuous
9+
basis.
10+
11+
## Example
12+
13+
The [example](./example) shows the use of the `Ads7138` component to communicate
14+
with an ADS7138 I2C analog to digital converter using the I2C peripheral of the
15+
ESP32.
16+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## IDF Component Manager Manifest File
2+
version: "0.21.0"
3+
license: "MIT"
4+
description: "ADS7138 I2C ADC Expander component for ESP-IDF"
5+
url: "https://github.com/esp-cpp/espp/tree/main/components/ads7138"
6+
repository: "git://github.com/esp-cpp/espp.git"
7+
maintainers:
8+
- William Emfinger <waemfinger@gmail.com>
9+
documentation: "https://esp-cpp.github.io/espp/adc/ads7138.html"
10+
examples:
11+
- path: example
12+
tags:
13+
- cpp
14+
- Component
15+
- ADC
16+
- I2C
17+
- Peripheral
18+
- Expander
19+
dependencies:
20+
idf:
21+
version: '>=5.0'
22+
espp/base_peripheral:
23+
version: '>=0.21.0'

0 commit comments

Comments
 (0)