drv_sure_2416.c File Reference

Include dependency graph for drv_sure_2416.c:

Functions

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

Function Documentation

void drv_clear_screen (  ) 

00203                         {
00204     //ht1632_clear_screen();
00205 }

uns8 drv_get_pixel ( uns8  x,
uns8  y 
)

00199                                    {
00200     //ht1632_get_pixel(x, y);
00201 }

void drv_init (  ) 

00211                 {
00212     // 2416 board is configured as 16 COMMONs
00213     ht1632_init(HT1632_CMD_PMOS_16_COMMON);
00214 }   

Here is the call graph for this function:

void drv_paint (  ) 

00137                  {
00138 
00139 uns8 count;
00140 uns8 x, y, inv_y;
00141 uns16 buffer_loc;
00142 uns8 byte_loc, bit_loc;
00143 uns8 data;
00144 
00145     clear_pin(ht1632_cs1_port, ht1632_cs1_pin);
00146     
00147     // send WR command
00148 
00149     // send 1
00150     set_pin  (ht1632_data_port, ht1632_data_pin);
00151     // pulse wr
00152     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00153     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00154     
00155     // send 0
00156     clear_pin  (ht1632_data_port, ht1632_data_pin);
00157     // pulse wr
00158     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00159     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00160 
00161     // send 1
00162     set_pin  (ht1632_data_port, ht1632_data_pin);
00163     // pulse wr
00164     clear_pin(ht1632_wr_port, ht1632_wr_pin);
00165     set_pin  (ht1632_wr_port, ht1632_wr_pin);
00166 
00167     // send mem address of zero
00168     clear_pin(ht1632_data_port, ht1632_data_pin);
00169     
00170     // write mem addr, bits 6 -> 0
00171     for(count = 0 ; count < 7 ; count++) {
00172             
00173         // pulse wr
00174         clear_pin(ht1632_wr_port, ht1632_wr_pin);
00175         set_pin  (ht1632_wr_port, ht1632_wr_pin);
00176     }
00177 
00178     buffer_loc = 0;
00179     for (count = 0; count < 48; count++) {
00180         data = draw_buffer0[count];
00181         for (bit_loc = 0; bit_loc < 8; bit_loc++) {
00182             if (data.0) {
00183                 set_pin(ht1632_data_port, ht1632_data_pin);
00184             } else {
00185                 clear_pin(ht1632_data_port, ht1632_data_pin);
00186             }
00187             data = data >> 1;   
00188             clear_pin(ht1632_wr_port, ht1632_wr_pin);
00189             set_pin  (ht1632_wr_port, ht1632_wr_pin);
00190         }   
00191     }   
00192     
00193     // reset CS
00194 
00195     set_pin(ht1632_cs1_port, ht1632_cs1_pin);
00196 }   

void drv_setup_io (  ) 

00207                     {
00208     ht1632_setup_io();
00209 }

Here is the call graph for this function:


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