From 0f6a0c59a1fd5e87eeed63d155468dea4979c044 Mon Sep 17 00:00:00 2001 From: aeprox Date: Sun, 23 Aug 2015 14:52:15 +0200 Subject: [PATCH] Documentation update --- app/modules/tsl2561.c | 17 +++++++++-------- app/tsl2561/tsl2561.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/modules/tsl2561.c b/app/modules/tsl2561.c index 81868f4f..d5b0c3c4 100644 --- a/app/modules/tsl2561.c +++ b/app/modules/tsl2561.c @@ -13,8 +13,9 @@ static uint16_t ch0; static uint16_t ch1; -/* - * Lua: error = tsl2561.init(sdapin, sclpin) + +/* Initialises the device on pins sdapin and sclpin + * Lua: status = tsl2561.init(sdapin, sclpin) */ static int ICACHE_FLASH_ATTR tsl2561_init(lua_State* L) { uint32_t sda; @@ -35,8 +36,8 @@ static int ICACHE_FLASH_ATTR tsl2561_init(lua_State* L) { lua_pushnumber(L, error); return 1; } -/* - * Lua: error = tsl2561.settiming(integration, gain) +/* Sets the integration time and gain settings of the device + * Lua: status = tsl2561.settiming(integration, gain) */ static int ICACHE_FLASH_ATTR tsl2561_lua_settiming(lua_State* L) { // check variables @@ -55,8 +56,8 @@ static int ICACHE_FLASH_ATTR tsl2561_lua_settiming(lua_State* L) { lua_pushnumber(L, tsl2561SetTiming(integration, gain)); return 1; } -/* - * Lua: lux, error = tsl2561.getlux() +/* Reads sensor values from device and return calculated lux + * Lua: lux, status = tsl2561.getlux() */ static int ICACHE_FLASH_ATTR tsl2561_lua_calclux(lua_State* L) { uint8_t error = tsl2561GetLuminosity(&ch0, &ch1); @@ -69,8 +70,8 @@ static int ICACHE_FLASH_ATTR tsl2561_lua_calclux(lua_State* L) { } return 2; } -/* - * Lua: tsl2561.getrawchannels() +/* Reads sensor values from device and returns them + * Lua: ch0, ch1, status = tsl2561.getrawchannels() */ static int ICACHE_FLASH_ATTR tsl2561_lua_getchannels(lua_State* L) { uint8_t error = tsl2561GetLuminosity(&ch0, &ch1); diff --git a/app/tsl2561/tsl2561.h b/app/tsl2561/tsl2561.h index f4b5b203..1308f681 100644 --- a/app/tsl2561/tsl2561.h +++ b/app/tsl2561/tsl2561.h @@ -41,7 +41,7 @@ #define TSL2561_PACKAGE_CS // Lux calculations differ slightly for CS package // #define TSL2561_PACKAGE_T_FN_CL -#define TSL2561_ADDRESS (0x39) // or 0x29, or 0x49 +#define TSL2561_ADDRESS (0x39) // GND=>0x29, float=>0x39 or VDD=>0x49 #define TSL2561_READBIT (0x01) #define TSL2561_COMMAND_BIT (0x80) // Must be 1