Skip to content

drivers/tmp00x : Expose Configurations to Kconfig #13989

Merged
leandrolanzieri merged 3 commits intoRIOT-OS:masterfrom
akshaim:Kconfig_tmp00x_1
May 20, 2020
Merged

drivers/tmp00x : Expose Configurations to Kconfig #13989
leandrolanzieri merged 3 commits intoRIOT-OS:masterfrom
akshaim:Kconfig_tmp00x_1

Conversation

@akshaim
Copy link
Copy Markdown
Member

@akshaim akshaim commented Apr 30, 2020

Contribution description

This PR exposes compile configurations in TMP006/TMP007 Sensor Device driver to Kconfig.

Testing procedure

  1. New documentation was built using doxygen

The build worked fine.

  1. New macro was introduced in tests/driver_tmp00x/main.c for testing.
#define STR(x)   #x
#define SHOW_DEFINE(x) printf("%s=%s\n", #x, STR(x))

Firmware was uploaded to FIT IoT Lab test bed.

Default State:

Firmware Output

main(): This is RIOT! (Version: 2020.07-devel-309-g0af78-Kconfig_tmp00x_1_tests)
CONFIG_TMP00X_I2C_ADDRESS=(0x40)
CONFIG_TMP00X_CONVERSION_TIME=(1E6)
CONFIG_TMP00X_USE_LOW_POWER=CONFIG_TMP00X_USE_LOW_POWER
CONFIG_TMP00X_USE_RAW_VALUES=CONFIG_TMP00X_USE_RAW_VALUES
TMP00X infrared thermopile sensor driver test application

Initializing TMP00X sensor at I2C_0 ... tmp00x_init: error reading device ID!
init device [ERROR]

Usage with CFLAGS

/tests/driver_tmp00x/Makefile

CFLAGS += -DCONFIG_TMP00X_I2C_ADDRESS=0x41
CFLAGS += -DCONFIG_TMP00X_CONVERSION_TIME=2E6
CFLAGS += -DCONFIG_TMP00X_USE_LOW_POWER=1
CFLAGS += -DCONFIG_TMP00X_USE_RAW_VALUES=1

Firmware Output

main(): This is RIOT! (Version: 2020.07-devel-310-gba881-Kconfig_tmp00x_1_tests)
CONFIG_TMP00X_I2C_ADDRESS=0x41
CONFIG_TMP00X_CONVERSION_TIME=2E6
CONFIG_TMP00X_USE_LOW_POWER=1
CONFIG_TMP00X_USE_RAW_VALUES=1
TMP00X infrared thermopile sensor driver test application

Initializing TMP00X sensor at I2C_0 ... tmp00x_init: error reading device ID!
init device [ERROR]

Usage with Kconfig

/tests/driver_tmp00x/

make menuconfig

Firmware Output

main(): This is RIOT! (Version: 2020.07-devel-310-ga6e69-Kconfig_tmp00x_1_tests)
CONFIG_TMP00X_I2C_ADDRESS=0x45
CONFIG_TMP00X_CONVERSION_TIME=(25E4)
CONFIG_TMP00X_USE_LOW_POWER=1
CONFIG_TMP00X_USE_RAW_VALUES=1
TMP00X infrared thermopile sensor driver test application

Initializing TMP00X sensor at I2C_0 ... tmp00x_init: error reading device ID!
init device [ERROR]

Note : The sensor is not available for interfacing hence configurability of macros were only tested.

Issues/PRs references

#12888
@leandrolanzieri Please merge this only after #13981

@leandrolanzieri leandrolanzieri added Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Apr 30, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.07 milestone Apr 30, 2020
@leandrolanzieri leandrolanzieri removed the State: waiting for other PR State: The PR requires another PR to be merged first label May 4, 2020
@leandrolanzieri
Copy link
Copy Markdown
Contributor

Please rebase

@akshaim akshaim force-pushed the Kconfig_tmp00x_1 branch from 4bcd889 to ecec2ea Compare May 4, 2020 12:00
@akshaim
Copy link
Copy Markdown
Member Author

akshaim commented May 4, 2020

Please rebase

Done.

@akshaim akshaim force-pushed the Kconfig_tmp00x_1 branch from e01571b to 5f19159 Compare May 13, 2020 09:53
@leandrolanzieri
Copy link
Copy Markdown
Contributor

Result of the driver test application:

2020-05-18 14:44:25,454 # a�main(): This is RIOT! (Version: 2020.07-devel-523-g5f191-Kconfig_tmp00x_1)
2020-05-18 14:44:25,459 # TMP00X infrared thermopile sensor driver test application
2020-05-18 14:44:25,463 # 
2020-05-18 14:44:29,461 # Initializing TMP00X sensor at I2C_0 ... [SUCCESS]
2020-05-18 14:44:29,461 # 
2020-05-18 14:44:29,465 # Raw data T:  3056   V:   -43
2020-05-18 14:44:29,469 # Data Tabm: 2387   Tobj: 2711
2020-05-18 14:44:33,469 # Raw data T:  3052   V:   106
2020-05-18 14:44:33,472 # Data Tabm: 2384   Tobj: 3039
2020-05-18 14:44:37,471 # Raw data T:  3048   V:   110
2020-05-18 14:44:37,474 # Data Tabm: 2381   Tobj: 3045
2020-05-18 14:44:41,474 # Raw data T:  3044   V:   103
2020-05-18 14:44:41,477 # Data Tabm: 2378   Tobj: 3026
2020-05-18 14:44:45,476 # Raw data T:  3044   V:   120
2020-05-18 14:44:45,479 # Data Tabm: 2378   Tobj: 3063
2020-05-18 14:44:49,479 # Raw data T:  3036   V:   -70
2020-05-18 14:44:49,483 # Data Tabm: 2371   Tobj: 2633

I changed the conversion time to 4 seconds via menuconfig

@akshaim
Copy link
Copy Markdown
Member Author

akshaim commented May 18, 2020

Result of the driver test application:

2020-05-18 14:44:25,454 # a�main(): This is RIOT! (Version: 2020.07-devel-523-g5f191-Kconfig_tmp00x_1)
2020-05-18 14:44:25,459 # TMP00X infrared thermopile sensor driver test application
2020-05-18 14:44:25,463 # 
2020-05-18 14:44:29,461 # Initializing TMP00X sensor at I2C_0 ... [SUCCESS]
2020-05-18 14:44:29,461 # 
2020-05-18 14:44:29,465 # Raw data T:  3056   V:   -43
2020-05-18 14:44:29,469 # Data Tabm: 2387   Tobj: 2711
2020-05-18 14:44:33,469 # Raw data T:  3052   V:   106
2020-05-18 14:44:33,472 # Data Tabm: 2384   Tobj: 3039
2020-05-18 14:44:37,471 # Raw data T:  3048   V:   110
2020-05-18 14:44:37,474 # Data Tabm: 2381   Tobj: 3045
2020-05-18 14:44:41,474 # Raw data T:  3044   V:   103
2020-05-18 14:44:41,477 # Data Tabm: 2378   Tobj: 3026
2020-05-18 14:44:45,476 # Raw data T:  3044   V:   120
2020-05-18 14:44:45,479 # Data Tabm: 2378   Tobj: 3063
2020-05-18 14:44:49,479 # Raw data T:  3036   V:   -70
2020-05-18 14:44:49,483 # Data Tabm: 2371   Tobj: 2633

I changed the conversion time to 4 seconds via menuconfig

Nice. Thanks for posting the test results.

@leandrolanzieri
Copy link
Copy Markdown
Contributor

Looks good. Please squash.

akshaim and others added 3 commits May 20, 2020 19:09
Add CONFIG_ prefix to compile configurations
Model CONFIG_TMP00X_USE_LOW_POWER and CONFIG_TMP00X_USE_RAW_VALUES
as bool
Expose configurations to Kconfig

Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
@akshaim akshaim force-pushed the Kconfig_tmp00x_1 branch from a47dc87 to 74a7bb2 Compare May 20, 2020 13:40
@akshaim
Copy link
Copy Markdown
Member Author

akshaim commented May 20, 2020

Looks good. Please squash.

Done.

@leandrolanzieri leandrolanzieri added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels May 20, 2020
Copy link
Copy Markdown
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

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

ACK.

@leandrolanzieri leandrolanzieri merged commit 2a8d692 into RIOT-OS:master May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants