From edcabf7cb6b08675c56bae4e85cffaa0d2652d84 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 27 Nov 2013 17:54:30 +0100 Subject: [PATCH] Fixed a lot of comments by removing tabs and correcting format. --- core/bitarithm.c | 5 + core/include/config.h | 2 +- core/include/hwtimer.h | 5 +- core/include/io.h | 2 +- core/include/irq.h | 2 +- core/include/lifo.h | 1 + core/include/msg.h | 2 +- core/include/queue.h | 2 - core/lifo.c | 3 + core/sched.c | 4 +- cpu/arm_common/arm_cpu.c | 5 - cpu/cc430/doc.txt | 6 +- cpu/lpc2387/gpioint/lpc2387-gpioint.c | 64 +++--- cpu/lpc2387/include/cpu.h | 8 +- cpu/lpc_common/doc.txt | 6 +- cpu/mc1322x/include/cpu.h | 8 +- cpu/msp430-common/include/cpu.h | 11 +- cpu/native/include/cpu.h | 4 +- cpu/native/include/nativenet.h | 4 +- drivers/cc110x/cc1100.h | 209 +++++++++--------- drivers/cc110x_ng/cc110x-defaultSettings.c | 48 ++-- drivers/cc110x_ng/cc110x-rx.c | 24 +- drivers/cc110x_ng/cc110x-tx.c | 9 +- drivers/cc110x_ng/cc110x.c | 26 +-- drivers/cc110x_ng/include/cc110x-arch.h | 16 +- drivers/cc110x_ng/include/cc110x-config.h | 76 +++---- .../include/cc110x-defaultSettings.h | 53 ++--- drivers/cc110x_ng/include/cc110x-internal.h | 109 ++++----- drivers/cc110x_ng/include/cc110x-reg.h | 11 +- drivers/cc110x_ng/include/cc110x_ng.h | 100 ++++----- drivers/cc110x_ng/include/cc110x_spi.h | 15 +- drivers/cc110x_ng/spi/cc110x_spi.c | 26 +-- drivers/doc.txt | 4 +- drivers/include/adc.h | 23 +- drivers/include/diskio.h | 82 +++---- drivers/include/flashrom.h | 22 +- drivers/include/gpioint.h | 49 ++-- drivers/include/lm75a-temp-sensor.h | 22 +- drivers/include/ltc4150_arch.h | 11 +- drivers/include/rtc.h | 22 +- drivers/include/sht11.h | 43 ++-- drivers/include/srf02-ultrasonic-sensor.h | 27 +-- drivers/include/srf08-ultrasonic-sensor.h | 23 +- sys/doc.txt | 4 +- sys/include/auto_init.h | 12 +- sys/include/bloom.h | 21 +- sys/include/board_uart0.h | 11 +- sys/include/chardev_thread.h | 6 +- sys/include/hashes.h | 25 ++- sys/include/ping.h | 6 +- sys/include/posix_io.h | 6 +- sys/include/ps.h | 6 +- sys/include/random.h | 6 +- sys/include/sha256.h | 6 +- sys/include/shell.h | 6 +- sys/include/timex.h | 6 +- sys/include/transceiver.h | 6 +- sys/include/vtimer.h | 18 +- sys/net/doc.txt | 6 +- sys/net/include/ieee802154_frame.h | 19 +- sys/net/include/net_help.h | 26 +-- sys/net/include/protocol-multiplex.h | 48 ++-- sys/net/rpl/rpl.h | 31 ++- sys/net/sixlowpan/lowpan.h | 30 +-- 64 files changed, 734 insertions(+), 765 deletions(-) diff --git a/core/bitarithm.c b/core/bitarithm.c index 398c85f815..265362fcf9 100644 --- a/core/bitarithm.c +++ b/core/bitarithm.c @@ -9,10 +9,15 @@ /** * @ingroup core_util * @{ +<<<<<<< HEAD * * @file bitarithm.c * @brief Bit arithmetic helper functions implementation * +======= + * @file bitarithm.c + * @brief Bit arithmetic helper functions implementation +>>>>>>> 94fedda... Fixed a lot of comments by removing tabs and correcting format. * @author Kaspar Schleiser * @author Martin Lenders * diff --git a/core/include/config.h b/core/include/config.h index 332d43ff94..7492a57a47 100644 --- a/core/include/config.h +++ b/core/include/config.h @@ -13,9 +13,9 @@ * @file config.h * @brief Kernel configuration interface * + * @author unknown */ - #ifndef CONFIG_H #define CONFIG_H diff --git a/core/include/hwtimer.h b/core/include/hwtimer.h index cfc25804c4..c916dc63cf 100644 --- a/core/include/hwtimer.h +++ b/core/include/hwtimer.h @@ -122,12 +122,9 @@ void hwtimer_spin(unsigned long ticks); int hwtimer_active(void); -/** - * @} - */ +/** @} */ /* internal */ - /** * @brief TODO * @internal diff --git a/core/include/io.h b/core/include/io.h index a51eeee17c..dcc2d62bb0 100644 --- a/core/include/io.h +++ b/core/include/io.h @@ -24,5 +24,5 @@ int fw_puts(char *data, int count); -/** @} */ +/** @} */ #endif /* IO_H */ diff --git a/core/include/irq.h b/core/include/irq.h index d072aabb65..82f4fe79ac 100644 --- a/core/include/irq.h +++ b/core/include/irq.h @@ -57,5 +57,5 @@ void restoreIRQ(unsigned state); */ int inISR(void); -/** @} */ +/** @} */ #endif /* IRQ_H_ */ diff --git a/core/include/lifo.h b/core/include/lifo.h index 2db4c7c7de..1fb99b1664 100644 --- a/core/include/lifo.h +++ b/core/include/lifo.h @@ -13,6 +13,7 @@ * @file lifo.h * @brief LIFO buffer API * + * @author unknwon */ #ifndef __LIFO_H diff --git a/core/include/msg.h b/core/include/msg.h index 206e745a2d..38199c8197 100644 --- a/core/include/msg.h +++ b/core/include/msg.h @@ -19,7 +19,7 @@ * queue are never dropped and the sending never blocks. Threads with a full message queue behaves * like in synchronous mode. * - * @{ + * @{ * * @file msg.h * @brief Messaging API for inter process communication diff --git a/core/include/queue.h b/core/include/queue.h index 13ff782846..6da8f66aa0 100644 --- a/core/include/queue.h +++ b/core/include/queue.h @@ -13,8 +13,6 @@ * @file queue.h * @brief A simple queue implementation * - * TODO document functions and datastructures - * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Kaspar Schleiser */ diff --git a/core/lifo.c b/core/lifo.c index e66d89b0d5..33b7e71bf0 100644 --- a/core/lifo.c +++ b/core/lifo.c @@ -13,6 +13,9 @@ * @file lifo.c * @brief LIFO buffer implementation * + * @file lifo.c + * @brief LIFO buffer implementation + * @author unknown * @} */ diff --git a/core/sched.c b/core/sched.c index da27f02f5d..528acc31cf 100644 --- a/core/sched.c +++ b/core/sched.c @@ -17,10 +17,10 @@ * @author Kaspar Schleiser * * @} + * + * TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER */ -/* TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER */ - #include #include #include diff --git a/cpu/arm_common/arm_cpu.c b/cpu/arm_common/arm_cpu.c index 429088f836..032b42020d 100644 --- a/cpu/arm_common/arm_cpu.c +++ b/cpu/arm_common/arm_cpu.c @@ -15,11 +15,6 @@ * @author Heiko Will * @} */ -/** - * - * - * - */ #include #include "arm_cpu.h" diff --git a/cpu/cc430/doc.txt b/cpu/cc430/doc.txt index 5e21f3547b..8987b573cb 100644 --- a/cpu/cc430/doc.txt +++ b/cpu/cc430/doc.txt @@ -7,7 +7,7 @@ */ /** - * @defgroup cc430 TI CC430 - * @brief Texas Instruments CC430 specific code - * @ingroup cpu + * @defgroup cc430 TI CC430 + * @brief Texas Instruments CC430 specific code + * @ingroup cpu */ diff --git a/cpu/lpc2387/gpioint/lpc2387-gpioint.c b/cpu/lpc2387/gpioint/lpc2387-gpioint.c index 9654092308..836f50e708 100644 --- a/cpu/lpc2387/gpioint/lpc2387-gpioint.c +++ b/cpu/lpc2387/gpioint/lpc2387-gpioint.c @@ -11,20 +11,20 @@ See the file LICENSE in the top level directory for more details. *******************************************************************************/ /** - * @ingroup lpc2387 + * @ingroup lpc2387 * @{ */ /** * @file - * @brief LPC2387 GPIO Interrupt Multiplexer implementation + * @brief LPC2387 GPIO Interrupt Multiplexer implementation * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Michael Baar + * @author Michael Baar * @version $Revision: 1508 $ * - * @note $Id: lpc2387-gpioint.c 1508 2009-10-26 15:10:02Z baar $ - * @see dev_gpioint + * @note $Id: lpc2387-gpioint.c 1508 2009-10-26 15:10:02Z baar $ + * @see dev_gpioint */ #include @@ -34,7 +34,7 @@ See the file LICENSE in the top level directory for more details. #include struct irq_callback_t { - fp_irqcb callback; + fp_irqcb callback; }; static struct irq_callback_t gpioint0[32]; @@ -54,50 +54,50 @@ void gpioint_init(void) bool gpioint_set(int port, uint32_t bitmask, int flags, fp_irqcb callback) { - struct irq_callback_t *cbdata; + struct irq_callback_t *cbdata; unsigned long bit; volatile unsigned long *en_f; volatile unsigned long *en_r; volatile unsigned long *en_clr; /* lookup registers */ - bit = number_of_highest_bit(bitmask); /* get irq mapping table index */ + bit = number_of_highest_bit(bitmask); /* get irq mapping table index */ switch(port) { - case 0: /* PORT0 */ + case 0: /* PORT0 */ cbdata = gpioint0; en_f = &IO0_INT_EN_F; en_r = &IO0_INT_EN_R; en_clr = &IO0_INT_CLR; break; - case 2: /* PORT2 */ + case 2: /* PORT2 */ cbdata = gpioint2; en_f = &IO2_INT_EN_F; en_r = &IO2_INT_EN_R; en_clr = &IO2_INT_CLR; break; - default: /* unsupported */ - return false; /* fail */ + default: /* unsupported */ + return false; /* fail */ } /* reconfigure irq */ unsigned long cpsr = disableIRQ(); - *en_clr |= bitmask; /* clear interrupt */ + *en_clr |= bitmask; /* clear interrupt */ if ((flags & GPIOINT_FALLING_EDGE) != 0) { - *en_f |= bitmask; /* enable falling edge */ + *en_f |= bitmask; /* enable falling edge */ } else { - *en_f &= ~bitmask; /* disable falling edge */ + *en_f &= ~bitmask; /* disable falling edge */ } if ((flags & GPIOINT_RISING_EDGE) != 0) { - *en_r |= bitmask; /* enable rising edge */ + *en_r |= bitmask; /* enable rising edge */ } else { - *en_r &= ~bitmask; /* disable rising edge */ + *en_r &= ~bitmask; /* disable rising edge */ } if (((flags & (GPIOINT_FALLING_EDGE | GPIOINT_RISING_EDGE)) != 0)) { @@ -105,12 +105,12 @@ gpioint_set(int port, uint32_t bitmask, int flags, fp_irqcb callback) } else { - cbdata[bit].callback = NULL; /* remove from interrupt mapping table */ + cbdata[bit].callback = NULL; /* remove from interrupt mapping table */ } restoreIRQ(cpsr); - return true; /* success */ + return true; /* success */ } /*---------------------------------------------------------------------------*/ static void __attribute__((__no_instrument_function__)) test_irq(int port, unsigned long f_mask, unsigned long r_mask, struct irq_callback_t *pcb) @@ -122,7 +122,7 @@ static void __attribute__((__no_instrument_function__)) test_irq(int port, unsig do { if ((pcb->callback != NULL)) { if ((r_mask & 1) | (f_mask & 1)) { - pcb->callback(); /* pass to handler */ + pcb->callback(); /* pass to handler */ } } @@ -135,7 +135,7 @@ static void __attribute__((__no_instrument_function__)) test_irq(int port, unsig /*---------------------------------------------------------------------------*/ void GPIO_IRQHandler(void) __attribute__((interrupt("IRQ"))); /** - * @brief GPIO Interrupt handler function + * @brief GPIO Interrupt handler function * @internal * * Invoked whenever an activated gpio interrupt is triggered by a rising @@ -143,27 +143,27 @@ void GPIO_IRQHandler(void) __attribute__((interrupt("IRQ"))); */ void __attribute__((__no_instrument_function__)) GPIO_IRQHandler(void) { - if (IO_INT_STAT & BIT0) { /* interrupt(s) on PORT0 pending */ - unsigned long int_stat_f = IO0_INT_STAT_F; /* save content */ - unsigned long int_stat_r = IO0_INT_STAT_R; /* save content */ + if (IO_INT_STAT & BIT0) { /* interrupt(s) on PORT0 pending */ + unsigned long int_stat_f = IO0_INT_STAT_F; /* save content */ + unsigned long int_stat_r = IO0_INT_STAT_R; /* save content */ - IO0_INT_CLR = int_stat_f; /* clear flags of fallen pins */ - IO0_INT_CLR = int_stat_r; /* clear flags of risen pins */ + IO0_INT_CLR = int_stat_f; /* clear flags of fallen pins */ + IO0_INT_CLR = int_stat_r; /* clear flags of risen pins */ test_irq(0, int_stat_f, int_stat_r, gpioint0); } - if (IO_INT_STAT & BIT2) { /* interrupt(s) on PORT2 pending */ - unsigned long int_stat_f = IO2_INT_STAT_F; /* save content */ - unsigned long int_stat_r = IO2_INT_STAT_R; /* save content */ + if (IO_INT_STAT & BIT2) { /* interrupt(s) on PORT2 pending */ + unsigned long int_stat_f = IO2_INT_STAT_F; /* save content */ + unsigned long int_stat_r = IO2_INT_STAT_R; /* save content */ - IO2_INT_CLR = int_stat_f; /* clear flags of fallen pins */ - IO2_INT_CLR = int_stat_r; /* clear flags of risen pins */ + IO2_INT_CLR = int_stat_f; /* clear flags of fallen pins */ + IO2_INT_CLR = int_stat_r; /* clear flags of risen pins */ test_irq(2, int_stat_f, int_stat_r, gpioint2); } - VICVectAddr = 0; /* Acknowledge Interrupt */ + VICVectAddr = 0; /* Acknowledge Interrupt */ } /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/cpu/lpc2387/include/cpu.h b/cpu/lpc2387/include/cpu.h index 55d8f6ffef..acc85673f0 100644 --- a/cpu/lpc2387/include/cpu.h +++ b/cpu/lpc2387/include/cpu.h @@ -14,9 +14,9 @@ See the file LICENSE in the top level directory for more details. #define __CPU_H /** - * @defgroup lpc2387 NXP LPC2387 - * @ingroup cpu - * @brief NXP LPC2387 specific code + * @defgroup lpc2387 NXP LPC2387 + * @ingroup cpu + * @brief NXP LPC2387 specific code * @{ */ @@ -24,7 +24,7 @@ See the file LICENSE in the top level directory for more details. #include "lpc2387.h" #include "arm_cpu.h" -extern uintptr_t __stack_start; ///< end of user stack memory space +extern uintptr_t __stack_start; ///< end of user stack memory space void lpc2387_pclk_scale(uint32_t source, uint32_t target, uint32_t *pclksel, uint32_t *prescale); bool install_irq(int IntNumber, void (*HandlerAddr)(void), int Priority); diff --git a/cpu/lpc_common/doc.txt b/cpu/lpc_common/doc.txt index f0cae38184..ed2a6b60c4 100644 --- a/cpu/lpc_common/doc.txt +++ b/cpu/lpc_common/doc.txt @@ -7,7 +7,7 @@ */ /** - * @defgroup lpc_common LPC common - * @brief Common code for all arm-based LPC controllers - * @ingroup cpu + * @defgroup lpc_common LPC common + * @brief Common code for all arm-based LPC controllers + * @ingroup cpu */ diff --git a/cpu/mc1322x/include/cpu.h b/cpu/mc1322x/include/cpu.h index 7ba2c7980b..f37db452d5 100644 --- a/cpu/mc1322x/include/cpu.h +++ b/cpu/mc1322x/include/cpu.h @@ -7,9 +7,9 @@ */ /** - * @defgroup mc1322x Freescale MC1322x - * @ingroup cpu - * @brief Freescale MC1322x specific code + * @defgroup mc1322x Freescale MC1322x + * @ingroup cpu + * @brief Freescale MC1322x specific code */ #ifndef CPU_H @@ -19,6 +19,6 @@ #include "arm_cpu.h" #include "mc1322x.h" -extern uintptr_t __stack_start; ///< end of user stack memory space +extern uintptr_t __stack_start; ///< end of user stack memory space #endif /* CPU_H */ diff --git a/cpu/msp430-common/include/cpu.h b/cpu/msp430-common/include/cpu.h index 562de619e4..2c2aac0e9d 100644 --- a/cpu/msp430-common/include/cpu.h +++ b/cpu/msp430-common/include/cpu.h @@ -14,12 +14,12 @@ See the file LICENSE in the top level directory for more details. #define _CPU_H /** - * @defgroup msp430 TI MSP430 - * @ingroup cpu - * @brief Texas Instruments MSP430 specific code + * @defgroup msp430 TI MSP430 + * @ingroup cpu + * @brief Texas Instruments MSP430 specific code

First steps

-\li See the manual for toolchain and ide setup +\li See the manual for toolchain and ide setup * @{ */ @@ -34,7 +34,7 @@ See the file LICENSE in the top level directory for more details. /* CPU speed */ #define F_CPU (2457600ul) -#define F_RC_OSCILLATOR (32768) ///< Frequency of internal RC oscillator +#define F_RC_OSCILLATOR (32768) ///< Frequency of internal RC oscillator extern volatile int __inISR; extern char __isr_stack[MSP430_ISR_STACK_SIZE]; @@ -132,4 +132,3 @@ void msp430_cpu_init(void); /** @} */ #endif // _CPU_H - diff --git a/cpu/native/include/cpu.h b/cpu/native/include/cpu.h index 60e2f3c0fe..c0bb9069fd 100644 --- a/cpu/native/include/cpu.h +++ b/cpu/native/include/cpu.h @@ -13,8 +13,8 @@ /** * @ingroup arch * @defgroup native_cpu Native CPU - * @ingroup cpu - * @brief CPU abstraction for the native port + * @ingroup cpu + * @brief CPU abstraction for the native port * @{ * @author Ludwig Ortmann */ diff --git a/cpu/native/include/nativenet.h b/cpu/native/include/nativenet.h index 9e5a75b3b1..963bf1f0d6 100644 --- a/cpu/native/include/nativenet.h +++ b/cpu/native/include/nativenet.h @@ -16,8 +16,8 @@ */ /** - * @defgroup native_net - * @ingroup native_cpu + * @defgroup native_net + * @ingroup native_cpu * @{ * @author Ludwig Ortmann */ diff --git a/drivers/cc110x/cc1100.h b/drivers/cc110x/cc1100.h index 3b7975233b..265127f839 100644 --- a/drivers/cc110x/cc1100.h +++ b/drivers/cc110x/cc1100.h @@ -1,8 +1,8 @@ -/****************************************************************************** +/* * Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems -and Telematics group (http://cst.mi.fu-berlin.de). + * and Telematics group (http://cst.mi.fu-berlin.de). * ---------------------------------------------------------------------------- * This file is part of RIOT. * @@ -13,27 +13,21 @@ and Telematics group (http://cst.mi.fu-berlin.de). *******************************************************************************/ /** - * @defgroup drivers_cc110x CC110x - * @ingroup drivers - * @brief Texas Instruments CC110x driver + * @defgroup drivers_cc110x CC110x + * @ingroup drivers + * @brief Texas Instruments CC110x driver * *

Quick links

- * \li \ref cc1100_packet_layer0_t MAC packet format + * \li \ref cc1100_packet_layer0_t MAC packet format * - *
* @{ - */ - -/** + * * @file - * @brief TI Chipcon CC110x radio driver + * @brief TI Chipcon CC110x radio driver * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @version $Revision: 2128 $ - * - * @note $Id: cc1100.h 2128 2010-05-12 12:07:59Z hillebra $ + * @author Thomas Hillebrandt + * @author Heiko Will */ #ifndef CC1100_H @@ -43,17 +37,17 @@ and Telematics group (http://cst.mi.fu-berlin.de). #include "cc1100-interface.h" /** - * @name Defines used as state values for state machine + * @name Defines used as state values for state machine * @{ */ -#define RADIO_UNKNOWN (0) -#define RADIO_AIR_FREE_WAITING (1) -#define RADIO_WOR (2) -#define RADIO_IDLE (3) -#define RADIO_SEND_BURST (4) -#define RADIO_RX (5) -#define RADIO_SEND_ACK (6) -#define RADIO_PWD (7) +#define RADIO_UNKNOWN (0) +#define RADIO_AIR_FREE_WAITING (1) +#define RADIO_WOR (2) +#define RADIO_IDLE (3) +#define RADIO_SEND_BURST (4) +#define RADIO_RX (5) +#define RADIO_SEND_ACK (6) +#define RADIO_PWD (7) /** @} */ @@ -102,73 +96,73 @@ typedef struct cc1100_reg { /** CC1100 radio configuration */ typedef struct cc1100_cfg_t { - cc1100_reg_t reg_cfg; ///< CC1100 register configuration - uint8_t pa_power; ///< Output power setting + cc1100_reg_t reg_cfg; ///< CC1100 register configuration + uint8_t pa_power; ///< Output power setting } cc1100_cfg_t; /** - * @brief Radio Control Flags + * @brief Radio Control Flags */ typedef struct cc1100_flags { - uint32_t TOF; ///< Time of flight of the last packet and last ACK - uint32_t TCP; ///< Time to compute packet - unsigned RPS : 16; ///< Raw packets sent to transmit last packet - unsigned RETC : 8; ///< Retransmission count of last send packet - unsigned RSSI : 8; ///< The RSSI value of last received packet - unsigned RSSI_SEND : 8; ///< The RSSI value of the last send unicast packet of this node - unsigned LQI : 8; ///< The LQI value of the last received packet - unsigned LL_ACK : 1; ///< Is set if Link-Level ACK is received, otherwise 0 (reset on new burst) - unsigned CAA : 1; ///< The status of the air (1 = air free, 0 = air not free) - unsigned CRC_STATE : 1; ///< The CRC status of last received packet (1 = OK, 0 = not OK) - unsigned SEQ : 1; ///< Sequence number (toggles between 0 and 1) - unsigned MAN_WOR : 1; ///< Manual WOR set (for randomized WOR times => no synch) - unsigned KT_RES_ERR : 1; ///< A hwtimer resource error has occurred (no free timers available) - unsigned TX : 1; ///< State machine TX lock, only ACKs will be received - unsigned WOR_RST : 1; ///< Reset CC1100 real time clock (WOR) on next WOR strobe + uint32_t TOF; ///< Time of flight of the last packet and last ACK + uint32_t TCP; ///< Time to compute packet + unsigned RPS : 16; ///< Raw packets sent to transmit last packet + unsigned RETC : 8; ///< Retransmission count of last send packet + unsigned RSSI : 8; ///< The RSSI value of last received packet + unsigned RSSI_SEND : 8; ///< The RSSI value of the last send unicast packet of this node + unsigned LQI : 8; ///< The LQI value of the last received packet + unsigned LL_ACK : 1; ///< Is set if Link-Level ACK is received, otherwise 0 (reset on new burst) + unsigned CAA : 1; ///< The status of the air (1 = air free, 0 = air not free) + unsigned CRC_STATE : 1; ///< The CRC status of last received packet (1 = OK, 0 = not OK) + unsigned SEQ : 1; ///< Sequence number (toggles between 0 and 1) + unsigned MAN_WOR : 1; ///< Manual WOR set (for randomized WOR times => no synch) + unsigned KT_RES_ERR : 1; ///< A hwtimer resource error has occurred (no free timers available) + unsigned TX : 1; ///< State machine TX lock, only ACKs will be received + unsigned WOR_RST : 1; ///< Reset CC1100 real time clock (WOR) on next WOR strobe } cc1100_flags; /** - * @brief Statistic interface for debugging + * @brief Statistic interface for debugging */ typedef struct cc1100_statistic { - uint32_t packets_in; - uint32_t packets_in_crc_fail; - uint32_t packets_in_while_tx; - uint32_t packets_in_dups; - uint32_t packets_in_up; - uint32_t packets_out; - uint32_t packets_out_acked; - uint32_t packets_out_broadcast; - uint32_t raw_packets_out; - uint32_t raw_packets_out_acked; - uint32_t acks_send; - uint32_t rx_buffer_max; - uint32_t watch_dog_resets; + uint32_t packets_in; + uint32_t packets_in_crc_fail; + uint32_t packets_in_while_tx; + uint32_t packets_in_dups; + uint32_t packets_in_up; + uint32_t packets_out; + uint32_t packets_out_acked; + uint32_t packets_out_broadcast; + uint32_t raw_packets_out; + uint32_t raw_packets_out_acked; + uint32_t acks_send; + uint32_t rx_buffer_max; + uint32_t watch_dog_resets; } cc1100_statistic_t; enum radio_mode { - RADIO_MODE_GET = -1, ///< leave mode unchanged - RADIO_MODE_OFF = 0, ///< turn radio off - RADIO_MODE_ON = 1 ///< turn radio on + RADIO_MODE_GET = -1, ///< leave mode unchanged + RADIO_MODE_OFF = 0, ///< turn radio off + RADIO_MODE_ON = 1 ///< turn radio on }; enum radio_result { - RADIO_PAYLOAD_TOO_LONG = -1, ///< payload too long - RADIO_WRONG_MODE = -2, ///< operation not supported in current mode - RADIO_ADDR_OUT_OF_RANGE = -3, ///< address out of range - RADIO_OP_FAILED = -4, ///< operation failed - RADIO_CS_TIMEOUT = -5, ///< Carrier Sense timeout: air was never free - RADIO_INVALID_PARAM = -6 ///< Invalid parameters passed to radio + RADIO_PAYLOAD_TOO_LONG = -1, ///< payload too long + RADIO_WRONG_MODE = -2, ///< operation not supported in current mode + RADIO_ADDR_OUT_OF_RANGE = -3, ///< address out of range + RADIO_OP_FAILED = -4, ///< operation failed + RADIO_CS_TIMEOUT = -5, ///< Carrier Sense timeout: air was never free + RADIO_INVALID_PARAM = -6 ///< Invalid parameters passed to radio }; /* ------------------------------------------------------------------------- */ -// Variable declarations (also used in other files) +// Variable declarations (also used in other files) /* ------------------------------------------------------------------------- */ -extern volatile cc1100_flags rflags; ///< Radio flags +extern volatile cc1100_flags rflags; ///< Radio flags -extern volatile uint8_t radio_mode; ///< Radio mode -extern volatile uint8_t radio_state; ///< Radio state +extern volatile uint8_t radio_mode; ///< Radio mode +extern volatile uint8_t radio_state; ///< Radio state /** Mode callback functions */ typedef void (*cc1100_mode_callback_t)(void); @@ -177,85 +171,85 @@ extern volatile cc1100_mode_callback_t cc1100_go_receive; extern volatile cc1100_mode_callback_t cc1100_go_after_tx; extern volatile cc1100_mode_callback_t cc1100_setup_mode; -extern volatile int wor_hwtimer_id; ///< WOR hwtimer identifier +extern volatile int wor_hwtimer_id; ///< WOR hwtimer identifier /* ------------------------------------------------------------------------- */ -// CC1100 radio driver API +// CC1100 radio driver API /* ------------------------------------------------------------------------- */ /** - * @brief Set chip and state machine to IDLE mode. + * @brief Set chip and state machine to IDLE mode. */ void cc1100_set_idle(void); /** - * @brief Convert radio mode to textual representation. + * @brief Convert radio mode to textual representation. * - * @param mode The radio mode to convert. + * @param mode The radio mode to convert. * - * @return Textual representation of radio mode. + * @return Textual representation of radio mode. */ char *cc1100_mode_to_text(uint8_t mode); /** - * @brief Convert radio state to textual representation. + * @brief Convert radio state to textual representation. * - * @param mode The radio state to convert. + * @param mode The radio state to convert. * - * @return Textual representation of radio state. + * @return Textual representation of radio state. */ char *cc1100_state_to_text(uint8_t state); /** - * @brief Convert current output power to textual representation. + * @brief Convert current output power to textual representation. * - * @return Textual representation of current output power in dBm. + * @return Textual representation of current output power in dBm. */ char *cc1100_get_output_power(char *buf); /** - * @brief Read out main radio control FSM state. + * @brief Read out main radio control FSM state. * - * @return Textual representation of current main radio control FSM state. + * @return Textual representation of current main radio control FSM state. */ char *cc1100_get_marc_state(void); /** - * @brief hwtimer wrapper function. + * @brief hwtimer wrapper function. * * This wrapper function puts the radio to receive mode. * - * @param ptr Optional data (only to match hwtimer interface). + * @param ptr Optional data (only to match hwtimer interface). */ void cc1100_hwtimer_go_receive_wrapper(void *ptr); /** - * @brief GDO0 interrupt handler. + * @brief GDO0 interrupt handler. */ void cc1100_gdo0_irq(void); /** - * @brief GDO2 interrupt handler. + * @brief GDO2 interrupt handler. * - * @note Wakes up MCU on packet reception. + * @note Wakes up MCU on packet reception. */ void cc1100_gdo2_irq(void); /** - * @brief Transfer packet from CC1100 RX FIFO. + * @brief Transfer packet from CC1100 RX FIFO. * * Transfers a packet from CC1100 RX FIFO into a buffer. * - * @param rxBuffer The buffer in which to transfer the packet. - * @param length The size of the buffer in which to transfer the packet. + * @param rxBuffer The buffer in which to transfer the packet. + * @param length The size of the buffer in which to transfer the packet. * - * @return true if operation succeeded; false otherwise (e.g. no data + * @return true if operation succeeded; false otherwise (e.g. no data * available, buffer to small or CRC check failed). */ bool cc1100_spi_receive_packet(uint8_t *rxBuffer, uint8_t length); /** - * @brief Sends raw data. + * @brief Sends raw data. * * Sends the data of the given buffer. The first two bytes of the * buffer must match the CC1100 packet format (so address interpretation @@ -264,8 +258,8 @@ bool cc1100_spi_receive_packet(uint8_t *rxBuffer, uint8_t length); * This function is not mode safe!The radio must be woke up before * sending and has to be put back manually to receive mode. * - * @param tx_buffer Data source buffer. - * @param size The size of the data source buffer (maximum: 62 bytes). + * @param tx_buffer Data source buffer. + * @param size The size of the data source buffer (maximum: 62 bytes). */ void cc1100_send_raw(uint8_t *tx_buffer, uint8_t size); @@ -275,62 +269,61 @@ void cc1100_send_raw(uint8_t *tx_buffer, uint8_t size); */ /** - * @brief Initialize radio for carrier sense detection. + * @brief Initialize radio for carrier sense detection. */ void cc1100_cs_init(void); /** - * @brief Enable or disable carrier sense detections. + * @brief Enable or disable carrier sense detections. * * Turns interrupts for carrier sense on or off. * - * @param enabled true if carrier sense detection should + * @param enabled true if carrier sense detection should * be enabled; false otherwise. */ void cc1100_cs_set_enabled(bool enabled); /** - * @brief Read carrier sense signal. + * @brief Read carrier sense signal. * - * @return High (1) if air is not free; low (0) if air is + * @return High (1) if air is not free; low (0) if air is * currently free. */ int cc1100_cs_read(void); /** - * @brief Reads the CCA (Clear Channel Assessment) flag. + * @brief Reads the CCA (Clear Channel Assessment) flag. * * The CCA flag is set by an interrupt service routine, after * carrier sense detection is enabled. So the status of the * carrier sense signal can be evaluated in a non blocking * manner. * - * @return The current value of the CCA flag (High: air is free, - * low: air is not free). + * @return The current value of the CCA flag (High: air is free, + * low: air is not free). */ int cc1100_cs_read_cca(void); /** - * @brief Sets the CCA flag. + * @brief Sets the CCA flag. * - * @param cca The new value for the CCA flag. + * @param cca The new value for the CCA flag. */ void cc1100_cs_write_cca(const int cca); /** @} */ /** - * @name Statistic interface + * @name Statistic interface * @{ */ /** - * @brief Reset radio statistics. + * @brief Reset radio statistics. */ void cc1100_reset_statistic(void); /** @} */ /** @} */ - #endif diff --git a/drivers/cc110x_ng/cc110x-defaultSettings.c b/drivers/cc110x_ng/cc110x-defaultSettings.c index a5dc73a846..98ae2fa3f0 100644 --- a/drivers/cc110x_ng/cc110x-defaultSettings.c +++ b/drivers/cc110x_ng/cc110x-defaultSettings.c @@ -1,6 +1,4 @@ -/** - * Default configuration for the cc110x chip - * +/* * Copyright (C) 2013 INRIA * * This file is subject to the terms and conditions of the GNU Lesser General @@ -9,19 +7,17 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ * * @file - * @brief TI Chipcon CC110x default settings + * @brief TI Chipcon CC110x default settings * * @author Freie Universität Berlin, Computer Systems & Telematics * @author INRIA - * @author Thomas Hillebrandt - * @author Heiko Will + * @author Thomas Hillebrandt + * @author Heiko Will * @author Oliver Hahm - * - * @note $Id: cc110x-defaultSettings.c 2058 2010-03-31 08:59:31Z hillebra $ * @} */ @@ -35,7 +31,7 @@ * ----------------------------------------- * 0 | 0 | 869.525 * 1 | 10 | 871.61 - * 2 | 20 | 873.58 ~ seems to be bad (hang-ups with this channel) + * 2 | 20 | 873.58 ~ seems to be bad (hang-ups with this channel) * 3 | 30 | 875.61 * 4 | 40 | 877.58 * 5 | 50 | 879.61 @@ -68,9 +64,9 @@ char cc110x_conf[] = { 0x0F, // FIFOTHR 0x9B, // SYNC1 0xAD, // SYNC0 - 0x3D, // PKTLEN (maximum value of packet length byte = 61) + 0x3D, // PKTLEN (maximum value of packet length byte = 61) 0x06, // PKTCTRL1 - 0x45, // PKTCTRL0 (variable packet length) + 0x45, // PKTCTRL0 (variable packet length) 0xFF, // ADDR CC1100_DEFAULT_CHANNR * 10, // CHANNR 0x0B, // FSCTRL1 @@ -105,18 +101,18 @@ char cc110x_conf[] = { 0x00 // padding to 4 bytes }; -uint8_t pa_table_index = PATABLE; ///< Current PATABLE Index -uint8_t pa_table[] = { ///< PATABLE with available output powers - 0x00, ///< -52 dBm - 0x03, ///< -30 dBm - 0x0D, ///< -20 dBm - 0x1C, ///< -15 dBm - 0x34, ///< -10 dBm - 0x57, ///< - 5 dBm - 0x3F, ///< - 1 dBm - 0x8E, ///< 0 dBm - 0x85, ///< + 5 dBm - 0xCC, ///< + 7 dBm - 0xC6, ///< + 9 dBm - 0xC3 ///< +10 dBm +uint8_t pa_table_index = PATABLE; ///< Current PATABLE Index +uint8_t pa_table[] = { ///< PATABLE with available output powers + 0x00, ///< -52 dBm + 0x03, ///< -30 dBm + 0x0D, ///< -20 dBm + 0x1C, ///< -15 dBm + 0x34, ///< -10 dBm + 0x57, ///< - 5 dBm + 0x3F, ///< - 1 dBm + 0x8E, ///< 0 dBm + 0x85, ///< + 5 dBm + 0xCC, ///< + 7 dBm + 0xC6, ///< + 9 dBm + 0xC3 ///< +10 dBm }; // If PATABLE is changed in size, adjust MAX_OUTPUT_POWER definition in CC1100 interface! diff --git a/drivers/cc110x_ng/cc110x-rx.c b/drivers/cc110x_ng/cc110x-rx.c index 0492ca9bc4..ed00c10f50 100644 --- a/drivers/cc110x_ng/cc110x-rx.c +++ b/drivers/cc110x_ng/cc110x-rx.c @@ -8,13 +8,15 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ - * @file cc110x-rx.c - * @brief Functions for packet reception on cc110x - * @author Oliver Hahm + * @file cc110x-rx.c + * @brief Functions for packet reception on cc110x + * + * @author Oliver Hahm * @} */ + #include #include #include @@ -41,8 +43,8 @@ static uint8_t is_ignored(radio_address_t addr); static uint8_t receive_packet_variable(uint8_t *rxBuffer, uint8_t length); static uint8_t receive_packet(uint8_t *rxBuffer, uint8_t length); -rx_buffer_t cc110x_rx_buffer[RX_BUF_SIZE]; ///< RX buffer -volatile uint8_t rx_buffer_next; ///< Next packet in RX queue +rx_buffer_t cc110x_rx_buffer[RX_BUF_SIZE]; ///< RX buffer +volatile uint8_t rx_buffer_next; ///< Next packet in RX queue void cc110x_rx_handler(void) { @@ -66,13 +68,13 @@ void cc110x_rx_handler(void) cc110x_rx_buffer[rx_buffer_next].rssi = rflags._RSSI; cc110x_rx_buffer[rx_buffer_next].lqi = rflags._LQI; - cc110x_strobe(CC1100_SFRX); /* ...for flushing the RX FIFO */ + cc110x_strobe(CC1100_SFRX); /* ...for flushing the RX FIFO */ /* Valid packet. After a wake-up, the radio should be in IDLE. * So put CC1100 to RX for WOR_TIMEOUT (have to manually put * the radio back to sleep/WOR). */ - //cc110x_spi_write_reg(CC1100_MCSM0, 0x08); /* Turn off FS-Autocal */ - cc110x_write_reg(CC1100_MCSM2, 0x07); /* Configure RX_TIME (until end of packet) */ + //cc110x_spi_write_reg(CC1100_MCSM0, 0x08); /* Turn off FS-Autocal */ + cc110x_write_reg(CC1100_MCSM2, 0x07); /* Configure RX_TIME (until end of packet) */ cc110x_strobe(CC1100_SRX); hwtimer_wait(IDLE_TO_RX_TIME); radio_state = RADIO_RX; @@ -106,8 +108,8 @@ void cc110x_rx_handler(void) rflags.TOF = 0; /* CRC false or RX buffer full -> clear RX FIFO in both cases */ - cc110x_strobe(CC1100_SIDLE); /* Switch to IDLE (should already be)... */ - cc110x_strobe(CC1100_SFRX); /* ...for flushing the RX FIFO */ + cc110x_strobe(CC1100_SIDLE); /* Switch to IDLE (should already be)... */ + cc110x_strobe(CC1100_SFRX); /* ...for flushing the RX FIFO */ /* If packet interrupted this nodes send call, * don't change anything after this point. */ diff --git a/drivers/cc110x_ng/cc110x-tx.c b/drivers/cc110x_ng/cc110x-tx.c index 62c1e68cce..792c73bc51 100644 --- a/drivers/cc110x_ng/cc110x-tx.c +++ b/drivers/cc110x_ng/cc110x-tx.c @@ -8,11 +8,12 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ - * @file cc110x-tx.c - * @brief Functions for packet transmission on cc110x - * @author Oliver Hahm + * @file cc110x-tx.c + * @brief Functions for packet transmission on cc110x + * + * @author Oliver Hahm * @} */ #include diff --git a/drivers/cc110x_ng/cc110x.c b/drivers/cc110x_ng/cc110x.c index bf7e149641..717e1c9a59 100644 --- a/drivers/cc110x_ng/cc110x.c +++ b/drivers/cc110x_ng/cc110x.c @@ -8,12 +8,12 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ + * @file cc110x.c + * @brief Basic functionality of cc110x driver * - * @file cc110x.c - * @brief Basic functionality of cc110x driver - * @author Oliver Hahm + * @author Oliver Hahm * @} */ #include @@ -32,15 +32,15 @@ #include /* some externals */ -extern uint8_t pa_table[]; ///< PATABLE with available output powers +extern uint8_t pa_table[]; ///< PATABLE with available output powers extern uint8_t pa_table_index; ///< Current PATABLE Index /* global variables */ cc110x_statistic_t cc110x_statistic; -volatile cc110x_flags rflags; ///< Radio control flags -volatile uint8_t radio_state = RADIO_UNKNOWN; ///< Radio state +volatile cc110x_flags rflags; ///< Radio control flags +volatile uint8_t radio_state = RADIO_UNKNOWN; ///< Radio state static radio_address_t radio_address; ///< Radio address static uint8_t radio_channel; ///< Radio channel @@ -54,7 +54,7 @@ static void power_up_reset(void); static void write_register(uint8_t r, uint8_t value); /*---------------------------------------------------------------------------* - * Radio Driver API * + * Radio Driver API * *---------------------------------------------------------------------------*/ void cc110x_init(int tpid) { @@ -353,7 +353,7 @@ int16_t cc110x_get_channel(void) /*--------------------------------------------------------------------------- - * CC1100 reset functionality + * CC1100 reset functionality *---------------------------------------------------------------------------*/ static void reset(void) @@ -409,13 +409,13 @@ static int rd_set_mode(int mode) switch(mode) { case RADIO_MODE_ON: DEBUG("Enabling rx mode\n"); - cc110x_init_interrupts(); /* Enable interrupts */ - cc110x_setup_rx_mode(); /* Set chip to desired mode */ + cc110x_init_interrupts(); /* Enable interrupts */ + cc110x_setup_rx_mode(); /* Set chip to desired mode */ break; case RADIO_MODE_OFF: - cc110x_disable_interrupts(); /* Disable interrupts */ - cc110x_switch_to_pwd(); /* Set chip to power down mode */ + cc110x_disable_interrupts(); /* Disable interrupts */ + cc110x_switch_to_pwd(); /* Set chip to power down mode */ break; case RADIO_MODE_GET: diff --git a/drivers/cc110x_ng/include/cc110x-arch.h b/drivers/cc110x_ng/include/cc110x-arch.h index 62865999a3..e32417bad0 100644 --- a/drivers/cc110x_ng/include/cc110x-arch.h +++ b/drivers/cc110x_ng/include/cc110x-arch.h @@ -1,8 +1,8 @@ -/****************************************************************************** +/* * Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems -and Telematics group (http://cst.mi.fu-berlin.de). + * and Telematics group (http://cst.mi.fu-berlin.de). * ---------------------------------------------------------------------------- * This file is part of RIOT. * @@ -13,18 +13,16 @@ and Telematics group (http://cst.mi.fu-berlin.de). *******************************************************************************/ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ * - * @file cc110x-arch.h - * @brief CC1100 architecture dependent functions + * @file cc110x-arch.h + * @brief CC1100 architecture dependent functions * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Heiko Will - * @version $Revision: 1775 $ - * - * @note $Id: arch_cc110x.h 1775 2010-01-26 09:37:03Z hillebra $ + * @author Heiko Will */ + #ifndef __CC1100_ARCH_H #define __CC1100_ARCH_H diff --git a/drivers/cc110x_ng/include/cc110x-config.h b/drivers/cc110x_ng/include/cc110x-config.h index ddd53f839c..a054f1c3c6 100644 --- a/drivers/cc110x_ng/include/cc110x-config.h +++ b/drivers/cc110x_ng/include/cc110x-config.h @@ -1,18 +1,20 @@ -/** - * Configuration parameters for the cc110x radio chip - * +/* * Copyright (C) 2009 Freie Universität Berlin * Copyright (C) 2013 INRIA * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file LICENSE in the top level directory for more * details. - * - * @ingroup drivers_cc110x_ng + */ + +/** + * @ingroup drivers_cc110x_ng * @{ * - * @file cc110x-config.h - * @author Oliver Hahm + * @file cc110x-config.h + * @brief Configuration parameters for the cc110x radio chip + * + * @author Oliver Hahm */ #ifndef CC1100_CONFIG_H #define CC1100_CONFIG_H @@ -65,47 +67,47 @@ typedef struct { /** CC1100 radio configuration */ typedef struct { - cc110x_reg_t reg_cfg; ///< CC1100 register configuration - uint8_t pa_power; ///< Output power setting + cc110x_reg_t reg_cfg; ///< CC1100 register configuration + uint8_t pa_power; ///< Output power setting } cc110x_cfg_t; /** - * @brief Radio Control Flags + * @brief Radio Control Flags */ typedef struct { - uint32_t TOF; ///< Time of flight of the last packet and last ACK + uint32_t TOF; ///< Time of flight of the last packet and last ACK timex_t TOA; ///< Time of packet arriveal - uint32_t TCP; ///< Time to compute packet - unsigned RPS : 16; ///< Raw packets sent to transmit last packet - unsigned RETC : 8; ///< Retransmission count of last send packet - unsigned _RSSI : 8; ///< The RSSI value of last received packet - unsigned RSSI_SEND : 8; ///< The RSSI value of the last send unicast packet of this node - unsigned _LQI : 8; ///< The LQI value of the last received packet - unsigned LL_ACK : 1; ///< Is set if Link-Level ACK is received, otherwise 0 (reset on new burst) - unsigned CAA : 1; ///< The status of the air (1 = air free, 0 = air not free) - unsigned CRC_STATE : 1; ///< The CRC status of last received packet (1 = OK, 0 = not OK) - unsigned SEQ : 1; ///< Sequence number (toggles between 0 and 1) - unsigned MAN_WOR : 1; ///< Manual WOR set (for randomized WOR times => no synch) - unsigned KT_RES_ERR : 1; ///< A hwtimer resource error has occurred (no free timers available) - unsigned TX : 1; ///< State machine TX lock, only ACKs will be received - unsigned WOR_RST : 1; ///< Reset CC1100 real time clock (WOR) on next WOR strobe + uint32_t TCP; ///< Time to compute packet + unsigned RPS : 16; ///< Raw packets sent to transmit last packet + unsigned RETC : 8; ///< Retransmission count of last send packet + unsigned _RSSI : 8; ///< The RSSI value of last received packet + unsigned RSSI_SEND : 8; ///< The RSSI value of the last send unicast packet of this node + unsigned _LQI : 8; ///< The LQI value of the last received packet + unsigned LL_ACK : 1; ///< Is set if Link-Level ACK is received, otherwise 0 (reset on new burst) + unsigned CAA : 1; ///< The status of the air (1 = air free, 0 = air not free) + unsigned CRC_STATE : 1; ///< The CRC status of last received packet (1 = OK, 0 = not OK) + unsigned SEQ : 1; ///< Sequence number (toggles between 0 and 1) + unsigned MAN_WOR : 1; ///< Manual WOR set (for randomized WOR times => no synch) + unsigned KT_RES_ERR : 1; ///< A hwtimer resource error has occurred (no free timers available) + unsigned TX : 1; ///< State machine TX lock, only ACKs will be received + unsigned WOR_RST : 1; ///< Reset CC1100 real time clock (WOR) on next WOR strobe } cc110x_flags; /** - * @brief Statistic interface for debugging + * @brief Statistic interface for debugging */ typedef struct cc110x_statistic { - uint32_t packets_in; - uint32_t packets_in_crc_fail; - uint32_t packets_in_while_tx; - uint32_t packets_in_dups; - uint32_t packets_in_up; - uint32_t packets_out; - uint32_t packets_out_broadcast; - uint32_t raw_packets_out; - uint32_t acks_send; - uint32_t rx_buffer_max; - uint32_t watch_dog_resets; + uint32_t packets_in; + uint32_t packets_in_crc_fail; + uint32_t packets_in_while_tx; + uint32_t packets_in_dups; + uint32_t packets_in_up; + uint32_t packets_out; + uint32_t packets_out_broadcast; + uint32_t raw_packets_out; + uint32_t acks_send; + uint32_t rx_buffer_max; + uint32_t watch_dog_resets; } cc110x_statistic_t; /** @} */ diff --git a/drivers/cc110x_ng/include/cc110x-defaultSettings.h b/drivers/cc110x_ng/include/cc110x-defaultSettings.h index 37057830d4..7c08835f52 100644 --- a/drivers/cc110x_ng/include/cc110x-defaultSettings.h +++ b/drivers/cc110x_ng/include/cc110x-defaultSettings.h @@ -16,20 +16,15 @@ and Telematics group (http://cst.mi.fu-berlin.de). #define __CC1100_DEFAULTSETTINGS_H /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ - */ - -/** + * * @file - * @brief TI Chipcon CC110x default settings + * @brief TI Chipcon CC110x default settings * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @version $Revision: 2139 $ - * - * @note $Id: cc110x-defaultSettings.h 2139 2010-05-26 08:04:04Z hillebra $ + * @author Thomas Hillebrandt + * @author Heiko Will */ #include @@ -37,61 +32,61 @@ and Telematics group (http://cst.mi.fu-berlin.de). // returns hwtimer ticks per us #define RTIMER_TICKS(us) HWTIMER_TICKS(us) -#define TIMER_TICK_USEC_RES (122) +#define TIMER_TICK_USEC_RES (122) // Default PA table index (output power) -#define PATABLE (11) +#define PATABLE (11) // Watchdog cycle time in seconds, set 0 to disable watchdog -#define CC1100_WATCHDOG_PERIOD (5) +#define CC1100_WATCHDOG_PERIOD (5) // Number of transmission retries for unicast packets (constant RX mode) -#define TRANSMISSION_RETRIES_CRX_UC (5) +#define TRANSMISSION_RETRIES_CRX_UC (5) // Number of transmission retries for unicast packets (WOR mode) -#define TRANSMISSION_RETRIES_WOR_UC (1) +#define TRANSMISSION_RETRIES_WOR_UC (1) // Number of transmission retries for broadcast packets (constant RX mode) -#define TRANSMISSION_RETRIES_CRX_BC (0) +#define TRANSMISSION_RETRIES_CRX_BC (0) // Number of transmission retries for broadcast packets (WOR mode) -#define TRANSMISSION_RETRIES_WOR_BC (0) +#define TRANSMISSION_RETRIES_WOR_BC (0) // Time before chip goes back to RX (= stays in PWD after incoming packet) -#define WOR_TIMEOUT_1 (3200) // ~ 32 milliseconds +#define WOR_TIMEOUT_1 (3200) // ~ 32 milliseconds // Time before chip goes back to WOR (= stays in RX after elapsed WOR_TIMEOUT_1) -#define WOR_TIMEOUT_2 (800) // ~ 8 milliseconds +#define WOR_TIMEOUT_2 (800) // ~ 8 milliseconds // XOSC startup + FS calibration (300 + 809 us ~ 1.38 ms) -#define FS_CAL_TIME RTIMER_TICKS(12 * TIMER_TICK_USEC_RES) +#define FS_CAL_TIME RTIMER_TICKS(12 * TIMER_TICK_USEC_RES) // Manual FS calibration (721 us) -#define MANUAL_FS_CAL_TIME RTIMER_TICKS(7 * TIMER_TICK_USEC_RES) +#define MANUAL_FS_CAL_TIME RTIMER_TICKS(7 * TIMER_TICK_USEC_RES) // Reset wait time (in reset procedure) -#define RESET_WAIT_TIME RTIMER_TICKS(4 * TIMER_TICK_USEC_RES) +#define RESET_WAIT_TIME RTIMER_TICKS(4 * TIMER_TICK_USEC_RES) // Time chip needs to go to RX -#define IDLE_TO_RX_TIME RTIMER_TICKS(1 * TIMER_TICK_USEC_RES) +#define IDLE_TO_RX_TIME RTIMER_TICKS(1 * TIMER_TICK_USEC_RES) // Time chip needs to go to RX and CS signal is ready -#define CS_READY_TIME RTIMER_TICKS(3 * TIMER_TICK_USEC_RES) +#define CS_READY_TIME RTIMER_TICKS(3 * TIMER_TICK_USEC_RES) // Default RX interval for WOR in milliseconds -#define T_RX_INTERVAL (542) +#define T_RX_INTERVAL (542) // Time of packet interval in microseconds (at 400 kbps) -#define T_PACKET_INTERVAL (3800) +#define T_PACKET_INTERVAL (3800) // The size of the configuration array for CC1100 in bytes -#define CC1100_CONF_SIZE (39) +#define CC1100_CONF_SIZE (39) // The default channel number (0-24) for CC1100 -#define CC1100_DEFAULT_CHANNR (0) +#define CC1100_DEFAULT_CHANNR (0) // Burst retry to TX switch time (measured ~ 230 us) -#define BURST_RETRY_TX_SWITCH_TIME (23) +#define BURST_RETRY_TX_SWITCH_TIME (23) /** @} */ diff --git a/drivers/cc110x_ng/include/cc110x-internal.h b/drivers/cc110x_ng/include/cc110x-internal.h index 20a7279270..1c31545676 100644 --- a/drivers/cc110x_ng/include/cc110x-internal.h +++ b/drivers/cc110x_ng/include/cc110x-internal.h @@ -8,32 +8,33 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ * - * @file - * @brief Driver internal constants for 110x chip configuration + * @file cc110x-internal.h + * @brief Driver internal constants for 110x chip configuration * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @author Oliver Hahm + * @author Thomas Hillebrandt + * @author Heiko Will + * @author Oliver Hahm */ + #ifndef CC1100_INTERNAL_H #define CC1100_INTERNAL_H -#define FIXED_PKTLEN (0x00) ///< Fixed length packets, length configured in PKTLEN register. -#define VARIABLE_PKTLEN (0x01) ///< Variable length packets, packet length configured by the first - ///< byte after synch word. +#define FIXED_PKTLEN (0x00) ///< Fixed length packets, length configured in PKTLEN register. +#define VARIABLE_PKTLEN (0x01) ///< Variable length packets, packet length configured by the first + ///< byte after synch word. /** - * @name Bitmasks for reading out status register values + * @name Bitmasks for reading out status register values * @{ */ /** - * @brief Bitmask (=10000000) for reading CRC_OK. + * @brief Bitmask (=10000000) for reading CRC_OK. * * If CRC_OK == 1: CRC for received data OK (or CRC disabled). * If CRC_OK == 0: CRC error in received data. @@ -44,42 +45,42 @@ * * The Link Quality Indicator estimates how easily a received signal can be demodulated. */ -#define LQI_EST (0x7F) -#define I_RSSI (0x00) ///< Index 0 contains RSSI information (from optionally appended packet status bytes). -#define I_LQI (0x01) ///< Index 1 contains LQI & CRC_OK information (from optionally appended packet status bytes). -#define MARC_STATE (0x1F) ///< Bitmask (=00011111) for reading MARC_STATE in MARCSTATE status register. -#define CS (0x40) ///< Bitmask (=01000000) for reading CS (Carrier Sense) in PKTSTATUS status register. -#define PQT_REACHED (0x20) ///< Bitmask (=00100000) for reading PQT_REACHED (Preamble Quality reached) in PKTSTATUS status register. -#define CCA (0x10) ///< Bitmask (=00010000) for reading CCA (clear channel assessment) in PKTSTATUS status register. -#define SFD (0x08) ///< Bitmask (=00001000) for reading SFD (Sync word found) in PKTSTATUS status register. -#define GDO2 (0x04) ///< Bitmask (=00000100) for reading GDO2 (current value on GDO2 pin) in PKTSTATUS status register. -#define GDO1 (0x02) ///< Bitmask (=00000010) for reading GDO1 (current value on GDO1 pin) in PKTSTATUS status register. -#define GDO0 (0x01) ///< Bitmask (=00000001) for reading GDO0 (current value on GDO0 pin) in PKTSTATUS status register. -#define TXFIFO_UNDERFLOW (0x80) ///< Bitmask (=10000000) for reading TXFIFO_UNDERFLOW in TXBYTES status register. -#define BYTES_IN_TXFIFO (0x7F) ///< Bitmask (=01111111) for reading NUM_TXBYTES in TXBYTES status register. -#define RXFIFO_OVERFLOW (0xBF) ///< Bitmask (=10000000) for reading RXFIFO_OVERFLOW in RXBYTES status register. -#define BYTES_IN_RXFIFO (0xFF) ///< Bitmask (=01111111) for reading NUM_RXBYTES in RXBYTES status register. +#define LQI_EST (0x7F) +#define I_RSSI (0x00) ///< Index 0 contains RSSI information (from optionally appended packet status bytes). +#define I_LQI (0x01) ///< Index 1 contains LQI & CRC_OK information (from optionally appended packet status bytes). +#define MARC_STATE (0x1F) ///< Bitmask (=00011111) for reading MARC_STATE in MARCSTATE status register. +#define CS (0x40) ///< Bitmask (=01000000) for reading CS (Carrier Sense) in PKTSTATUS status register. +#define PQT_REACHED (0x20) ///< Bitmask (=00100000) for reading PQT_REACHED (Preamble Quality reached) in PKTSTATUS status register. +#define CCA (0x10) ///< Bitmask (=00010000) for reading CCA (clear channel assessment) in PKTSTATUS status register. +#define SFD (0x08) ///< Bitmask (=00001000) for reading SFD (Sync word found) in PKTSTATUS status register. +#define GDO2 (0x04) ///< Bitmask (=00000100) for reading GDO2 (current value on GDO2 pin) in PKTSTATUS status register. +#define GDO1 (0x02) ///< Bitmask (=00000010) for reading GDO1 (current value on GDO1 pin) in PKTSTATUS status register. +#define GDO0 (0x01) ///< Bitmask (=00000001) for reading GDO0 (current value on GDO0 pin) in PKTSTATUS status register. +#define TXFIFO_UNDERFLOW (0x80) ///< Bitmask (=10000000) for reading TXFIFO_UNDERFLOW in TXBYTES status register. +#define BYTES_IN_TXFIFO (0x7F) ///< Bitmask (=01111111) for reading NUM_TXBYTES in TXBYTES status register. +#define RXFIFO_OVERFLOW (0xBF) ///< Bitmask (=10000000) for reading RXFIFO_OVERFLOW in RXBYTES status register. +#define BYTES_IN_RXFIFO (0xFF) ///< Bitmask (=01111111) for reading NUM_RXBYTES in RXBYTES status register. /** @} */ /** - * @name Bitmasks for reading out configuration register values + * @name Bitmasks for reading out configuration register values * @{ */ -#define PKT_LENGTH_CONFIG (0x03) ///< Bitmask (=00000011) for reading LENGTH_CONFIG in PKTCTRL0 configuration register. +#define PKT_LENGTH_CONFIG (0x03) ///< Bitmask (=00000011) for reading LENGTH_CONFIG in PKTCTRL0 configuration register. /** @} */ /** - * @name Definitions to support burst/single access + * @name Definitions to support burst/single access * @{ */ -#define CC1100_WRITE_BURST (0x40) ///< Offset for burst write. -#define CC1100_READ_SINGLE (0x80) ///< Offset for read single byte. -#define CC1100_READ_BURST (0xC0) ///< Offset for read burst. -#define CC1100_NOBYTE (0xFF) ///< No command (for reading). +#define CC1100_WRITE_BURST (0x40) ///< Offset for burst write. +#define CC1100_READ_SINGLE (0x80) ///< Offset for read single byte. +#define CC1100_READ_BURST (0xC0) ///< Offset for read burst. +#define CC1100_NOBYTE (0xFF) ///< No command (for reading). /** @} */ /** - * @name Configuration Registers (47x) + * @name Configuration Registers (47x) * @{ */ #define CC1100_IOCFG2 (0x00) ///< GDO2 output pin configuration @@ -132,12 +133,12 @@ /** @} */ /** - * @name Strobe commands (14x) + * @name Strobe commands (14x) * @{ */ -#define CC1100_SRES (0x30) ///< Reset chip. +#define CC1100_SRES (0x30) ///< Reset chip. /** - * @brief Enable and calibrate frequency synthesizer (if MCSM0.FS_AUTOCAL=1). + * @brief Enable and calibrate frequency synthesizer (if MCSM0.FS_AUTOCAL=1). * * If in RX/TX: Go to a wait state where only the synthesizer is running (for quick RX / TX turnaround). */ @@ -161,35 +162,35 @@ /** @} */ /** - * @name Status registers (12x) + * @name Status registers (12x) * @{ */ -#define CC1100_PARTNUM (0x30) ///< Part number of CC1100. -#define CC1100_VERSION (0x31) ///< Current version number. -#define CC1100_FREQEST (0x32) ///< Frequency Offset Estimate. -#define CC1100_LQI (0x33) ///< Demodulator estimate for Link Quality. -#define CC1100_RSSI (0x34) ///< Received signal strength indication. -#define CC1100_MARCSTATE (0x35) ///< Control state machine state. -#define CC1100_WORTIME1 (0x36) ///< High byte of WOR timer. -#define CC1100_WORTIME0 (0x37) ///< Low byte of WOR timer. -#define CC1100_PKTSTATUS (0x38) ///< Current GDOx status and packet status. -#define CC1100_VCO_VC_DAC (0x39) ///< Current setting from PLL calibration module. -#define CC1100_TXBYTES (0x3A) ///< Underflow and number of bytes in the TX FIFO. -#define CC1100_RXBYTES (0x3B) ///< Overflow and number of bytes in the RX FIFO. +#define CC1100_PARTNUM (0x30) ///< Part number of CC1100. +#define CC1100_VERSION (0x31) ///< Current version number. +#define CC1100_FREQEST (0x32) ///< Frequency Offset Estimate. +#define CC1100_LQI (0x33) ///< Demodulator estimate for Link Quality. +#define CC1100_RSSI (0x34) ///< Received signal strength indication. +#define CC1100_MARCSTATE (0x35) ///< Control state machine state. +#define CC1100_WORTIME1 (0x36) ///< High byte of WOR timer. +#define CC1100_WORTIME0 (0x37) ///< Low byte of WOR timer. +#define CC1100_PKTSTATUS (0x38) ///< Current GDOx status and packet status. +#define CC1100_VCO_VC_DAC (0x39) ///< Current setting from PLL calibration module. +#define CC1100_TXBYTES (0x3A) ///< Underflow and number of bytes in the TX FIFO. +#define CC1100_RXBYTES (0x3B) ///< Overflow and number of bytes in the RX FIFO. /** @} */ /** - * @name Multi byte registers + * @name Multi byte registers * @{ */ /** - * @brief Register for eight user selected output power settings. + * @brief Register for eight user selected output power settings. * * 3-bit FREND0.PA_POWER value selects the PATABLE entry to use. */ #define CC1100_PATABLE (0x3E) -#define CC1100_TXFIFO (0x3F) ///< TX FIFO: Write operations write to the TX FIFO (SB: +0x00; BURST: +0x40) -#define CC1100_RXFIFO (0x3F) ///< RX FIFO: Read operations read from the RX FIFO (SB: +0x80; BURST: +0xC0) +#define CC1100_TXFIFO (0x3F) ///< TX FIFO: Write operations write to the TX FIFO (SB: +0x00; BURST: +0x40) +#define CC1100_RXFIFO (0x3F) ///< RX FIFO: Read operations read from the RX FIFO (SB: +0x80; BURST: +0xC0) /** @} */ /** @} */ diff --git a/drivers/cc110x_ng/include/cc110x-reg.h b/drivers/cc110x_ng/include/cc110x-reg.h index df5318774b..2e0ea37f18 100644 --- a/drivers/cc110x_ng/include/cc110x-reg.h +++ b/drivers/cc110x_ng/include/cc110x-reg.h @@ -8,15 +8,16 @@ */ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ * - * @file cc110x-reg.h - * @brief Access to CC110X registers + * @file cc110x-reg.h + * @brief Access to CC110X registers * - * @author INRIA - * @author Oliver Hahm + * @author INRIA + * @author Oliver Hahm */ + #ifndef __CC110X_REG_H #define __CC110X_REG_H diff --git a/drivers/cc110x_ng/include/cc110x_ng.h b/drivers/cc110x_ng/include/cc110x_ng.h index be0558ee89..af6a414a9d 100644 --- a/drivers/cc110x_ng/include/cc110x_ng.h +++ b/drivers/cc110x_ng/include/cc110x_ng.h @@ -8,14 +8,17 @@ */ /** - * @defgroup drivers_cc110x_ng CC110x_ng - * @brief Next generation version of the TI CC110x driver - * @ingroup drivers + * @defgroup drivers_cc110x_ng CC110x_ng + * @brief Next generation version of the TI CC110x driver + * @ingroup drivers * @{ - * @file cc110x_ng.h - * @brief Data structures and variables for the cc110x driver interface - * @author Oliver Hahm + * + * @file cc110x_ng.h + * @brief Data structures and variables for the cc110x driver interface + * + * @author Oliver Hahm */ + #ifndef CC1100_H #define CC1100_H @@ -28,40 +31,40 @@ #define CC1100_HEADER_LENGTH (3) ///< Header covers SRC, DST and FLAGS -#define CC1100_BROADCAST_ADDRESS (0x00) ///< CC1100 broadcast address +#define CC1100_BROADCAST_ADDRESS (0x00) ///< CC1100 broadcast address -#define MAX_UID (0xFF) ///< Maximum UID of a node is 255 -#define MIN_UID (0x01) ///< Minimum UID of a node is 1 +#define MAX_UID (0xFF) ///< Maximum UID of a node is 255 +#define MIN_UID (0x01) ///< Minimum UID of a node is 1 -#define MIN_CHANNR (0) ///< Minimum channel number -#define MAX_CHANNR (24) ///< Maximum channel number +#define MIN_CHANNR (0) ///< Minimum channel number +#define MAX_CHANNR (24) ///< Maximum channel number -#define MIN_OUTPUT_POWER (0) ///< Minimum output power value -#define MAX_OUTPUT_POWER (11) ///< Maximum output power value +#define MIN_OUTPUT_POWER (0) ///< Minimum output power value +#define MAX_OUTPUT_POWER (11) ///< Maximum output power value -#define PACKET_LENGTH (0x3E) ///< Packet length = 62 Bytes. -#define CC1100_SYNC_WORD_TX_TIME (90000) // loop count (max. timeout ~ 15 ms) to wait for - // sync word to be transmitted (GDO2 from low to high) +#define PACKET_LENGTH (0x3E) ///< Packet length = 62 Bytes. +#define CC1100_SYNC_WORD_TX_TIME (90000) // loop count (max. timeout ~ 15 ms) to wait for + // sync word to be transmitted (GDO2 from low to high) /** - * @name Defines used as state values for state machine + * @name Defines used as state values for state machine * @{ */ -#define RADIO_UNKNOWN (0) -#define RADIO_AIR_FREE_WAITING (1) -#define RADIO_WOR (2) -#define RADIO_IDLE (3) -#define RADIO_SEND_BURST (4) -#define RADIO_RX (5) -#define RADIO_SEND_ACK (6) -#define RADIO_PWD (7) +#define RADIO_UNKNOWN (0) +#define RADIO_AIR_FREE_WAITING (1) +#define RADIO_WOR (2) +#define RADIO_IDLE (3) +#define RADIO_SEND_BURST (4) +#define RADIO_RX (5) +#define RADIO_SEND_ACK (6) +#define RADIO_PWD (7) /** @} */ -extern volatile cc110x_flags rflags; ///< Radio flags +extern volatile cc110x_flags rflags; ///< Radio flags extern char cc110x_conf[]; /** - * @brief CC1100 layer 0 protocol + * @brief CC1100 layer 0 protocol * *
 ---------------------------------------------------
@@ -72,24 +75,24 @@ extern char cc110x_conf[];
   1 byte   1 byte    1 byte   1 byte   <= 58 bytes
 
 Flags:
-		Bit | Meaning
-		--------------------
-		7:4	| -
-		3:1 | Protocol
-		  0 | Identification
+        Bit | Meaning
+        --------------------
+        7:4 | -
+        3:1 | Protocol
+          0 | Identification
 
Notes: \li length & address are given by CC1100 \li Identification is increased is used to scan duplicates. It must be increased - for each new packet and kept for packet retransmissions. + for each new packet and kept for packet retransmissions. */ typedef struct __attribute__((packed)) { - uint8_t length; ///< Length of the packet (without length byte) - uint8_t address; ///< Destination address - uint8_t phy_src; ///< Source address (physical source) - uint8_t flags; ///< Flags - uint8_t data[CC1100_MAX_DATA_LENGTH]; ///< Data (high layer protocol) + uint8_t length; ///< Length of the packet (without length byte) + uint8_t address; ///< Destination address + uint8_t phy_src; ///< Source address (physical source) + uint8_t flags; ///< Flags + uint8_t data[CC1100_MAX_DATA_LENGTH]; ///< Data (high layer protocol) } cc110x_packet_t; @@ -100,16 +103,16 @@ typedef struct { } rx_buffer_t; enum radio_mode { - RADIO_MODE_GET = -1, ///< leave mode unchanged - RADIO_MODE_OFF = 0, ///< turn radio off - RADIO_MODE_ON = 1 ///< turn radio on + RADIO_MODE_GET = -1, ///< leave mode unchanged + RADIO_MODE_OFF = 0, ///< turn radio off + RADIO_MODE_ON = 1 ///< turn radio on }; extern rx_buffer_t cc110x_rx_buffer[]; -extern volatile uint8_t rx_buffer_next; ///< Next packet in RX queue +extern volatile uint8_t rx_buffer_next; ///< Next packet in RX queue -extern volatile uint8_t radio_state; ///< Radio state +extern volatile uint8_t radio_state; ///< Radio state extern cc110x_statistic_t cc110x_statistic; int transceiver_pid; ///< the transceiver thread pid @@ -140,14 +143,14 @@ void cc110x_set_monitor(uint8_t mode); void cc110x_print_config(void); /** - * @brief GDO0 interrupt handler. + * @brief GDO0 interrupt handler. */ void cc110x_gdo0_irq(void); /** - * @brief GDO2 interrupt handler. + * @brief GDO2 interrupt handler. * - * @note Wakes up MCU on packet reception. + * @note Wakes up MCU on packet reception. */ void cc110x_gdo2_irq(void); @@ -168,8 +171,5 @@ void cc110x_init_ignore(void); uint8_t cc110x_add_ignored(radio_address_t addr); #endif -/** - * @} - */ - +/** @} */ #endif diff --git a/drivers/cc110x_ng/include/cc110x_spi.h b/drivers/cc110x_ng/include/cc110x_spi.h index 08554f8531..65643fa217 100644 --- a/drivers/cc110x_ng/include/cc110x_spi.h +++ b/drivers/cc110x_ng/include/cc110x_spi.h @@ -13,20 +13,15 @@ and Telematics group (http://cst.mi.fu-berlin.de). *******************************************************************************/ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ - */ - -/** + * * @file - * @brief TI Chipcon CC1100 SPI driver + * @brief TI Chipcon CC1100 SPI driver * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @version $Revision: 1775 $ - * - * @note $Id: cc110x_spi.h 1775 2010-01-26 09:37:03Z hillebra $ + * @author Thomas Hillebrandt + * @author Heiko Will */ #ifndef CC1100_SPI_H_ diff --git a/drivers/cc110x_ng/spi/cc110x_spi.c b/drivers/cc110x_ng/spi/cc110x_spi.c index fb5f8bd3b6..379b870c42 100644 --- a/drivers/cc110x_ng/spi/cc110x_spi.c +++ b/drivers/cc110x_ng/spi/cc110x_spi.c @@ -1,8 +1,8 @@ -/****************************************************************************** +/* * Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems -and Telematics group (http://cst.mi.fu-berlin.de). + * and Telematics group (http://cst.mi.fu-berlin.de). * ---------------------------------------------------------------------------- * This file is part of RIOT. * @@ -13,20 +13,16 @@ and Telematics group (http://cst.mi.fu-berlin.de). *******************************************************************************/ /** - * @ingroup drivers_cc110x_ng + * @ingroup drivers_cc110x_ng * @{ - */ - -/** - * @file - * @brief TI Chipcon CC1100 SPI driver + * + * @file cc110x_spi.c + * @brief TI Chipcon CC1100 SPI driver * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @version $Revision: 1775 $ - * - * @note $Id: cc110x_spi.c 1775 2010-01-26 09:37:03Z hillebra $ + * @author Thomas Hillebrandt + * @author Heiko Will + * @} */ #include @@ -40,7 +36,7 @@ and Telematics group (http://cst.mi.fu-berlin.de). #include "irq.h" /*---------------------------------------------------------------------------*/ -// CC1100 SPI access +// CC1100 SPI access /*---------------------------------------------------------------------------*/ uint8_t cc110x_writeburst_reg(uint8_t addr, char *src, uint8_t count) @@ -125,5 +121,3 @@ uint8_t cc110x_strobe(uint8_t c) restoreIRQ(cpsr); return result; } - -/** @} */ diff --git a/drivers/doc.txt b/drivers/doc.txt index f93b8894d5..dc1878227a 100644 --- a/drivers/doc.txt +++ b/drivers/doc.txt @@ -7,8 +7,8 @@ */ /** - * @defgroup drivers Drivers - * @brief Drivers for external devices as radios, sensors, memory etc. + * @defgroup drivers Drivers + * @brief Drivers for external devices as radios, sensors, memory etc. * * The module contains all kind of drivers for specific devices. */ diff --git a/drivers/include/adc.h b/drivers/include/adc.h index 4136b12258..f7a09689ca 100644 --- a/drivers/include/adc.h +++ b/drivers/include/adc.h @@ -1,27 +1,30 @@ +/** + * @defgroup drivers_adc ADC + * @ingroup drivers + * @brief Generic ADC driver + * @{ + * + * @file adc.h + */ + #ifndef ADC_H #define ADC_H #include - /** - * @defgroup drivers_adc ADC - * @ingroup drivers - * @brief Generic ADC driver - */ - -/** - * @brief Initialize ADC. + * @brief Initialize ADC. */ void adc_init(void); /** - * @brief Read ADC value of selected channel. + * @brief Read ADC value of selected channel. * * Valid channel numbers are from 0 to 2. * - * @return ADC value of selected channel. + * @return ADC value of selected channel. */ uint16_t adc_read(uint8_t channel); +/** @} */ #endif /* ADC_H */ diff --git a/drivers/include/diskio.h b/drivers/include/diskio.h index e83c80d956..5ef1001fd8 100644 --- a/drivers/include/diskio.h +++ b/drivers/include/diskio.h @@ -3,11 +3,17 @@ /-----------------------------------------------------------------------*/ /** - * @defgroup diskio Disk IO Driver - * @ingroup drivers - * @brief Low level disk interface + * @defgroup diskio Disk IO Driver + * @ingroup drivers + * @brief Low level disk interface * * The connection between the MCU and the SRF08 is based on the i2c-interface. + * + * @{ + * + * @file diskio.h + * + * @author unknown */ #ifndef DEF_DISKIO @@ -15,33 +21,33 @@ #include -#define DN_MCI 0 /* Physical drive number for MCI */ -#define DN_NAND 1 /* Physical drive number for NAND flash */ +#define DN_MCI 0 /* Physical drive number for MCI */ +#define DN_NAND 1 /* Physical drive number for NAND flash */ /** - * @def MCI_PWRSAVE - * @ingroup conf - * @brief Powerdown mode to use between mci operations + * @def MCI_PWRSAVE + * @ingroup conf + * @brief Powerdown mode to use between mci operations */ #ifndef MCI_PWRSAVE -#define MCI_PWRSAVE 0 +#define MCI_PWRSAVE 0 #endif /* These functions are defined in asmfunc.S */ -void Copy_al2un(unsigned char *dst, const unsigned long *src, int count); /* Copy aligned to unaligned. */ -void Copy_un2al(unsigned long *dst, const unsigned char *src, int count); /* Copy unaligned to aligned. */ +void Copy_al2un(unsigned char *dst, const unsigned long *src, int count); /* Copy aligned to unaligned. */ +void Copy_un2al(unsigned long *dst, const unsigned char *src, int count); /* Copy unaligned to aligned. */ /* Status of Disk Functions */ -typedef unsigned char DSTATUS; +typedef unsigned char DSTATUS; /* Results of Disk Functions */ typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ + RES_OK = 0, /* 0: Successful */ + RES_ERROR, /* 1: R/W Error */ + RES_WRPRT, /* 2: Write Protected */ + RES_NOTRDY, /* 3: Not Ready */ + RES_PARERR /* 4: Invalid Parameter */ } DRESULT; @@ -58,39 +64,39 @@ DRESULT disk_ioctl(unsigned char, unsigned char, void *); /* Disk Status Bits (DSTATUS) */ -#define STA_NOINIT 0x01 /* Drive not initialized */ -#define STA_NODISK 0x02 /* No medium in the drive */ -#define STA_PROTECT 0x04 /* Write protected */ +#define STA_NOINIT 0x01 /* Drive not initialized */ +#define STA_NODISK 0x02 /* No medium in the drive */ +#define STA_PROTECT 0x04 /* Write protected */ /* Command code for disk_ioctrl fucntion */ /* Generic ioctl command (defined for FatFs) */ -#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ -#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ -#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ +#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ +#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ +#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ /* Generic ioctl command */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ +#define CTRL_POWER 5 /* Get/Set power status */ +#define CTRL_LOCK 6 /* Lock/Unlock media removal */ +#define CTRL_EJECT 7 /* Eject media */ /* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ +#define MMC_GET_TYPE 10 /* Get card type */ +#define MMC_GET_CSD 11 /* Get CSD */ +#define MMC_GET_CID 12 /* Get CID */ +#define MMC_GET_OCR 13 /* Get OCR */ +#define MMC_GET_SDSTAT 14 /* Get SD status */ /* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ +#define ATA_GET_REV 20 /* Get F/W revision */ +#define ATA_GET_MODEL 21 /* Get model name */ +#define ATA_GET_SN 22 /* Get serial number */ /* NAND specific ioctl command */ -#define NAND_FORMAT 30 /* Create physical format */ +#define NAND_FORMAT 30 /* Create physical format */ @@ -111,5 +117,5 @@ DRESULT MCI_write(const unsigned char *, unsigned long, unsigned char); DRESULT MCI_ioctl(unsigned char, void *); void MCI_timerproc(void); - +/** @} */ #endif diff --git a/drivers/include/flashrom.h b/drivers/include/flashrom.h index c7f78ce2cc..59ce1ee528 100644 --- a/drivers/include/flashrom.h +++ b/drivers/include/flashrom.h @@ -1,10 +1,12 @@ - - - -/** - * @defgroup flashrom Flash memory driver - * @ingroup drivers - * @brief Generic flash memory driver +/* + * @defgroup flashrom Flash memory driver + * @ingroup drivers + * @brief Generic flash memory driver + * @{ + * + * @file flashrom.h + * + * @author unknown */ #ifndef FLASHROM_H @@ -20,7 +22,7 @@ * * @return 1 on success, 0 otherwise */ -uint8_t flashrom_erase(uint8_t *addr); +uint8_t flashrom_erase(uint8_t *addr); /* @brief Write buffer from ram to flash * @@ -30,7 +32,7 @@ uint8_t flashrom_erase(uint8_t *addr); * * @return 1 on success, 0 otherwise */ -uint8_t flashrom_write(uint8_t *dst, char *src, size_t size); - +uint8_t flashrom_write(uint8_t *dst, char *src, size_t size); +/** @} */ #endif /* FLASHROM_H */ diff --git a/drivers/include/gpioint.h b/drivers/include/gpioint.h index b4fc89903e..26421b0157 100644 --- a/drivers/include/gpioint.h +++ b/drivers/include/gpioint.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/* * Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems @@ -16,32 +16,25 @@ and Telematics group (http://cst.mi.fu-berlin.de). #define GPIOINT_H_ /** - * @defgroup drivers_gpioint GPIO IRQ Multiplexer - * @ingroup drivers - * @brief Provides an API to implement interrupt handlers on IO pins. + * @defgroup drivers_gpioint GPIO IRQ Multiplexer + * @ingroup drivers + * @brief Provides an API to implement interrupt handlers on IO pins. * * Multiplexer and interrupt handling must be implemented platform specific. * * See gpioint-example.c for an example of how to use gpioint. * * @{ - */ - -/** + * * @example gpioint-example.c * This example shows how to setup an interrupt handler for a GPIO pin * without using the HAL. - */ - -/** + * * @file - * @brief GPIO IRQ Multiplexer interface + * @brief GPIO IRQ Multiplexer interface * * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Michael Baar - * @version $Revision: 1508 $ - * - * @note $Id: gpioint.h 1508 2009-10-26 15:10:02Z baar $ + * @author Michael Baar */ #include @@ -52,26 +45,26 @@ and Telematics group (http://cst.mi.fu-berlin.de). * Note: - We rely on the exact values for the edges. * - These flags are extended in hal/drivers/device-gpio.h */ -#define GPIOINT_DISABLE 0x00 -#define GPIOINT_RISING_EDGE 0x01 ///< interrupt is generated on rising edge -#define GPIOINT_FALLING_EDGE 0x02 ///< interrupt is generated on falling edge +#define GPIOINT_DISABLE 0x00 +#define GPIOINT_RISING_EDGE 0x01 ///< interrupt is generated on rising edge +#define GPIOINT_FALLING_EDGE 0x02 ///< interrupt is generated on falling edge #define GPIOINT_DEBOUNCE 0x04 ///< debounce this interrupt /** - * @brief GPIO IRQ callback function type - * @param[in] data User defined callback data passed through gpioint_set - * @param[in] edge A combination of GPIOINT_RISING_EDGE and GPIOINT_FALLING_EDGE + * @brief GPIO IRQ callback function type + * @param[in] data User defined callback data passed through gpioint_set + * @param[in] edge A combination of GPIOINT_RISING_EDGE and GPIOINT_FALLING_EDGE */ typedef void(*fp_irqcb)(void); /** - * @brief GPIO IRQ handler setup - * @param[in] port CPU specific port number (starting at 0) - * @param[in] bitmask One or more bits for which to set the handler - * @param[in] flags A combination of #GPIOINT_RISING_EDGE and #GPIOINT_FALLING_EDGE - * @param[in] callback A pointer to a handler function - * @retval true successful - * @retval false failed + * @brief GPIO IRQ handler setup + * @param[in] port CPU specific port number (starting at 0) + * @param[in] bitmask One or more bits for which to set the handler + * @param[in] flags A combination of #GPIOINT_RISING_EDGE and #GPIOINT_FALLING_EDGE + * @param[in] callback A pointer to a handler function + * @retval true successful + * @retval false failed * * To enable interrupt handling for a pin flags and callback must be non-zero. To disable interrupt * handling flags and callback shall be zero. diff --git a/drivers/include/lm75a-temp-sensor.h b/drivers/include/lm75a-temp-sensor.h index 5fccab68b7..fbf8039591 100644 --- a/drivers/include/lm75a-temp-sensor.h +++ b/drivers/include/lm75a-temp-sensor.h @@ -1,7 +1,4 @@ /* - - * lm75a-temp-sensor.h - Definitions of the LM75A temperature sensor driver. - * * Copyright (C) 2013 Zakaria Kasmi * * This source code is licensed under the LGPLv2 license, @@ -9,26 +6,22 @@ */ /** - * @defgroup lm75a LM75A - * @ingroup drivers - * @brief Driver for the LM75A digital temperature sensor and thermal watchdog + * @defgroup lm75a LM75A + * @ingroup drivers + * @brief Driver for the LM75A digital temperature sensor and thermal watchdog * * The connection between the MCU and the LM75A is based on the i2c-interface. - */ - -/** + * + * @{ + * * @file * @internal * @brief Definitions of the LM75A temperature sensor driver. * - * The connection between the LM75A and the MCU is based - * on the I2C-interface. + * The connection between the LM75A and the MCU is based on the I2C-interface. * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Zakaria Kasmi - * @version $Revision: 3859 $ - * - * @note $Id: lm75a-temp-sensor.h 3854 2013-09-2 15:35:21 kasmi $ */ #ifndef LM75A_H_ @@ -260,4 +253,5 @@ bool lm75A_external_interrupt_register(void *handler); */ void lm75A_set_in_alarm(bool b); +/** @} */ #endif /* LM75A_H_ */ diff --git a/drivers/include/ltc4150_arch.h b/drivers/include/ltc4150_arch.h index db6c799dfe..a459630935 100644 --- a/drivers/include/ltc4150_arch.h +++ b/drivers/include/ltc4150_arch.h @@ -18,19 +18,14 @@ and Telematics group (http://cst.mi.fu-berlin.de). /** * @defgroup ltc4150 LTC4150 * @ingroup drivers - * @brief Driver for the Linear Technology LTC4150 Coulomb Counter + * @brief Driver for the Linear Technology LTC4150 Coulomb Counter * @{ - */ - -/** - * @file + * + * @file ltc4150_arch.h * @brief LTC4150 Coulomb Counter * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Heiko Will - * @version $Revision: 1203 $ - * - * @note $Id: ltc4150_arch.h 1203 2009-07-07 10:23:18Z baar $ */ #define _GFH (double)32.631375 diff --git a/drivers/include/rtc.h b/drivers/include/rtc.h index 6799f0789c..5517df6076 100644 --- a/drivers/include/rtc.h +++ b/drivers/include/rtc.h @@ -1,4 +1,4 @@ -/****************************************************************************** +/* * Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems @@ -13,9 +13,9 @@ and Telematics group (http://cst.mi.fu-berlin.de). *******************************************************************************/ /** - * @defgroup rtc Realtime Clock - * @ingroup drivers - * @brief Generic real time clock driver + * @defgroup rtc Realtime Clock + * @ingroup drivers + * @brief Generic real time clock driver * @{ */ @@ -47,24 +47,24 @@ void rtc_enable(void); void rtc_disable(void); /** - * @brief Sets the current time in broken down format directly from to RTC - * @param[in] localt Pointer to structure with time to set + * @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); /** - * @brief Returns the current time in broken down format directly from the RTC - * @param[out] localt Pointer to structure to receive time + * @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); /** - * @brief Get the current time as a struct timeval - * @param[out] time Pointer to structure to receive time + * @brief Get the current time as a struct timeval + * @param[out] time Pointer to structure to receive time */ time_t rtc_time(struct timeval *time); extern int rtc_second_pid; -#endif /** @} */ +#endif diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h index aa1f9e3aa3..575b60310b 100644 --- a/drivers/include/sht11.h +++ b/drivers/include/sht11.h @@ -16,30 +16,26 @@ and Telematics group (http://cst.mi.fu-berlin.de). #define SHT11_H_ /** - * @defgroup sht11 SHT11 - * @ingroup drivers + * @defgroup sht11 SHT11 + * @ingroup drivers * @{ - */ - -/** - * @file - * @brief SHT11 Device Driver + * + * @file sht11.h + * @brief SHT11 Device Driver * * @author Freie Universität Berlin, Computer Systems & Telematics - * @version $Revision: 667 $ - * - * @note $Id: sht11.h 667 2009-02-19 15:06:38Z baar $ */ + #include -#define SHT11_NO_ACK (0) -#define SHT11_ACK (1) +#define SHT11_NO_ACK (0) +#define SHT11_ACK (1) //adr command r/w -#define SHT11_STATUS_REG_W (0x06) //000 0011 0 -#define SHT11_STATUS_REG_R (0x07) //000 0011 1 -#define SHT11_MEASURE_TEMP (0x03) //000 0001 1 -#define SHT11_MEASURE_HUMI (0x05) //000 0010 1 -#define SHT11_RESET (0x1E) //000 1111 0 +#define SHT11_STATUS_REG_W (0x06) //000 0011 0 +#define SHT11_STATUS_REG_R (0x07) //000 0011 1 +#define SHT11_MEASURE_TEMP (0x03) //000 0001 1 +#define SHT11_MEASURE_HUMI (0x05) //000 0010 1 +#define SHT11_RESET (0x1E) //000 1111 0 /* time to wait after toggling the data line */ #define SHT11_DATA_WAIT (HWTIMER_TICKS(1)) @@ -53,13 +49,13 @@ and Telematics group (http://cst.mi.fu-berlin.de). * @brief sht11 measureable data */ typedef struct { - float temperature; /**< temperature value */ - float relhum; /**< linear relative humidity */ - float relhum_temp; /**< temperature compensated relative humidity */ + float temperature; /**< temperature value */ + float relhum; /**< linear relative humidity */ + float relhum_temp; /**< temperature compensated relative humidity */ } sht11_val_t; /** - * @brief SHT11 modes that can be measured + * @brief SHT11 modes that can be measured */ typedef enum { TEMPERATURE = 1, @@ -67,12 +63,12 @@ typedef enum { } sht11_mode_t; /** - * @brief Initialize SHT11 ports + * @brief Initialize SHT11 ports */ void sht11_init(void); /** - * @brief Read sensor + * @brief Read sensor * * @param value The struct to be filled with measured values * @param mode Specifies type of data to be read @@ -107,4 +103,3 @@ uint8_t sht11_read_status(uint8_t *p_value, uint8_t *p_checksum); /** @} */ #endif /*SHT11_H_*/ - diff --git a/drivers/include/srf02-ultrasonic-sensor.h b/drivers/include/srf02-ultrasonic-sensor.h index c7c144e61d..95ab003a0b 100644 --- a/drivers/include/srf02-ultrasonic-sensor.h +++ b/drivers/include/srf02-ultrasonic-sensor.h @@ -1,7 +1,4 @@ /* - * srf02-ultrasonic-sensor.h - Definitions for the SRF02 ultrasonic ranger - * driver. - * * Copyright (C) 2013 Zakaria Kasmi * * This source code is licensed under the LGPLv2 license, @@ -9,26 +6,21 @@ */ /** - * @defgroup srf02 SRF02 - * @ingroup drivers - * @brief Driver for the SRF02 ultrasonic range sensor + * @defgroup srf02 SRF02 + * @ingroup drivers + * @brief Driver for the SRF02 ultrasonic range sensor * * The connection between the MCU and the SRF08 is based on the i2c-interface. - */ - -/** - * @file - * @internal + * + * @{ + * + * @file srf02-ultrasonic-sensor.h * @brief Driver definitions for the SRF02 ultrasonic ranger. - * The connection between the SRF02 and the MCU is based on - * the i2c interface. + * + * The connection between the SRF02 and the MCU is based on the i2c interface. * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Zakaria Kasmi - * @version $Revision: 3857 $ - * - * @note $Id: srf02-ultrasonic-sensor.h 3854 2013-09-03 13:55:30 kasmi $ - * */ #ifndef SRF02_ULTRASONIC_SENSOR_I2C_H_ @@ -102,4 +94,5 @@ uint32_t srf02_get_distance(uint8_t ranging_mode); */ void srf02_start_ranging(uint16_t ranging_mode); +/** @} */ #endif /* SRF02_ULTRASONIC_SENSOR_I2C_H_ */ diff --git a/drivers/include/srf08-ultrasonic-sensor.h b/drivers/include/srf08-ultrasonic-sensor.h index 7749fafaca..eab68fd2ab 100644 --- a/drivers/include/srf08-ultrasonic-sensor.h +++ b/drivers/include/srf08-ultrasonic-sensor.h @@ -1,6 +1,4 @@ /* - * srf08-ultrasonic-sensor.h - Definitions for the SRF08 ultrasonic ranger. - * * Copyright (C) 2013 Zakaria Kasmi * * This source code is licensed under the LGPLv2 license, @@ -8,26 +6,22 @@ */ /** - * @defgroup srf08 SRF08 - * @ingroup drivers - * @brief Driver for the SRF08 ultrasonic range sensor + * @defgroup srf08 SRF08 + * @ingroup drivers + * @brief Driver for the SRF08 ultrasonic range sensor * * The connection between the MCU and the SRF08 is based on the i2c-interface. - */ - -/** + * + * @{ + * * @file * @internal * @brief Driver definitions for the SRF08 ultrasonic. - * The communication between the MCU and SRF08 is via the i2c - * interface. + * + * The communication between the MCU and SRF08 is via the i2c interface. * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Zakaria Kasmi - * @version $Revision: 3857 $ - * - * @note $Id: srf08-ultrasonic-sensor.h 3854 2013-09-03 16:26:13 kasmi $ - * */ #ifndef SRF08_ULTRASONIC_SENSOR_I2C_H_ @@ -134,4 +128,5 @@ uint8_t srf08_get_gain(void); */ int32_t srf08_get_distances(uint32_t *range_array, uint8_t ranging_mode); +/** @} */ #endif /* SRF08_ULTRASONIC_SENSOR_I2C_H_ */ diff --git a/sys/doc.txt b/sys/doc.txt index 0dcd8b3a55..5f185b0e1d 100644 --- a/sys/doc.txt +++ b/sys/doc.txt @@ -7,6 +7,6 @@ */ /** - * @defgroup sys System - * @brief System library contains tools and utilities that make RIOT an actual operating system + * @defgroup sys System + * @brief System library contains tools and utilities that make RIOT an actual operating system */ diff --git a/sys/include/auto_init.h b/sys/include/auto_init.h index 86876fcc32..44116cb02a 100644 --- a/sys/include/auto_init.h +++ b/sys/include/auto_init.h @@ -1,8 +1,11 @@ /** - * @defgroup sys_autoinit Auto-init - * @ingroup sys - * @brief Autoconfigure libraries + * @defgroup sys_autoinit Auto-init + * @ingroup sys + * @brief Autoconfigure libraries + * @{ + * + * @file auto_init.h */ #ifndef AUTO_INIT_H @@ -30,4 +33,5 @@ void auto_init(void); -#endif +/** @} */ +#endif /* AUTO_INIT_H */ diff --git a/sys/include/bloom.h b/sys/include/bloom.h index 02628d85dd..9579eca3a1 100644 --- a/sys/include/bloom.h +++ b/sys/include/bloom.h @@ -1,11 +1,4 @@ - -/** - * @defgroup sys_bloom Bloom filter - * @ingroup sys - * @brief Bloom filter library - */ - -/** +/* * bloom.c * * Bloom filters @@ -108,7 +101,14 @@ */ /** - * @file + * @defgroup sys_bloom Bloom filter + * @ingroup sys + * @brief Bloom filter library + * @{ + * + * @file bloom.h + * @brief Bloom filter API + * * @autor Christian Mehlis * @autor Freie Universität Berlin, Computer Systems & Telematics */ @@ -208,4 +208,5 @@ void bloom_add(struct bloom_t *bloom, const uint8_t *buf, size_t len); */ bool bloom_check(struct bloom_t *bloom, const uint8_t *buf, size_t len); -#endif +/** @} */ +#endif /* _BLOOM_FILTER_H */ diff --git a/sys/include/board_uart0.h b/sys/include/board_uart0.h index 7b6de7af7e..734950da05 100644 --- a/sys/include/board_uart0.h +++ b/sys/include/board_uart0.h @@ -1,8 +1,12 @@ /** - * @defgroup sys_uart0 UART0 - * @ingroup sys - * @brief UART0 interface abstraction + * @defgroup sys_uart0 UART0 + * @ingroup sys + * @brief UART0 interface abstraction + * @{ + * + * @file board_uart0.h + * @brief Interface definitions for the UART0 abstraction */ #ifndef __BOARD_UART0_H @@ -17,4 +21,5 @@ void uart0_notify_thread(void); int uart0_readc(void); void uart0_putc(int c); +/** @} */ #endif /* __BOARD_UART0_H */ diff --git a/sys/include/chardev_thread.h b/sys/include/chardev_thread.h index 1d2b8a5cd3..439354b81d 100644 --- a/sys/include/chardev_thread.h +++ b/sys/include/chardev_thread.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_chardevthread Chardev Thread - * @ingroup sys - * @brief Chardev thread + * @defgroup sys_chardevthread Chardev Thread + * @ingroup sys + * @brief Chardev thread */ #ifndef __CHARDEV_THREAD_H diff --git a/sys/include/hashes.h b/sys/include/hashes.h index 636c726a01..95aa46c9a8 100644 --- a/sys/include/hashes.h +++ b/sys/include/hashes.h @@ -1,6 +1,4 @@ -/** - * This file contains some simple hash function - * +/* * Copyright (C) 2013 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General @@ -9,18 +7,22 @@ */ /** - * @defgroup sys_hashes Hashes - * @ingroup sys - * @brief Hash function library - */ - -/** - * @file + * @defgroup sys_hashes Hashes + * @ingroup sys + * @brief Hash function library + * @{ + * + * @file hashes.h + * @brief Hash function API + * * @autor Jason Linehan * @author Freie Universität Berlin, Computer Systems & Telematics * @author Christian Mehlis */ +#ifndef __HASHES_H +#define __HASHES_H + #include #include @@ -153,3 +155,6 @@ uint32_t rotating_hash(const uint8_t *buf, size_t len); * @return 32 bit sized hash */ uint32_t one_at_a_time_hash(const uint8_t *buf, size_t len); + +/** @} */ +#endif /* __HASHES_H */ \ No newline at end of file diff --git a/sys/include/ping.h b/sys/include/ping.h index d671d8aee6..6e9d392227 100644 --- a/sys/include/ping.h +++ b/sys/include/ping.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_ping Ping - * @ingroup sys - * @brief Ping + * @defgroup sys_ping Ping + * @ingroup sys + * @brief Ping */ #include "radio/radio.h" diff --git a/sys/include/posix_io.h b/sys/include/posix_io.h index df11cff337..cddba17396 100644 --- a/sys/include/posix_io.h +++ b/sys/include/posix_io.h @@ -7,9 +7,9 @@ */ /** - * @defgroup sys_posixio Posix IO - * @ingroup sys - * @brief Posix compatible IO + * @defgroup sys_posixio Posix IO + * @ingroup sys + * @brief Posix compatible IO * @{ * @file * @brief POSIX-like IO diff --git a/sys/include/ps.h b/sys/include/ps.h index 010272a300..824bd9949b 100644 --- a/sys/include/ps.h +++ b/sys/include/ps.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_ps PS - * @ingroup sys - * @brief Show list with all threads + * @defgroup sys_ps PS + * @ingroup sys + * @brief Show list with all threads */ #ifndef __PS_H diff --git a/sys/include/random.h b/sys/include/random.h index e4295b3f5a..6bebda748d 100644 --- a/sys/include/random.h +++ b/sys/include/random.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_random Random - * @ingroup sys - * @brief Random number generator + * @defgroup sys_random Random + * @ingroup sys + * @brief Random number generator */ #include diff --git a/sys/include/sha256.h b/sys/include/sha256.h index aa9f30e59b..852dad4fcf 100644 --- a/sys/include/sha256.h +++ b/sys/include/sha256.h @@ -29,9 +29,9 @@ /** - * @defgroup sys_sha256 SHA264 - * @ingroup sys - * @brief SHA264 hash generator + * @defgroup sys_sha256 SHA264 + * @ingroup sys + * @brief SHA264 hash generator */ #ifndef _SHA256_H_ diff --git a/sys/include/shell.h b/sys/include/shell.h index ad17509180..0b3cf13aee 100644 --- a/sys/include/shell.h +++ b/sys/include/shell.h @@ -13,9 +13,9 @@ *******************************************************************************/ /** - * @defgroup sys_shell Shell - * @ingroup sys - * @brief Simple shell interpreter + * @defgroup sys_shell Shell + * @ingroup sys + * @brief Simple shell interpreter */ #ifndef __SHELL_H diff --git a/sys/include/timex.h b/sys/include/timex.h index e0b9a99b69..ee866ebc4e 100644 --- a/sys/include/timex.h +++ b/sys/include/timex.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_timex Timex - * @ingroup sys - * @brief Utility library for comparing and computing timestamps + * @defgroup sys_timex Timex + * @ingroup sys + * @brief Utility library for comparing and computing timestamps */ #ifndef __TIMEX_H diff --git a/sys/include/transceiver.h b/sys/include/transceiver.h index b9c818faf5..73159f4770 100644 --- a/sys/include/transceiver.h +++ b/sys/include/transceiver.h @@ -1,8 +1,8 @@ /** - * @defgroup sys_transceiver Transceiver - * @ingroup sys - * @brief Transceiver library + * @defgroup sys_transceiver Transceiver + * @ingroup sys + * @brief Transceiver library */ #ifndef TRANSCEIVER_H diff --git a/sys/include/vtimer.h b/sys/include/vtimer.h index e1d5e09e39..d256a4612e 100644 --- a/sys/include/vtimer.h +++ b/sys/include/vtimer.h @@ -1,21 +1,20 @@ -/** \addtogroup sys - * @{ */ - /** - * \defgroup vtimer Virtual (Software) Timer library + * @defgroup sys_vtimer Virtual (Software) Timer library + * @addtogroup sys + * @brief Virtual software timer for general timer functionality in applications + * @{ + * + * @file vtimer.h + * @brief VTimer API * * The vtimer library provides functions for setting, resetting and restarting * software timers, and for checking if a vtimer has expired. * * (As of now, not resetting, restarting, removing and checking are not implemented) * - * @{ + * @author unknown */ -/** - * \file - * Timer library header file. - */ #ifndef __VTIMER_H #define __VTIMER_H @@ -120,4 +119,5 @@ void vtimer_print_long_queue(void); #endif +/** @} */ #endif /* __VTIMER_H */ diff --git a/sys/net/doc.txt b/sys/net/doc.txt index 810b73ffef..e142fe7d1c 100644 --- a/sys/net/doc.txt +++ b/sys/net/doc.txt @@ -7,7 +7,7 @@ */ /** - * @defgroup net Net - * @ingroup sys - * @brief Networking libraries + * @defgroup net Net + * @ingroup sys + * @brief Networking libraries */ diff --git a/sys/net/include/ieee802154_frame.h b/sys/net/include/ieee802154_frame.h index d75056e8bc..5e2088d4fc 100644 --- a/sys/net/include/ieee802154_frame.h +++ b/sys/net/include/ieee802154_frame.h @@ -1,21 +1,22 @@ -/** - * Data struct and prototypes for the IEEE 802.15.4 frame format - * +/* * Copyright (C) 2013 INRIA. * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file LICENSE in the top level directory for more * details. - * - * @defgroup net_ieee802154 IEEE802.15.4 + */ + +/** + * @defgroup net_ieee802154 IEEE802.15.4 * @ingroup net - * @brief IEEE802.15.4 adapaption layer + * @brief IEEE802.15.4 adapaption layer * @{ + * * @file ieee802154/ieee802154_frame.h * @brief IEEE 802.14.4 framing data structs and prototypes + * * @author Stephan Zeisberg * @author Oliver Hahm - * @} */ #ifndef IEEE802154_IEEE802154_FRAME @@ -63,8 +64,8 @@ typedef struct __attribute__((packed)) { uint8_t ieee802154_frame_init(ieee802154_frame_t *frame, uint8_t *buf); uint8_t ieee802154_frame_get_hdr_len(ieee802154_frame_t *frame); -uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, - uint8_t len); +uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, uint8_t len); void ieee802154_frame_print_fcf_frame(ieee802154_frame_t *frame); +/** @} */ #endif /* IEEE802154_IEEE802154_FRAME */ diff --git a/sys/net/include/net_help.h b/sys/net/include/net_help.h index 8ef9c5994f..6dd566efa1 100644 --- a/sys/net/include/net_help.h +++ b/sys/net/include/net_help.h @@ -1,18 +1,17 @@ -/* - * common.h - * - * Created on: 05.10.2011 - * Author: Oliver - */ - /** - * @defgroup net_help Net help - * @ingroup net - * @brief Helper functions for networking as byte order conversions and checksum calculations + * @defgroup net_help Net help + * @ingroup net + * @brief Helper functions for networking as byte order conversions and checksum calculations + * @{ + * + * @file net_help.h + * + * @author Oliver */ -#ifndef COMMON_H_ -#define COMMON_H_ +#ifndef __NET_HELP_H +#define __NET_HELP_H + #include #include @@ -30,4 +29,5 @@ uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len); void printArrayRange(uint8_t *array, uint16_t len, char *str); -#endif /* COMMON_H_ */ +/** @} */ +#endif /* __NET_HELP_H */ diff --git a/sys/net/include/protocol-multiplex.h b/sys/net/include/protocol-multiplex.h index d8ff545364..157d300471 100644 --- a/sys/net/include/protocol-multiplex.h +++ b/sys/net/include/protocol-multiplex.h @@ -1,8 +1,8 @@ -/****************************************************************************** +/* * Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved. * * These sources were developed at the Freie Universitaet Berlin, Computer Systems -and Telematics group (http://cst.mi.fu-berlin.de). + * and Telematics group (http://cst.mi.fu-berlin.de). * ---------------------------------------------------------------------------- * This file is part of RIOT. * @@ -12,40 +12,35 @@ and Telematics group (http://cst.mi.fu-berlin.de). * *******************************************************************************/ +/** + * @defgroup net_mmstack Protocol multiplex + * @ingroup net + * @brief Protocol handler multiplexing + * @{ + * + * @file + * @brief Protocol handler multiplexing + * + * @author Freie Universität Berlin, Computer Systems & Telematics + * @author Thomas Hillebrandt + * @author Heiko Will + * @author Michael Baar + */ + #ifndef PROTOCOLMULTIPLEX_H_ #define PROTOCOLMULTIPLEX_H_ -/** - * @defgroup net_mmstack Protocol multiplex - * @ingroup net - * @brief Protocol handler multiplexing - * @{ - */ - -/** - * @file - * @internal - * @brief Protocol handler multiplexing - * - * @author Freie Universität Berlin, Computer Systems & Telematics - * @author Thomas Hillebrandt - * @author Heiko Will - * @author Michael Baar - * @version $Revision: 1526 $ - * - * @note $Id: protocol-multiplex.h 1526 2009-10-30 13:40:20Z hillebra $ - */ #include "radio/types.h" typedef struct { - packet_handler_t handler; - protocol_t protocol; + packet_handler_t handler; + protocol_t protocol; } handler_entry_t; typedef struct { - uint8_t size; - handler_entry_t *handler; + uint8_t size; + handler_entry_t *handler; } pm_table_t; void pm_init_table(pm_table_t *table, uint8_t size, handler_entry_t *handler); @@ -55,5 +50,4 @@ void pm_remove_handler(const pm_table_t *table, protocol_t protocol, packet_hand int pm_invoke(const pm_table_t *table, protocol_t protocol, void *payload, int payload_size, packet_info_t *packet_info); /** @} */ - #endif /* PROTOCOLMULTIPLEX_H_ */ diff --git a/sys/net/rpl/rpl.h b/sys/net/rpl/rpl.h index cc10affc67..e64bc362d3 100644 --- a/sys/net/rpl/rpl.h +++ b/sys/net/rpl/rpl.h @@ -1,22 +1,26 @@ -/** - * RPL constants and prototypes - * +/* * Copyright (C) 2013 INRIA. * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file LICENSE in the top level directory for more * details. - * - * @defgroup net_rpl RPL - * @ingroup net - * @brief Routing Protocol for Low power and Lossy Networks - * @{ - * @file rpl.h - * @brief RPL header - * @author Eric Engel - * @} */ +/** + * @defgroup net_rpl RPL + * @ingroup net + * @brief Routing Protocol for Low power and Lossy Networks + * @{ + * + * @file rpl.h + * @brief RPL header + * + * @author Eric Engel + */ + +#ifndef __RPL_H +#define __RPL_H + #include #include #include @@ -51,3 +55,6 @@ void rpl_del_routing_entry(ipv6_addr_t *addr); rpl_routing_entry_t *rpl_find_routing_entry(ipv6_addr_t *addr); void rpl_clear_routing_table(void); rpl_routing_entry_t *rpl_get_routing_table(void); + +/** @} */ +#endif /* __RPL_H */ diff --git a/sys/net/sixlowpan/lowpan.h b/sys/net/sixlowpan/lowpan.h index 1299559e8c..873c1dadf8 100644 --- a/sys/net/sixlowpan/lowpan.h +++ b/sys/net/sixlowpan/lowpan.h @@ -1,22 +1,24 @@ /* - * 6LoWPAN constants, data structs, and prototypes - * * Copyright (C) 2013 INRIA. * * This file is subject to the terms and conditions of the GNU Lesser General * Public License. See the file LICENSE in the top level directory for more * details. - * - * @defgroup net_sixlowpan 6LoWPAN - * @ingroup net - * @brief Riots 6LowPAN implementation + */ + +/** + * @defgroup net_sixlowpan 6LoWPAN + * @ingroup net + * @brief Riots 6LowPAN implementation * @{ - * @file sixlowpan.h - * @brief 6lowpan header - * @author Stephan Zeisberg - * @author Martin Lenders - * @author Oliver Gesch - * @author Eric Engel + * + * @file sixlowpan.h + * @brief 6lowpan header + * + * @author Stephan Zeisberg + * @author Martin Lenders + * @author Oliver Gesch + * @author Eric Engel */ #ifndef _SIXLOWPAN_LOWPAN_H @@ -49,7 +51,5 @@ lowpan_context_t *lowpan_context_update(uint8_t num, lowpan_context_t *lowpan_context_get(void); lowpan_context_t *lowpan_context_num_lookup(uint8_t num); -/** - * @} - */ +/** @} */ #endif /* _SIXLOWPAN_LOWPAN_H */