X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fhw%2Fhw_sipo.h;h=a5d680ac1688905ac8bf630f7eb6f6d5e5f8d21c;hb=747233b80705146400952ab08bea94f04bf23ae6;hp=0ac56ba76adaa3f4bce34d11928cc56856f845e7;hpb=083645700424a51aa1a8d8cc24bcdae45e627f18;p=bertos.git diff --git a/bertos/hw/hw_sipo.h b/bertos/hw/hw_sipo.h index 0ac56ba7..a5d680ac 100644 --- a/bertos/hw/hw_sipo.h +++ b/bertos/hw/hw_sipo.h @@ -26,8 +26,8 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2006, 2008 Develer S.r.l. (http://www.develer.com/) - * Copyright 2000 Bernardo Innocenti + * Copyright 2003, 2004, 2006, 2008, 2009 Develer S.r.l. (http://www.develer.com/) + * Copyright 2000 Bernie Innocenti * All Rights Reserved. * --> * @@ -36,6 +36,7 @@ * * \version $Id$ * + * \author Andrea Grandi * \author Daniele Basile */ @@ -46,31 +47,72 @@ /** - * Define the procedure to set one bit low/hight to - * serial input in sipo device. + * Mapping sipo connection on board. + * See scheme to more info. */ -#define SIPO_SI_HIGH()/* Implement me! */ -#define SIPO_SI_LOW() /* Implement me! */ +typedef enum SipoMap { + + /* Add device here */ + + SIPO_CNT +} SipoMap; + + +/** + * Define the macros needed to set the serial input bit of SIPO device + * low or high. + */ +#define SIPO_SI_HIGH() do { /* Implement me! */ } while (0) +#define SIPO_SI_LOW() do { /* Implement me! */ } while (0) /** * Drive pin to load the bit, presented in serial-in pin, * into sipo shift register. */ -#define SIPO_SI_CLOCK() /* Implement me! */ +#define SIPO_SI_CLOCK(clk_pol) + do { \ + /* Implement me! */ \ + (void)clk_pol; \ + } while (0) /** * Clock the content of shift register to output. */ -#define SIPO_LOAD() /* Implement me! */ +#define SIPO_LOAD(device, load_pol) \ + do { \ + /* Implement me! */ \ + (void)device; \ + (void)load_pol; \ + } while (0) /** * Enable the shift register output. */ #define SIPO_ENABLE() /* Implement me! */ +/** + * Set logic level for load signal + */ +#define SIPO_SET_LD_LEVEL(device, load_pol) \ + do { \ + /* Implement me! */ \ + (void)device; \ + (void)load_pol; \ + } while (0) + + +/** + * Sel logic level for clock signal + */ +#define SIPO_SET_CLK_LEVEL(clock_pol) \ + do { \ + /* Implement me! */ \ + (void)clock_pol; \ + } while (0) + /** - * Do anything that needed to init sipo pins. + * Do everything needed in order to init the SIPO pins. */ #define SIPO_INIT_PIN() \ do { \