summaryrefslogtreecommitdiff
path: root/nuttx/configs/dk-tm4c129x/README.txt
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/dk-tm4c129x/README.txt')
-rw-r--r--nuttx/configs/dk-tm4c129x/README.txt43
1 files changed, 42 insertions, 1 deletions
diff --git a/nuttx/configs/dk-tm4c129x/README.txt b/nuttx/configs/dk-tm4c129x/README.txt
index 720a522bf..017bf0e6f 100644
--- a/nuttx/configs/dk-tm4c129x/README.txt
+++ b/nuttx/configs/dk-tm4c129x/README.txt
@@ -652,6 +652,8 @@ f Application Configuration -> Network Utilities
Temperature Sensor
==================
+ TMP-1000 Temperature Sensor Driver
+ ----------------------------------
Support for the on-board TMP-100 temperature sensor is available. This
uses the driver for the compatible LM-75 part. To set up the temperature
sensor, add the following to the NuttX configuration file:
@@ -663,8 +665,12 @@ Temperature Sensor
CONFIG_I2C=y
Drivers -> Sensors
+ CONFIG_LM75=y
CONFIG_I2C_LM75=y
+ Applications -> NSH Library
+ CONFIG_NSH_ARCHINIT=y
+
Then you can implement logic like the following to use the temperature sensor:
#include <nuttx/sensors/lm75.h>
@@ -673,13 +679,35 @@ Temperature Sensor
ret = tiva_tmp100_initialize("/dev/temp"); /* Register the temperature sensor */
fd = open("/dev/temp", O_RDONLY); /* Open the temperature sensor device */
ret = ioctl(fd, SNIOC_FAHRENHEIT, 0); /* Select Fahrenheit */
- bytesread = read(fd, buffer, 8*sizeof(b16_t)); /* Read temperature samples */
+ bytesread = read(fd, buffer, 8*sizeof(b16_t)); /* Read (8) temperature samples */
More complex temperature sensor operations are also available. See the IOCTL
commands enumerated in include/nuttx/sensors/lm75.h. Also read the descriptions
of the tiva_tmp100_initialize() and tiva_tmp100_attach() interfaces in the
arch/board/board.h file (sames as configs/dk-tm4c129x/include/board.h).
+ NSH Command Line Application
+ ----------------------------
+ There is a tiny NSH command line application at examples/system/lm75 that
+ will read the current temperature from an LM75 compatible temperature sensor
+ and print the temperature on stdout in either units of degrees Fahrenheit or
+ Centigrade. This tiny command line application is enabled with the following
+ configuratin options:
+
+ Library
+ CONFIG_LIBM=y
+ CONFIG_LIBC_FLOATINGPOINT=y
+
+ Applications -> NSH Library
+ CONFIG_NSH_ARCHINIT=y
+
+ Applications -> System Add-Ons
+ CONFIG_SYSTEM_LM75=y
+ CONFIG_SYSTEM_LM75_DEVNAME="/dev/temp"
+ CONFIG_SYSTEM_LM75_FAHRENHEIT=y (or CENTIGRADE)
+ CONFIG_SYSTEM_LM75_STACKSIZE=1024
+ CONFIG_SYSTEM_LM75_PRIORITY=100
+
DK-TM4129X Configuration Options
================================
@@ -868,3 +896,16 @@ Where <subdir> is one of the following:
network back up when the link becomes available again (for example,
if the cable is reconnected. The paragraph "Network Monitor" above
for additional information.
+
+ 5. I2C6 and support for the on-board TMP-100 temperature sensor are
+ enabled. Also enabled is the NSH 'temp' command that will show the
+ current temperature on the command line like:
+
+ nsh> temp
+ 80.60 degrees Fahrenheit
+
+ [80.6 F in January. I love living in Costa Rica1]
+
+ The default units is degrees Fahrenheit, but that is easily
+ reconfigured. See the discussin above in the paragraph entitled
+ "Temperature Sensor".