CONFIG_XMODEM_RECV=1 \
CONFIG_XMODEM_SEND=1 \
LOG_LEVEL=3 \
+ CONFIG_HEAP_MALLOC=1 \
CONFIG_I2C_DISABLE_OLD_API=0 \
COMPILER_VARIADIC_MACROS=1
*
* -->
*
- * \addtogroup logging
+ * \defgroup logging Logging facilities
+ * \ingroup core
+ * \{
* \brief Logging system module.
*
* This module implement a simple interface to use the multi level logging system.
#include <cfg/debug.h>
-/**
- * \defgroup logging Logging facilities
- * \{
- */
-
// Use a default setting if nobody defined a log level
#ifndef LOG_LEVEL
#define LOG_LEVEL LOG_LVL_ERR
*
* -->
*
+ * \defgroup macros General purpose macros
+ * \ingroup core
+ * \{
+ *
* \brief Common and handy function macros
*
* \author Bernie Innocenti <bernie@codewiz.org>
*/
typedef uint32_t id_t;
+/** \} */ //defgroup macros
+
#endif /* MACROS_H */
* Copyright 2000, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
+ * \defgroup drv_timers Timer module
+ * \ingroup core
+ * \{
+ *
* \brief Hardware independent timer driver.
*
* All timer related functions are implemented in this module. You have several options to use timers:
#endif /* CONFIG_KERN_SIGNALS */
+/** \} */ //defgroup drv_timers
+
#endif /* DRV_TIMER_H */
*
* -->
*
- * \author Francesco Sacchi <batt@develer.com>
+ * \defgroup io_kblock KBlock interface
+ * \ingroup core
+ * \{
*
* \brief KBlock interface
*
+ * A block device is a device which can only be read/written
+ * with data blocks of constant size: flash memories,
+ * SD cards, hard disks, etc...
+ * This interface is designed to adapt to most block devices and
+ * use peculiar features in order to save CPU time and memory space.
+ *
+ * There is no init function because you do not have to use this
+ * structure directly, specific implementations will supply their own init
+ * functions.
+ *
+ * Error handling is done in a way similar to standard C library: whenever a
+ * function (eg. kblock_flush()) returns error, you need to check the error
+ * code, which is implementation specific.
+ *
+ * Example of code flow:
+ * \code
+ * // init a KBlock-derived class
+ * Flash fls;
+ * flash_init(&fls.blk, 0);
+ *
+ * // use kblock_* functions to access the derived class
+ * kblock_write(&fls.blk, ...);
+ * if (kblock_flush(&fls.blk) == EOF)
+ * {
+ * // oops, error occurred!
+ * int err = kblock_error(&fls.blk);
+ * // handle Flash specific error conditions
+ * // ...
+ * // clear error condition
+ * kblock_clearerr(&fls.blk);
+ * }
+ * \endcode
+ *
+ * \author Francesco Sacchi <batt@develer.com>
+ *
* $WIZ$ module_name = "kblock"
*/
/**
* KBlock: interface for a generic block device.
*
- * A block device is a device which can only be read/written
- * with data blocks of constant size: flash memories,
- * SD cards, hard disks, etc...
- *
- * This interface is designed to adapt to most block devices and
- * use peculiar features in order to save CPU time and memory space.
- *
- * You do not have to use this structure directly, specific implementations
- * will be supplied in the peripheral drivers.
*/
typedef struct KBlock
{
size_t kblock_swWriteBuf(struct KBlock *b, const void *buf, size_t offset, size_t size);
int kblock_swClose(struct KBlock *b);
+/** \} */ //defgroup io_kblock
+
+
#endif /* IO_KBLOCK_H */
*
* -->
*
+ * \defgroup core BeRTOS core functionality
+ * \{
+ *
+ * \defgroup io_kfile KFile interface
+ * \ingroup core
+ * \{
+ *
* \brief Virtual KFile I/O interface.
*
* KFile is a simple, generic interface for file I/O. It uses an
void kfile_init(struct KFile *fd);
/* @} */
+/** \} */ //Defgroup io_kfile
+
/*
* Kfile test function.
*/
int kfile_testRun(void);
int kfile_testRunGeneric(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size);
int kfile_testTearDown(void);
+/** \} */ //defgroup core
#endif /* KERN_KFILE_H */
* -->
*
*
- * This module implements a common system for executing
- * a user defined action calling a hook function.
- *
- *
- * \author Bernie Innocenti <bernie@codewiz.org>
+ * \defgroup kern_msg Message box IPC
+ * \ingroup kern
+ * \{
*
* \brief Simple inter-process messaging system
*
- * Handle queues of messages associated an action.
+ * This module implements a common system for executing
+ * a user defined action calling a hook function.
*
* A message port is an abstraction used to exchange information
* asynchronously between processes or other entities such as
* }
* \endcode
*
+ * \author Bernie Innocenti <bernie@codewiz.org>
+ *
* $WIZ$ module_name = "msg"
* $WIZ$ module_depends = "event", "signal", "kernel"
*/
msg_put(msg->replyPort, msg);
}
+/** \} */ //defgroup kern_msg
+
int msg_testRun(void);
int msg_testSetup(void);
int msg_testTearDown(void);
* Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
+ * \defgroup kern Kernel facilities
+ * \{
+ *
+ * \defgroup kern_proc Process (Threads) management
+ * \{
+ *
* \brief BeRTOS Kernel core (Process scheduler).
*
* \author Bernie Innocenti <bernie@codewiz.org>
#error No cpu_stack_t size supported!
#endif
#endif
+/** \} */ //defgroup kern_proc
+/** \} */ //defgroup kern
#endif /* KERN_PROC_H */
*
* -->
*
+ * \defgroup kern_sem Mutually exclusive semaphores
+ * \ingroup kern
+ * \{
* \brief Mutually exclusive semaphores.
* Shared locking not supported in this implementation.
*
void sem_obtain(struct Semaphore *s);
void sem_release(struct Semaphore *s);
/* \} */
+/* \} */ //defgroup kern_sem
int sem_testRun(void);
int sem_testSetup(void);
*
* -->
*
+ * \defgroup kern_signal Kernel signals
+ * \ingroup kern
+ * \{
+ *
* \brief Signal module for IPC.
*
*
#define SIG_SINGLE BV(7) /**< Used to wait for a single event */
/*\}*/
+/* \} */ //defgroup kern_signal
+
#endif /* KERN_SIGNAL_H */
* Copyright 1999, 2001, 2003 Bernie Innocenti <bernie@codewiz.org>
* -->
*
- * \addtogroup event_handling
+ * \defgroup event_handling Event handling module
+ * \ingroup core
+ * \{
*
* \brief Events handling
*
struct Process;
#endif
-/**
- * \defgroup event_handling Events handling module
- * \{
- */
-
-
/// User defined callback type
typedef void (*Hook)(void *);
#if CONFIG_HEAP_MALLOC
+/**
+ * Standard malloc interface
+ */
void *heap_malloc(struct Heap* h, size_t size)
{
size_t *mem;
return mem;
}
+/**
+ * Standard calloc interface
+ */
void *heap_calloc(struct Heap* h, size_t size)
{
void *mem;
* Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>
* -->
*
+ * \defgroup heap Embedded optimized memory allocator
+ * \ingroup core
+ * \{
+ *
* \brief Heap subsystem (public interface).
*
* \todo Heap memory could be defined as an array of MemChunk, and used
#if CONFIG_HEAP_MALLOC
+/**
+ * \name Compatibility interface with C standard library
+ * \{
+ */
void *heap_malloc(struct Heap* heap, size_t size);
void *heap_calloc(struct Heap* heap, size_t size);
void heap_free(struct Heap* heap, void * mem);
+/** \} */
#endif
+/** \} */ //defgroup heap
+
int heap_testSetup(void);
int heap_testRun(void);
int heap_testTearDown(void);