From 51e72774736e27af9f29fd28f151122934da9637 Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Mon, 1 Nov 2010 17:38:03 +0100 Subject: [PATCH 1/3] * removed old reference to clock module from rtc * added documentation for sht11 and swtimer Conflicts: drivers/include/sht11.h --- drivers/include/sht11.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h index 9119d911db..573a21590b 100644 --- a/drivers/include/sht11.h +++ b/drivers/include/sht11.h @@ -50,22 +50,26 @@ and the mailinglist (subscription via web site) #define SHT11_MEASURE_HUMI (0x05) //000 0010 1 #define SHT11_RESET (0x1E) //000 1111 0 +<<<<<<< HEAD /* time to wait after toggling the data line */ #define SHT11_DATA_WAIT (HWTIMER_TICKS(5)) /* time to wait after toggling the clock line */ #define SHT11_CLK_WAIT (HWTIMER_TICKS(1)) /* set measurement timeout to 1 second */ +======= +/** + * set measurement timeout to 1 second */ +>>>>>>> fb40690... * removed old reference to clock module from rtc #define SHT11_MEASURE_TIMEOUT (1000) -/** sht11 measureable data */ +/** + * @brief sht11 measureable data + */ typedef struct { - /* temperature value */ - float temperature; - /* linear relative humidity */ - float relhum; - /* temperature compensated relative humidity */ - float relhum_temp; + float temperature; /**< temperature value */ + float relhum; /**< linear relative humidity */ + float relhum_temp; /**< temperature compensated relative humidity */ } sht11_val_t; /** @@ -84,9 +88,14 @@ void sht11_init(void); /** * @brief Read sensor * + * @param value The struct to be filled with measured values + * @param mode Specifies type of data to be read + * + * @return 1 on success, 0 otherwise + * * Example: - * \code struct sht11_val sht11; - * sht11_Read_Sensor(&sht11, HUMIDITY|TEMPERATURE); + * \code sht11_val sht11; + * sht11_read_sensor(&sht11, HUMIDITY|TEMPERATURE); * printf("%-6.2f °C %5.2f %% %5.2f %%\n", sht11.temperature, sht11.relhum, sht11.relhum_temp); \endcode */ uint8_t sht11_read_sensor(sht11_val_t *value, sht11_mode_t mode); From 88d3421ee75de9b1d6535c4497b804929c41d6bf Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Mon, 1 Nov 2010 17:38:23 +0100 Subject: [PATCH 2/3] * missing part of last commit --- cpu/lpc2387/include/lpc2387-rtc.h | 1 - cpu/lpc2387/lpc2387-rtc.c | 3 --- sys/include/swtimer.h | 9 +++++++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cpu/lpc2387/include/lpc2387-rtc.h b/cpu/lpc2387/include/lpc2387-rtc.h index 4fb8f52e51..9420fc7c21 100644 --- a/cpu/lpc2387/include/lpc2387-rtc.h +++ b/cpu/lpc2387/include/lpc2387-rtc.h @@ -51,7 +51,6 @@ and the mailinglist (subscription via web site) #include #include #include "lpc2387.h" -#include "clock.h" /* ------------------------------------------------------------------------- */ /** diff --git a/cpu/lpc2387/lpc2387-rtc.c b/cpu/lpc2387/lpc2387-rtc.c index 7ab60e09c4..ca713833a0 100644 --- a/cpu/lpc2387/lpc2387-rtc.c +++ b/cpu/lpc2387/lpc2387-rtc.c @@ -45,7 +45,6 @@ and the mailinglist (subscription via web site) #include "lpc2387.h" #include "lpc2387-rtc.h" #include "lpm.h" -#include "clock.h" #define PREINT_RTC 0x000001C8 /* Prescaler value, integer portion, PCLK = 15Mhz */ #define PREFRAC_RTC 0x000061C0 /* Prescaler value, fraction portion, PCLK = 15Mhz */ @@ -58,7 +57,6 @@ and the mailinglist (subscription via web site) #define PRINTF(fmt, args...) #endif -extern void _clock_alarm(void); /** * @brief epoch time in hour granularity @@ -155,7 +153,6 @@ void RTC_IRQHandler (void) RTC_AMR = 0xff; // disable alarm irq PRINTF("alarm"); lpm_end_awake(); - _clock_alarm(); } VICVectAddr = 0; // Acknowledge Interrupt diff --git a/sys/include/swtimer.h b/sys/include/swtimer.h index 9f7d9a9730..0cc30f82c0 100644 --- a/sys/include/swtimer.h +++ b/sys/include/swtimer.h @@ -64,14 +64,23 @@ typedef struct swtimer_t { } action; } swtimer_t; +/** + * @brief Current system time + * @return Time in ticks since system boot + */ swtime_t swtimer_now(); +/** + * @brief Initializes swtimer + * @return always 0 + */ int swtimer_init(); /** * @brief set swtimer interval and activate * @param[in] t pointer to preinitialised swtimer_t * @param[in] interval swtimer interval + * @return always 0 */ int swtimer_set(swtimer_t *t, swtime_t interval); From cec06f6b834c7f28acb7c1397be9f80976a3f687 Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Mon, 1 Nov 2010 17:42:35 +0100 Subject: [PATCH 3/3] * resolved conflict --- drivers/include/sht11.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h index 573a21590b..71e7e8bac1 100644 --- a/drivers/include/sht11.h +++ b/drivers/include/sht11.h @@ -50,17 +50,12 @@ and the mailinglist (subscription via web site) #define SHT11_MEASURE_HUMI (0x05) //000 0010 1 #define SHT11_RESET (0x1E) //000 1111 0 -<<<<<<< HEAD /* time to wait after toggling the data line */ #define SHT11_DATA_WAIT (HWTIMER_TICKS(5)) /* time to wait after toggling the clock line */ #define SHT11_CLK_WAIT (HWTIMER_TICKS(1)) /* set measurement timeout to 1 second */ -======= -/** - * set measurement timeout to 1 second */ ->>>>>>> fb40690... * removed old reference to clock module from rtc #define SHT11_MEASURE_TIMEOUT (1000) /**