diff --git a/cpu/cc430/cc430-rtc.c b/cpu/cc430/cc430-rtc.c index f37de3732855d2b242722b3a0e492c14660f47bf..c34dcddd5fdbe4dabb2b648a58960a8e78187c29 100644 --- a/cpu/cc430/cc430-rtc.c +++ b/cpu/cc430/cc430-rtc.c @@ -24,6 +24,10 @@ and the mailinglist (subscription via web site) scatterweb@lists.spline.inf.fu-berlin.de *******************************************************************************/ +/** + * @ingroup rtc + */ + #include <string.h> #include <signal.h> #include <irq.h> diff --git a/cpu/lpc2387/lpc2387-lpm.c b/cpu/lpc2387/lpc2387-lpm.c index 8261873d405443daee93ef208f466dd04ddf4de0..468797e83e68e8b1a0182e0b3f61d58564388616 100644 --- a/cpu/lpc2387/lpc2387-lpm.c +++ b/cpu/lpc2387/lpc2387-lpm.c @@ -26,6 +26,7 @@ and the mailinglist (subscription via web site) /** * @ingroup lpc2387 + * @ingroup lpm * @{ */ diff --git a/cpu/native/hwtimer_cpu.c b/cpu/native/hwtimer_cpu.c index 3d362575d41a43cc55c2da1e1f64f92de5cdf126..3ee6d7637af90142a5eadf7a7718ed4520f26366 100644 --- a/cpu/native/hwtimer_cpu.c +++ b/cpu/native/hwtimer_cpu.c @@ -1,15 +1,19 @@ /** * Native CPU hwtimer_arch.h implementation * + * Uses POSIX real-time extension timers to mimic hardware timers. + * XXX: see hwtimer_isr_timer() + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch + * @ingroup hwtimer + * @ingroup native_cpu * @{ - * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> + * @file * @} */ @@ -33,18 +37,29 @@ static int native_hwtimer_irq[ARCH_MAXTIMERS]; static timer_t native_hwtimer_timer[ARCH_MAXTIMERS]; static void (*int_handler)(int); +/** + * sets timespec to given ticks + */ void ticks2ts(unsigned long ticks, struct timespec *tp) { tp->tv_sec = ticks / HWTIMER_SPEED; tp->tv_nsec = (ticks % HWTIMER_SPEED)*1000 ; } +/** + * returns ticks for give timespec + */ unsigned long ts2ticks(struct timespec *tp) { /* TODO: check for overflow */ return((tp->tv_sec * HWTIMER_SPEED) + (tp->tv_nsec/1000)); } +/** + * native timer signal handler, + * + * XXX: Calls callback for all timers whenever any timer finishes. + */ void hwtimer_isr_timer() { DEBUG("hwtimer_isr_timer()\n"); @@ -95,10 +110,6 @@ void hwtimer_arch_unset(short timer) return; } -/** - * Set a kernel timer to raise an interrupt after ::offset kernel timer ticks - * from now. - */ void hwtimer_arch_set(unsigned long offset, short timer) { struct itimerspec its; diff --git a/cpu/native/include/cpu.h b/cpu/native/include/cpu.h index 50effea7cb47d5a89d6f6bbfa752d5a8680e7c45..d2c0fbd14473a5d3176df5e14ac287a1a84ca3ed 100644 --- a/cpu/native/include/cpu.h +++ b/cpu/native/include/cpu.h @@ -1,16 +1,19 @@ /** * Native CPU interface * + * The native CPU uses system calls to simulate hardware access. + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. - * + */ + +/** * @ingroup arch + * @defgroup native_cpu Native CPU * @{ - * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> - * @} */ #ifndef _CPU_H @@ -30,8 +33,18 @@ void dINT(void); void eINT(void); +/** + * register interrupt handler handler for interrupt sig + */ int register_interrupt(int sig, void *handler); + +/** + * unregister interrupt handler for interrupt sig + */ int unregister_interrupt(int sig); + +/* this should be defined elsewhere */ void thread_yield(void); +/** @} */ #endif //_CPU_H diff --git a/cpu/native/include/hwtimer_cpu.h b/cpu/native/include/hwtimer_cpu.h index 630741dfc34122e624b9f8c749e633d1e8eda22f..1a66fa7e135e7b701c127b42da6a532e4884fd78 100644 --- a/cpu/native/include/hwtimer_cpu.h +++ b/cpu/native/include/hwtimer_cpu.h @@ -6,8 +6,8 @@ * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch * @{ + * @ingroup native_hwtimer * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> * @} diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c index abc88f8884ef1fb1fc750b9222d866c95e70b606..89c2acdf60c4567fd47503f62f37effc49e00a62 100644 --- a/cpu/native/irq_cpu.c +++ b/cpu/native/irq_cpu.c @@ -1,16 +1,19 @@ /** * Native CPU irq.h implementation * + * uses POSIX real-time extension signals to create interrupts + * TODO: needs to be rewritten for better portability + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch + * @ingroup native_cpu + * @ingroup irq * @{ * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> - * @} */ #include <signal.h> #include <err.h> @@ -34,6 +37,9 @@ struct int_handler_t { }; static struct int_handler_t native_irq_handlers[255]; +/** + * block signals + */ unsigned disableIRQ(void) { unsigned int prev_state; @@ -60,6 +66,9 @@ unsigned disableIRQ(void) return prev_state; } +/** + * unblock signals + */ unsigned enableIRQ(void) { unsigned int prev_state; @@ -181,8 +190,10 @@ void native_isr_entry(int sig, siginfo_t *info, void *context) } /** + * register signal/interrupt handler for signal sig + * * TODO: check sa_flags for appropriateness - * TODO: use appropriate data structure (hashmap?) for signal + * TODO: use appropriate data structure for signal * handlers. */ int register_interrupt(int sig, void *handler) @@ -212,6 +223,8 @@ int register_interrupt(int sig, void *handler) } /** + * empty signal mask + * * TODO: see register_interrupt * TODO: ignore signal */ @@ -239,6 +252,9 @@ int unregister_interrupt(int sig) /** + * register internal signal handler, + * initalize local variables + * * TODO: see register_interrupt */ void native_interrupt_init(void) @@ -269,3 +285,4 @@ void native_interrupt_init(void) puts("RIOT native interrupts/signals initialized."); } +/** @} */ diff --git a/cpu/native/lpm_cpu.c b/cpu/native/lpm_cpu.c index 6e39ce3aeb3c2eb1a6e2d548cafc9b98e5e19dd2..9d13ab7229076e70178209a27bfa9eef27f2cb80 100644 --- a/cpu/native/lpm_cpu.c +++ b/cpu/native/lpm_cpu.c @@ -1,12 +1,15 @@ /** * Native CPU lpm.h implementation * + * Uses system calls to emulate CPU power modes. + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch + * @ingroup lpm + * @ingroup native_cpu * @{ * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> @@ -28,6 +31,11 @@ void lpm_init(void) return; } +/** + * LPM_IDLE uses sleep() to wait for interrupts + * LPM_OFF exits process + * other modes not supported at the moment + */ enum lpm_mode lpm_set(enum lpm_mode target) { enum lpm_mode last_lpm; @@ -90,6 +98,7 @@ void lpm_end_awake(void) native_lpm = LPM_ON; return; } + enum lpm_mode lpm_get(void) { return native_lpm; diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index b4f49e9a54709840e55e86a1efb705e2324de9a0..cb6b8b722abd6e4911a7ef997f3dc0c0699095a8 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -1,16 +1,18 @@ /** * Native CPU kernel_intern.h and sched.h implementation * + * in-process preemptive context switching utilizes POSIX ucontexts. + * (ucontext provides for architecture independent stack handling) + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch + * @ingroup native_cpu * @{ * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> - * @} */ #include <stdio.h> #include <ucontext.h> @@ -109,3 +111,4 @@ void native_cpu_init() makecontext(&native_context, sched_task_exit, 0); puts("RIOT native cpu initialized."); } +/** @} */ diff --git a/cpu/native/rtc/posix-rtc.c b/cpu/native/rtc/posix-rtc.c index 98629d281bfe7e78a74a9e8f88e8167103408c09..22444d65f1c160809e22b2811ef2cd501a3e3f07 100644 --- a/cpu/native/rtc/posix-rtc.c +++ b/cpu/native/rtc/posix-rtc.c @@ -1,16 +1,21 @@ /** * Native CPU rtc.h implementation * + * The native rtc implementation uses POSIX system calls to simulate a + * real-time clock. + * + * Setting the clock will be implemented using a delta variable. + * * Copyright (C) 2013 Ludwig Ortmann * * This file subject to the terms and conditions of the GNU General Public * License. See the file LICENSE in the top level directory for more details. * - * @ingroup arch - * @{ - * @file * @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de> - * @} + * + * @ingroup native_cpu + * @ingroup rtc + * @file */ #include <time.h> @@ -22,47 +27,30 @@ static int native_rtc_enabled; -/** - * @brief Initializes the RTC for calendar mode - */ void rtc_init(void) { native_rtc_enabled = 0; printf("native rtc initialized\n"); } -/** - * @brief Starts the RTC - */ void rtc_enable(void) { DEBUG("rtc_enable\n"); native_rtc_enabled = 1; } -/** - * @brief Stops the RTC - */ void rtc_disable(void) { DEBUG("rtc_disable()\n"); native_rtc_enabled = 0; } -/** - * @brief Sets the current time in broken down format directly from to RTC - * @param[in] localt Pointer to structure with time to set - */ void rtc_set_localtime(struct tm* localt) { DEBUG("rtc_set_localtime()\n"); printf("setting time not supported."); } -/** - * @brief Returns the current time in broken down format directly from the RTC - * @param[out] localt Pointer to structure to receive time - */ void rtc_get_localtime(struct tm* localt) { time_t t; diff --git a/drivers/include/ltc4150_arch.h b/drivers/include/ltc4150_arch.h index 84a5c6810253f208611b473ceebad53cff2544c1..90fe5de20efadb318e75a1757928a01e1e5e1d7d 100644 --- a/drivers/include/ltc4150_arch.h +++ b/drivers/include/ltc4150_arch.h @@ -29,7 +29,7 @@ and the mailinglist (subscription via web site) /** * @defgroup ltc4150 LTC4150 Coulomb Counter - * @ingroup coulomb + * @ingroup drivers * @{ */ @@ -48,11 +48,21 @@ and the mailinglist (subscription via web site) #define _R_SENSE (double)0.330 #define SUPPLY_VOLTAGE (5) +/** board specific ltc4150 interrupt disable */ void ltc4150_disable_int(void); +/** board specific ltc4150 interrupt enable */ void ltc4150_enable_int(void); +/** board specific synchronization of ltc4150 */ void ltc4150_sync_blocking(void); +/** board specific ltc4150 initialization */ void ltc4150_arch_init(void); + +/** + * ltc4150 interrupt handler, + * shall be called on ltc4150 interrupt, + * implemented in driver + */ void ltc4150_interrupt(void); -/** @} */ +/** * @} */ #endif /* __LTC4150_ARCH_H */ diff --git a/drivers/include/rtc.h b/drivers/include/rtc.h index 25b0d8759b04a028745ddb39b8dcdf665fc922d5..e1ade0c791f3e4b83fd52acf1c4e1031b1e82618 100644 --- a/drivers/include/rtc.h +++ b/drivers/include/rtc.h @@ -24,6 +24,12 @@ and the mailinglist (subscription via web site) scatterweb@lists.spline.inf.fu-berlin.de *******************************************************************************/ +/** + * @defgroup rtc Realtime Clock + * @ingroup drivers + * @{ + */ + #ifndef RTC_H #define RTC_H @@ -61,3 +67,4 @@ void rtc_get_localtime(struct tm* localt); extern int rtc_second_pid; #endif +/** @} */ diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h index 00f00e0bd16478de15ea30785f98839a011e4f40..cb615f7848f7414643c99a74ffbf85650052cb35 100644 --- a/drivers/include/sht11.h +++ b/drivers/include/sht11.h @@ -27,7 +27,7 @@ and the mailinglist (subscription via web site) /** * @defgroup sht11 Sensirion SHT11 Driver - * @ingroup dev + * @ingroup drivers * @{ */