Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8b747db
move externals into their respective components
finger563 Aug 19, 2024
4f2ab3f
rebase main
finger563 May 2, 2025
121b2b2
WIP #312 starting to add some idf component files for testing
finger563 Aug 19, 2024
349ddaf
update idf component
finger563 May 2, 2025
8cc4fda
update idf-component files
finger563 May 2, 2025
2ccb1fe
add _all_ the component manifest files which are hopefully correct. a…
finger563 May 2, 2025
c9ce302
fix tags
finger563 May 2, 2025
ce02417
remove unused component manifest
finger563 May 3, 2025
b7ae58a
fix manifests some more
finger563 May 3, 2025
07eb286
fix yaml for seed-studio-round-display
finger563 May 3, 2025
010d260
remove top level component manifest file
finger563 May 3, 2025
5e47254
update gfps component files
finger563 May 3, 2025
c954395
fix yml and lib build
finger563 May 3, 2025
3161c2a
fix upload to remove commented lines that messed up
finger563 May 3, 2025
9bb343d
change namespace
finger563 May 3, 2025
fd3a23c
turn off component manager for CI builds
finger563 May 3, 2025
9e52396
Add component readmes - copied and modified from the docs
finger563 May 5, 2025
8e496ed
update readme
finger563 May 5, 2025
cf91a98
add example paths to relevant component manifests
finger563 May 5, 2025
7f91184
add back specific targets for the BSP components
finger563 May 5, 2025
165aa85
use espp namespace now that we have it
finger563 May 6, 2025
fb1e18a
remove esp_littlefs from upload
finger563 May 6, 2025
30d5e83
Revert "add back specific targets for the BSP components"
finger563 May 6, 2025
4ecf892
update gh action to dry run except on releases and target proper bran…
finger563 May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,5 @@ jobs:
esp_idf_version: release-v5.4
target: ${{ matrix.test.target }}
path: ${{ matrix.test.path }}
# do not do CI build using component manager
command: IDF_COMPONENT_MANAGER=0 idf.py build
116 changes: 116 additions & 0 deletions .github/workflows/upload_components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Push component to https://components.espressif.com
on:
# For pull requests: perform upload with "--dry-run" argument,
# i.e. validate that the component passes all checks for being uploaded.
pull_request:

push:
branches:
- main
tags:
# only upload components on tagged commits
- v*
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v2
with:
# Please try to keep the directories list sorted.
#
# Do note, however, that if you are updating two components in the same PR
# and one depends on the other, the new version of the 2nd component won't
# be found in the registry when the 1st component is uploaded.
#
# This is only a problem if you are adding two components for the first time,
# or if the 2nd component depends on the exact (new) version of the first one.
#
components: |
components/adc
components/ads1x15
components/ads7138
components/as5600
components/aw9523
components/base_component
components/base_peripheral
components/binary-log
components/bldc_driver
components/bldc_haptics
components/bldc_motor
components/ble_gatt_server
components/bm8563
components/button
components/chsc6x
components/cli
components/codec
components/color
components/controller
components/cst816
components/csv
components/display
components/display_drivers
components/drv2605
components/encoder
components/esp-box
components/esp32-timer-cam
components/event_manager
components/file_system
components/filters
components/format
components/ft5x06
components/ftp
components/gfps_service
components/gt911
components/hid_service
components/hid-rp
components/i2c
components/icm20948
components/icm42607
components/input_drivers
components/interrupt
components/joystick
components/kts1622
components/led
components/led_strip
components/logger
components/math
components/matouch-rotary-display
components/max1704x
components/mcp23x17
components/monitor
components/motorgo-mini
components/mt6701
components/ndef
components/neopixel
components/nvs
components/pid
components/qtpy
components/qwiicnes
components/rmt
components/rtsp
components/runqueue
components/seeed-studio-round-display
components/serialization
components/socket
components/st25dv
components/state_machine
components/t_keyboard
components/t-deck
components/t-dongle-s3
components/tabulate
components/task
components/thermistor
components/timer
components/tla2528
components/tt21100
components/utils
components/vl53l
components/wifi
components/wrover-kit
namespace: "espp"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
dry_run: ${{ github.ref_name != 'main' || github.repository_owner != 'esp-cpp' || ! (github.event.release && github.event.action == 'published') }}
16 changes: 8 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "external/fmt"]
path = external/fmt
path = components/format/detail/fmt
url = https://github.com/fmtlib/fmt
[submodule "external/alpaca"]
path = external/alpaca
path = components/serialization/detail/alpaca
url = https://github.com/p-ranav/alpaca
[submodule "components/esp_littlefs"]
path = components/esp_littlefs
Expand All @@ -14,28 +14,28 @@
path = components/esp-dsp
url = https://github.com/espressif/esp-dsp
[submodule "external/csv2"]
path = external/csv2
path = components/csv/detail/csv2
url = https://github.com/p-ranav/csv2
[submodule "external/cli"]
path = external/cli
path = components/cli/detail/cli
url = https://github.com/daniele77/cli
[submodule "external/tabulate"]
path = external/tabulate
path = components/tabulate/detail/tabulate
url = https://github.com/p-ranav/tabulate
[submodule "lib/pybind11"]
path = lib/pybind11
url = https://github.com/pybind/pybind11
[submodule "external/magic_enum"]
path = external/magic_enum
path = components/state_machine/detail/magic_enum
url = https://github.com/neargye/magic_enum
[submodule "components/esp-nimble-cpp"]
path = components/esp-nimble-cpp
url = https://github.com/esp-cpp/esp-nimble-cpp
[submodule "external/hid-rp"]
path = external/hid-rp
path = components/hid-rp/detail/hid-rp
url = https://github.com/intergatedcircuits/hid-rp
[submodule "external/nearby"]
path = external/nearby
path = components/gfps_service/detail/nearby
url = https://github.com/google/nearby
[submodule "components/binary-log/detail"]
path = components/binary-log/detail
Expand Down
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you have questions or would like to chat, feel free to hop over to our discor
## Getting Started

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

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

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

2. If you have an existing project with a `components` directory, then you can
1. You can add dependencies on the components you want using the `idf component
manager`. All `espp` components are published to the [ESP Component
Registry](https://components.espressif.com) under the namespace `esp-cpp`.

For example, if you want to use the `task` component and the
`ble_gatt_server` components, you could run:

```console
idf.py add-dependency "esp-cpp/task^0.21.0"
idf.py add-dependency "esp-cpp/ble_gatt_server^0.21.0"
```

Alternatively, you could add the following dependencies to your
`main/idf_component.yml`:

```yaml
dependencies:
esp-cpp/ble_gatt_server:
version: '>=0.21.0'
esp-cpp/task:
version: '>=0.21.0'
# other dependencies here...
```

1. If you have an existing project with a `components` directory, then you can
clone `espp` as a submodule within that directory e.g. `git submodule add
https://github.com/esp-cpp/espp components/espp`, then make sure to run `git
submodule update --init --recursive`. Afterwards, simply update your
Expand All @@ -51,13 +75,10 @@ To use the components in this repository, you have a few options:
)
```

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

In the future (as part of #312), we may publish espp components (or even the
whole espp repo) as an IDF component via the idf-component-registry.

## Additional Information and Links

* [Documentation](https://esp-cpp.github.io/espp/) - github hosted version of
Expand Down
28 changes: 28 additions & 0 deletions components/adc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ADC (Analog to Digital Converter) Component

This component provides some classes which encapsulate analog value sampling
using the ESP's built-in ADC hardware and peripheral drivers.

## Oneshot ADC

The `OneshotAdc` allows the user a simple, low-resource way to sporadically (and
with moderate frequency needs) measure an analog voltage for multiple channels
on a single ADC UNIT. It does not start or manage any tasks and does not perform
any filtering on the data. Each time the user calls `read_raw(adc_channel_t)` or
`read_mv(adc_channel_t)`, it block and trigger an analog read for the associated
channel (if it was configured to do so).

## Continuous ADC

The `ContinuousAdc` provides a mechanism for high-frequency, continuous,
deterministic sampling of analog voltages for multiple channels (potentially
across multiple ADC units, depending on the ESP32 chip used). It does this be
enabling the continuous ADC DMA mode and then running its own task which
retrieves the data and filters it. When the user calls `get_mv(adc_channel_t)`,
it simply returns the most recent filtered value for that channel, if it was
configured.

## Example

There is an [example](./example) which shows the use of the `espp::OneshotAdc`
and the `espp::ContinuousAdc` components.
24 changes: 24 additions & 0 deletions components/adc/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## IDF Component Manager Manifest File
version: "0.21.0"
license: "MIT"
description: "ADC (oneshot and continuous) component for ESP-IDF"
url: "https://github.com/esp-cpp/espp/tree/main/components/adc"
repository: "git://github.com/esp-cpp/espp.git"
maintainers:
- William Emfinger <waemfinger@gmail.com>
documentation: "https://esp-cpp.github.io/espp/adc/index.html"
examples:
- path: example
tags:
- cpp
- Component
- ADC
- Oneshot
- Continuous
dependencies:
idf:
version: '>=5.0'
espp/base_component:
version: '>=0.21.0'
espp/task:
version: '>=0.21.0'
13 changes: 13 additions & 0 deletions components/ads1x15/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ads1x15 I2C ADC Expander

The `ADS1x15` provides a class for communicating with the ADS1x15 (ADS1015 and
ADS1115) family of I2C ADC chips with configurable gain and sampling rate.

## Example

The [example](./example) shows the use of the `Ads1x15` component to communicate
with an ADS1015 I2C analog to digital converter using the I2C peripheral of the
ESP32.

It uses the `task` component to periodically read two channels of analog data
from the ADS1015 and print them in CSV format using the `format` component.
23 changes: 23 additions & 0 deletions components/ads1x15/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## IDF Component Manager Manifest File
version: "0.21.0"
license: "MIT"
description: "ADS1x15 I2C ADC Expander component for ESP-IDF"
url: "https://github.com/esp-cpp/espp/tree/main/components/ads1x15"
repository: "git://github.com/esp-cpp/espp.git"
maintainers:
- William Emfinger <waemfinger@gmail.com>
documentation: "https://esp-cpp.github.io/espp/adc/ads1x15.html"
examples:
- path: example
tags:
- cpp
- Component
- ADC
- I2C
- Peripheral
- Expander
dependencies:
idf:
version: '>=5.0'
espp/base_peripheral:
version: '>=0.21.0'
16 changes: 16 additions & 0 deletions components/ads7138/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ads7138 I2C ADC Expander

The `Ads7138` class implements support for the Texas Instruments ADS7138 12-bit
8-channel ADC. The ADS7138 is a 12-bit, 8-channel, low-power, successive
approximation register (SAR) analog-to-digital converter (ADC) which can
configure any of its 8 channels as single-ended analog inputs, digital inputs,
or digital outputs. It has an operating mode that allows the user to configure
the device for a single conversion, or to automatically convert on a continuous
basis.

## Example

The [example](./example) shows the use of the `Ads7138` component to communicate
with an ADS7138 I2C analog to digital converter using the I2C peripheral of the
ESP32.

23 changes: 23 additions & 0 deletions components/ads7138/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## IDF Component Manager Manifest File
version: "0.21.0"
license: "MIT"
description: "ADS7138 I2C ADC Expander component for ESP-IDF"
url: "https://github.com/esp-cpp/espp/tree/main/components/ads7138"
repository: "git://github.com/esp-cpp/espp.git"
maintainers:
- William Emfinger <waemfinger@gmail.com>
documentation: "https://esp-cpp.github.io/espp/adc/ads7138.html"
examples:
- path: example
tags:
- cpp
- Component
- ADC
- I2C
- Peripheral
- Expander
dependencies:
idf:
version: '>=5.0'
espp/base_peripheral:
version: '>=0.21.0'
28 changes: 28 additions & 0 deletions components/as5600/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# As5600 Magnetic Encoder

The `AS5600` magnetic encoder component provides the user a convenient way to
measure

* Raw count
* Raw radians
* Raw degrees
* Accumulated count (since the component was created)
* Accumulated radians (since the component was created)
* Accumulated degrees (since the component was created)
* Speed (rotations per minute / RPM)

It does so by spawning a task which periodically reads the magnetic encoder,
updates the accumulator, and computes the velocity. The component can be
configured to optionally filter the velocity.

The periodicity / update rate of the encoder can be configured at time of
creation.

The encoder is designed to fulfill the needs of the `BldcMotor` API, to provide
closed-loop motor control.

## Example

The [example](./example) shows the use of the `As5600` component to communicate
with an AS5600 I2C magnetic encoder chip.

Loading
Loading