Skip to content

drivers/tmp117: TMP117 driver#22310

Open
leocordier wants to merge 21 commits into
RIOT-OS:masterfrom
leocordier:driver_tmp117
Open

drivers/tmp117: TMP117 driver#22310
leocordier wants to merge 21 commits into
RIOT-OS:masterfrom
leocordier:driver_tmp117

Conversation

@leocordier
Copy link
Copy Markdown

Contribution description

This pull request add a basic driver for the TMP117 sensor with the following capabilities:

  • tmp117 initialization
  • tmp117 configuration : update the conversion mode, cycle and averaging parameters
  • tmp117 temperature reading : with a result in centi-degrees
  • check if tmp117 temperature measure is ready

This pull request add a driver in the drivers folder and a test in the test/drivers folder

Testing procedure

The basic test that i wrote, initialize the sensor with default paramaters and i2c address.
After the initialization, it display the measured temperature every 1.5 seconds.

If the initialization or the temperature reading fail, it displays anb error.

Issues/PRs references

issue #22308

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

tests/drivers/tmp117: test for the TMP117 driver

This driver add the support for the TMP117 i2c temperature sensor.
@github-actions github-actions Bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: drivers Area: Device drivers labels May 19, 2026
@crasbe crasbe added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 19, 2026
Comment thread drivers/include/tmp117.h
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread tests/drivers/tmp117/README.md Outdated
Comment thread tests/drivers/tmp117/README.md Outdated
Comment thread tests/drivers/tmp117/main.c Outdated
@crasbe crasbe linked an issue May 19, 2026 that may be closed by this pull request
leocordier and others added 14 commits May 19, 2026 16:15
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Co-authored-by: crasbe <crasbe@gmail.com>
Comment thread drivers/include/tmp117.h
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread drivers/tmp117/tmp117.c Outdated
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/include/tmp117.h Outdated
Comment thread drivers/include/tmp117.h Outdated
@basilfx
Copy link
Copy Markdown
Member

basilfx commented May 19, 2026

Thanks @leocordier.

Could you also check if SAUL support would be easy to add? See https://docs.riot-os.org/advanced_tutorials/device_drivers/#saul

@riot-ci
Copy link
Copy Markdown

riot-ci commented May 19, 2026

Murdock results

FAILED

9a52738 correct murdock errors

Success Failures Total Runtime
5705 0 10633 05m:46s

Artifacts

@leocordier
Copy link
Copy Markdown
Author

Thanks @leocordier.

Could you also check if SAUL support would be easy to add? See https://docs.riot-os.org/advanced_tutorials/device_drivers/#saul

Hello, i'm starting to add SAUL support to the TMP117 but i'm not familiar with the SAUL system.
I've added a tmp117_saul.c file with function which comply with the saul_read() format and i've registered this function in a saul_driver_t structure.

However, i don't understand how my device can be initialized only with saul.

@basilfx
Copy link
Copy Markdown
Member

basilfx commented May 20, 2026

SAUL-compatibel sensors are/can be auto-initialized. See https://github.com/RIOT-OS/RIOT/blob/master/drivers/saul/init_devs/auto_init_si70xx.c and https://github.com/RIOT-OS/RIOT/blob/master/drivers/saul/init_devs/init.c#L342.

The main driver Makefile must look like this: https://github.com/RIOT-OS/RIOT/blob/master/drivers/si70xx/Makefile

Now, when the saul_default module is used, any SAUL compatible driver for your board, will automatically be initializes.

Does this help?

@leocordier
Copy link
Copy Markdown
Author

Yep, thanks i will look into it

@github-actions github-actions Bot added the Area: SAUL Area: Sensor/Actuator Uber Layer label May 21, 2026
@leocordier
Copy link
Copy Markdown
Author

Here it is, i've tested the saul support for the tmp117 and it works ! 🙂

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

Labels

Area: doc Area: Documentation Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

Add a driver for the TMP117 temperature sensor

4 participants