Skip to content

Extend bus types and structure for Peripheral Manager #8888

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

Merged
merged 14 commits into from
Nov 25, 2023

Conversation

P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y commented Nov 15, 2023

Description of Change

This PR extends informations about the pin in Peripheral manager:

  • Adds more specific bus types for peripherals pins.
  • Adds bus_num option to specify bus number or unit.
  • Adds bus_channel option to specify bus channel.
  • Adds new custom option to set extra_type for the bus used on the pin.

All of those informations will be printed by printPerimanInfo() after end of Setup() if proper debug level is set.

  • Added new file extra_attr.h for easier use for some struct attributes.

Output example:

Before:

------------------------------------------
GPIO Info:
------------------------------------------
                  0 : ADC_ONESHOT
                  1 : UART_TX
                  3 : UART_RX
                  5 : GPIO
                 18 : SPI_MASTER
                 19 : SPI_MASTER
                 21 : I2C_MASTER
                 22 : I2C_MASTER
                 23 : SPI_MASTER
                 26 : UART_RX
                 27 : UART_TX
============ After Setup End =============

With changes in PR:

------------------------------------------
GPIO Info:
------------------------------------------
  GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------  
     0 : ADC_ONESHOT[1][1]
     1 : UART_TX[0]
     3 : UART_RX[0]
     5 : SD_SS
    18 : SPI_MASTER_SCK[3]
    19 : SPI_MASTER_MISO[3]
    21 : I2C_MASTER_SDA[0]
    22 : I2C_MASTER_SCL[0]
    23 : SPI_MASTER_MOSI[3]
    26 : UART_RX[1]
    27 : UART_TX[1]
============ After Setup End =============

Tests scenarios

Locally on ESP32 + CI.

Related links

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Nov 15, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y changed the title Extended bus types for peripheral manager Extended bus types for Peripheral Manager Nov 15, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y added this to the 3.0.0 milestone Nov 15, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y changed the title Extended bus types for Peripheral Manager Extend bus types and structure for Peripheral Manager Nov 16, 2023
@me-no-dev
Copy link
Member

please post example sketch and output :)

Copy link
Collaborator

@lucasssvaz lucasssvaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it. Everything worked as expected.

void * bus;
int8_t bus_num;
int8_t bus_channel;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't extra_type be changed to description? I couldn't see other usage for it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is an extra type. That is what is being used for. We added it for the cases where GPIO is being used for some specific task (like CS, RST, DC, etc.) and cases where different peripherals are used for some other specific task/driver. Hypothetic example would be implementing NeoPixel over RMT/Else and setting the extra type as NEOPIXEL_OUT

@SuGlider SuGlider self-requested a review November 24, 2023 13:09
Copy link
Collaborator

@SuGlider SuGlider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very Good Improvement @P-R-O-C-H-Y !

@SuGlider SuGlider added Status: Pending Merge Pull Request is ready to be merged 3.0 migration issue relates to migration from 2.X to 3.X version and removed 3.0 migration issue relates to migration from 2.X to 3.X version labels Nov 24, 2023
@SuGlider
Copy link
Collaborator

@me-no-dev - I think that we could already merge it.

@me-no-dev me-no-dev merged commit 0d0d27f into espressif:master Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Merge Pull Request is ready to be merged
Projects
Development

Successfully merging this pull request may close these issues.

4 participants