How to use TEMP sensor on nRF5x boards ? #nrf52840 #sensor

Yorick Brunet


I have recently started to use Zephyr. Up to now, I have been able to set up some tasks and ESS (with Temperature characteristic (dummy value for the moment)) and BAS Bluetooth profiles. The BAS profile comes from the samples. I have been able to compile and flash my nRF52840 DK (or pca10056) board. It works well.

I'd like now to get the processor temperature using the TEMP sensor. I have seen that Zephyr provides it:
I added
to my prf.conf and the driver seems to have been compiled.

However, I haven't found any doc to use this sensor except

Do you know I how should use the sensor in my application ?

I haven't found any function in temp_nrf5.c that I can call. All functions are static and takes a "struct device* " as parameter that I don't have. I don't think that my question is only related to this sensor, it must be a generic question valid also for other sensors.


Best regards,

Join { to automatically receive all group messages.