sheldonix/esp_io_expander_xl9555

0.8.0

Latest
uploaded 2 days ago
ESP-IDF component driver for the XL9555 I/O expander

readme

# esp-io-expander-xl9555

ESP-IDF component driver for the XL9555 I/O expander.
Built on the official `esp_io_expander` base interface.

## Install

Use the ESP-IDF component manager:

```bash
idf.py add-dependency "sheldonix/esp_io_expander_xl9555^0.8.0"
```

## Usage

```c
#include "esp_io_expander.h"
#include "esp_io_expander_xl9555.h"

esp_io_expander_handle_t expander = NULL;
ESP_ERROR_CHECK(esp_io_expander_new_i2c_xl9555(bus_handle, 0x20, &expander));

ESP_ERROR_CHECK(esp_io_expander_set_dir(expander, IO_EXPANDER_PIN_NUM_0, IO_EXPANDER_OUTPUT));
ESP_ERROR_CHECK(esp_io_expander_set_level(expander, IO_EXPANDER_PIN_NUM_0, 1));
```

## Examples

Two ESP-IDF example projects are provided:

- `examples/xl9555_basic`: Toggle a single output pin (default P0) every 500 ms.
- `examples/xl9555_input`: Read a single input pin (default P0) every 500 ms.

Build and flash an example:

```bash
cd examples/xl9555_basic
idf.py set-target esp32s3
idf.py menuconfig
idf.py build flash monitor
```

Each example exposes its own menu in `idf.py menuconfig`:
- `XL9555 Basic Example`
- `XL9555 Input Example`

## Configuration

Kconfig options:

```text
XL9555_I2C_TIMEOUT_MS     I2C transaction timeout
XL9555_DEFAULT_OUTPUT     Default output register value (16-bit)
```

Note: XL9555 does not provide internal pull-ups/pull-downs; ensure external circuitry sets a defined input level.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

[![GitHub](https://img.shields.io/badge/Github-sheldonix%2Fesp_io_expander_xl9555-green?logo=github)](https://github.com/sheldonix/esp_io_expander_xl9555)

## License
[Apache-2.0](./LICENSE)

Links

Supports all targets

License: Apache-2.0

To add this component to your project, run:

idf.py add-dependency "sheldonix/esp_io_expander_xl9555^0.8.0"

download archive

Stats

  • Archive size
    Archive size ~ 14.83 KB
  • Downloaded in total
    Downloaded in total 1 time
  • Downloaded this version
    This version: 1 time

Badge

sheldonix/esp_io_expander_xl9555 version: 0.8.0
|