Skip to content

boards/esp32: changes the approach for configurations of I2C in board definitions#11291

Merged
MrKevinWeiss merged 2 commits intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/periph/conf/i2c
May 9, 2019
Merged

boards/esp32: changes the approach for configurations of I2C in board definitions#11291
MrKevinWeiss merged 2 commits intoRIOT-OS:masterfrom
gschorcht:cpu/esp32/periph/conf/i2c

Conversation

@gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Mar 27, 2019

Contribution description

This PR changes the approach of peripheral configurations for I2C in board definitions to the usual RIOT approach. With these changes, peripheral configurations use static const arrays in the boards/esp32*/periph_conf.h files and define the *_NUMOF macros using the size of these static array.

The static configuration arrays contain only definitions that can be changed by the board definition or the application. They do not contain any MCU implementation detail. The board definitions use preprocessor defines as before to fill these static configuration arrays. This makes it possible to override all configurations either with the make command or application specific configuration files.

Please note that commit 8b48dfd is in also in related PRs to get each PR compilable separately.

Testing procedure

Compilation and test with the most common ESP32 board should be executed

make BOARD=esp32-wroom-32 -C tests/periph_i2c flash test

Issues/PRs references

PRs #11289 #11290 #11291 #11292 #11293 #11294 are releated and should be merged together.

@MrKevinWeiss
Copy link
Contributor

I will add it to the list but it will require some testing since it is a structure change and not just a cleanup.

@gschorcht
Copy link
Contributor Author

@MrKevinWeiss Thanks 😄 Sorry, for so many new PRs. Initally, they all were part of the single PR #10644 but splitted now into a separate PR for each peripheral by request from @leandrolanzieri for easier reviewing.

In case of I2C, I have tested it with

make BOARD=esp32-wroom-32 -C tests/driver_lis3mdl

without any problems.

Please, don't wonder about the changes of GPIO definitions in cpu/esp32/periph_cpu.h. These are part of all PRs to make them all compilable. The changes became necessary to have gpio_t and GPIO_* macros defined in boards/common/esp32/include/periph_conf_common.h.

@MrKevinWeiss
Copy link
Contributor

hey all were part of the single PR #10644 but splitted now into a separate PR

That is a good thing!

I will rerun it through the RF tests to be sure (they have negative testing). Just need a bit of time to setup.

@MrKevinWeiss MrKevinWeiss added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 28, 2019
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

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

I would say it looks good. I also tested it and it appears to work (just manually against PHiLIP). There are wrong error codes but that isn't related to this PR and I will soon add a test to expose that so don't worry about it now. I will ACK.

@MrKevinWeiss
Copy link
Contributor

I will let @leandrolanzieri coordinate the merging.

@leandrolanzieri leandrolanzieri added the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 29, 2019
@gschorcht gschorcht force-pushed the cpu/esp32/periph/conf/i2c branch from 0cdbecc to b3116e7 Compare May 2, 2019 14:16
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 2, 2019
gschorcht added 2 commits May 6, 2019 13:32
I2C devices are now configured using static array in header files instead of static variables in implementation to be able to define I2C_NUMOF using the size of the array instead of a variable.
I2C devices are now configured using static array in header files instead of static variables in implementation to be able to define I2C_NUMOF using the size of the array instead of a variable.
@gschorcht gschorcht force-pushed the cpu/esp32/periph/conf/i2c branch from b3116e7 to 6a3bc3e Compare May 6, 2019 11:32
@MrKevinWeiss MrKevinWeiss removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 9, 2019
@MrKevinWeiss MrKevinWeiss added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 9, 2019
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

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

Quick retests against philip (flashing, reading and writing registers). Seems good. ACK!

@MrKevinWeiss MrKevinWeiss merged commit 6afb060 into RIOT-OS:master May 9, 2019
@gschorcht
Copy link
Contributor Author

@MrKevinWeiss Thanks a lot for testing and reviewing it again 😄

@gschorcht gschorcht deleted the cpu/esp32/periph/conf/i2c branch May 9, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants