sipo.c
Go to the documentation of this file.00001
00045 #include <drv/ser.h>
00046 #include "sipo.h"
00047
00048 Serial *sipo_port;
00049
00051 void sipo_init(void)
00052 {
00053 CLOCK_LOW;
00054 SET_SOUT_LOW;
00055 LOAD_LOW;
00056 SET_SCK_OUT;
00057 SET_SOUT_OUT;
00058 LOAD_INIT;
00059 sipo_putchar(0x0);
00060 OE_OUT;
00061 OE_LOW;
00062 }
00063
00065 void sipo_putchar(uint8_t c)
00066 {
00067 for(int i = 0; i <= 7; i++)
00068 {
00069 if((c & BV(i)) == 0)
00070 SET_SOUT_LOW;
00071 else
00072 SET_SOUT_HIGH;
00073
00074 CLOCK_PULSE;
00075 }
00076
00077 LOAD_HIGH;
00078 LOAD_LOW;
00079 }
00080