I have the SparkFun Qwiic TMP117 breakout SEN-15805.
I have been using Raspberry Pi RP2040 and RP2350 boards like the Pico and Pico 2 to test the Raspberry Pi Pico C SDK Interface library I ported, expanded, and totally revamped from the Sparkfun TMP117 Arduino Library. I added EEPROM programming, no-float Celsius temperature readings, and improved the algorithms and code of several functions. The examples are either brand new, or in my own style and re-vamped. Examples for one-shot mode, interrupt pin use, SMBus Alert Response, and EEPROM programming are new compared to the Arduino library. The temperature readings example uses Q notation.
I hope it is acceptable to Sparkfun.
TMP117 Library for Raspberry Pi Pico C SDK
TMP117 library for Raspberry Pi Pico C SDK
================================================================================
This version is for use as an INTERFACE library to the Raspberry Pi Pico SDK
Based on the SparkFun TMP117 Arduino Library and ported to the Raspberry Pi Pico C SDK by Madison Chodikov
The basics of the original Library remains but much of it has changed in this version.
This port is written in C, by breaker (name on the Raspberry Pi Forum).
This was written to use my sensor with the SDK and learn it a bit along the way.
Tested with the Raspberry Pi Pico H, Pimoroni Pico Plus 2 (RP2350), and SparkFun SEN-15805.
Texas Instruments TMP117 High-Accuracy, Low-Power, Digital Temperature Sensor With SMBus™- and I2C-Compatible Interface
data sheet: https://www.ti.com/lit/gpn/TMP117
SparkFun SEN-15805: https://www.sparkfun.com/products/15805
Refer to the Raspberry Pico documentation to set up the Pico C SDK build environment.
https://www.raspberrypi.com/documentation/microcontrollers/
Notes about the code:
================================================================================
There are 13 examples, some are in the same directory.
All examples built and ran OK using Pico SDK 2.1.0 for both RP2040 and RP2350 boards.
Default Pico board file I2C and UART pins were used. Configure alert interrupt pin in examples.
In the first temperature reading example temp_result.c
Q notation is introduced in order to show how the temperature can be displayed without using floating point math.
See TI Application Note: How to Read and Interpret Digital Temperature Sensor Output Data
"Modern sensors, such as the TMP117, offer a full 16 bits of resolution in a Q7 format."
The 16-bit Word of the temp_result register consists of;
bit 15: sign bit, [14:7] Integer bits, "decimal point", [6:0] Fractional bits
================================================================================