drv_sure_3208.c File Reference

Draw drivers for HT1632 based displays such as Sure 3208 and similar. More...

Include dependency graph for drv_sure_3208.c:

Functions

void drv_clear_screen ()
uns8 drv_get_pixel (uns8 x, uns8 y)
void drv_init ()
void drv_paint ()
void drv_setup_io ()

Detailed Description


Function Documentation

void drv_clear_screen (  ) 

00161                         {
00162     //ht1632_clear_screen();
00163 }

uns8 drv_get_pixel ( uns8  x,
uns8  y 
)

00157                                    {
00158     //ht1632_get_pixel(x, y);
00159 }

void drv_init (  ) 

00169                 {
00170     ht1632_init();
00171 }   

Here is the call graph for this function:

Here is the caller graph for this function:

void drv_paint (  ) 

00047                  {
00048 
00049 uns8 count;
00050 uns8 x, y, inv_y;
00051 uns16 buffer_loc;
00052 uns8 byte_loc, bit_loc;
00053 uns8 data;
00054 
00055     //ht1632_send_command(HT1632_CMD_SYS_DISABLE);
00056     clear_pin(ht1632_cs1_port, ht1632_cs1_pin);
00057     
00058     // send WR command
00059 
00060     // send 1
00061     set_pin  (ht1632_data_port, ht1632_data_pin);
00062     // pulse wr
00063     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00064     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00065     
00066     // send 0
00067     clear_pin  (ht1632_data_port, ht1632_data_pin);
00068     // pulse wr
00069     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00070     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00071 
00072     // send 1
00073     set_pin  (ht1632_data_port, ht1632_data_pin);
00074     // pulse wr
00075     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00076     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00077 
00078     // send mem address of zero
00079     clear_pin(ht1632_data_port, ht1632_data_pin);
00080     
00081     // write mem addr, bits 6 -> 0
00082     for(count = 0 ; count < 7 ; count++) {
00083             
00084         //change_pin_var(ht1632_data_port, ht1632_data_pin, test_bit(mem_addr, 6));
00085         // pulse wr
00086         clear_pin(ht1632_wr_port, ht1632_wr_pin);
00087         set_pin  (ht1632_wr_port, ht1632_wr_pin);
00088         // shift mem addr along
00089 
00090     }
00091 /*
00092     for(x = 0 ; x < DRAW_PIXELS_WIDE  ; x++) {
00093         for(y = 0 ; y < DRAW_PIXELS_HIGH ; y++) {
00094             inv_y = DRAW_PIXELS_HIGH - 1 - y;
00095             buffer_loc = inv_y * DRAW_PIXELS_WIDE + x;
00096             byte_loc = buffer_loc / DRAW_PIXELS_PER_BYTE;
00097             bit_loc = buffer_loc & (DRAW_PIXELS_PER_BYTE -1);
00098             if (test_bit(draw_buffer0[byte_loc], bit_loc)) {
00099                 set_pin(ht1632_data_port, ht1632_data_pin);
00100             } else {
00101                 clear_pin(ht1632_data_port, ht1632_data_pin);
00102             }   
00103             clear_pin(ht1632_wr_port, ht1632_wr_pin);
00104             set_pin  (ht1632_wr_port, ht1632_wr_pin);
00105         }
00106     }
00107 */  
00108     buffer_loc = 0;
00109     for (count = 0; count < 32; count++) {
00110         data = draw_buffer0[count];
00111         for (bit_loc = 0; bit_loc < 8; bit_loc++) {
00112             if (data.0) {
00113                 set_pin(ht1632_data_port, ht1632_data_pin);
00114             } else {
00115                 clear_pin(ht1632_data_port, ht1632_data_pin);
00116             }
00117             data = data >> 1;   
00118             clear_pin(ht1632_wr_port, ht1632_wr_pin);
00119             set_pin  (ht1632_wr_port, ht1632_wr_pin);
00120         }   
00121     }   
00122 
00123     /*uns8 xbyte = 0x2d;
00124     uns8 xbit = 0b00000001;
00125     
00126     for(x = 0 ; x < DRAW_PIXELS_WIDE  ; x++) {
00127         for(y = 0 ; y < 16 ; y++) {
00128         if (draw_buffer0[xbyte] & xbit) {
00129                 set_pin(ht1632_data_port, ht1632_data_pin);
00130             } else {
00131                 clear_pin(ht1632_data_port, ht1632_data_pin);
00132             }   
00133             clear_pin(ht1632_wr_port, ht1632_wr_pin);
00134             set_pin  (ht1632_wr_port, ht1632_wr_pin);
00135             if (xbyte < 3) {
00136                 if (xbit == 0b10000000) {
00137                     xbyte = xbyte + 0x2e;
00138                     xbit = 0b00000001;
00139                 } else {
00140                     xbit = xbit << 1;
00141                     xbyte = xbyte + 0x2d;
00142                 }
00143             } else {        
00144                 xbyte = xbyte - 3;
00145             }   
00146         }
00147     }
00148 */  // reset CS
00149 
00150     set_pin(ht1632_cs1_port, ht1632_cs1_pin);
00151     //ht1632_send_command(HT1632_CMD_SYS_ENABLE);
00152 
00153     
00154 }   

void drv_setup_io (  ) 

00165                     {
00166     ht1632_setup_io();
00167 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Fri Aug 19 09:05:07 2011 for Pic Pack Library by  doxygen 1.6.1