Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[io_bus] Add i80 parallel bus and parent #6787

Open
wants to merge 31 commits into
base: dev
Choose a base branch
from

Conversation

clydebarrow
Copy link
Contributor

@clydebarrow clydebarrow commented May 21, 2024

What does this implement/fix?

Types of changes

Add a new bus parallel type - i80 - used for interfacing LCD display controllers. This is used in a similar way to the spi component, and will be utilised by the ili9xxx display driver, enabling support for the Seeed W32-SC01-Plus and the LilyGo T-Display S3.

NOTE

This PR is not usable on its own for driving those displays. Until this and subsequent PRs are merged, use #6537 which also has the ili9xxx driver changes.

The changes have been tested on the above as well as numerous SPI interfaced displays previously supported by ili9xxx to ensure that nothing has been broken in the process.

This PR contains only the io_bus and i80 components. Further PRs will add the functionality to the SPI and ili9xxx components.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3761

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml
i80:
  dc_pin: 7
  wr_pin: 8
  rd_pin: 9
  data_pins:
    - 39
    - 40
    - 41
    - 42
    -
      ignore_strapping_warning: true
      number: 45
    -
      ignore_strapping_warning: true
      number: 46
    - 47
    - 48
    
display:
  - platform: ili9xxx
    bus_type: i80
    cs_pin: 6
    reset_pin: 5
    model: st7789v

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

Remove send_command() from ili9xxx
Introduce shim IOBus class for Waveshare 3.5 to work-around the above.
@clydebarrow clydebarrow requested a review from a team as a code owner May 21, 2024 02:16
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.88%. Comparing base (4d8b5ed) to head (2c5b093).
Report is 688 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6787      +/-   ##
==========================================
+ Coverage   53.70%   53.88%   +0.17%     
==========================================
  Files          50       50              
  Lines        9408     9619     +211     
  Branches     1654     1698      +44     
==========================================
+ Hits         5053     5183     +130     
- Misses       4056     4112      +56     
- Partials      299      324      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bearpawmaxim
Copy link
Contributor

bearpawmaxim commented May 24, 2024

Hello @clydebarrow !

How can I use this with my WT32-SC01 Plus screen?
There are no changes for ili9xxx component in this pr, so it fails on the bus_type validation...
If using your iobus branch, it also fails with the same.

Here's my config

substitutions:
  device_name: battery-controller
      
packages:
  device_common: !include .device_common.yaml

esphome:
  name: battery-controller
  friendly_name: battery-controller

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

external_components:
  - source: github://pr#6787
    components: [io_bus, i80]
  - source: github://clydebarrow/esphome@iobus
    components: [ili9xxx]
    refresh: 1s

# Enable logging
logger:

i80:
  dc_pin: 7
  wr_pin: 8
  rd_pin: 9
  data_pins:
    - 39
    - 40
    - 41
    - 42
    - ignore_strapping_warning: true
      number: 45
    - ignore_strapping_warning: true
      number: 46
    - 47
    - 48

spi:

display:
  - platform: ili9xxx
    bus_type: i80
    model: st7796
    dc_pin: GPIO1
    reset_pin: GPIO2

@clydebarrow
Copy link
Contributor Author

You need to use #6537 for now. That was the original complete PR. I was asked to split that into parts, this is just the first part, the others have to wait for this to be merged. But you should be able to use the original PR as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants