acassis commented on code in PR #16838: URL: https://github.com/apache/nuttx/pull/16838#discussion_r2283114922
########## drivers/sensors/Kconfig: ########## @@ -2146,4 +2146,64 @@ config SENSORS_FS3000_THREAD_STACKSIZE endif # SENSORS_FS3000 +config SENSORS_TMP112 + bool "Texas Instruments TMP112x Temperature Sensor support" + default n + select I2C + ---help--- + Enable driver support for the Texas Instruments TMP112x temperature sensor. + +if SENSORS_TMP112 + +config TMP112_I2C_FREQUENCY + int "TMP112 I2C frequency" + default 400000 + +config TMP112_I2C_ADDR_1 + hex "I2C Address 1" + default 0x48 + ---help--- + Address used for the first sensor on the bus. + +config TMP112_ENABLE_2 + bool "Enable a second sensor" + default n + ---help--- + Register a second sensor on the bus. Review Comment: > You are right, I added these entries mostly because the actual I2C addresses may vary depending on the specific variant of the IC; see [this previous comment](https://github.com/apache/nuttx/pull/16838#discussion_r2276382270). How would you suggest getting around that? Should the `TMP112_I2C_ADDR_{2,3,4}` Kconfig entries always be shown when the sensor is enabled, maybe? @nmaggioni normally we let it to someone creating the board configuration to define the I2C address. The I2C Address is not driver dependent, it is board dependent. I know you are trying to make this process more simple to the developer, but it is something very simple to be figured out. Just use the default address (i.e. the lowest I2C Addr) and let to user/dev to pass the right address. Some sensors driver like the BMI270 makes I2C address initialization very clear to setup, see bmi270_register(). Maybe you can follow similar approach. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org