-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:24 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/05/28 12:18:12 bernie
*#* Disable menu timeout.
*#*
#ifndef CONFIG_COMMON_H
#define CONFIG_COMMON_H
-/*! Baud-rate for the kdebug console */
+/** Baud-rate for the kdebug console */
#define CONFIG_KDEBUG_BAUDRATE 19200
-/*!
+/**
* printf()-style formatter configuration.
*
* \sa PRINTF_DISABLED
*/
#define CONFIG_PRINTF PRINTF_FULL
-/*!
+/**
* Multithreading kernel.
*
* \sa config_kern.h
*/
#define CONFIG_KERNEL 1
-/*!
+/**
* \name Serial driver parameters
* \{
*/
- /*! [bytes] Size of the outbound FIFO buffer for port 0. */
+ /** [bytes] Size of the outbound FIFO buffer for port 0. */
#define CONFIG_UART0_TXBUFSIZE 32
- /*! [bytes] Size of the inbound FIFO buffer for port 0. */
+ /** [bytes] Size of the inbound FIFO buffer for port 0. */
#define CONFIG_UART0_RXBUFSIZE 64
- /*! [bytes] Size of the outbound FIFO buffer for port 1. */
+ /** [bytes] Size of the outbound FIFO buffer for port 1. */
#define CONFIG_UART1_TXBUFSIZE 32
- /*! [bytes] Size of the inbound FIFO buffer for port 1. */
+ /** [bytes] Size of the inbound FIFO buffer for port 1. */
#define CONFIG_UART1_RXBUFSIZE 64
- /*! [bytes] Size of the outbound FIFO buffer for SPI port (AVR only). */
+ /** [bytes] Size of the outbound FIFO buffer for SPI port (AVR only). */
#define CONFIG_SPI_TXBUFSIZE 16
- /*! [bytes] Size of the inbound FIFO buffer for SPI port (AVR only). */
+ /** [bytes] Size of the inbound FIFO buffer for SPI port (AVR only). */
#define CONFIG_SPI_RXBUFSIZE 32
- /*! Default transmit timeout (ms). Set to -1 to disable timeout support */
+ /** Default transmit timeout (ms). Set to -1 to disable timeout support */
#define CONFIG_SER_TXTIMEOUT -1
- /*! Default receive timeout (ms). Set to -1 to disable timeout support */
+ /** Default receive timeout (ms). Set to -1 to disable timeout support */
#define CONFIG_SER_RXTIMEOUT -1
- /*! Use RTS/CTS handshake */
+ /** Use RTS/CTS handshake */
#define CONFIG_SER_HWHANDSHAKE 0
- /*! Default baud rate (set to 0 to disable) */
+ /** Default baud rate (set to 0 to disable) */
#define CONFIG_SER_DEFBAUDRATE 0
- /*! Enable ser_gets() and ser_gets_echo() */
+ /** Enable ser_gets() and ser_gets_echo() */
#define CONFIG_SER_GETS 0
/** Enable second serial port in emulator. */
#define CONFIG_EMUL_UART1 0
- /*!
+ /**
* Transmit always something on serial port 0 TX
* to avoid interference when sending burst of data,
* using AVR multiprocessor serial mode
#define CONFIG_SER_STROBE 0
/*\}*/
-//! Hardware timer selection for drv/timer.c
+/// Hardware timer selection for drv/timer.c
#define CONFIG_TIMER TIMER_ON_OUTPUT_COMPARE2
-//! Debug timer interrupt using a strobe pin.
+/// Debug timer interrupt using a strobe pin.
#define CONFIG_TIMER_STROBE 0
-//! Enable watchdog timer.
+/// Enable watchdog timer.
#define CONFIG_WATCHDOG 1
-//! EEPROM type for drv/eeprom.c
+/// EEPROM type for drv/eeprom.c
#define CONFIG_EEPROM_TYPE EEPROM_24XX256
/// Select bitmap pixel format.
/// Enable key beeps.
#define CONFIG_KBD_BEEP 1
-/*!
+/**
* \name Type for the chart dataset
* \{
*/
#define VERS_REV 0
#define VERS_LETTER ""
-/*!
+/**
* If _SNAPSHOT is defined, \c VERS_TAG contains the build date
* date instead of a numeric version string.
*/
#define __STRINGIZE(x) #x
#define _STRINGIZE(x) __STRINGIZE(x)
-/*! Build application version string (i.e.: "1.7.0") */
+/** Build application version string (i.e.: "1.7.0") */
#define MAKE_VERS(maj,min,rev) _STRINGIZE(maj) "." _STRINGIZE(min) "." _STRINGIZE(rev) VERS_LETTER VERS_DBG
#ifdef _SNAPSHOT
#define VERS_TAG "snapshot" " " __DATE__ " " __TIME__ " " VERS_LETTER " " VERS_DBG
#define VERS_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
#endif
-/*! Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
+/** Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
#define MAKE_RCVERS(maj,min,rev,bld) _STRINGIZE(maj) ", " _STRINGIZE(min) ", " _STRINGIZE(rev) ", " _STRINGIZE(bld)
#define RCVERSION_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
-/*! The revision string (contains VERS_TAG) */
+/** The revision string (contains VERS_TAG) */
extern const char vers_tag[];
-/*! Sequential build number (contains VERS_BUILD) */
+/** Sequential build number (contains VERS_BUILD) */
extern const int vers_build_nr;
//extern const char vers_build_str[];
-/*! Hostname of the machine used to build this binary (contains VERS_HOST) */
+/** Hostname of the machine used to build this binary (contains VERS_HOST) */
extern const char vers_host[];
#endif /* DEVLIB_VERSTAG_H */
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/06/12 21:37:01 marco
*#* implemented some commands (ver and sleep)
*#*
#define VERS_REV 0
#define VERS_LETTER ""
-/*!
+/**
* If _SNAPSHOT is defined, \c VERS_TAG contains the build date
* date instead of a numeric version string.
*/
#define __STRINGIZE(x) #x
#define _STRINGIZE(x) __STRINGIZE(x)
-/*! Build application version string (i.e.: "1.7.0") */
+/** Build application version string (i.e.: "1.7.0") */
#define MAKE_VERS(maj,min,rev) _STRINGIZE(maj) "." _STRINGIZE(min) "." _STRINGIZE(rev) VERS_LETTER VERS_DBG
#ifdef _SNAPSHOT
#define VERS_TAG "snapshot" " " __DATE__ " " __TIME__ " " VERS_LETTER " " VERS_DBG
#define VERS_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
#endif
-/*! Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
+/** Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
#define MAKE_RCVERS(maj,min,rev,bld) _STRINGIZE(maj) ", " _STRINGIZE(min) ", " _STRINGIZE(rev) ", " _STRINGIZE(bld)
#define RCVERSION_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
-/*! The revision string (contains VERS_TAG) */
+/** The revision string (contains VERS_TAG) */
extern const char vers_tag[];
-/*! Sequential build number (contains VERS_BUILD) */
+/** Sequential build number (contains VERS_BUILD) */
extern const int vers_build_nr;
//extern const char vers_build_str[];
-/*! Hostname of the machine used to build this binary (contains VERS_HOST) */
+/** Hostname of the machine used to build this binary (contains VERS_HOST) */
extern const char vers_host[];
#endif /* DEVLIB_VERSTAG_H */
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:24 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/05/18 00:40:43 bernie
*#* Rename appconfig.h to appconfig_common.h.
*#*
#ifndef CONFIG_COMMON_H
#define CONFIG_COMMON_H
-/*! Baud-rate for the kdebug console */
+/** Baud-rate for the kdebug console */
#define CONFIG_KDEBUG_BAUDRATE 19200
-/*!
+/**
* printf()-style formatter configuration.
*
* \sa PRINTF_DISABLED
*/
#define CONFIG_PRINTF PRINTF_FULL
-/*!
+/**
* Multithreading kernel.
*
* \sa config_kern.h
*/
#define CONFIG_KERNEL 1
-/*!
+/**
* \name Serial driver parameters
* \{
*/
- /*! [bytes] Size of the outbound FIFO buffer for port 0. */
+ /** [bytes] Size of the outbound FIFO buffer for port 0. */
#define CONFIG_UART0_TXBUFSIZE 32
- /*! [bytes] Size of the inbound FIFO buffer for port 0. */
+ /** [bytes] Size of the inbound FIFO buffer for port 0. */
#define CONFIG_UART0_RXBUFSIZE 64
- /*! [bytes] Size of the outbound FIFO buffer for port 1. */
+ /** [bytes] Size of the outbound FIFO buffer for port 1. */
#define CONFIG_UART1_TXBUFSIZE 32
- /*! [bytes] Size of the inbound FIFO buffer for port 1. */
+ /** [bytes] Size of the inbound FIFO buffer for port 1. */
#define CONFIG_UART1_RXBUFSIZE 64
- /*! [bytes] Size of the outbound FIFO buffer for SPI port (AVR only). */
+ /** [bytes] Size of the outbound FIFO buffer for SPI port (AVR only). */
#define CONFIG_SPI_TXBUFSIZE 16
- /*! [bytes] Size of the inbound FIFO buffer for SPI port (AVR only). */
+ /** [bytes] Size of the inbound FIFO buffer for SPI port (AVR only). */
#define CONFIG_SPI_RXBUFSIZE 32
- /*! Default transmit timeout (ms). Set to -1 to disable timeout support */
+ /** Default transmit timeout (ms). Set to -1 to disable timeout support */
#define CONFIG_SER_TXTIMEOUT -1
- /*! Default receive timeout (ms). Set to -1 to disable timeout support */
+ /** Default receive timeout (ms). Set to -1 to disable timeout support */
#define CONFIG_SER_RXTIMEOUT -1
- /*! Use RTS/CTS handshake */
+ /** Use RTS/CTS handshake */
#define CONFIG_SER_HWHANDSHAKE 0
- /*! Default baud rate (set to 0 to disable) */
+ /** Default baud rate (set to 0 to disable) */
#define CONFIG_SER_DEFBAUDRATE 0
- /*! Enable ser_gets() and ser_gets_echo() */
+ /** Enable ser_gets() and ser_gets_echo() */
#define CONFIG_SER_GETS 0
/** Enable second serial port in emulator. */
#define CONFIG_EMUL_UART1 0
- /*!
+ /**
* Transmit always something on serial port 0 TX
* to avoid interference when sending burst of data,
* using AVR multiprocessor serial mode
#define CONFIG_SER_STROBE 0
/*\}*/
-//! Hardware timer selection for drv/timer.c
+/// Hardware timer selection for drv/timer.c
#define CONFIG_TIMER TIMER_ON_OUTPUT_COMPARE2
-//! Debug timer interrupt using a strobe pin.
+/// Debug timer interrupt using a strobe pin.
#define CONFIG_TIMER_STROBE 0
-//! Enable watchdog timer.
+/// Enable watchdog timer.
#define CONFIG_WATCHDOG 1
-//! EEPROM type for drv/eeprom.c
+/// EEPROM type for drv/eeprom.c
#define CONFIG_EEPROM_TYPE EEPROM_24XX256
/// Select bitmap pixel format.
/// Enable key beeps
#define CONFIG_KBD_BEEP 1
-/*!
+/**
* \name Type for the chart dataset
* \{
*/
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/24 00:27:56 bernie
*#* Remove #error to allow compiling local demo.
*#*
#ifndef ARCH_CONFIG_H
#define ARCH_CONFIG_H
-/*!
+/**
* \name Architectures
* \{
*/
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.22 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.21 2006/07/19 12:53:43 bernie
*#* Prune log.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.15 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.14 2006/07/19 12:54:12 bernie
*#* Documentation fixes.
*#*
#define CPU_BYTE_ORDER CPU_LITTLE_ENDIAN
#define CPU_HARVARD 1
- /*!
+ /**
* Initialization value for registers in stack frame.
* The register index is not directly corrispondent to CPU
* register numbers. Index 0 is the SREG register: the initial
#error No CPU_... defined.
#endif
-/*!
+/**
* Execute \a CODE atomically with respect to interrupts.
*
* \see IRQ_SAVE_DISABLE IRQ_RESTORE
} while (0)
-//! Default for macro not defined in the right arch section
+/// Default for macro not defined in the right arch section
#ifndef CPU_REG_INIT_VALUE
#define CPU_REG_INIT_VALUE(reg) 0
#endif
#endif
-/*!
+/**
* \name Default type sizes.
*
* These defaults are reasonable for most 16/32bit machines.
STATIC_ASSERT(sizeof(uint64_t) * CPU_BITS_PER_CHAR == 64);
#endif
-/*!
+/**
* \def CPU_IDLE
*
* \brief Invoked by the scheduler to stop the CPU when idle.
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/10 12:37:37 bernie
*#* Add support for ARM on IAR.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.14 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.13 2006/03/22 13:34:34 bernie
*#* MSVC support.
*#*
#undef NDEBUG
#endif
- /*!
+ /**
* This macro duplicates the old MSVC trick of redefining
* THIS_FILE locally to avoid the overhead of many duplicate
* strings in ASSERT().
#define THIS_FILE __FILE__
#endif
- /*!
+ /**
* This macro can be used to conditionally exclude one or more
* statements conditioned on \c _DEBUG, avoiding the clutter
* of ifdef/endif pairs.
#endif /* !OS_HOSTED */
- /*!
+ /**
* \name Walls to detect data corruption
* \{
*/
#define CHECK_WALL(name) __check_wall((name), countof(name), #name, THIS_FILE, __LINE__)
/*\}*/
- /*!
+ /**
* Check that the given pointer actually points to an object
* of the specified type.
*/
ASSERT(dynamic_cast<_t>((_o)) != NULL); \
}
- /*!
+ /**
* \name Debug object creation and destruction.
*
* These macros help track some kinds of leaks in C++ programs.
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2006/03/13 02:06:55 bernie
*#* ROUND_UP2: Rename from ROUND2.
*#*
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif /* !(COMPILER_STATEMENT_EXPRESSIONS && COMPILER_TYPEOF) */
-/*! Bound \a x between \a min and \a max. */
+/** Bound \a x between \a min and \a max. */
#define MINMAX(min,x,max) (MIN(MAX(min, x), max))
#ifdef __cplusplus
/* Use standard implementation from <algorithm> */
#define SWAP(a,b) std::swap(a, b)
#elif COMPILER_TYPEOF
- /*!
+ /**
* Type-generic macro to swap \a a with \a b.
*
* \note Arguments are evaluated multiple times.
#endif /* COMPILER_TYPEOF */
#ifndef BV
- /*! Convert a bit value to a binary flag. */
+ /** Convert a bit value to a binary flag. */
#define BV(x) (1<<(x))
#endif
/* OBSOLETE */
#define ROUND2 ROUND_UP2
-/*!
+/**
* \name Integer round macros.
*
* Round \a x to a multiple of \a base.
/** Check if \a x is an integer power of 2. */
#define IS_POW2(x) (!(bool)((x) & ((x)-1)))
-/*! Calculate a compile-time log2 for a uint8_t */
+/** Calculate a compile-time log2 for a uint8_t */
#define UINT8_LOG2(x) \
((x) < 2 ? 0 : \
((x) < 4 ? 1 : \
((x) < 64 ? 5 : \
((x) < 128 ? 6 : 7)))))))
-/*! Calculate a compile-time log2 for a uint16_t */
+/** Calculate a compile-time log2 for a uint16_t */
#define UINT16_LOG2(x) \
((x < 256) ? UINT8_LOG2(x) : UINT8_LOG2((x) >> 8) + 8)
-/*! Calculate a compile-time log2 for a uint32_t */
+/** Calculate a compile-time log2 for a uint32_t */
#define UINT32_LOG2(x) \
((x < 65536UL) ? UINT16_LOG2(x) : UINT16_LOG2((x) >> 16) + 16)
#if COMPILER_VARIADIC_MACROS
- /*! Count the number of arguments (up to 16). */
+ /** Count the number of arguments (up to 16). */
#define PP_COUNT(...) \
PP_COUNT__(__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
#define PP_COUNT__(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,count,...) \
#endif
#if COMPILER_VARIADIC_MACROS
- /*!
+ /**
* \def BIT_CHANGE(reg, (mask, value), ...)
*
* This macro allows for efficient and compact bit toggling in a hardware
* for use with C90 compilers, through Boost Preprocessor.
*/
- /*!
+ /**
* \def BIT_CHANGE_BV(reg, (bit, value), ...)
*
* Similar to BIT_CHANGE(), but get bits instead of masks (and applies BV() to convert
-/*!
+/**
* \file
* <!--
* Copyright 2006 Develer S.r.l. (http://www.develer.com/)
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2006/03/22 13:34:34 bernie
*#* MSVC support.
*#*
#ifndef DEVLIB_OS_H
#define DEVLIB_OS_H
-/*! Macro to include OS-specific versions of the headers. */
+/** Macro to include OS-specific versions of the headers. */
#define OS_HEADER(module) PP_STRINGIZE(PP_CAT3(module, _, OS_ID).h)
#define OS_CSOURCE(module) PP_STRINGIZE(PP_CAT3(module, _, OS_ID).c)
# Author: Bernardo Innocenti <bernie@develer.com>
#
# $Log$
+# Revision 1.7 2006/07/19 12:56:24 bernie
+# Convert to new Doxygen style.
+#
# Revision 1.6 2006/06/12 22:05:09 marco
# Bring back config wrongly commited
#
# STK200 parallel cable
#DPROG = -c stk200 -E noreset
+# JTAG ICE mkII
+#DPROG = avarice --mkII -j usb -l
+
# PonyProg serial programmer
#DPROG = -c dasa2
#
# define some variables based on the AVR base path in $(AVR)
#
-CROSS =
+CROSS = avr-
CC = $(CROSS)gcc
AS = $(CC) -x assembler-with-cpp
LD = $(CC)
-/*!
+/**
* \file
* <!--
* Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:24 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2006/02/21 16:05:53 bernie
*#* Move from cfg/ to top-level.
*#*
#include <cfg/arch_config.h> /* ARCH_EMUL */
-/*!
+/**
* \name Modules activation
*
* \{
/* EXPERIMENTAL */
#define CONFIG_KERN_PREEMPTIVE (0 && CONFIG_KERN_SCHED && CONFIG_KERN_TIMER)
-#define CONFIG_KERN_QUANTUM 50 /*!< Time sharing quantum in timer ticks. */
+#define CONFIG_KERN_QUANTUM 50 /**< Time sharing quantum in timer ticks. */
#if (ARCH & ARCH_EMUL)
#define CONFIG_KERN_DEFSTACKSIZE 65536
#else
- #define CONFIG_KERN_DEFSTACKSIZE 128 /*!< Default stack size for each thread. */
+ #define CONFIG_KERN_DEFSTACKSIZE 128 /**< Default stack size for each thread. */
#endif
/* Memory fill codes to help debugging */
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/06/27 21:28:31 bernie
*#* Import ADC driver.
*#*
DB(bool adc_initialized = false;)
-/*!
+/**
* Read the ADC channel \a ch.
*/
adcread_t adc_read(uint16_t ch)
return(adc_hw_read());
}
-/*!
+/**
* Initialize the ADC hardware.
*/
void adc_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/06/27 21:28:31 bernie
*#* Import ADC driver.
*#*
#include <cfg/compiler.h>
#include <cfg/debug.h>
-/*!Type for ADC return value. */
+/**Type for ADC return value. */
typedef uint16_t adcread_t;
#define adc_bits() ADC_BITS
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.19 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.18 2006/02/17 21:15:25 bernie
*#* Add MOD_CHECK() checks.
*#*
static mtime_t buz_repeat_duration;
-/*!
+/**
* Turn off buzzer, called by software timer
*/
static void buz_softint(void)
}
-/*!
+/**
* Beep for the specified ms time
*/
void buz_beep(mtime_t time)
}
-/*!
+/**
* Start buzzer repetition
*/
void buz_repeat_start(mtime_t duration, mtime_t interval)
}
-/*!
+/**
* Stop buzzer repetition
*/
void buz_repeat_stop(void)
MOD_DEFINE(buzzer)
-/*!
+/**
* Initialize buzzer.
*/
void buz_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003,2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2005/11/27 23:32:15 bernie
*#* Update copyright information.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include <cfg/cpu.h>
-/*! Include hw.h. We expect hw.h to define enum BLD_DEVICE, which must contain
+/** Include hw.h. We expect hw.h to define enum BLD_DEVICE, which must contain
* an enumarator for each device, plus a special symbol NUM_BLDS containing the
* number of devices.
*/
#include CPU_HEADER(buzzerled)
-/*! Initialize the buzzerled library.
+/** Initialize the buzzerled library.
*
* \note This function must be called before any other function in the library.
*/
void bld_init(void);
-/*! Set or reset a device.
+/** Set or reset a device.
*
* \param device Device to be set
* \param enable Enable/disable status
#define bld_set(device, enable) bld_hw_set(device, enable)
-/*! Enable a device for a certain interval of time
+/** Enable a device for a certain interval of time
*
* \param device Device to be enabled
* \param duration Number of milliseconds the device must be enabled
void bld_beep(enum BLD_DEVICE device, uint16_t duration);
-/*! Enable a device for a certain interval of time and wait.
+/** Enable a device for a certain interval of time and wait.
*
* \param device Device to be enabled
* \param duration Number of milliseconds the device must be enabled
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#if ARCH & ARCH_HECO
-/*!
+/**
* \name Connection of the leds to the DSP:
* <pre>
* Led Line DSP Pin
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.20 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.19 2006/03/20 17:49:50 bernie
*#* Make the TWI driver more generic to work with devices other than EEPROMS.
*#*
-/*!
+/**
* Copy \c count bytes from buffer \c buf to
* eeprom at address \c addr.
*/
#if CONFIG_EEPROM_VERIFY
-/*!
+/**
* Check that the contents of an EEPROM range
* match with a provided data buffer.
*
}
-/*!
+/**
* Copy \c count bytes at address \c addr
* from eeprom to RAM to buffer \c buf.
*
}
-/*!
+/**
* Write a single character \a c at address \a addr.
*/
bool eeprom_write_char(e2addr_t addr, char c)
}
-/*!
+/**
* Read a single character at address \a addr.
*
* \return the requested character or -1 in case of failure.
}
-/*!
+/**
* Erase specified part of eeprom, writing 0xFF.
*
* \param addr starting address
}
-/*!
+/**
* Initialize TWI module.
*/
void eeprom_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2005/11/27 23:33:40 bernie
*#* Use appconfig.h instead of cfg/config.h.
*#*
#include <cfg/compiler.h>
#include <appconfig.h>
-/*!
+/**
* \name Values for CONFIG_EEPROM_TYPE
* \{
*/
/*\}*/
#if CONFIG_EEPROM_TYPE == EEPROM_24XX16
- #define EEPROM_BLKSIZE 0x10 //!< Eeprom block size (16byte)
- #define EEPROM_SIZE 0x800 //!< Eeprom total size (2kB)
+ #define EEPROM_BLKSIZE 0x10 ///< Eeprom block size (16byte)
+ #define EEPROM_SIZE 0x800 ///< Eeprom total size (2kB)
#elif CONFIG_EEPROM_TYPE == EEPROM_24XX256
- #define EEPROM_BLKSIZE 0x40 //!< Eeprom block size (64byte)
- #define EEPROM_SIZE 0x8000 //!< Eeprom total size (32kB)
+ #define EEPROM_BLKSIZE 0x40 ///< Eeprom block size (64byte)
+ #define EEPROM_SIZE 0x8000 ///< Eeprom total size (32kB)
#else
#error Unsupported EEPROM type.
#endif
-//! Type for EEPROM addresses
+/// Type for EEPROM addresses
typedef uint16_t e2addr_t;
bool eeprom_write(e2addr_t addr, const void *buf, size_t count);
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2006/06/03 13:57:36 bernie
*#* Make keyboard repeat mask run-time configurable.
*#*
#include <drv/buzzer.h>
#endif
-#define KBD_CHECK_INTERVAL 10 /*!< (ms) Timing for kbd softint */
-#define KBD_DEBOUNCE_TIME 30 /*!< (ms) Debounce time */
-#define KBD_BEEP_TIME 5 /*!< (ms) Duration of keybeep */
+#define KBD_CHECK_INTERVAL 10 /**< (ms) Timing for kbd softint */
+#define KBD_DEBOUNCE_TIME 30 /**< (ms) Debounce time */
+#define KBD_BEEP_TIME 5 /**< (ms) Duration of keybeep */
-#define KBD_REPEAT_DELAY 400 /*!< (ms) Keyboard repeat delay for first character */
-#define KBD_REPEAT_RATE 100 /*!< (ms) Initial interchar delay for keyboard repeat */
-#define KBD_REPEAT_MAXRATE 20 /*!< (ms) Minimum delay for keyboard repeat */
-#define KBD_REPEAT_ACCEL 5 /*!< (ms) Keyboard repeat speed increase */
+#define KBD_REPEAT_DELAY 400 /**< (ms) Keyboard repeat delay for first character */
+#define KBD_REPEAT_RATE 100 /**< (ms) Initial interchar delay for keyboard repeat */
+#define KBD_REPEAT_MAXRATE 20 /**< (ms) Minimum delay for keyboard repeat */
+#define KBD_REPEAT_ACCEL 5 /**< (ms) Keyboard repeat speed increase */
-#define KBD_LNG_DELAY 1000 /*!< (ms) Keyboard long pression keys delay */
+#define KBD_LNG_DELAY 1000 /**< (ms) Keyboard long pression keys delay */
-/*! Status for keyboard repeat state machine */
+/** Status for keyboard repeat state machine */
static enum { KS_IDLE, KS_REPDELAY, KS_REPEAT } kbd_rptStatus;
-static volatile keymask_t kbd_buf; /*!< Single entry keyboard buffer */
-static volatile keymask_t kbd_cnt; /*!< Number of keypress events in \c kbd_buf */
+static volatile keymask_t kbd_buf; /**< Single entry keyboard buffer */
+static volatile keymask_t kbd_cnt; /**< Number of keypress events in \c kbd_buf */
static keymask_t kbd_rpt_mask; /**< Mask of repeatable keys. */
#if CONFIG_KBD_POLL == KBD_POLL_SOFTINT
-static Timer kbd_timer; /*!< Keyboard softtimer */
+static Timer kbd_timer; /**< Keyboard softtimer */
#endif
-static List kbd_rawHandlers; /*!< Raw keyboard handlers */
-static List kbd_handlers; /*!< Cooked keyboard handlers */
+static List kbd_rawHandlers; /**< Raw keyboard handlers */
+static List kbd_handlers; /**< Cooked keyboard handlers */
-static KbdHandler kbd_defHandler; /*!< The default keyboard handler */
-static KbdHandler kbd_debHandler; /*!< The debounce keyboard handler */
-static KbdHandler kbd_rptHandler; /*!< Auto-repeat keyboard handler */
+static KbdHandler kbd_defHandler; /**< The default keyboard handler */
+static KbdHandler kbd_debHandler; /**< The debounce keyboard handler */
+static KbdHandler kbd_rptHandler; /**< Auto-repeat keyboard handler */
#ifdef K_LNG_MASK
-static KbdHandler kbd_lngHandler; /*!< Long pression keys handler */
+static KbdHandler kbd_lngHandler; /**< Long pression keys handler */
#endif
#if CONFIG_KBD_OBSERVER
#endif
-/*!
+/**
* Poll keyboard and dispatch keys to handlers.
*
* Read the key states and invoke all keyboard
*/
static void kbd_poll(void)
{
- /*! Currently depressed key */
+ /** Currently depressed key */
static keymask_t current_key;
struct KbdHandler *handler;
#if CONFIG_KBD_POLL == KBD_POLL_SOFTINT
-/*!
+/**
* Keyboard soft-irq handler.
*/
static void kbd_softint(UNUSED_ARG(iptr_t, arg))
#endif /* CONFIG_KBD_POLL */
-/*!
+/**
* \brief Read a key from the keyboard buffer.
*
* When a key is kept depressed between calls of this function a value
return key;
}
-/*!
+/**
* Wait for a keypress and return the mask of depressed keys.
*
* \note This function is \b not interrupt safe!
}
-/*!
+/**
* Wait up to \c timeout ms for a keypress
* and return the mask of depressed keys, or K_TIMEOUT
* if the timeout was reacked.
}
-/*!
+/**
* This is the default key handler, called after
* all other handlers have had their chance to
* do their special processing. This handler
return 0;
}
-/*!
+/**
* Handle keyboard debounce
*/
static keymask_t kbd_debHandlerFunc(keymask_t key)
{
- /*! Buffer for debounce */
+ /** Buffer for debounce */
static keymask_t debounce_key;
- /*! Timer for keyboard debounce */
+ /** Timer for keyboard debounce */
static ticks_t debounce_time;
- /*! Key aquired after debounce */
+ /** Key aquired after debounce */
static keymask_t new_key;
return oldmask;
}
-/*!
+/**
* Handle keyboard repeat
*/
static keymask_t kbd_rptHandlerFunc(keymask_t key)
static ticks_t repeat_time;
/* Current repeat rate (for acceleration). */
- static ticks_t repeat_rate; /*! Current repeat rate (for acceleration) */
+ static ticks_t repeat_rate; /** Current repeat rate (for acceleration) */
ticks_t now = timer_clock();
MOD_DEFINE(kbd)
-/*!
+/**
* Initialize keyboard ports and softtimer
*/
void kbd_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2006/06/03 13:57:36 bernie
*#* Make keyboard repeat mask run-time configurable.
*#*
#define KBD_POLL_FREERTOS 2
/* \} */
-/*!
+/**
* Keyboard handler descriptor
*/
typedef struct KbdHandler
{
Node link;
- keymask_t (*hook)(keymask_t); /*!< Hook function */
- int8_t pri; /*!< Priority in input queue */
- uint8_t flags; /*!< See below for definitions */
+ keymask_t (*hook)(keymask_t); /**< Hook function */
+ int8_t pri; /**< Priority in input queue */
+ uint8_t flags; /**< See below for definitions */
} KbdHandler;
-#define KHF_RAWKEYS BV(0) /*!< Handler gets raw key events */
+#define KHF_RAWKEYS BV(0) /**< Handler gets raw key events */
void kbd_init(void);
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.28 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.27 2006/06/01 12:32:06 marco
*#* Updated include reference.
*#*
}
-/*!
+/**
* Output one character to the debug console
*/
static void __kputchar(char c, UNUSED_ARG(void *, unused))
}
-/*!
+/**
* Cheap function to print small integers without using printf().
*/
int kputnum(int num)
#if CONFIG_PRINTF
-/*!
+/**
* Dump binary data in hex
*/
void kdump(const void *_buf, size_t len)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2006/04/27 05:40:11 bernie
*#* Naming convention fixes; Partial merge from project_grl.
*#*
#if CONFIG_LCD_SOFTINT_REFRESH
- /*! Interval between softint driven lcd refresh */
+ /** Interval between softint driven lcd refresh */
# define LCD_REFRESH_INTERVAL 20 /* 20ms -> 50fps */
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
-/*! Number of LCD pages */
+/** Number of LCD pages */
#define LCD_PAGES 4
-/*! Width of an LCD page */
+/** Width of an LCD page */
#define LCD_PAGESIZE (LCD_WIDTH / 2)
-/*!
+/**
* \name LCD I/O pins/ports
* @{
*/
#define LCD_PE_E2 PE6
/*@}*/
-/*!
+/**
* \name DB high nibble (DB[4-7])
* @{
*/
#define LCD_DATA_HI_MASK 0xF0
/*@}*/
-/*!
+/**
* \name DB low nibble (DB[0-3])
* @{
*/
#define LCD_DATA_LO_MASK 0xF0
/*@}*/
-/*!
+/**
* \name LCD bus control macros
* @{
*/
#define LCD_CLR_E(x) (PORTE &= ~(x))
/*@}*/
-/*!
+/**
* \name Chip select bits for LCD_SET_E()
* @{
*/
#define LCDF_E2 (BV(LCD_PE_E2))
/*@}*/
-/*! Read from the LCD data bus (DB[0-7]) */
+/** Read from the LCD data bus (DB[0-7]) */
#define LCD_READ ( \
((LCD_DATA_LO_PIN & LCD_DATA_LO_MASK) >> LCD_DATA_LO_SHIFT) | \
((LCD_DATA_HI_PIN & LCD_DATA_HI_MASK) >> LCD_DATA_HI_SHIFT) \
)
-/*! Write to the LCD data bus (DB[0-7]) */
+/** Write to the LCD data bus (DB[0-7]) */
#define LCD_WRITE(d) \
do { \
LCD_DATA_LO_PORT = (LCD_DATA_LO_PORT & ~LCD_DATA_LO_MASK) | (((d)<<LCD_DATA_LO_SHIFT) & LCD_DATA_LO_MASK); \
LCD_DATA_HI_PORT = (LCD_DATA_HI_PORT & ~LCD_DATA_HI_MASK) | (((d)<<LCD_DATA_HI_SHIFT) & LCD_DATA_HI_MASK); \
} while (0)
-/*! Set data bus direction to output (write to display) */
+/** Set data bus direction to output (write to display) */
#define LCD_DB_OUT \
do { \
LCD_DATA_LO_DDR |= LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR |= LCD_DATA_HI_MASK; \
} while (0)
-/*! Set data bus direction to input (read from display) */
+/** Set data bus direction to input (read from display) */
#define LCD_DB_IN \
do { \
LCD_DATA_LO_DDR &= ~LCD_DATA_LO_MASK; \
LCD_DATA_HI_DDR &= ~LCD_DATA_HI_MASK; \
} while (0)
-/*! Delay for tEW (160ns) */
+/** Delay for tEW (160ns) */
#define LCD_DELAY_WRITE \
do { \
NOP; \
NOP; \
} while (0)
-/*! Delay for tACC6 (180ns) */
+/** Delay for tACC6 (180ns) */
#define LCD_DELAY_READ \
do { \
NOP; \
} while (0)
-/*!
+/**
* \name 32122A Commands
* @{
*/
#define LCDF_BUSY BV(7)
#if CONFIG_LCD_WAIT
-/*!
+/**
* \code
* __ __
* RS __\____________/__
#endif /* CONFIG_LCD_WAIT */
-/*!
+/**
* Raster buffer to draw into.
*
* Bits in the bitmap bytes have vertical orientation,
static uint8_t lcd_raster[RASTER_SIZE(LCD_WIDTH, LCD_HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
-/*! Default LCD bitmap */
+/** Default LCD bitmap */
struct Bitmap lcd_bitmap;
#if CONFIG_LCD_SOFTINT_REFRESH
-/*! Timer for regular LCD refresh */
+/** Timer for regular LCD refresh */
static Timer *lcd_refresh_timer;
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
WAIT_LCD;
- /*!
+ /**
* \code
* __________________
* A0 __/ \__
{
WAIT_LCD;
- /*!
+ /**
* \code
* __________________
* A0 ___/ \___
}
-/*!
+/**
* Set LCD contrast PWM.
*/
void lcd_setPwm(int duty)
#endif /* CONFIG_LCD_SOFTINT_REFRESH */
-/*!
+/**
* Initialize LCD subsystem.
*
* \note The PWM used for LCD contrast is initialized in drv/pwm.c
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2006/04/27 05:40:11 bernie
*#* Naming convention fixes; Partial merge from project_grl.
*#*
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2006/05/28 12:17:57 bernie
*#* Drop almost all the Qt3 cruft.
*#*
static uint8_t lcd_raster[RASTER_SIZE(EmulLCD::WIDTH, EmulLCD::HEIGHT)];
DECLARE_WALL(wall_after_raster, WALL_SIZE)
-/*! Default LCD bitmap */
+/** Default LCD bitmap */
struct Bitmap lcd_bitmap;
/*extern "C"*/ void lcd_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:00:42 bernie
*#* Import into DevLib.
*#*
#error Incomplete or missing LCD_READ/LCD_WRITE macros
#endif
-/*! Flag di stato del display */
+/** Flag di stato del display */
#define LCDF_BUSY BV(7)
-/*!
+/**
* Addresses of LCD display character positions, expanded
* for faster access (DB7 = 1).
*/
STATIC_ASSERT(countof(lcd_address) == LCD_ROWS * LCD_COLS);
-/*!
+/**
* Current display position. We remember this to optimize
* LCD output by avoiding to set the address every time.
*/
#endif /* ARCH_EMUL */
-/*!
+/**
* Wait until the LCD busy flag clears.
*/
void lcd_waitBusy(void)
}
-/*!
+/**
* Move the cursor to \a addr, only if not already there.
*/
void lcd_moveTo(uint8_t addr)
}
-/*!
+/**
* Write a value in LCD data register, waiting for the busy flag.
*/
void lcd_setReg(uint8_t val)
}
#include <cfg/debug.h>
-/*!
+/**
* Write the character \a c on display address \a addr.
*
* NOTE: argh, the HD44 lcd type is a bad beast: our
}
-/*!
+/**
* Remap the glyph of a character.
*
* glyph - bitmap of 8x8 bits.
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:00:42 bernie
*#* Import into DevLib.
*#*
#include <cfg/compiler.h> /* For stdint types */
-/*!
+/**
* \name Display dimensions (in chars)
* \{
*/
#define LCD_COLS 16
/* \} */
-/*!
+/**
* \name Hitachi HD44 commands.
* \{
*/
#define LCD_CMD_DISPLAY_INI 0x30
-//#define LCD_CMD_SETFUNC 0x38 /*!< 8 bits, 2 lines, 5x7 dots */
-#define LCD_CMD_SETFUNC 0x28 /*!< 4 bits, 2 lines, 5x7 dots */
-#define LCD_CMD_DISPLAY_ON 0x0F /*!< Switch on display */
-#define LCD_CMD_DISPLAY_OFF 0x08 /*!< Switch off display */
-#define LCD_CMD_CLEAR 0x01 /*!< Clear display */
-#define LCD_CMD_CURSOR_BLOCK 0x0D /*!< Show cursor (block) */
-#define LCD_CMD_CURSOR_LINE 0x0F /*!< Show cursor (line) */
-#define LCD_CMD_CURSOR_OFF 0x0C /*!< Hide cursor */
+//#define LCD_CMD_SETFUNC 0x38 /**< 8 bits, 2 lines, 5x7 dots */
+#define LCD_CMD_SETFUNC 0x28 /**< 4 bits, 2 lines, 5x7 dots */
+#define LCD_CMD_DISPLAY_ON 0x0F /**< Switch on display */
+#define LCD_CMD_DISPLAY_OFF 0x08 /**< Switch off display */
+#define LCD_CMD_CLEAR 0x01 /**< Clear display */
+#define LCD_CMD_CURSOR_BLOCK 0x0D /**< Show cursor (block) */
+#define LCD_CMD_CURSOR_LINE 0x0F /**< Show cursor (line) */
+#define LCD_CMD_CURSOR_OFF 0x0C /**< Hide cursor */
#define LCD_CMD_DISPLAYMODE 0x06
#define LCD_CMD_SET_CGRAMADDR 0x40
#define LCD_CMD_RESET_DDRAM 0x80
#define LCD_CMD_MOVESHIFT_RIGHT 0x04
/*\}*/
-/*! Type for combined LCD cursor position (x,y). */
+/** Type for combined LCD cursor position (x,y). */
typedef uint8_t lcdpos_t;
void lcd_waitBusy(void);
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:25 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/02/24 00:27:14 bernie
*#* Use new naming convention for list macros.
*#*
#include <string.h> // strlen()
-/*! Maximum number of layers. */
+/** Maximum number of layers. */
#define LCD_LAYERS 6
#if CONFIG_KERNEL
- /*! Semaphore to arbitrate access to the display. */
+ /** Semaphore to arbitrate access to the display. */
static struct Semaphore lcd_semaphore;
#define LOCK_LCD sem_obtain(&lcd_semaphore)
#define UNLOCK_LCD sem_release(&lcd_semaphore)
static LIST_TYPE(Layer) lcd_Layers;
static LIST_TYPE(Layer) lcd_FreeLayers;
-/*!
+/**
* Current cursor status.
*
* One of LCD_CMD_CURSOR_OFF, LCD_CMD_CURSOR_BLOCK or LCD_CMD_CURSOR_LINE.
*/
static uint8_t lcd_CursorStatus;
-/*! Current cursor position, encoded as a Cursor position and status. */
+/** Current cursor position, encoded as a Cursor position and status. */
static lcdpos_t lcd_CursorAddr;
#endif /* CONFIG_KERNEL */
-/*!
+/**
* Write one character to the display at the current
* cursor prosition, then move the cursor right. The
* cursor is wrapped to the next line when it moves
}
-/*!
+/**
* Internal function to move a layer between two positions.
*
* \note The layer must be *already* enqueued in some list.
return layer;
}
-/*!
+/**
* Redraw the display (internal).
*
* \note The display must be already locked.
}
}
-/*!
+/**
* Rearrange layer depth and refresh display accordingly.
*
* \note Setting a priority of LAYER_HIDDEN makes the layer invisible.
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/02/23 10:59:14 bernie
*#* Documentation fixes.
*#*
#define LCD_CENTER BV(1) /* Center string in line */
#define LCD_NOCURSOR BV(2) /* Scrittura senza spostamento cursore */
-/*! Special priority value for lcd_setLayerDepth(). */
+/** Special priority value for lcd_setLayerDepth(). */
#define LAYER_HIDDEN -128
/* Compute LCD address from x/y coordinates */
#define LCD_ROW2 (LCD_COLS * 2)
#define LCD_ROW3 (LCD_COLS * 3)
-/*!
+/**
* Overwrapping layer context.
*/
typedef struct _Layer
{
- /*!
+ /**
* Active layers are linked together in a list
* sorted in top to bottom order.
*/
DECLARE_NODE_ANON(struct _Layer)
- /*! Current XY address into this layer, for write operations. */
+ /** Current XY address into this layer, for write operations. */
lcdpos_t addr;
- /*! Priority of this layer (greater in front of lesser). */
+ /** Priority of this layer (greater in front of lesser). */
char pri;
/**
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.de+veler.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 17:59:47 bernie
*#* Import into DevLib.
*#*
DB(bool ntc_initialized;)
-/*!
+/**
* Find in a table of values \a orig_table of size \a size, the index which
* value is less or equal to \a val.
*
}
-/*!
+/**
* Read the temperature for the NTC channel \a dev.
* First read the resistence of the NTC through ntc_hw_read(), then,
* for the conversion from resistance to temperature, since the formula
}
-/*!
+/**
* Init NTC hardware.
*/
void ntc_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 17:59:47 bernie
*#* Import into DevLib.
*#*
#define NTC_OPEN_CIRCUIT -32768
#define NTC_SHORT_CIRCUIT 32767
-typedef int16_t deg_t; /*! type for celsius degrees deg_t = °C * 10 */
+typedef int16_t deg_t; /** type for celsius degrees deg_t = °C * 10 */
-/*! Macro for converting from deg to deg_t type */
+/** Macro for converting from deg to deg_t type */
#define DEG_TO_DEG_T(x) ((deg_t)((x) * 10))
-/*! Macro for converting from deg_t to celsius degrees (returns only the integer part) */
+/** Macro for converting from deg_t to celsius degrees (returns only the integer part) */
#define DEG_T_TO_INTDEG(x) ((x) / 10)
-/*! Macro for converting from deg_t to celsius degrees (returns only the decimal part) */
+/** Macro for converting from deg_t to celsius degrees (returns only the decimal part) */
#define DEG_T_TO_DECIMALDEG(x) ((x) % 10)
-/*! Macro for converting from deg_t to celsius degrees (returns type is float) */
+/** Macro for converting from deg_t to celsius degrees (returns type is float) */
#define DEG_T_TO_FLOATDEG(x) ((x) / 10.0)
-typedef uint32_t res_t; /*! type for resistor res_t = Ohm * 100 */
-typedef float amp_t; /*! type for defining amplifications amp_t = A, where A is a pure number */
+typedef uint32_t res_t; /** type for resistor res_t = Ohm * 100 */
+typedef float amp_t; /** type for defining amplifications amp_t = A, where A is a pure number */
DB(extern bool ntc_initialized;)
-/*! Describe a NTC chip */
+/** Describe a NTC chip */
typedef struct NtcHwInfo
{
- const res_t *resistances; //!< resistances of the NTC (ohms * 100)
- size_t num_resistances; //!< number of resistances
- deg_t degrees_min; //!< degrees corresponding to the first entry in the table (celsius * 10)
- deg_t degrees_step; //!< difference in degrees between two consecutive elements in the table (celsius * 10)
+ const res_t *resistances; ///< resistances of the NTC (ohms * 100)
+ size_t num_resistances; ///< number of resistances
+ deg_t degrees_min; ///< degrees corresponding to the first entry in the table (celsius * 10)
+ deg_t degrees_step; ///< difference in degrees between two consecutive elements in the table (celsius * 10)
} NtcHwInfo;
-/*! Initialize the NTC module */
+/** Initialize the NTC module */
void ntc_init(void);
-/*! Read a single temperature value from the NTC */
+/** Read a single temperature value from the NTC */
deg_t ntc_read(NtcDev dev);
#endif /* DRV_NTC_H */
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:06:44 bernie
*#* Import into DevLib.
*#*
#include <math.h>
-/*! Array of triacs */
+/** Array of triacs */
static Triac triacs[TRIAC_CNT];
DB(bool phase_initialized;)
-/*!
+/**
* Zerocross interrupt, call when 220V cross zero.
*
* This function turn off all triacs that have duty < 100%
-/*!
+/**
* Set duty of the triac channel \a dev (interrupt safe).
*/
void phase_setDuty(TriacDev dev, triac_duty_t duty)
-/*!
+/**
* Set duty of the triac channel \a dev (NOT INTERRUPT SAFE).
*/
void phase_setDutyUnlock(TriacDev dev, triac_duty_t duty)
-/*!
+/**
* Set power of the triac channel \a dev (interrupt safe).
*
* This function approsimate the sine wave to a triangular wave to compute
-/*!
+/**
* Soft int for each \a _dev triac.
*
* The triacs are turned on at different time to achieve phase control.
-/*!
+/**
* Initialize phase control driver
*/
void phase_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:06:44 bernie
*#* Import into DevLib.
*#*
#define TRIAC_MAX_POWER 100
#define TRIAC_POWER_K TRIAC_MAX_DUTY * (1 / sqrt(2 * TRIAC_MAX_POWER))
-/*!
+/**
* \name Types for duty and power.
* \{
*/
DB(extern bool phase_initialized;)
-/*!
+/**
* \name Type for triac control.
* \{
*/
typedef struct Triac
{
- Timer timer; /*!< Timer for phase control. */
- triac_duty_t duty; /*!< Duty cycle of the channel. */
- bool running; /*!< True when the timer is active. */
+ Timer timer; /**< Timer for phase control. */
+ triac_duty_t duty; /**< Duty cycle of the channel. */
+ bool running; /**< True when the timer is active. */
} Triac;
/* \} */
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:08:49 bernie
*#* Import into DevLib.
*#*
#include <drv/pwm.h>
#include <cfg/macros.h>
-/*!
+/**
* Set duty of pwm channel \a dev.
*/
void pwm_setDuty(PwmDev dev, pwm_duty_t duty)
pwm_hw_setDutyUnlock(dev, duty);
}
-/*!
+/**
* Initialize PWM hw.
*/
void pwm_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:08:49 bernie
*#* Import into DevLib.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.30 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.29 2006/05/18 00:39:30 bernie
*#* ser_open(): Document a bit more.
*#*
/* Serial configuration parameters */
-#define SER_CTSDELAY 70 /*!< CTS line retry interval (ms) */
-#define SER_TXPOLLDELAY 2 /*!< Transmit buffer full retry interval (ms) */
-#define SER_RXPOLLDELAY 2 /*!< Receive buffer empty retry interval (ms) */
+#define SER_CTSDELAY 70 /**< CTS line retry interval (ms) */
+#define SER_TXPOLLDELAY 2 /**< Transmit buffer full retry interval (ms) */
+#define SER_RXPOLLDELAY 2 /**< Receive buffer empty retry interval (ms) */
struct Serial ser_handles[SER_CNT];
-/*!
+/**
* Inserisce il carattere c nel buffer di trasmissione.
* Questa funzione mette il processo chiamante in attesa
* quando il buffer e' pieno.
}
-/*!
+/**
* Preleva un carattere dal buffer di ricezione.
* Questa funzione mette il processo chiamante in attesa
* quando il buffer e' vuoto. L'attesa ha un timeout
}
-/*!
+/**
* Preleva un carattere dal buffer di ricezione.
* Se il buffer e' vuoto, ser_getchar_nowait() ritorna
* immediatamente EOF.
#if CONFIG_SER_GETS
-/*!
+/**
* Read a line long at most as size and put it
* in buf.
* \return number of chars read or EOF in case
}
-/*!
+/**
* Read a line long at most as size and put it
* in buf, with optional echo.
*
#endif /* !CONFIG_SER_GETS */
-/*!
+/**
* Read at most \a size bytes from \a port and put them in \a buf
*
* \return number of bytes actually read, or EOF in
}
-/*!
+/**
* Write a string to serial.
* \return 0 if OK, EOF in case of error.
*/
}
-/*!
+/**
* \brief Write a buffer to serial.
*
* \return 0 if OK, EOF in case of error.
#if CONFIG_PRINTF
-/*!
+/**
* Formatted write
*/
int ser_printf(struct Serial *port, const char *format, ...)
#endif /* CONFIG_SER_RXTIMEOUT || CONFIG_SER_TXTIMEOUT */
#if CONFIG_SER_RXTIMEOUT != -1
-/*!
+/**
* Discard input to resynchronize with remote end.
*
* Discard incoming data until the port stops receiving
}
-/*!
+/**
* Flush both the RX and TX buffers.
*/
void ser_purge(struct Serial *port)
}
-/*!
+/**
* Wait until all pending output is completely
* transmitted to the other end.
*
}
-/*!
+/**
* Initialize a serial port.
*
* \param unit Serial unit to open. Possible values are architecture dependant.
}
-/*!
+/**
* Clean up serial port, disabling the associated hardware.
*/
void ser_close(struct Serial *port)
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.27 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.26 2006/05/18 00:39:13 bernie
*#* Add struct Serial friendly typedef.
*#*
#include <cfg/os.h>
#include <appconfig.h>
-/*! \name Serial Error/status flags. */
+/** \name Serial Error/status flags. */
/*\{*/
#if CPU_AVR
typedef uint8_t serstatus_t;
/* Software errors */
- #define SERRF_RXFIFOOVERRUN BV(0) /*!< Rx FIFO buffer overrun */
- #define SERRF_RXTIMEOUT BV(5) /*!< Receive timeout */
- #define SERRF_TXTIMEOUT BV(6) /*!< Transmit timeout */
+ #define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */
+ #define SERRF_RXTIMEOUT BV(5) /**< Receive timeout */
+ #define SERRF_TXTIMEOUT BV(6) /**< Transmit timeout */
/*
* Hardware errors.
* These flags map directly to the AVR UART Status Register (USR).
*/
- #define SERRF_RXSROVERRUN BV(3) /*!< Rx shift register overrun */
- #define SERRF_FRAMEERROR BV(4) /*!< Stop bit missing */
- #define SERRF_PARITYERROR BV(7) /*!< Parity error */
- #define SERRF_NOISEERROR 0 /*!< Unsupported */
+ #define SERRF_RXSROVERRUN BV(3) /**< Rx shift register overrun */
+ #define SERRF_FRAMEERROR BV(4) /**< Stop bit missing */
+ #define SERRF_PARITYERROR BV(7) /**< Parity error */
+ #define SERRF_NOISEERROR 0 /**< Unsupported */
#elif CPU_DSP56K
typedef uint16_t serstatus_t;
/* Software errors */
- #define SERRF_RXFIFOOVERRUN BV(0) /*!< Rx FIFO buffer overrun */
- #define SERRF_RXTIMEOUT BV(1) /*!< Receive timeout */
- #define SERRF_TXTIMEOUT BV(2) /*!< Transmit timeout */
+ #define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */
+ #define SERRF_RXTIMEOUT BV(1) /**< Receive timeout */
+ #define SERRF_TXTIMEOUT BV(2) /**< Transmit timeout */
/*
* Hardware errors.
* These flags map directly to the SCI Control Register.
*/
- #define SERRF_PARITYERROR BV(8) /*!< Parity error */
- #define SERRF_FRAMEERROR BV(9) /*!< Stop bit missing */
- #define SERRF_NOISEERROR BV(10) /*!< Noise error */
- #define SERRF_RXSROVERRUN BV(11) /*!< Rx shift register overrun */
+ #define SERRF_PARITYERROR BV(8) /**< Parity error */
+ #define SERRF_FRAMEERROR BV(9) /**< Stop bit missing */
+ #define SERRF_NOISEERROR BV(10) /**< Noise error */
+ #define SERRF_RXSROVERRUN BV(11) /**< Rx shift register overrun */
#elif OS_HOSTED
typedef uint16_t serstatus_t;
/* Software errors */
- #define SERRF_RXFIFOOVERRUN BV(0) /*!< Rx FIFO buffer overrun */
- #define SERRF_RXTIMEOUT BV(1) /*!< Receive timeout */
- #define SERRF_TXTIMEOUT BV(2) /*!< Transmit timeout */
+ #define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */
+ #define SERRF_RXTIMEOUT BV(1) /**< Receive timeout */
+ #define SERRF_TXTIMEOUT BV(2) /**< Transmit timeout */
/* Hardware errors */
- #define SERRF_RXSROVERRUN 0 /*!< Unsupported in emulated serial port. */
- #define SERRF_FRAMEERROR 0 /*!< Unsupported in emulated serial port. */
- #define SERRF_PARITYERROR 0 /*!< Unsupported in emulated serial port. */
- #define SERRF_NOISEERROR 0 /*!< Unsupported in emulated serial port. */
+ #define SERRF_RXSROVERRUN 0 /**< Unsupported in emulated serial port. */
+ #define SERRF_FRAMEERROR 0 /**< Unsupported in emulated serial port. */
+ #define SERRF_PARITYERROR 0 /**< Unsupported in emulated serial port. */
+ #define SERRF_NOISEERROR 0 /**< Unsupported in emulated serial port. */
#else
#error unknown architecture
#define SERRF_TX (SERRF_TXTIMEOUT)
-/*!
+/**
* \name Parity settings for ser_setparity().
*
* \note Values are AVR-specific for performance reasons.
#define SER_PARITY_ODD 3
/*\}*/
-/*!
+/**
* \name Serial hw numbers
*
* \{
#else
#error unknown architecture
#endif
- SER_CNT /*!< Number of serial ports */
+ SER_CNT /**< Number of serial ports */
};
/*\}*/
struct SerialHardware;
-/*! Human-readable serial error descriptions */
+/** Human-readable serial error descriptions */
extern const char * const serial_errors[8];
-/*! Serial handle structure */
+/** Serial handle structure */
typedef struct Serial
{
- /*! Physical port number */
+ /** Physical port number */
unsigned int unit;
#ifdef _DEBUG
bool is_open;
#endif
- /*!
+ /**
* \name Transmit and receive FIFOs.
*
* Declared volatile because handled asinchronously by interrupts.
mtime_t txtimeout;
#endif
- /*! Holds the flags defined above. Will be 0 when no errors have occurred. */
+ /** Holds the flags defined above. Will be 0 when no errors have occurred. */
serstatus_t status;
- /*! Low-level interface to hardware. */
+ /** Low-level interface to hardware. */
struct SerialHardware* hw;
} Serial;
extern struct Serial *ser_open(unsigned int unit);
extern void ser_close(struct Serial *port);
-/*!
+/**
* \name Additional functions implemented as macros
*
* \{
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.32 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.31 2006/05/18 00:37:29 bernie
*#* Use hw_ser.h instead of ubiquitous hw.h.
*#*
#if !CONFIG_SER_HWHANDSHAKE
- /*!
+ /**
* \name Hardware handshake (RTS/CTS).
* \{
*/
#define RTS_ON do {} while (0)
#define RTS_OFF do {} while (0)
#define IS_CTS_ON true
- #define EIMSKF_CTS 0 /*!< Dummy value, must be overridden */
+ #define EIMSKF_CTS 0 /**< Dummy value, must be overridden */
/*\}*/
#endif
-/*!
+/**
* \name Overridable serial bus hooks
*
* These can be redefined in hw.h to implement
* \{
*/
#ifndef SER_UART0_BUS_TXINIT
- /*!
+ /**
* Default TXINIT macro - invoked in uart0_init()
*
* - Enable both the receiver and the transmitter
#endif
#ifndef SER_UART0_BUS_TXBEGIN
- /*!
+ /**
* Invoked before starting a transmission
*
* - Enable both the receiver and the transmitter
#endif
#ifndef SER_UART0_BUS_TXCHAR
- /*!
+ /**
* Invoked to send one character.
*/
#define SER_UART0_BUS_TXCHAR(c) do { \
#endif
#ifndef SER_UART0_BUS_TXEND
- /*!
+ /**
* Invoked as soon as the txfifo becomes empty
*
* - Keep both the receiver and the transmitter enabled
#endif
#ifndef SER_UART0_BUS_TXOFF
- /*!
+ /**
* \def SER_UART0_BUS_TXOFF
*
* Invoked after the last character has been transmitted
#endif
#ifndef SER_UART1_BUS_TXINIT
- /*! \sa SER_UART0_BUS_TXINIT */
+ /** \sa SER_UART0_BUS_TXINIT */
#define SER_UART1_BUS_TXINIT do { \
UCSR1B = BV(RXCIE) | BV(RXEN) | BV(TXEN); \
} while (0)
#endif
#ifndef SER_UART1_BUS_TXBEGIN
- /*! \sa SER_UART0_BUS_TXBEGIN */
+ /** \sa SER_UART0_BUS_TXBEGIN */
#define SER_UART1_BUS_TXBEGIN do { \
UCSR1B = BV(RXCIE) | BV(UDRIE) | BV(RXEN) | BV(TXEN); \
} while (0)
#endif
#ifndef SER_UART1_BUS_TXCHAR
- /*! \sa SER_UART0_BUS_TXCHAR */
+ /** \sa SER_UART0_BUS_TXCHAR */
#define SER_UART1_BUS_TXCHAR(c) do { \
UDR1 = (c); \
} while (0)
#endif
#ifndef SER_UART1_BUS_TXEND
- /*! \sa SER_UART0_BUS_TXEND */
+ /** \sa SER_UART0_BUS_TXEND */
#define SER_UART1_BUS_TXEND do { \
UCSR1B = BV(RXCIE) | BV(RXEN) | BV(TXEN); \
} while (0)
#endif
#ifndef SER_UART1_BUS_TXOFF
- /*!
+ /**
* \def SER_UART1_BUS_TXOFF
*
* \see SER_UART0_BUS_TXOFF
/*\}*/
-/*!
+/**
* \name Overridable SPI hooks
*
* These can be redefined in hw.h to implement
* \{
*/
#ifndef SER_SPI_BUS_TXINIT
- /*!
+ /**
* Default TXINIT macro - invoked in spi_init()
* The default is no action.
*/
#endif
#ifndef SER_SPI_BUS_TXCLOSE
- /*!
+ /**
* Invoked after the last character has been transmitted.
* The default is no action.
*/
#endif
-/*!
+/**
* \def CONFIG_SER_STROBE
*
* This is a debug facility that can be used to
static unsigned char spi_rxbuffer[CONFIG_SPI_RXBUFSIZE];
-/*!
+/**
* Internal hardware state structure
*
* The \a sending variable is true while the transmission
#if CONFIG_SER_HWHANDSHAKE
-//! This interrupt is triggered when the CTS line goes high
+/// This interrupt is triggered when the CTS line goes high
SIGNAL(SIG_CTS)
{
// Re-enable UDR empty interrupt and TX, then disable CTS interrupt
#endif // CONFIG_SER_HWHANDSHAKE
-/*!
+/**
* Serial 0 TX interrupt handler
*/
SIGNAL(SIG_UART0_DATA)
}
#ifdef SER_UART0_BUS_TXOFF
-/*!
+/**
* Serial port 0 TX complete interrupt handler.
*
* This IRQ is usually disabled. The UDR-empty interrupt
#if AVR_HAS_UART1
-/*!
+/**
* Serial 1 TX interrupt handler
*/
SIGNAL(SIG_UART1_DATA)
}
#ifdef SER_UART1_BUS_TXOFF
-/*!
+/**
* Serial port 1 TX complete interrupt handler.
*
* \sa port 0 TX complete handler.
#endif // AVR_HAS_UART1
-/*!
+/**
* Serial 0 RX complete interrupt handler.
*
* This handler is interruptible.
#if AVR_HAS_UART1
-/*!
+/**
* Serial 1 RX complete interrupt handler.
*
* This handler is interruptible.
#endif // AVR_HAS_UART1
-/*!
+/**
* SPI interrupt handler
*/
SIGNAL(SIG_SPI)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.14 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.13 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright (C) 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2006/02/17 22:23:06 bernie
*#* Update POSIX serial emulator.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/02/17 22:28:00 bernie
*#* Rename ser_emul.c to ser_posix.c.
*#*
static unsigned char uart1_rxbuffer[CONFIG_UART1_RXBUFSIZE];
-/*!
+/**
* Internal state structure
*/
struct EmulSerial
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/04/12 01:37:50 bernie
*#* Import into DevLib.
*#*
#include <avr/io.h>
-/*!
+/**
* Send a character over the serial line.
*
* \return the character sent.
}
-/*!
+/**
* Get a character from the serial line.
* If ther is no character in the buffer this function wait until
* one is received (no timeout).
}
-/*!
+/**
* Get a character from the receiver buffer
* If the buffer is empty, ser_getchar_nowait() returns
* immediatly EOF.
{
}
-/*!
+/**
* Set the baudrate.
*/
void _ser_setbaudrate(unsigned long rate)
UBRR0L = (period);
}
-/*!
+/**
* Send a string.
*/
int _ser_print(const char *s)
UCSR0C |= (UCSR0C & ~(BV(UPM1) | BV(UPM0))) | (parity << UPM0);
}
-/*!
+/**
* Dummy functions.
*/
void _ser_purge(void)
while (_ser_getchar_nowait() != EOF) {}
}
-/*!
+/**
* Initialize serial.
*/
struct Serial * _ser_open(void)
}
-/*!
+/**
* Clean up serial port, disabling the associated hardware.
*/
void _ser_close(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/04/12 01:37:50 bernie
*#* Import into DevLib.
*#*
typedef uint8_t serstatus_t;
/* Software errors */
- #define SERRF_RXFIFOOVERRUN BV(0) /*!< Rx FIFO buffer overrun */
- #define SERRF_RXTIMEOUT BV(5) /*!< Receive timeout */
- #define SERRF_TXTIMEOUT BV(6) /*!< Transmit timeout */
+ #define SERRF_RXFIFOOVERRUN BV(0) /**< Rx FIFO buffer overrun */
+ #define SERRF_RXTIMEOUT BV(5) /**< Receive timeout */
+ #define SERRF_TXTIMEOUT BV(6) /**< Transmit timeout */
/* Hardware errors */
- #define SERRF_RXSROVERRUN BV(3) /*!< Rx shift register overrun */
- #define SERRF_FRAMEERROR BV(4) /*!< Stop bit missing */
- #define SERRF_PARITYERROR BV(7) /*!< Parity error */
+ #define SERRF_RXSROVERRUN BV(3) /**< Rx shift register overrun */
+ #define SERRF_FRAMEERROR BV(4) /**< Stop bit missing */
+ #define SERRF_PARITYERROR BV(7) /**< Parity error */
#else
#error unknown architecture
#endif
/*\}*/
-/*!
+/**
* \name Serial hw numbers
*
* \{
#else
#error unknown architecture
#endif
- SER_CNT /*!< Number of serial ports */
+ SER_CNT /**< Number of serial ports */
};
/*\}*/
#endif
-/*! \name Parity settings for ser_setparity() */
+/** \name Parity settings for ser_setparity() */
/*\{*/
#define SER_PARITY_NONE 0
#define SER_PARITY_EVEN 2
/*\}*/
-/*! Serial handle structure */
+/** Serial handle structure */
struct Serial;
/* Function prototypes */
extern struct Serial *_ser_open(void);
extern void _ser_close(void);
-/*!
+/**
* \name Functions implemented as macros
*
* \{
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 17:59:47 bernie
*#* Import into DevLib.
*#*
#include <cfg/debug.h>
-/*! Interval at which thermo control is performed. */
+/** Interval at which thermo control is performed. */
#define THERMO_INTERVAL_MS 100
-/*! Number of different samples we interpolate over to get the hifi temperature. */
+/** Number of different samples we interpolate over to get the hifi temperature. */
#define THERMO_HIFI_NUM_SAMPLES 10
-/*! Timer for thermo-regulation. */
+/** Timer for thermo-regulation. */
static Timer thermo_timer;
typedef struct ThermoControlDev
ticks_t expire;
} ThermoControlDev;
-/*! Array of thermo-devices. */
+/** Array of thermo-devices. */
ThermoControlDev devs[THERMO_CNT];
-/*!
+/**
* Return the status of the specific \a dev thermo-device.
*/
thermostatus_t thermo_status(ThermoDev dev)
}
-/*!
+/**
* Do a single thermo control for device \a dev.
*/
static void thermo_do(ThermoDev index)
}
-/*!
+/**
* Thermo soft interrupt.
*/
static void thermo_softint(void)
}
-/*!
+/**
* Set the target temperature \a temperature for a specific \a dev thermo-device.
*/
void thermo_setTarget(ThermoDev dev, deg_t temperature)
kprintf("setTarget dev[%d], T[%d.%d]\n", dev, temperature / 10, temperature % 10);
}
-/*!
+/**
* Starts a thermo-regulation for channel \a dev.
*/
void thermo_start(ThermoDev dev)
devs[dev].expire = timer_clock() + thermo_hw_timeout(dev);
}
-/*!
+/**
* Stops a thermo-regulation for channel \a dev.
*/
void thermo_stop(ThermoDev dev)
}
-/*!
+/**
* Clear errors for channel \a dev.
*/
void thermo_clearErrors(ThermoDev dev)
}
-/*!
+/**
* Read the temperature of the thermo-device \a dev using mobile mean.
*/
deg_t thermo_read_temperature(ThermoDev dev)
}
-/*!
+/**
* Init thermo-control and associated hw.
*/
void thermo_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 17:59:47 bernie
*#* Import into DevLib.
*#*
void thermo_init(void);
-/*!
+/**
* Set the target temperature at which a given device should be kept.
*
* \param dev Device
*/
void thermo_setTarget(ThermoDev dev, deg_t temperature);
-/*! Start thermo control for a certain device \a dev */
+/** Start thermo control for a certain device \a dev */
void thermo_start(ThermoDev dev);
-/*! Stop thermo control for a certain device \a dev */
+/** Stop thermo control for a certain device \a dev */
void thermo_stop(ThermoDev dev);
-/*! Clear errors for channel \a dev */
+/** Clear errors for channel \a dev */
void thermo_clearErrors(ThermoDev dev);
-/*! Return the status of the specific \a dev thermo-device. */
+/** Return the status of the specific \a dev thermo-device. */
thermostatus_t thermo_status(ThermoDev dev);
-/*!
+/**
* Return the current temperature of a device currently under thermo
* control.
*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.31 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.30 2006/02/24 00:26:49 bernie
*#* Fixes for CONFIG_KERNEL.
*#*
#endif
-/*!
+/**
* \def CONFIG_TIMER_STROBE
*
* This is a debug facility that can be used to
#endif
-//! Master system clock (1 tick accuracy)
+/// Master system clock (1 tick accuracy)
volatile ticks_t _clock;
#ifndef CONFIG_TIMER_DISABLE_EVENTS
-/*!
+/**
* List of active asynchronous timers.
*/
REGISTER static List timers_queue;
-/*!
+/**
* Add the specified timer to the software timer service queue.
* When the delay indicated by the timer expires, the timer
* device will execute the event associated with it.
}
-/*!
+/**
* Remove a timer from the timer queue before it has expired.
*/
Timer *timer_abort(Timer *timer)
#ifndef CONFIG_TIMER_DISABLE_UDELAY
-/*!
+/**
* Busy wait until the specified amount of high-precision ticks have elapsed.
*
* \note This function is interrupt safe, the only
}
}
-/*!
+/**
* Wait for the specified amount of time (expressed in microseconds).
*
* \bug In AVR arch the maximum amount of time that can be used as
#endif /* CONFIG_TIMER_DISABLE_UDELAY */
-/*!
+/**
* Timer interrupt handler. Find soft timers expired and
* trigger corresponding events.
*/
MOD_DEFINE(timer)
-/*!
+/**
* Initialize timer
*/
void timer_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.31 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.30 2006/02/24 00:26:49 bernie
*#* Fixes for CONFIG_KERNEL.
*#*
extern volatile ticks_t _clock;
-/*!
+/**
* \brief Return the system tick counter (expressed in ticks)
*
* The result is guaranteed to increment monotonically,
return result;
}
-/*!
+/**
* Faster version of timer_clock(), to be called only when the timer
* interrupt is disabled (DISABLE_INTS) or overridden by a
* higher-priority or non-nesting interrupt.
return _clock;
}
-/*! Convert \a ms [ms] to ticks. */
+/** Convert \a ms [ms] to ticks. */
INLINE ticks_t ms_to_ticks(mtime_t ms)
{
#if TIMER_TICKS_PER_SEC < 1000
#endif
}
-/*! Convert \a us [us] to ticks. */
+/** Convert \a us [us] to ticks. */
INLINE ticks_t us_to_ticks(utime_t us)
{
#if TIMER_TICKS_PER_SEC < 1000
#endif
}
-/*! Convert \a ticks [ticks] to ms. */
+/** Convert \a ticks [ticks] to ms. */
INLINE mtime_t ticks_to_ms(ticks_t ticks)
{
#if TIMER_TICKS_PER_SEC < 1000
#endif
}
-/*! Convert \a ticks [ticks] to us. */
+/** Convert \a ticks [ticks] to us. */
INLINE utime_t ticks_to_us(ticks_t ticks)
{
#if TIMER_TICKS_PER_SEC < 1000
#endif
}
-/*! Convert \a us [us] to hpticks */
+/** Convert \a us [us] to hpticks */
INLINE hptime_t us_to_hptime(utime_t us)
{
#if TIMER_HW_HPTICKS_PER_SEC > 10000000UL
#endif
}
-/*! Convert \a hpticks [hptime] to usec */
+/** Convert \a hpticks [hptime] to usec */
INLINE utime_t hptime_to_us(hptime_t hpticks)
{
#if TIMER_HW_HPTICKS_PER_SEC < 100000UL
#include <mware/event.h>
-/*!
+/**
* The timer driver supports multiple synchronous timers
* that can trigger an event when they expire.
*
*/
typedef struct Timer
{
- Node link; /*!< Link into timers queue */
- ticks_t _delay; /*!< Timer delay in ms */
- ticks_t tick; /*!< Timer will expire at this tick */
- Event expire; /*!< Event to execute when the timer expires */
+ Node link; /**< Link into timers queue */
+ ticks_t _delay; /**< Timer delay in ms */
+ ticks_t tick; /**< Timer will expire at this tick */
+ Event expire; /**< Event to execute when the timer expires */
DB(uint16_t magic;)
} Timer;
-/*! Timer is active when Timer.magic contains this value (for debugging purposes). */
+/** Timer is active when Timer.magic contains this value (for debugging purposes). */
#define TIMER_MAGIC_ACTIVE 0xABBA
#define TIMER_MAGIC_INACTIVE 0xBAAB
extern void timer_add(Timer *timer);
extern Timer *timer_abort(Timer *timer);
-/*! Set the timer so that it calls an user hook when it expires */
+/** Set the timer so that it calls an user hook when it expires */
INLINE void timer_set_event_softint(Timer *timer, Hook func, iptr_t user_data)
{
event_initSoftInt(&timer->expire, func, user_data);
}
-/*! Set the timer delay (the time before the event will be triggered) */
+/** Set the timer delay (the time before the event will be triggered) */
INLINE void timer_setDelay(Timer *timer, ticks_t delay)
{
timer->_delay = delay;
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
-/*! Set the timer so that it sends a signal when it expires */
+/** Set the timer so that it sends a signal when it expires */
INLINE void timer_set_event_signal(Timer *timer, struct Process *proc, sigmask_t sigs)
{
event_initSignal(&timer->expire, proc, sigs);
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/06/12 21:37:02 marco
*#* implemented some commands (ver and sleep)
*#*
#include <avr/interrupt.h>
#include <avr/io.h>
-/*! HW dependent timer initialization */
+/** HW dependent timer initialization */
#if (CONFIG_TIMER == TIMER_ON_OUTPUT_COMPARE0)
static void timer_hw_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.28 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.27 2006/05/18 00:38:24 bernie
*#* Use hw_cpu.h instead of ubiquitous hw.h.
*#*
#include <cfg/compiler.h> /* uint8_t */
#include <hw_cpu.h> /* CLOCK_FREQ */
-/*!
+/**
* \name Values for CONFIG_TIMER.
*
* Select which hardware timer interrupt to use for system clock and softtimers.
#define TIMER_TICKS_PER_SEC 1000
#define TIMER_HW_CNT OCR_DIVISOR
- //! Type of time expressed in ticks of the hardware high-precision timer
+ /// Type of time expressed in ticks of the hardware high-precision timer
typedef uint8_t hptime_t;
#elif (CONFIG_TIMER == TIMER_ON_OVERFLOW1)
#define TIMER_PRESCALER 1
#define TIMER_HW_BITS 8
- /*! This value is the maximum in overflow based timers. */
+ /** This value is the maximum in overflow based timers. */
#define TIMER_HW_CNT (1 << TIMER_HW_BITS)
#define DEFINE_TIMER_ISR SIGNAL(SIG_OVERFLOW1)
#define TIMER_TICKS_PER_SEC ((TIMER_HW_HPTICKS_PER_SEC + TIMER_HW_CNT / 2) / TIMER_HW_CNT)
- //! Type of time expressed in ticks of the hardware high precision timer
+ /// Type of time expressed in ticks of the hardware high precision timer
typedef uint16_t hptime_t;
#elif (CONFIG_TIMER == TIMER_ON_OUTPUT_COMPARE2)
#define TIMER_HW_BITS 8
#define DEFINE_TIMER_ISR SIGNAL(SIG_OUTPUT_COMPARE2)
#define TIMER_TICKS_PER_SEC 1000
- /*! Value for OCR register in output-compare based timers. */
+ /** Value for OCR register in output-compare based timers. */
#define TIMER_HW_CNT OCR_DIVISOR
- //! Type of time expressed in ticks of the hardware high precision timer
+ /// Type of time expressed in ticks of the hardware high precision timer
typedef uint8_t hptime_t;
#elif (CONFIG_TIMER == TIMER_ON_OVERFLOW3)
#define TIMER_PRESCALER 1
#define TIMER_HW_BITS 8
- /*! This value is the maximum in overflow based timers. */
+ /** This value is the maximum in overflow based timers. */
#define TIMER_HW_CNT (1 << TIMER_HW_BITS)
#define DEFINE_TIMER_ISR SIGNAL(SIG_OVERFLOW3)
#define TIMER_TICKS_PER_SEC ((TIMER_HW_HPTICKS_PER_SEC + TIMER_HW_CNT / 2) / TIMER_HW_CNT)
- //! Type of time expressed in ticks of the hardware high precision timer
+ /// Type of time expressed in ticks of the hardware high precision timer
typedef uint16_t hptime_t;
#else
#endif /* CONFIG_TIMER */
-/*! Frequency of the hardware high precision timer. */
+/** Frequency of the hardware high precision timer. */
#define TIMER_HW_HPTICKS_PER_SEC ((CLOCK_FREQ + TIMER_PRESCALER / 2) / TIMER_PRESCALER)
-/*!
+/**
* System timer: additional division after the prescaler
* 12288000 / 64 / 192 (0..191) = 1 ms
*/
#define OCR_DIVISOR (((CLOCK_FREQ + TIMER_PRESCALER / 2) / TIMER_PRESCALER + TIMER_TICKS_PER_SEC / 2) / TIMER_TICKS_PER_SEC - 1)
-/*! Not needed, IRQ timer flag cleared automatically */
+/** Not needed, IRQ timer flag cleared automatically */
#define timer_hw_irq() do {} while (0)
#error This code must be revised for the new timer API
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2006/02/21 21:28:02 bernie
*#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
*#*
#define REG_SYSTEM_TIMER PP_CAT(REG_TIMER_, SYSTEM_TIMER)
#define SYSTEM_TIMER_IRQ_VECTOR PP_CAT(IRQ_TIMER_, SYSTEM_TIMER)
-//! Prescaler for the system timer
+/// Prescaler for the system timer
#define TIMER_PRESCALER 16
-//! Frequency of the hardware high precision timer
+/// Frequency of the hardware high precision timer
#define TIMER_HW_HPTICKS_PER_SEC (IPBUS_FREQ / TIMER_PRESCALER)
-//! Type of time expressed in ticks of the hardware high precision timer
+/// Type of time expressed in ticks of the hardware high precision timer
typedef uint16_t hptime_t;
static void system_timer_isr(UNUSED(iptr_t, arg));
#error This code must be revised for the new timer API
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/02/21 21:28:02 bernie
*#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
*#*
#ifndef TIMER_I196_H
#define TIMER_I196_H
-/*!
+/**
* Retrigger TIMER2, adjusting the time to account for
* the interrupt prologue latency.
*/
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2006/02/21 21:28:02 bernie
*#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/23 11:03:33 bernie
*#* Documentation fix.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2006/05/28 12:17:57 bernie
*#* Drop almost all the Qt3 cruft.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/21 21:28:02 bernie
*#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/04/12 01:37:50 bernie
*#* Import into DevLib.
*#*
#define TIMER_PRESCALER 64UL
#define TIMER_DELAY_1MS (255 - CLOCK_FREQ / TIMER_PRESCALER / MS_PER_SEC)
-/*!
+/**
* Wait \a time ms using timer 0.
*
*/
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/04/12 01:37:50 bernie
*#* Import into DevLib.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/21 21:28:02 bernie
*#* New time handling based on TIMER_TICKS_PER_SEC to support slow timers with ticks longer than 1ms.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/03/20 17:49:50 bernie
*#* Make the TWI driver more generic to work with devices other than EEPROMS.
*#*
#define READ_BIT BV(0)
-/*!
+/**
* Send START condition on the bus.
*
* \return true on success, false otherwise.
}
-/*!
+/**
* Send START condition and select slave for write.
* \c id is the device id comprehensive of address left shifted by 1.
* The LSB of \c id is ignored and reset to 0 for write operation.
}
-/*!
+/**
* Send START condition and select slave for read.
* \c id is the device id comprehensive of address left shifted by 1.
* The LSB of \c id is ignored and set to 1 for read operation.
}
-/*!
+/**
* Send STOP condition.
*/
void twi_stop(void)
}
-/*!
+/**
* Put a single byte in master transmitter mode
* to the selected slave device through the TWI bus.
*
}
-/*!
+/**
* Send a sequence of bytes in master transmitter mode
* to the selected slave device through the TWI bus.
*
}
-/*!
+/**
* Receive a sequence of one or more bytes from the
* selected slave device in master receive mode through
* the TWI bus.
}
-/*!
+/**
* Initialize TWI module.
*/
void twi_init(void)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2006/03/20 17:49:49 bernie
*#* Make the TWI driver more generic to work with devices other than EEPROMS.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.11 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.10 2006/05/18 00:38:42 bernie
*#* Work around missing ARCH_FREERTOS symbol.
*#*
#endif
#endif /* CONFIG_WATCHDOG */
-/*!
+/**
* Reset the watchdog timer.
*/
INLINE void wdt_reset(void)
#endif /* CONFIG_WATCHDOG */
}
-/*!
+/**
* Set watchdog timer timeout.
*
* \param timeout 0: 16.3ms, 7: 2.1s
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <dt/dnotifier.h>
#include <mware/list.h>
-/*!
+/**
* Default update used to notify target: notify all trasparently all
* targets in the list.
*/
dnotify_targets(n, tag, val);
}
-/*!
+/**
* Init.
*/
void notifier_init(DNotifier *n)
LIST_INIT(&n->targets);
}
-/*!
+/**
* Search in the map a tag and a val corresponding to the ones supplied.
* If a match is found change them to the corresponding ones in the map.
* If map is NULL the filter is trasparent and all messages sent to filter
}
-/*!
+/**
* Search in the table a tag corresponding to the one supplied and a val
* that has at least the mask map supplied bits to one.
* If a match is found change them to the corresponding ones in the map.
#define FILTER_MAGIC_ACTIVE 0xAA
-/*!
+/**
* Init filter.
* If \a masked is true, all the fields value in \a map must be interpreted as a mask of bits.
*/
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
typedef void (* update_func_ptr)(struct DNotifier *, dtag_t, dval_t);
typedef void (* update_filter_ptr)(struct DFilter *, dtag_t, dval_t);
-/*!
+/**
* Base object for receive and forward messages.
* It contains an update function used to update itslef and a list to
* notify other DNotifer eventually connected.
*/
typedef struct DNotifier
{
- //! Receive new attributes from other notifiers.
+ /// Receive new attributes from other notifiers.
update_func_ptr update;
- //! List of target notifiers to set new attributes to.
+ /// List of target notifiers to set new attributes to.
List targets;
} DNotifier;
-/*!
+/**
* Map for messages.
* Used to translate src message to dst message.
*/
} DFilterMap;
-/*!
+/**
* A filter is an interface between two notifier.
* It can translate messages between them through a map (if it is not null).
*/
typedef struct DFilter
{
- //! Allow creating a list of dfilter objects.
+ /// Allow creating a list of dfilter objects.
Node link;
- //! Target of the filter
+ /// Target of the filter
DNotifier *target;
- //! Update function called by the source dnotifier
+ /// Update function called by the source dnotifier
update_filter_ptr update;
- //!Map for translating messages for target
+ ///Map for translating messages for target
const DFilterMap *map;
- //!Used in debug to prevent inserting this filter in more than one list
+ ///Used in debug to prevent inserting this filter in more than one list
DB(uint8_t magic;)
} DFilter;
-//! Type for filter-mask checking
+/// Type for filter-mask checking
typedef uint16_t dfilter_mask_t;
-//! Filter init
+/// Filter init
void filter_init(DFilter *f, const DFilterMap *map, bool masked, DNotifier *source, DNotifier *target);
-//! Filter update function without masking capabilities.
+/// Filter update function without masking capabilities.
void filter_update(DFilter *f, dtag_t tag, dval_t val);
-//! Filter update function with masking capabilities.
+/// Filter update function with masking capabilities.
void filter_mask_update(DFilter *f, dtag_t tag, dval_t val);
-//! Notifier init
+/// Notifier init
void notifier_init(DNotifier *n);
-/*!
+/**
* Macro to notify the target object.
*/
INLINE void dnotify(DNotifier *target, dtag_t tag, dval_t val)
target->update(target, tag, val);
}
-/*!
+/**
* Macro to notify all the targets of \a target object.
*/
INLINE void dnotify_targets(DNotifier *target, dtag_t tag, dval_t val)
}
-/*!
+/**
* Macro that connect \a src notifier to \a tgt using \a map and passing \a opt for filtering option.
* It declares a static filter to achieve connection and messages translation.
* \note Due its static filter declaration, DCONNECT MUST NOT be used inside loops or in functions called multiple times.
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <cfg/macros.h>
-/*! Type for values associated with tags. */
+/** Type for values associated with tags. */
typedef iptr_t dval_t;
-/*! Type for constant values associated with tags. */
+/** Type for constant values associated with tags. */
typedef const_iptr_t const_dval_t;
-/*! Type for tag */
+/** Type for tag */
typedef enum dtag_t
{
TAG_END = 0,
TAG_ERROR,
} dtag_t;
-/*! This is the basic message structure used by all dnotifiers. */
+/** This is the basic message structure used by all dnotifiers. */
typedef struct DTagItem
{
dtag_t tag;
dval_t val;
} DTagItem;
-/*! Marker to indicate the end of a map for message filtering/translating */
+/** Marker to indicate the end of a map for message filtering/translating */
#define TAG_END_MARKER {{TAG_END, 0}, {TAG_END, 0}}
#endif
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <dt/dwidget.h>
#include <dt/dnotifier.h>
-/*!
+/**
* Init the widget of \a pos and \a size on the drawing \a context.
*/
void widget_init(DWidget *w, dpos_t pos, dpos_t size, dcontext_t *context)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <dt/dnotifier.h>
#include <cfg/compiler.h>
-/*! Widget position. */
+/** Widget position. */
typedef uint8_t dpos_t;
-/*! Widget drawing context. */
+/** Widget drawing context. */
typedef iptr_t dcontext_t;
-/*! Widget definition. */
+/** Widget definition. */
typedef struct DWidget
{
DNotifier notifier;
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <drv/lcd_text.h>
-/*!
+/**
* Init widget.
*/
void editbool_init(DEditBool *e, dpos_t pos, dpos_t size, dcontext_t *context, bool *value, const char *true_string, const char *false_string)
e->draw = editbool_draw;
}
-/*!
+/**
* Handle the messages (edit the bool).
*/
void editbool_update(DEditBool *e, dtag_t tag, dval_t _val)
}
}
-/*!
+/**
* Draw the string on the context.
*/
void editbool_draw(DEditBool *e)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#include <drv/lcd_text.h>
-/*!
+/**
* Init.
*/
void editint_init(DEditInt *e, dpos_t pos, dpos_t size, dcontext_t *context, int *value, int min, int max)
e->draw = editint_draw;
}
-/*!
+/**
* Handle the messages (edit the int).
*/
void editint_update(DEditInt *e, dtag_t tag, dval_t _val)
}
}
-/*!
+/**
* Draw the integer on the context.
*/
void editint_draw(DEditInt *e)
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/11/04 18:26:38 bernie
*#* Import into DevLib.
*#*
#define EDIS_CURSORLEFT BV(0)
#define EDIS_WRAP BV(1)
-/*! Type for edit style */
+/** Type for edit style */
typedef uint16_t dstyle_t;
typedef struct DEditInt
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/05/27 22:30:22 bernie
*#* Move 6x8 font to fonts/.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.11 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.10 2006/05/27 17:21:15 bernie
*#* Factor out, simplify and document clipping.
*#*
#endif
-/*!
+/**
* Initialize a Bitmap structure with the provided parameters.
*
* \note The pen position is reset to the origin.
}
-/*!
+/**
* Clear the whole bitmap surface to the background color.
*
* \note This function does \b not update the current pen position.
#include <avr/pgmspace.h> /* FIXME: memcpy_P() */
-/*!
+/**
* Copy a raster picture located in program memory in the bitmap.
* The size of the raster to copy *must* be the same of the raster bitmap.
*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2005/11/27 23:33:29 bernie
*#* Reorder includes.
*#*
}
-/*!
+/**
* Draw the chart axes
*/
void chart_drawAxis(Bitmap *bm)
}
-/*!
+/**
* Draw a set of \a curve_cnt connected segments, whose Y coordinates
* are identified by the \a curve_y array and X-coordinates are
* are evenly spaced by one virtual unit.
}
-/*!
+/**
* Disegna dei dot in corrispondenza delle coppie (dotsx[i];dotsy[i])
* Se dotsx e' NULL, i punti vengono disegnati ad intervalli regolari.
*/
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2005/11/27 23:36:18 bernie
*#* Use appconfig.h instead of cfg/config.h.
*#*
#include <gfx/gfx.h> /* vcoord_t */
#include <appconfig.h> /* CONFIG_ stuff */
-/*!
+/**
* \name Width/height of the small ticks drawn over the axes
* \{
*/
#define TICKS_WIDTH 2
/*\}*/
-/*!
+/**
* \name Chart frame dimensions
* \{
*/
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/05/27 22:31:34 bernie
*#* Switch to a smaller default fount.
*#*
-/*!
+/**
* \file
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
* Copyright 1999 Bernardo Innocenti <bernie@develer.com>
/*#*
*#* $Log$
+ *#* Revision 1.17 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.16 2006/05/27 17:17:34 bernie
*#* Optimize away divisions in RAST_ADDR/MASK macros.
*#*
EXTERN_C_BEGIN
-/*! Common type for coordinates expressed in pixel units */
+/** Common type for coordinates expressed in pixel units */
typedef int coord_t;
typedef unsigned int ucoord_t;
#if CONFIG_GFX_VCOORDS
-/*! Common type for coordinates expressed in logical units */
+/** Common type for coordinates expressed in logical units */
typedef float vcoord_t;
#endif /* CONFIG_GFX_VCOORDS */
*/
typedef struct Bitmap
{
- uint8_t *raster; /*!< Pointer to byte array to hold the data */
- coord_t width, height; /*!< Width/Height in pixels */
- coord_t stride; /*!< Bytes per row. */
- coord_t penX, penY; /*!< Current pen position MoveTo()/LineTo() */
+ uint8_t *raster; /**< Pointer to byte array to hold the data */
+ coord_t width, height; /**< Width/Height in pixels */
+ coord_t stride; /**< Bytes per row. */
+ coord_t penX, penY; /**< Current pen position MoveTo()/LineTo() */
- Rect cr; /*!< Clip drawing inside this rectangle */
+ Rect cr; /**< Clip drawing inside this rectangle */
#if CONFIG_GFX_TEXT
const struct Font *font;/**< Current font for text rendering. */
uint8_t styles;
#endif
#if CONFIG_GFX_VCOORDS
- /*!
+ /**
* \name Logical coordinate system
* \{
*/
*/
typedef struct Image
{
- const uint8_t *raster; /*!< Pointer to byte array to hold the data. */
- coord_t width; /*!< Raster width in pixels. */
- coord_t height; /*!< Raster height in pixels. */
- coord_t stride; /*!< Bytes per row. */
+ const uint8_t *raster; /**< Pointer to byte array to hold the data. */
+ coord_t width; /**< Raster width in pixels. */
+ coord_t height; /**< Raster height in pixels. */
+ coord_t stride; /**< Bytes per row. */
} Image;
#if CONFIG_BITMAP_FMT == BITMAP_FMT_PLANAR_H_MSB
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/05/27 17:17:34 bernie
*#* Optimize away divisions in RAST_ADDR/MASK macros.
*#*
#define BM_ADDR(bm, x, y) RAST_ADDR((bm)->raster, (x), (y), (bm)->stride)
#define BM_MASK(bm, x, y) RAST_MASK((bm)->raster, (x), (y))
-/*!
+/**
* Plot a pixel in bitmap \a bm.
*
* \note bm is evaluated twice.
#define BM_PLOT(bm, x, y) \
( *BM_ADDR(bm, x, y) |= BM_MASK(bm, x, y) )
-/*!
+/**
* Clear a pixel in bitmap \a bm.
*
* \note bm is evaluated twice.
#define BM_CLEAR(bm, x, y) \
( *BM_ADDR(bm, x, y) &= ~BM_MASK(bm, x, y) )
-/*!
+/**
* Set a pixel in bitmap \a bm to the specified color.
*
* \note bm is evaluated twice.
*p = (*p & ~mask) | ((fg_pen) ? mask : 0); \
} while (0)
-/*!
+/**
* Get the value of the pixel in bitmap \a bm.
*
* \return The returned value is either 0 or 1.
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/02/10 12:26:58 bernie
*#* Check CONFIG_* constraints.
*#*
#error CONFIG_GFX_VCOORDS must be defined to either 0 or 1
#endif
-/*!
+/**
* Draw a sloped line without performing clipping.
*
* Parameters are the same of gfx_line().
}
}
-//! Helper routine for gfx_line().
+/// Helper routine for gfx_line().
static int gfx_findRegion(int x, int y, Rect *cr)
{
int code = 0;
gfx_lineUnclipped(bm, x1, y1, x2, y2);
}
-/*!
+/**
* Move the current pen position to the specified coordinates.
*
* The pen position is used for drawing operations such as
bm->penY = y;
}
-/*!
+/**
* Draw a line from the current pen position to the new coordinates.
*
* \note This function moves the current pen position to the
}
-/*!
+/**
* Draw the perimeter of an hollow rectangle.
*
* \note The bottom-right corner of the rectangle is drawn at (x2-1;y2-1).
}
-/*!
+/**
* Fill a rectangular area with \a color.
*
* \note The bottom-right border of the rectangle is not drawn.
}
-/*!
+/**
* Draw a filled rectangle.
*
* \note The bottom-right border of the rectangle is not drawn.
}
-/*!
+/**
* Clear a rectangular area.
*
* \note The bottom-right border of the rectangle is not cleared.
#if CONFIG_GFX_VCOORDS
-/*!
+/**
* Imposta gli estremi del sistema di coordinate cartesiane rispetto
* al rettangolo di clipping della bitmap.
*/
}
-/*!
+/**
* Transform a coordinate from the current reference system to a
* pixel offset within the bitmap.
*/
return bm->cr.xmin + (coord_t)((x - bm->orgX) * bm->scaleX);
}
-/*!
+/**
* Transform a coordinate from the current reference system to a
* pixel offset within the bitmap.
*/
}
-/*!
+/**
* Draw a line from (x1;y1) to (x2;y2).
*/
void gfx_vline(Bitmap *bm, vcoord_t x1, vcoord_t y1, vcoord_t x2, vcoord_t y2)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.13 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.12 2006/05/25 23:35:22 bernie
*#* Implement correct and faster clipping for algo text.
*#*
*/
static bool ansi_mode = false;
-/*!
+/**
* Move (imaginary) cursor to coordinates specified.
*/
void text_setCoord(struct Bitmap *bm, int x, int y)
}
-/*!
+/**
* Move (imaginary) cursor to column and row specified.
* Next text write will start a that row and col.
*/
}
-/*!
+/**
* Render char \a c on Bitmap \a bm.
*/
static int text_putglyph(char c, struct Bitmap *bm)
}
-/*!
+/**
* Render char \c c, with (currently) limited ANSI escapes
* emulation support and '\n' for newline.
*/
}
-/*!
+/**
* Clear the screen and reset cursor position
*/
void text_clear(struct Bitmap *bmp)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/04/27 05:39:24 bernie
*#* Enhance text rendering to arbitrary x,y coords.
*#*
#include <stdarg.h>
-/*!
+/**
* \name Style flags
* \see text_style()
* \{
| STYLEF_STRIKEOUT | STYLEF_TALL)
/*\}*/
-/*!
+/**
* \name Formatting flags for text rendering
* \see text_xprintf()
* \{
*/
-#define TEXT_NORMAL 0 /*!< Normal mode */
-#define TEXT_FILL BV(13) /*!< Fill rest of line with spaces */
-#define TEXT_CENTER BV(14) /*!< Center string in line */
-#define TEXT_RIGHT BV(15) /*!< Right aligned */
+#define TEXT_NORMAL 0 /**< Normal mode */
+#define TEXT_FILL BV(13) /**< Fill rest of line with spaces */
+#define TEXT_CENTER BV(14) /**< Center string in line */
+#define TEXT_RIGHT BV(15) /**< Right aligned */
/*\}*/
-/*! Escape sequences codes */
+/** Escape sequences codes */
#define ANSI_ESC_CLEARSCREEN 'c'
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2006/04/27 05:39:24 bernie
*#* Enhance text rendering to arbitrary x,y coords.
*#*
#include <stdarg.h>
#include <string.h> /* strlen() */
-/*!
+/**
* Render string \a str in Bitmap \a bm at current cursor position
*
* \note Text formatting functions are also available with an _P suffix
}
-/*!
+/**
* vprintf()-like formatter to render text in a Bitmap.
*
* Perform vprintf()-like formatting on the \a fmt format string using the
return PGM_FUNC(_formatted_write)(fmt, (void (*)(char, void *))text_putchar, bm, ap);
}
-/*!
+/**
* printf()-like formatter to render text in a Bitmap.
*
* Perform printf()-like formatting on the \a fmt format string.
return c;
}
-/*!
+/**
* Return the width in pixels of a vprintf()-formatted string.
*/
int PGM_FUNC(text_vwidthf)(
}
-/*!
+/**
* Return the width in pixels of a printf()-formatted string.
*/
int PGM_FUNC(text_widthf)(struct Bitmap *bm, const char * PGM_ATTR fmt, ...)
-/*!
+/**
* \file
* <!--
* Copyright 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:26 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/10 12:25:41 bernie
*#* Add missing header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/01/26 00:36:48 bernie
*#* Const correctness for some new functions.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2006/06/03 13:58:01 bernie
*#* Fix recursive timeout and add exit status information.
*#*
}
-/*!
+/**
* Set flags on a menuitem.
*
* \param menu Menu owner of the item to change.
}
-/*!
+/**
* Clear flags on a menuitem.
*
* \param menu Menu owner of the item to change.
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/06/03 13:58:02 bernie
*#* Fix recursive timeout and add exit status information.
*#*
*/
typedef struct MenuItem
{
- const_iptr_t label; /*!< Item label (ID or ptr to string, 0 to disable) */
- int flags; /*!< See MIF_#? definitions below */
- MenuHook hook; /*!< Callback function (NULL to terminate item list) */
- iptr_t userdata; /*!< User data to be passed back to the hook */
+ const_iptr_t label; /**< Item label (ID or ptr to string, 0 to disable) */
+ int flags; /**< See MIF_#? definitions below */
+ MenuHook hook; /**< Callback function (NULL to terminate item list) */
+ iptr_t userdata; /**< User data to be passed back to the hook */
} MenuItem;
/**
#define MIF_EXCLUDE_MASK 0x00FF /**< Mask for mutual exclusion map (shared with priority). */
#define MIF_PRI_MASK 0x00FF /**< Mask for priority value (shared with mutual exclusion). */
#define MIF_PRI(x) ((x) & MIF_PRI_MASK) /**< Set menu item priority. */
-#define MIF_EXCLUDE_0 BV(0) /*!< Exclude item 0 when this item is checked */
-#define MIF_EXCLUDE_1 BV(1) /*!< Exclude item 1 when this item is checked */
-#define MIF_EXCLUDE_2 BV(2) /*!< Exclude item 2 when this item is checked */
-#define MIF_EXCLUDE_3 BV(3) /*!< Exclude item 3 when this item is checked */
-#define MIF_EXCLUDE_4 BV(4) /*!< Exclude item 4 when this item is checked */
-#define MIF_EXCLUDE_5 BV(5) /*!< Exclude item 5 when this item is checked */
-#define MIF_EXCLUDE_6 BV(6) /*!< Exclude item 6 when this item is checked */
-#define MIF_EXCLUDE_7 BV(7) /*!< Exclude item 7 when this item is checked */
-#define MIF_CHECKED BV(8) /*!< Item is currently checked */
-#define MIF_CHECKIT BV(9) /*!< Automatically check this item when selected */
-#define MIF_TOGGLE BV(10) /*!< Toggle MIF_CHECKED when item is selected */
-#define MIF_HIDDEN BV(11) /*!< This menu item is not visible */
-#define MIF_DISABLED BV(12) /*!< This menu item is not visible */
-#define MIF_RAMLABEL BV(13) /*!< Item label is stored in RAM, not in program memory */
+#define MIF_EXCLUDE_0 BV(0) /**< Exclude item 0 when this item is checked */
+#define MIF_EXCLUDE_1 BV(1) /**< Exclude item 1 when this item is checked */
+#define MIF_EXCLUDE_2 BV(2) /**< Exclude item 2 when this item is checked */
+#define MIF_EXCLUDE_3 BV(3) /**< Exclude item 3 when this item is checked */
+#define MIF_EXCLUDE_4 BV(4) /**< Exclude item 4 when this item is checked */
+#define MIF_EXCLUDE_5 BV(5) /**< Exclude item 5 when this item is checked */
+#define MIF_EXCLUDE_6 BV(6) /**< Exclude item 6 when this item is checked */
+#define MIF_EXCLUDE_7 BV(7) /**< Exclude item 7 when this item is checked */
+#define MIF_CHECKED BV(8) /**< Item is currently checked */
+#define MIF_CHECKIT BV(9) /**< Automatically check this item when selected */
+#define MIF_TOGGLE BV(10) /**< Toggle MIF_CHECKED when item is selected */
+#define MIF_HIDDEN BV(11) /**< This menu item is not visible */
+#define MIF_DISABLED BV(12) /**< This menu item is not visible */
+#define MIF_RAMLABEL BV(13) /**< Item label is stored in RAM, not in program memory */
/* \} */
/**
*/
typedef struct Menu
{
- MenuItem *items; /*!< Array of items (end with a NULL hook) */
- const_iptr_t title; /*!< Menu title (ID or ptr to string, 0 to disable) */
- int flags; /*!< See MF_#? definitions below */
- struct Bitmap *bitmap; /*!< Bitmap where the menu is rendered */
- int selected; /*!< Initial selection (written to if #MF_SAVESEL is set). */
+ MenuItem *items; /**< Array of items (end with a NULL hook) */
+ const_iptr_t title; /**< Menu title (ID or ptr to string, 0 to disable) */
+ int flags; /**< See MF_#? definitions below */
+ struct Bitmap *bitmap; /**< Bitmap where the menu is rendered */
+ int selected; /**< Initial selection (written to if #MF_SAVESEL is set). */
} Menu;
/**
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/02/10 12:31:03 bernie
*#* Add templates for hw definitions.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/03/22 09:51:27 bernie
*#* Wrap C++ stuff.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/02/10 12:31:03 bernie
*#* Add templates for hw definitions.
*#*
#include <cfg/macros.h>
-/*!
+/**
* Type for keyboard mask.
*/
typedef uint16_t keymask_t;
-/*!
+/**
* \name Keycodes.
*/
/*@{*/
#define K_OK BV(2)
#define K_CANCEL BV(3)
-#define K_REPEAT BV(14) /*!< This is a repeated keyevent. */
-#define K_TIMEOUT BV(15) /*!< Fake key event for timeouts. */
+#define K_REPEAT BV(14) /**< This is a repeated keyevent. */
+#define K_TIMEOUT BV(15) /**< Fake key event for timeouts. */
/*@}*/
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
typedef bool (*OpenFunc_t) (struct _KFile *fd, const char *name, int mode);
-/*!
+/**
* Context data for callback functions which operate on
* pseudo files.
*/
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2006/03/22 09:49:22 bernie
*#* Reduce memory usage.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2006/02/24 01:17:05 bernie
*#* Update for new emulator.
*#*
#if CONFIG_KERN_MONITOR
-/*!
+/**
* Start the kernel monitor. It is a special process which checks every second the stacks of the
* running processes trying to detect stack overflows.
*
void monitor_start(size_t stacksize, cpustack_t *stack);
-/*!
+/**
* Manually check if a given stack has overflown. This is used to check for stacks
* of processes handled externally form the kernel, or for other stacks (for instance
* the interrupt supervisor stack).
size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size);
-/*! Print a report of the stack status through kdebug */
+/** Print a report of the stack status through kdebug */
void monitor_report(void);
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include <mware/list.h>
-/*!
+/**
* Handle queues of messages associated an action.
*
* A message port is an abstraction used to exchange information
*/
typedef struct MsgPort
{
- List queue; /*!< Messages queued at this port. */
- Event event; /*!< Event to trigger when a message arrives. */
+ List queue; /**< Messages queued at this port. */
+ Event event; /**< Event to trigger when a message arrives. */
} MsgPort;
typedef struct Msg
{
- Node link; /*!< Link into message port queue. */
- MsgPort *replyPort; /*!< Port to which the msg is to be replied. */
+ Node link; /**< Link into message port queue. */
+ MsgPort *replyPort; /**< Port to which the msg is to be replied. */
/* User data may follow */
} Msg;
-/*!
+/**
* Lock a message port.
*
* This is required before reading or manipulating
proc_forbid();
}
-/*!
+/**
* Unlock a message port.
*
* \see msg_lockPort()
}
-/*! Initialize a message port */
+/** Initialize a message port */
INLINE void msg_initPort(MsgPort *port, Event event)
{
LIST_INIT(&port->queue);
port->event = event;
}
-/*! Queue \a msg into \a port, triggering the associated event */
+/** Queue \a msg into \a port, triggering the associated event */
INLINE void msg_put(MsgPort *port, Msg *msg)
{
msg_portLock(port);
event_do(&port->event);
}
-/*!
+/**
* Get the first message from the queue of \a port.
*
* \return Pointer to the message or NULL if the port was empty.
return msg;
}
-/*! Peek the first message in the queue of \a port, or NULL if the port is empty. */
+/** Peek the first message in the queue of \a port, or NULL if the port is empty. */
INLINE Msg *msg_peek(MsgPort *port)
{
Msg *msg;
return msg;
}
-/*! Send back (reply) \a msg to its sender. */
+/** Send back (reply) \a msg to its sender. */
INLINE void msg_reply(Msg *msg)
{
msg_put(msg->replyPort, msg);
-/*!
+/**
* \file
* <!--
* Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.31 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.30 2006/03/27 04:49:23 bernie
*#* CPU_IDLE(): Fix for new emulator.
*#*
#include <string.h> /* memset() */
-/*!
+/**
* CPU dependent context switching routines.
*
* \note This function *MUST* preserve also the status of the interrupts.
extern List StackFreeList;
#endif
-/*! The main process (the one that executes main()). */
+/** The main process (the one that executes main()). */
struct Process MainProcess;
}
-/*!
+/**
* Create a new process, starting at the provided entry point.
*
* \return Process structure of new created process
return proc;
}
-/*! Rename a process */
+/** Rename a process */
void proc_rename(struct Process *proc, const char *name)
{
#if CONFIG_KERN_MONITOR
}
-/*!
+/**
* System scheduler: pass CPU control to the next process in
* the ready queue.
*
}
-/*!
+/**
* Terminate the current process
*/
void proc_exit(void)
}
-/*!
+/**
* Co-operative context switch
*/
void proc_switch(void)
}
-/*!
+/**
* Get the pointer to the current process
*/
struct Process *proc_current(void)
return CurrentProcess;
}
-/*!
+/**
* Get the pointer to the user data of the current process
*/
iptr_t proc_current_user_data(void)
#if CONFIG_KERN_PREEMPTIVE
-/*!
+/**
* Disable preemptive task switching.
*
* The scheduler maintains a per-process nesting counter. Task switching is
++CurrentProcess->forbid_cnt;
}
-/*!
+/**
* Re-enable preemptive task switching.
*
* \sa proc_forbid()
#include <drv/timer.h>
-/*!
+/**
* Proc scheduling test subthread 1
*/
static void NORETURN proc_test_thread1(void)
}
}
-/*!
+/**
* Proc scheduling test subthread 2
*/
static void NORETURN proc_test_thread2(void)
static cpustack_t proc_test_stack1[CONFIG_KERN_DEFSTACKSIZE/sizeof(cpustack_t)];
static cpustack_t proc_test_stack2[CONFIG_KERN_DEFSTACKSIZE/sizeof(cpustack_t)];
-/*!
+/**
* Proc scheduling test
*/
void NORETURN proc_test(void)
-/*!
+/**
* \file
* <!--
* Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.12 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.11 2006/02/21 16:06:55 bernie
*#* Cleanup/update process scheduling.
*#*
INLINE void proc_permit(void) { /* nop */ }
#endif
-/*!
+/**
* Execute a block of \a CODE atomically with respect to task scheduling.
*/
#define PROC_ATOMIC(CODE) \
-/*!
+/**
* \file
* <!--
* Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.16 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.15 2005/11/27 23:36:19 bernie
*#* Use appconfig.h instead of cfg/config.h.
*#*
typedef struct Process
{
- Node link; /*!< Link Process into scheduler lists */
- cpustack_t *stack; /*!< Per-process SP */
- iptr_t user_data; /*!< Custom data passed to the process */
+ Node link; /**< Link Process into scheduler lists */
+ cpustack_t *stack; /**< Per-process SP */
+ iptr_t user_data; /**< Custom data passed to the process */
#if CONFIG_KERN_SIGNALS
- sigmask_t sig_wait; /*!< Signals the process is waiting for */
- sigmask_t sig_recv; /*!< Received signals */
+ sigmask_t sig_wait; /**< Signals the process is waiting for */
+ sigmask_t sig_recv; /**< Received signals */
#endif
#if CONFIG_KERN_PREEMPTIVE
- int forbid_cnt; /*!< Nesting count for proc_forbid()/proc_permit(). */
+ int forbid_cnt; /**< Nesting count for proc_forbid()/proc_permit(). */
#endif
#if CONFIG_KERN_HEAP
- uint16_t flags; /*!< Flags */
- cpustack_t *stack_base; /*!< Base of process stack */
- size_t stack_size; /*!< Size of process stack */
+ uint16_t flags; /**< Flags */
+ cpustack_t *stack_base; /**< Base of process stack */
+ size_t stack_size; /**< Size of process stack */
#endif
#if CONFIG_KERN_MONITOR
} Process;
-/*!
+/**
* \name Flags for Process.flags.
* \{
*/
-#define PF_FREESTACK BV(0) /*!< Free the stack when process dies */
+#define PF_FREESTACK BV(0) /**< Free the stack when process dies */
/*\}*/
-/*! Track running processes. */
+/** Track running processes. */
extern REGISTER Process *CurrentProcess;
-/*! Track ready processes. */
+/** Track ready processes. */
extern REGISTER List ProcReadyList;
-/*! Enqueue a task in the ready list. */
+/** Enqueue a task in the ready list. */
#define SCHED_ENQUEUE(proc) ADDTAIL(&ProcReadyList, &(proc)->link)
-/*! Schedule to another process *without* adding the current to the ready list. */
+/** Schedule to another process *without* adding the current to the ready list. */
void proc_schedule(void);
#if CONFIG_KERN_MONITOR
- /*! Initialize the monitor */
+ /** Initialize the monitor */
void monitor_init(void);
- /*! Register a process into the monitor */
+ /** Register a process into the monitor */
void monitor_add(Process *proc, const char *name, cpustack_t *stack, size_t stacksize);
- /*! Unregister a process from the monitor */
+ /** Unregister a process from the monitor */
void monitor_remove(Process *proc);
- /*! Rename a process */
+ /** Rename a process */
void monitor_rename(Process *proc, const char* name);
#endif /* CONFIG_KERN_MONITOR */
-/*!
+/**
* \file
* <!--
* Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.12 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.11 2006/02/24 01:17:05 bernie
*#* Update for new emulator.
*#*
}
-/*!
+/**
* \brief Initialize a Semaphore structure.
*/
void sem_init(struct Semaphore *s)
}
-/*!
+/**
* \brief Attempt to lock a semaphore without waiting.
*
* \return true in case of success, false if the semaphore
}
-/*!
+/**
* \brief Lock a semaphore.
*
* If the semaphore is already owned by another process, the caller
}
-/*!
+/**
* \brief Release a lock on a previously locked semaphore.
*
* If the nesting count of the semaphore reaches zero,
-/*!
+/**
* \file
* <!--
* Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
int nest_count;
} Semaphore;
-/*!
+/**
* \name Process synchronization services
* \{
*/
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.14 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.13 2006/02/24 01:17:05 bernie
*#* Update for new emulator.
*#*
#if CONFIG_KERN_SIGNALS
-/*!
+/**
* Check if any of the signals in \a sigs has occurred and clear them.
* Return the signals that have occurred.
*/
}
-/*!
+/**
* Sleep until any of the signals in \a sigs occurs.
* Return the signal(s) that have awaked the process.
*/
}
-/*!
+/**
* Send the signals \a sigs to the process \a proc.
* The process will be awaken if it was waiting for any of them.
*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
sigmask_t sig_wait(sigmask_t sigs);
-/*!
+/**
* \name Signal definitions
* \{
*/
-#define SIG_USER0 BV(0) /*!< Free for user usage */
-#define SIG_USER1 BV(1) /*!< Free for user usage */
-#define SIG_USER2 BV(2) /*!< Free for user usage */
-#define SIG_USER3 BV(3) /*!< Free for user usage */
-#define SIG_SYSTEM4 BV(4) /*!< Reserved for system use */
-#define SIG_SYSTEM5 BV(5) /*!< Reserved for system use */
-#define SIG_SYSTEM6 BV(6) /*!< Reserved for system use */
-#define SIG_SINGLE BV(7) /*!< Used to wait for a single event */
+#define SIG_USER0 BV(0) /**< Free for user usage */
+#define SIG_USER1 BV(1) /**< Free for user usage */
+#define SIG_USER2 BV(2) /**< Free for user usage */
+#define SIG_USER3 BV(3) /**< Free for user usage */
+#define SIG_SYSTEM4 BV(4) /**< Reserved for system use */
+#define SIG_SYSTEM5 BV(5) /**< Reserved for system use */
+#define SIG_SYSTEM6 BV(6) /**< Reserved for system use */
+#define SIG_SINGLE BV(7) /**< Used to wait for a single event */
/*\}*/
#endif /* KERN_SIGNAL_H */
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/02/24 01:17:05 bernie
*#* Update for new emulator.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Giovanni Bajo
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include "crc.h"
-/*!
+/**
* crctab calculated by Mark G. Mendel, Network Systems Corporation
*/
const uint16_t crc16tab[256] = {
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
extern const uint16_t crc16tab[256];
-/*!
+/**
* \brief Compute the updated CRC16 value for one octet (macro version)
*
* \note This version is only intended for old/broken compilers.
#ifdef INLINE
-/*!
+/**
* \brief Compute the updated CRC16 value for one octet (macro version)
*/
INLINE uint16_t updcrc16(uint8_t c, uint16_t oldcrc)
#endif // INLINE
-/*!
+/**
* This function implements the CRC 16 calculation on a buffer.
*
* \param crc Current CRC16 value.
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/02/10 12:24:42 bernie
*#* Fix standalone build.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2006/03/20 17:52:22 bernie
*#* Add missing forward declaration.
*#*
#endif
-//! User defined callback type
+/// User defined callback type
typedef void (*Hook)(void *);
typedef struct Event
void event_hook_signal(Event *event);
void event_hook_softint(Event *event);
-/*! Initialize the event \a e as a no-op */
+/** Initialize the event \a e as a no-op */
#define event_initNone(e) \
((e)->action = event_hook_ignore)
-/*! Same as event_initNone(), but returns the initialized event */
+/** Same as event_initNone(), but returns the initialized event */
INLINE Event event_createNone(void);
INLINE Event event_createNone(void)
{
return e;
}
-/*! Initialize the event \a e with a software interrupt (call function \a f, with parameter \a u) */
+/** Initialize the event \a e with a software interrupt (call function \a f, with parameter \a u) */
#define event_initSoftInt(e,f,u) \
((e)->action = event_hook_softint,(e)->Ev.Int.func = (f), (e)->Ev.Int.user_data = (u))
-/*! Same as event_initSoftInt(), but returns the initialized event */
+/** Same as event_initSoftInt(), but returns the initialized event */
INLINE Event event_createSoftInt(Hook func, void *user_data)
{
Event e;
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
-/*! Initialize the event \a e with a signal (send signal \a s to process \a p) */
+/** Initialize the event \a e with a signal (send signal \a s to process \a p) */
#define event_initSignal(e,p,s) \
((e)->action = event_hook_signal,(e)->Ev.Sig.sig_proc = (p), (e)->Ev.Sig.sig_bit = (s))
-/*! Same as event_initSignal(), but returns the initialized event */
+/** Same as event_initSignal(), but returns the initialized event */
INLINE Event event_createSignal(struct Process *proc, sigbit_t bit)
{
Event e;
#endif
-/*! Trigger an event */
+/** Trigger an event */
INLINE void event_do(struct Event *e)
{
e->action(e);
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.22 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.21 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
)
-/*!
+/**
* Check whether the fifo is empty
*
* \note Calling fifo_isempty() is safe while a concurrent
}
-/*!
+/**
* Check whether the fifo is full
*
* \note Calling fifo_isfull() is safe while a concurrent
}
-/*!
+/**
* Pop a character from the fifo buffer.
*
* \note Calling \c fifo_push() on a full buffer is undefined.
}
-/*!
+/**
* Pop a character from the fifo buffer.
*
* \note Calling \c fifo_pop() on an empty buffer is undefined.
}
-/*!
+/**
* Make the fifo empty, discarding all its current contents.
*/
INLINE void fifo_flush(FIFOBuffer *fb)
#else /* CPU_REG_BITS < CPU_BITS_PER_PTR */
- /*!
+ /**
* Similar to fifo_isempty(), but with stronger guarantees for
* concurrent access between user and interrupt code.
*
}
- /*!
+ /**
* Similar to fifo_push(), but with stronger guarantees for
* concurrent access between user and interrupt code.
*
return c;
}
- /*!
+ /**
* Similar to fifo_flush(), but with stronger guarantees for
* concurrent access between user and interrupt code.
*
#endif /* CPU_REG_BITS < BITS_PER_PTR */
-/*!
+/**
* Thread safe version of fifo_isfull()
*/
INLINE bool fifo_isfull_locked(const FIFOBuffer *_fb)
}
-/*!
+/**
* FIFO Initialization.
*/
INLINE void fifo_init(FIFOBuffer *fb, unsigned char *buf, size_t size)
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.18 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.17 2005/11/04 17:43:27 bernie
*#* Fix for LP64 architectures; Add some more tests.
*#*
#include <appconfig.h> /* CONFIG_ macros */
#ifndef CONFIG_PRINTF_N_FORMATTER
- /*! Disable the arcane %n formatter. */
+ /** Disable the arcane %n formatter. */
#define CONFIG_PRINTF_N_FORMATTER 0
#endif
#ifndef CONFIG_PRINTF_OCTAL_FORMATTER
- /*! Disable the %o formatter. */
+ /** Disable the %o formatter. */
#define CONFIG_PRINTF_OCTAL_FORMATTER 0
#endif
#endif /* CONFIG_PRINTF > PRINTF_NOFLOAT */
-/*!
+/**
* This routine forms the core and entry of the formatter.
*
* The conversion performed conforms to the ANSI specification for "printf".
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.11 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.10 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include <appconfig.h>
#include <cfg/cpu.h> /* CPU_HARVARD */
-/*!
+/**
* \name _formatted_write() configuration
* \{
*/
/* \} */
#ifndef CONFIG_PRINTF_RETURN_COUNT
- /*! Enable/disable _formatted_write return value */
+ /** Enable/disable _formatted_write return value */
#define CONFIG_PRINTF_RETURN_COUNT 1
#endif
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
#define NODE_EMPTY(node) (!*(node))
#define HT_HAS_INTERNAL_KEY(ht) (CONFIG_HT_OPTIONAL_INTERNAL_KEY && ht->flags.key_internal)
-/*! For hash tables with internal keys, compute the pointer to the internal key for a given \a node. */
+/** For hash tables with internal keys, compute the pointer to the internal key for a given \a node. */
INLINE uint8_t *key_internal_get_ptr(struct HashTable *ht, HashNodePtr node)
{
uint8_t* key_buf = ht->key_data.mem;
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
#include <cfg/macros.h>
#include <cfg/debug.h>
-/*!
+/**
* Enable/disable support to declare special hash tables which maintain a copy of
* the key internally instead of relying on the hook to extract it from the data.
*/
#define CONFIG_HT_OPTIONAL_INTERNAL_KEY 1
-//! Maximum length of the internal key (use (2^n)-1 for slight speedup)
+/// Maximum length of the internal key (use (2^n)-1 for slight speedup)
#define INTERNAL_KEY_MAX_LENGTH 15
-/*!
+/**
* Hook to get the key from \a data, which is an element of the hash table. The
* key must be returned together with \a key_length (in words).
*/
typedef const void *(*hook_get_key)(const void *data, uint8_t *key_length);
-/*!
+/**
* Hash table description
*
* \note This structures MUST NOT be accessed directly. Its definition is
*/
struct HashTable
{
- const void **mem; //!< Buckets of data
- uint16_t max_elts_log2; //!< Log2 of the size of the table
+ const void **mem; ///< Buckets of data
+ uint16_t max_elts_log2; ///< Log2 of the size of the table
struct {
- bool key_internal : 1; //!< true if the key is copied internally
+ bool key_internal : 1; ///< true if the key is copied internally
} flags;
union {
- hook_get_key hook; //!< Hook to get the key
- uint8_t *mem; //!< Pointer to the key memory
+ hook_get_key hook; ///< Hook to get the key
+ uint8_t *mem; ///< Pointer to the key memory
} key_data;
};
-//! Iterator to walk the hash table
+/// Iterator to walk the hash table
typedef struct
{
const void** pos;
} HashIterator;
-/*!
+/**
* Declare a hash table in the current scope
*
* \param name Variable name
static const void* name##_nodes[1 << UINT32_LOG2(size)]; \
struct HashTable name = { name##_nodes, UINT32_LOG2(size), { false }, hook_gk }
-/*! Exactly like \c DECLARE_HASHTABLE, but the variable will be declared as static. */
+/** Exactly like \c DECLARE_HASHTABLE, but the variable will be declared as static. */
#define DECLARE_HASHTABLE_STATIC(name, size, hook_gk) \
static const void* name##_nodes[1 << UINT32_LOG2(size)]; \
static struct HashTable name = { name##_nodes, UINT32_LOG2(size), { false }, { hook_gk } }
#if CONFIG_HT_OPTIONAL_INTERNAL_KEY
- /*! Declare a hash table with internal copies of the keys. This version does not
+ /** Declare a hash table with internal copies of the keys. This version does not
* require a hook, nor it requires the user to allocate static memory for the keys.
* It is mostly suggested for tables whose keys are computed on the fly and need
* to be stored somewhere.
static const void* name##_nodes[1 << UINT32_LOG2(size)]; \
struct HashTable name = { name##_nodes, UINT32_LOG2(size), { true }, name##_keys }
- /*! Exactly like \c DECLARE_HASHTABLE_INTERNALKEY, but the variable will be declared as static. */
+ /** Exactly like \c DECLARE_HASHTABLE_INTERNALKEY, but the variable will be declared as static. */
#define DECLARE_HASHTABLE_INTERNALKEY_STATIC(name, size) \
static uint8_t name##_keys[(1 << UINT32_LOG2(size)) * (INTERNAL_KEY_MAX_LENGTH + 1)]; \
static const void* name##_nodes[1 << UINT32_LOG2(size)]; \
static struct HashTable name = { name##_nodes, UINT32_LOG2(size), { true }, name##_keys }
#endif
-/*!
+/**
* Initialize (and clear) a hash table in a memory buffer.
*
* \param ht Hash table declared with \c DECLARE_HASHTABLE
*/
void ht_init(struct HashTable* ht);
-/*!
+/**
* Insert an element into the hash table
*
* \param ht Handle of the hash table
*/
bool ht_insert(struct HashTable* ht, const void* data);
-/*!
+/**
* Insert an element into the hash table
*
* \param ht Handle of the hash table
*/
bool ht_insert_with_key(struct HashTable* ht, const void* key, uint8_t key_length, const void* data);
-/*!
+/**
* Find an element in the hash table
*
* \param ht Handle of the hash table
*/
const void* ht_find(struct HashTable* ht, const void* key, uint8_t key_length);
-/*! Similar to \c ht_insert_with_key() but \a key is an ASCIIZ string */
+/** Similar to \c ht_insert_with_key() but \a key is an ASCIIZ string */
#define ht_insert_str(ht, key, data) ht_insert_with_key(ht, key, strlen(key), data)
-/*! Similar to \c ht_find() but \a key is an ASCIIZ string */
+/** Similar to \c ht_find() but \a key is an ASCIIZ string */
#define ht_find_str(ht, key) ht_find(ht, key, strlen(key))
-//! Get an iterator to the begin of the hash table \a ht
+/// Get an iterator to the begin of the hash table \a ht
INLINE HashIterator ht_iter_begin(struct HashTable* ht)
{
HashIterator h;
return h;
}
-/*!
+/**
* Get an iterator to the (exclusive) end of the hash table \a ht
*
* \note Like in STL, the end iterator is not a valid iterator (you
return h;
}
-//! Compare \a it1 and \a it2 for equality
+/// Compare \a it1 and \a it2 for equality
INLINE bool ht_iter_cmp(HashIterator it1, HashIterator it2)
{
ASSERT(it1.end == it2.end);
return it1.pos == it2.pos;
}
-//! Get the element within the hash table \a ht pointed by the iterator \a iter
+/// Get the element within the hash table \a ht pointed by the iterator \a iter
INLINE const void* ht_iter_get(HashIterator iter)
{ return *iter.pos; }
-/*! Return an iterator pointing to the element following \a h
+/** Return an iterator pointing to the element following \a h
*
* \note The order of the elements visited during the iteration is casual,
* and depends on the implementation.
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.9 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.8 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
return mem;
}
-/*!
+/**
* Free a block of memory, determining its size automatically.
*
* \param h Heap from which the block was allocated.
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.7 2006/07/19 12:56:27 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.6 2005/11/27 23:36:19 bernie
*#* Use appconfig.h instead of cfg/config.h.
*#*
struct _MemChunk;
-//! A heap
+/// A heap
struct Heap
{
- struct _MemChunk *FreeList; //!< Head of the free list
+ struct _MemChunk *FreeList; ///< Head of the free list
};
-//! Initialize \a heap within the buffer pointed by \a memory which is of \a size bytes
+/// Initialize \a heap within the buffer pointed by \a memory which is of \a size bytes
void heap_init(struct Heap* heap, void* memory, size_t size);
-//! Allocate a chunk of memory of \a size bytes from the heap
+/// Allocate a chunk of memory of \a size bytes from the heap
void *heap_allocmem(struct Heap* heap, size_t size);
-//! Free a chunk of memory of \a size bytes from the heap
+/// Free a chunk of memory of \a size bytes from the heap
void heap_freemem(struct Heap* heap, void *mem, size_t size);
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2006/02/10 11:30:48 bernie
*#* C++ fixes.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.20 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.19 2006/03/20 17:50:29 bernie
*#* Fix typo.
*#*
#include <cfg/compiler.h> /* INLINE */
#include <cfg/debug.h> /* ASSERT() */
-/*!
+/**
* This structure represents a node for bidirectional lists.
*
* Data is usually appended to nodes by making them the first
struct _Node *pred;
} Node;
-/*!
+/**
* Head of a doubly-linked list of \c Node structs.
*
* Lists must be initialized with LIST_INIT() prior to use.
} PriNode;
-/*!
+/**
* Template for a naked node in a list of \a T structures.
*
* To be used as data member in other structures:
#define DECLARE_NODE_ANON(T) \
T *succ; T *pred;
-/*! Declare a typesafe node for structures of type \a T. */
+/** Declare a typesafe node for structures of type \a T. */
#define DECLARE_NODE_TYPE(T) \
typedef struct T##Node { T *succ; T *pred; } T##Node
-/*! Template for a list of \a T structures. */
+/** Template for a list of \a T structures. */
#define DECLARE_LIST_TYPE(T) \
DECLARE_NODE_TYPE(T); \
typedef struct T##List { \
#define NODE_TYPE(T) T##Node
#define LIST_TYPE(T) T##List
-/*!
+/**
* Get a pointer to the first node in a list.
*
* If \a l is empty, result points to l->tail.
*/
#define LIST_HEAD(l) ((l)->head.succ)
-/*!
+/**
* Get a pointer to the last node in a list.
*
* If \a l is empty, result points to l->head.
#define TYPEOF_OR_VOIDPTR(type) void *
#endif
-/*!
+/**
* Iterate over all nodes in a list.
*
* This macro generates a "for" statement using the following parameters:
(n) = (TYPEOF_OR_VOIDPTR(n))(((Node *)(n))->succ) \
)
-/*!
+/**
* Iterate backwards over all nodes in a list.
*
* This macro generates a "for" statement using the following parameters:
(n) = (TYPEOF_OR_VOIDPTR(n))(((Node *)(n))->pred) \
)
-/*! Initialize a list. */
+/** Initialize a list. */
#define LIST_INIT(l) \
do { \
(l)->head.succ = (TYPEOF_OR_VOIDPTR((l)->head.succ)) &(l)->tail; \
} while (0)
#ifdef _DEBUG
- /*! Make sure that a list is valid (it was initialized and is not corrupted). */
+ /** Make sure that a list is valid (it was initialized and is not corrupted). */
#define LIST_ASSERT_VALID(l) \
do { \
Node *n, *pred; \
#define INVALIDATE_NODE(n) do {} while (0)
#endif
-/*! Add node to list head. */
+/** Add node to list head. */
#define ADDHEAD(l,n) \
do { \
ASSERT(l); \
(n)->pred->succ = (n); \
} while (0)
-/*! Add node to list tail. */
+/** Add node to list tail. */
#define ADDTAIL(l,n) \
do { \
ASSERT(l); \
(l)->tail.pred = (n); \
} while (0)
-/*!
+/**
* Insert node \a n before node \a ln.
*
* \note You can't pass in a list header as \a ln, but
(ln)->pred = (n); \
} while (0)
-/*!
+/**
* Remove \a n from whatever list it is in.
*
* \note Removing a node that has not previously been
INVALIDATE_NODE(n); \
} while (0)
-/*! Tell whether a list is empty. */
+/** Tell whether a list is empty. */
#define LIST_EMPTY(l) ( (void *)((l)->head.succ) == (void *)(&(l)->tail) )
/**
} while (0)
-/*!
+/**
* Unlink a node from the head of the list \a l.
*
* \return Pointer to node, or NULL if the list was empty.
return n;
}
-/*!
+/**
* Unlink a node from the tail of the list \a l.
*
* \return Pointer to node, or NULL if the list was empty.
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2005/03/01 23:31:02 bernie
*#* String table and localization stuff.
*#*
#include "msg.h"
-/*!
+/**
* Array of pointers to localized strings. Should be filled
* by localization stuff, but not for now.
*/
*/
-/*!
+/**
* Untranslated constant strings used more than once are
* grouped here to save ROM space.
*/
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2006 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
#define MAX_COMMANDS_NUMBER 128 // 64
-//! Hashtable hook to extract the key from a command
+/// Hashtable hook to extract the key from a command
static const void* get_key_from_command(const void* cmd, uint8_t* length);
-//! Hashtable that handles the commands that can be executed
+/// Hashtable that handles the commands that can be executed
DECLARE_HASHTABLE_STATIC(commands, MAX_COMMANDS_NUMBER, get_key_from_command);
-/*!
+/**
* \brief Tokenize one word at a time from a text.
*
* This function is similar to strtok, but does not use any implicit
}
-/*!
+/**
* \brief Command arguments parser.
*
* Using the format pointed by the argument fmt
}
#endif /* UNUSED_CODE */
-//! Hook provided by the parser for matching of command names (TAB completion) for readline
+/// Hook provided by the parser for matching of command names (TAB completion) for readline
const char* parser_rl_match(UNUSED_ARG(void *,dummy), const char *word, int word_len)
{
HashIterator cur;
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2006/06/12 21:37:02 marco
*#* implemented some commands (ver and sleep)
*#*
*/
typedef enum
{
- RC_ERROR = -1, //!< Reply with error.
- RC_OK = 0, //!< No reply (ignore reply arguments).
- RC_REPLY = 1, //!< Reply command arguments.
- RC_SKIP = 2 //!< Skip following commands
+ RC_ERROR = -1, ///< Reply with error.
+ RC_OK = 0, ///< No reply (ignore reply arguments).
+ RC_REPLY = 1, ///< Reply command arguments.
+ RC_SKIP = 2 ///< Skip following commands
} ResultCode;
/** union that contains parameters passed to and from commands */
bool parser_process_line(const char* line);
-/*!
+/**
* Execute a command with its arguments, and fetch its results.
*
* \param templ Template of the command to be executed
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
#define PROGMEM /* nothing */
#endif
-/*!
+/**
* \name Types for variables stored in program memory (harvard processors).
* \{
*/
typedef PROGMEM uint32_t pgm_uint32_t;
/*\}*/
-/*!
+/**
* \name PGM support macros.
*
* These macros enable dual compilation of code for both program
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
#include <stdio.h>
-//! Enable compilation of the unit test code
+/// Enable compilation of the unit test code
#define DEBUG_UNIT_TEST 0
-//! Enable dump of the history after each line
+/// Enable dump of the history after each line
#define DEBUG_DUMP_HISTORY 0
-/*! Special keys (escape sequences converted to a single code) */
+/** Special keys (escape sequences converted to a single code) */
enum RL_KEYS {
SPECIAL_KEYS = 0x1000,
KEY_F10, KEY_F11, KEY_F12,
};
-/*! Check if \a c is a separator between words.
+/** Check if \a c is a separator between words.
* \note Parameter \a c is evaluated multiple times
*/
#define IS_WORD_SEPARATOR(c) ((c) == ' ' || (c) == '\0')
-//! Write the string \a txt to the IO output (without any kind of termination)
+/// Write the string \a txt to the IO output (without any kind of termination)
INLINE void rl_puts(const struct RLContext* ctx, const char* txt)
{
if (!ctx->put)
ctx->put(*txt++, ctx->put_param);
}
-//! Write character \a ch to the IO output.
+/// Write character \a ch to the IO output.
INLINE void rl_putc(const struct RLContext* ctx, char ch)
{
if (ctx->put)
ctx->put(ch, ctx->put_param);
}
-/*! Read a character from the IO into \a ch. This function also takes
+/** Read a character from the IO into \a ch. This function also takes
* care of converting the ANSI escape sequences into one of the codes
* defined in \c RL_KEYS.
*/
return true;
}
-//! Check if index \a i points to the begin of the history.
+/// Check if index \a i points to the begin of the history.
INLINE bool is_history_begin(struct RLContext* ctx, int i)
{ return ctx->history + i == ctx->real_history; }
-//! Check if index \a i points to the (exclusive) end of history
+/// Check if index \a i points to the (exclusive) end of history
INLINE bool is_history_end(struct RLContext* ctx, int i)
{ return ctx->history + i == ctx->real_history + HISTORY_SIZE; }
-//! Check if index \a i points to the (exclusive) end of history, or somewhere past the end.
+/// Check if index \a i points to the (exclusive) end of history, or somewhere past the end.
INLINE bool is_history_past_end(struct RLContext* ctx, int i)
{ return ctx->history + i >= ctx->real_history + HISTORY_SIZE; }
-/*! Insert \a num_chars characters from \a ch into the history buffer at the
+/** Insert \a num_chars characters from \a ch into the history buffer at the
* position indicated by \a curpos. If needed, remove old history to make room.
* Returns true if everything was successful, false if there was no room to
* add the characters.
return true;
}
-//! Insert a single character \a ch into the buffer (with the same semantic of \c insert_chars())
+/// Insert a single character \a ch into the buffer (with the same semantic of \c insert_chars())
static bool insert_char(struct RLContext* ctx, size_t *curpos, char ch)
{
return insert_chars(ctx, curpos, &ch, 1);
}
#if DEBUG_DUMP_HISTORY
-//! Dump the internal history of a context (used only for debug purposes)
+/// Dump the internal history of a context (used only for debug purposes)
static void dump_history(struct RLContext* ctx)
{
int k;
}
#endif /* DEBUG_DUMP_HISTORY */
-//! Complete the current word. Return false if no unambiguous completion was found
+/// Complete the current word. Return false if no unambiguous completion was found
static bool complete_word(struct RLContext *ctx, size_t *curpos)
{
const char* completed_word;
#if DEBUG_UNIT_TEST
-/*! Perform the unit test for the readline library */
+/** Perform the unit test for the readline library */
void rl_test(void);
#if HISTORY_SIZE != 32
return *test_getc_ptr++;
}
-/*! Perform a readline test. The function pipes the characters from \a input_buffer
+/** Perform a readline test. The function pipes the characters from \a input_buffer
* through the I/O to \c rl_readline(). After the whole string is sent, \c do_test()
* checks if the current history within the context match \a expected_history.
*/
-/*!
+/**
* \file
* <!--
* Copyright (C) 2004 Giovanni Bajo
/*#*
*#* $Log$
+ *#* Revision 1.2 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.1 2006/06/01 12:27:39 marco
*#* Added utilities for protocols
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include "rle.h"
-/*!
+/**
* Run-length encode \a len bytes from the \a input buffer
* to the \a output buffer.
*/
}
-/*!
+/**
* Run-length decode from the \a input buffer to the \a output
* buffer.
*
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.4 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.3 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2002, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.11 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.10 2005/04/11 19:10:28 bernie
*#* Include top-level headers from cfg/ subdir.
*#*
return result;
}
-/*!
+/**
* State information for __sn_put_char()
*/
struct __sn_state
size_t len;
};
-/*!
+/**
* formatted_write() callback used [v]snprintf().
*/
static void __sn_put_char(char c, void *ptr)
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.6 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.5 2005/11/04 17:47:26 bernie
*#* Fix one warning.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2005/04/11 18:10:45 bernie
*#* Doxygen fixes.
*#*
#include "strtol10.h"
-/*!
+/**
* Convert a formatted base-10 ASCII number to unsigned long binary representation.
*
* Unlike the standard strtoul(), this function has an interface
}
-/*!
+/**
* Convert a formatted base-10 ASCII number to signed long binary representation.
*
* \see strtoul10()
-/*!
+/**
* \file
* <!--
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.3 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.2 2005/04/11 19:10:28 bernie
*#* Include top-level headers from cfg/ subdir.
*#*
bool strtoul10(const char *first, const char *last, unsigned long *val);
bool strtol10(const char *first, const char *last, long *val);
-/*!
+/**
* Replacement for standard library function atol().
*/
INLINE long atol(const char *str)
return val;
}
-/*!
+/**
* Replacement for standard library function atoi().
*/
INLINE int atoi(const char *str)
#error This module has not been revised for the API changes in several DevLib modules
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.10 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.9 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
#include <string.h> /* for memset() */
-/*!
+/**
* \name Protocol control codes
* \{
*/
-#define XM_SOH 0x01 /*!< Start Of Header (128-byte block) */
-#define XM_STX 0x02 /*!< Start Of Header (1024-byte block) */
-#define XM_EOT 0x04 /*!< End Of Transmission */
-#define XM_ACK 0x06 /*!< Acknowledge block */
-#define XM_NAK 0x15 /*!< Negative Acknowledge */
-#define XM_C 0x43 /*!< Request CRC-16 transmission */
-#define XM_CAN 0x18 /*!< CANcel transmission */
+#define XM_SOH 0x01 /**< Start Of Header (128-byte block) */
+#define XM_STX 0x02 /**< Start Of Header (1024-byte block) */
+#define XM_EOT 0x04 /**< End Of Transmission */
+#define XM_ACK 0x06 /**< Acknowledge block */
+#define XM_NAK 0x15 /**< Negative Acknowledge */
+#define XM_C 0x43 /**< Request CRC-16 transmission */
+#define XM_CAN 0x18 /**< CANcel transmission */
/*\}*/
-#define XM_MAXRETRIES 15 /*!< Max retries before giving up */
-#define XM_MAXCRCRETRIES 7 /*!< Max retries before switching to BCC */
-#define XM_BUFSIZE 1024 /*!< Size of block buffer */
+#define XM_MAXRETRIES 15 /**< Max retries before giving up */
+#define XM_MAXCRCRETRIES 7 /**< Max retries before switching to BCC */
+#define XM_BUFSIZE 1024 /**< Size of block buffer */
#if (ARCH & ARCH_BOOT)
#endif /* ARCH_BOOT */
-/*!
+/**
* Decode serial driver errors and print them on the display.
*/
static void print_serial_error(struct Serial *port, int retries)
}
-/*!
+/**
* \brief Receive a file using the XModem protocol.
*
* \param port Serial port to use for transfer
}
-/*!
+/**
* \brief Transmit a file using the XModem protocol.
*
* \param port Serial port to use for transfer
-/*!
+/**
* \file
* <!--
* Copyright 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.5 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.4 2005/11/04 16:20:02 bernie
*#* Fix reference to README.devlib in header.
*#*
-/*!
+/**
* \file
* <!--
* Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
/*#*
*#* $Log$
+ *#* Revision 1.8 2006/07/19 12:56:28 bernie
+ *#* Convert to new Doxygen style.
+ *#*
*#* Revision 1.7 2006/07/19 12:53:58 bernie
*#* Documentation fixes.
*#*
# Author: Bernardo Innocenti <bernie@develer.com>
#
# $Log$
+# Revision 1.4 2006/07/19 12:56:24 bernie
+# Convert to new Doxygen style.
+#
# Revision 1.3 2006/05/27 22:42:24 bernie
# Search for verstag.h in app subdirs first.
#
if ! $(AVRDUDE) $(DPROG) -p $$($(1)_MCU) -U flash:w:$$< ; then \
$(AVRDUDE) $(DPROG) -p $$($(1)_MCU) -U flash:w:$$< ; \
fi
+ #avarice --mkII -j usb --erase --program --verify --file images/triface.elf
.PHONY: flash_$(1)_local
flash_$(1)_local:
-/*!
+/**
* \file
* <!--
* Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
#error unknown architecture
#endif
-/*!
+/**
* If _SNAPSHOT is defined, \c VERS_TAG contains the build date
* date instead of a numeric version string.
*/
#define __STRINGIZE(x) #x
#define _STRINGIZE(x) __STRINGIZE(x)
-/*! Build application version string (i.e.: "1.7.0") */
+/** Build application version string (i.e.: "1.7.0") */
#define MAKE_VERS(maj,min,rev) _STRINGIZE(maj) "." _STRINGIZE(min) "." _STRINGIZE(rev) VERS_LETTER VERS_DBG
#ifdef _SNAPSHOT
#define VERS_TAG "snapshot" " " __DATE__ " " __TIME__ " " VERS_LETTER " " VERS_DBG
#define VERS_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
#endif
-/*! Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
+/** Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */
#define MAKE_RCVERS(maj,min,rev,bld) _STRINGIZE(maj) ", " _STRINGIZE(min) ", " _STRINGIZE(rev) ", " _STRINGIZE(bld)
#define RCVERSION_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)
-/*! The revision string (contains VERS_TAG) */
+/** The revision string (contains VERS_TAG) */
extern const char vers_tag[];
-/*! Sequential build number (contains VERS_BUILD) */
+/** Sequential build number (contains VERS_BUILD) */
extern const int vers_build_nr;
//extern const char vers_build_str[];
-/*! Hostname of the machine used to build this binary (contains VERS_HOST) */
+/** Hostname of the machine used to build this binary (contains VERS_HOST) */
extern const char vers_host[];
#endif /* DEVLIB_VERSTAG_H */