X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fser.h;h=c264811efcad05958226d482fe5c1a471b175127;hb=ce5ddc07440aeb1357c7133beac6959b90d21885;hp=0acf4b811d9d2804b096799fabb2511e21ce7158;hpb=df94a4b7d8102b20810f889fbc926ac4823b61d9;p=bertos.git diff --git a/bertos/drv/ser.h b/bertos/drv/ser.h index 0acf4b81..c264811e 100644 --- a/bertos/drv/ser.h +++ b/bertos/drv/ser.h @@ -31,17 +31,24 @@ * * --> * - * \brief High level serial I/O API + * \brief High level serial I/O API. * * \version $Id$ * \author Bernie Innocenti + * + * $WIZ$ module_name = "ser" + * $WIZ$ module_depends = "kfile", "timer" + * $WIZ$ module_configuration = "bertos/cfg/cfg_ser.h" + * $WIZ$ module_hw = "bertos/hw/hw_ser.h" + * $WIZ$ module_supports = "not atmega103 and not atmega168 " + * $WIZ$ module_supports += "and not atmega32 and not atmega8" */ #ifndef DRV_SER_H #define DRV_SER_H #include -#include +#include #include #if OS_HOSTED @@ -92,11 +99,11 @@ /** * \name LSB or MSB first data order for SPI driver. - * \{ + * + * $WIZ$ ser_order_bit = "SER_MSB_FIRST", "SER_LSB_FIRST" */ #define SER_MSB_FIRST 0 #define SER_LSB_FIRST 1 -/*\}*/ /** * \name Parity settings for ser_setparity(). @@ -112,6 +119,22 @@ /*\}*/ +/** + * \def CONFIG_SER_STROBE + * + * This is a debug facility that can be used to + * monitor SER interrupt activity on an external pin. + * + * To use strobes, redefine the macros SER_STROBE_ON, + * SER_STROBE_OFF and SER_STROBE_INIT and set + * CONFIG_SER_STROBE to 1. + */ +#if !defined(CONFIG_SER_STROBE) || !CONFIG_SER_STROBE + #define SER_STROBE_ON do {/*nop*/} while(0) + #define SER_STROBE_OFF do {/*nop*/} while(0) + #define SER_STROBE_INIT do {/*nop*/} while(0) +#endif + struct SerialHardware; /** Human-readable serial error descriptions */ @@ -162,7 +185,7 @@ typedef struct Serial #define KFT_SERIAL MAKE_ID('S', 'E', 'R', 'L') -INLINE Serial * SERIALKFILE(KFile *fd) +INLINE Serial * SERIAL_CAST(KFile *fd) { ASSERT(fd->_type == KFT_SERIAL); return (Serial *)fd;