static int VFD_Seg_Dig_Seg(unsigned char dignum, SegNum_T segnum, unsigned char val) { unsigned char addr=0; if(segnum < 0 && segnum > 1) { dprintk(2, "bad parameter!\n"); return -1; } VFD_CS_CLR(); if(segnum == SEGNUM1) { addr = VfdSegAddr[dignum].Segaddr1; VfdSegAddr[dignum].CurrValue1 = val ; } else if(segnum == SEGNUM2) { addr = VfdSegAddr[dignum].Segaddr2; VfdSegAddr[dignum].CurrValue2 = val ; } VFD_WR(addr); udelay(5); VFD_WR(val); VFD_CS_SET(); return 0; }
static int VFD_Show_Content(void) { int res = 0; VFD_CS_CLR(); res = VFD_WR(0x8F); VFD_CS_SET(); return res; }
static int VFD_Set_Mode(VFDMode_T mode) { unsigned char data = 0; if(mode == VFDWRITEMODE) { data = 0x44; VFD_CS_CLR(); VFD_WR(data); VFD_CS_SET(); } else if(mode == VFDREADMODE) { data = 0x46; VFD_WR(data); udelay(5); } return 0; }
static int VFD_Show_Content(void) { down_interruptible(&display_sem); //maby no need. need more testing VFD_CS_CLR(); VFD_WR(0x8F); VFD_CS_SET(); up(&display_sem); udelay(20); return 0; }
static int VFD_Seg_Dig_Seg(unsigned char dignum, SegNum_T segnum, unsigned char val) { int res = 0; unsigned char addr=0; if(segnum < 0 && segnum > 1) res = -EINVAL; VFD_CS_CLR(); if(segnum == SEGNUM1) { addr = VfdSegAddr[dignum].Segaddr1; VfdSegAddr[dignum].CurrValue1 = val ; } else if(segnum == SEGNUM2) { addr = VfdSegAddr[dignum].Segaddr2; VfdSegAddr[dignum].CurrValue2 = val ; } res = VFD_WR(addr); udelay(1); res = VFD_WR(val); VFD_CS_SET(); return res; }
static int VFD_Show_Content_Off(void) { VFD_WR(0x87); return 0; }
static int VFD_Show_Content_Off(void) { int res = 0; res = VFD_WR(0x87); return res; }