From 1446092e959dd3d34ad945c50327471817643d6a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 7 Jan 2015 06:23:24 -0600 Subject: [PATCH] Update README --- configs/dk-tm4c129x/README.txt | 2 +- configs/stm3210e-eval/README.txt | 61 +++++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/configs/dk-tm4c129x/README.txt b/configs/dk-tm4c129x/README.txt index 017bf0e6f4..4de213b615 100644 --- a/configs/dk-tm4c129x/README.txt +++ b/configs/dk-tm4c129x/README.txt @@ -692,7 +692,7 @@ Temperature Sensor 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: + configuration options: Library CONFIG_LIBM=y diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index a6743c803e..d3c27916b7 100644 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -347,28 +347,55 @@ events as follows: Temperature Sensor ================== -Support for the on-board LM-75 temperature sensor is available. This supported -has been verified, but has not been included in any of the available the -configurations. To set up the temperature sensor, add the following to the -NuttX configuration file + LM-75 Temperature Sensor Driver + ------------------------------- + Support for the on-board LM-75 temperature sensor is available. This + support has been verified, but has not been included in any of the + available the configurations. To set up the temperature sensor, add the + following to the NuttX configuration file - CONFIG_I2C=y - CONFIG_I2C_LM75=y + Drivers -> Sensors + CONFIG_LM75=y + CONFIG_I2C_LM75=y -Then you can implement logic like the following to use the temperature sensor: + Then you can implement logic like the following to use the temperature + sensor: - #include - #include + #include + #include - ret = stm32_lm75initialize("/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 */ + ret = stm32_lm75initialize("/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 */ -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 stm32_lm75initialize() and stm32_lm75attach() interfaces in the -arch/board/board.h file (sames as configs/stm3210e-eval/include/board.h). + More complex temperature sensor operations are also available. See the + IOCTL commands enumerated in include/nuttx/sensors/lm75.h. Also read the + escriptions of the stm32_lm75initialize() and stm32_lm75attach() + interfaces in the arch/board/board.h file (sames as + configs/stm3210e-eval/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 + configuration 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 RTC ===