X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fsipo.h;fp=bertos%2Fcpu%2Favr%2Fdrv%2Fsipo.h;h=ab5100f45e9f10378256153ab4f458771a770293;hb=083645700424a51aa1a8d8cc24bcdae45e627f18;hp=ab57908b76aaf9b0c4a887955a477905f5ef740c;hpb=9f78ac29bdc537afaab5dba3239b6631bdf2a740;p=bertos.git diff --git a/bertos/cpu/avr/drv/sipo.h b/bertos/cpu/avr/drv/sipo.h index ab57908b..ab5100f4 100644 --- a/bertos/cpu/avr/drv/sipo.h +++ b/bertos/cpu/avr/drv/sipo.h @@ -35,18 +35,37 @@ * * \version $Id$ * - * \author Andrea Grandi + * \author Daniele Basile */ -#ifndef SIPO_H -#define SIPO_H +#ifndef DRV_SIPO_H +#define DRV_SIPO_H -#include "hw/hw_sipo.h" +#include -#include +/** + * Sipo KFile context structure. + */ +typedef struct Sipo +{ + KFile fd; ///< File descriptor. +} Sipo; + +/** + * ID for sipo. + */ +#define KFT_SIPO MAKE_ID('S', 'I', 'P', 'O') + +/** + * Convert + ASSERT from generic KFile to Sipo. + */ +INLINE Sipo * SIPO_CAST(KFile *fd) +{ + ASSERT(fd->_type == KFT_SIPO); + return (Sipo *)fd; +} -void sipo_init(void); -void sipo_putchar(uint8_t c); +void sipo_init(Sipo *fd); -#endif // SIPO_H +#endif // DRV_SIPO_H