bt96040.h File Reference

Go to the source code of this file.

Defines

#define BT_CHARACTER_PIXEL_WIDTH   6
 One character has a width of 6 (six) pixels.

Enumerations

enum  CHARACHTER_ROWS {
  BT_ROW_1 = 0, BT_ROW_2 = 1, BT_ROW_3 = 2, BT_ROW_4 = 3,
  BT_ROW_5 = 4, BT_ROW_LAST = 4, BT_ROW_FIRST = 0
}
 This enumeration lists all rows of the display using the standard pixel width (BT_CHARACTER_PIXEL_WIDTH). More...
enum  CHARACTER_COLUMNS {
  BT_CHAR_1 = (BT_CHARACTER_PIXEL_WIDTH * 0), BT_CHAR_2 = (BT_CHARACTER_PIXEL_WIDTH * 1), BT_CHAR_3 = (BT_CHARACTER_PIXEL_WIDTH * 2), BT_CHAR_4 = (BT_CHARACTER_PIXEL_WIDTH * 3),
  BT_CHAR_5 = (BT_CHARACTER_PIXEL_WIDTH * 4), BT_CHAR_6 = (BT_CHARACTER_PIXEL_WIDTH * 5), BT_CHAR_7 = (BT_CHARACTER_PIXEL_WIDTH * 6), BT_CHAR_8 = (BT_CHARACTER_PIXEL_WIDTH * 7),
  BT_CHAR_9 = (BT_CHARACTER_PIXEL_WIDTH * 8), BT_CHAR_10 = (BT_CHARACTER_PIXEL_WIDTH * 9), BT_CHAR_11 = (BT_CHARACTER_PIXEL_WIDTH * 10), BT_CHAR_12 = (BT_CHARACTER_PIXEL_WIDTH * 11),
  BT_CHAR_13 = (BT_CHARACTER_PIXEL_WIDTH * 12), BT_CHAR_14 = (BT_CHARACTER_PIXEL_WIDTH * 13), BT_CHAR_15 = (BT_CHARACTER_PIXEL_WIDTH * 14), BT_CHAR_16 = (BT_CHARACTER_PIXEL_WIDTH * 15),
  BT_CHAR_FIRST = BT_CHAR_1, BT_CHAR_LAST = BT_CHAR_16
}
 This enumeration lists all starting positions for characters using the standard pixel with (BT_CHARACTER_PIXEL_WIDTH). More...

Functions

void bt_clear (int display_no)
void bt_clear_display (int display_no)
void bt_print_char_lcd (int row, int col, BYTE ch)
void bt_write_char (int row, int col, BYTE ch)
void bt_write_char_display (int display_no, int row, int col, BYTE ch)
void bt_write_hcilab_display (int display_no, int row, int col)
void bt_write_line (int row, int ch)
void bt_write_line_display (int display_no, int row, int ch)
void bt_write_long_display (int display_no, int row, int col, long long_val)
void bt_write_pix_set_display (int display_no, int row, int col, int ch, int count)
void bt_write_string (int row, int col, char *str)
void bt_write_string_display (int display_no, int row, int col, char *str)

Variables

BYTE const table1 [240]
BYTE const table2 [240]


Define Documentation

#define BT_CHARACTER_PIXEL_WIDTH   6
 

One character has a width of 6 (six) pixels.

Definition at line 28 of file bt96040.h.

Referenced by bt_write_string(), and bt_write_string_display().


Enumeration Type Documentation

enum CHARACHTER_ROWS
 

This enumeration lists all rows of the display using the standard pixel width (BT_CHARACTER_PIXEL_WIDTH).

Enumeration values:
BT_ROW_1 
BT_ROW_2 
BT_ROW_3 
BT_ROW_4 
BT_ROW_5 
BT_ROW_LAST 
BT_ROW_FIRST 

Definition at line 53 of file bt96040.h.

00054 {
00055         BT_ROW_1  = 0,
00056         BT_ROW_2  = 1,
00057         BT_ROW_3  = 2,
00058         BT_ROW_4  = 3,
00059         BT_ROW_5  = 4,
00060         BT_ROW_LAST = 4,
00061         BT_ROW_FIRST = 0
00062 };

enum CHARACTER_COLUMNS
 

This enumeration lists all starting positions for characters using the standard pixel with (BT_CHARACTER_PIXEL_WIDTH).

Enumeration values:
BT_CHAR_1 
BT_CHAR_2 
BT_CHAR_3 
BT_CHAR_4 
BT_CHAR_5 
BT_CHAR_6 
BT_CHAR_7 
BT_CHAR_8 
BT_CHAR_9 
BT_CHAR_10 
BT_CHAR_11 
BT_CHAR_12 
BT_CHAR_13 
BT_CHAR_14 
BT_CHAR_15 
BT_CHAR_16 
BT_CHAR_FIRST 
BT_CHAR_LAST 

Definition at line 31 of file bt96040.h.


Function Documentation

void bt_clear int  display_no  ) 
 

void bt_clear_display int  display_no  ) 
 

Clears the display number display_no.

Parameters:
display_no the display to clear to.

Definition at line 352 of file bt96040.c.

References bt_write_line_display().

00353 {
00354         bt_write_line_display(display_no, 0x00,0x00);
00355         bt_write_line_display(display_no, 0x01,0x00);
00356         bt_write_line_display(display_no, 0x02,0x00);
00357         bt_write_line_display(display_no, 0x03,0x00);
00358         bt_write_line_display(display_no, 0x04,0x00);
00359 }

void bt_print_char_lcd int  row,
int  col,
BYTE  ch
 

Deprecated. Use bt_write_char instead.

Parameters:
row the row to write to.
col the column to start writing to.
ch character to be written.

Definition at line 426 of file bt96040.c.

References bt_write_char().

00427 {
00428         bt_write_char(row, col, ch);    
00429 }

void bt_write_char int  row,
int  col,
BYTE  ch
 

Extracts ascii from tables & write to the standard display.

Parameters:
row the row to write to.
col the column to start writing to.
ch character to be written.

Definition at line 437 of file bt96040.c.

References table1, table2, and write_pix_set().

Referenced by bt_print_char_lcd(), and bt_write_string().

00438 {
00439         int tab_index;
00440         BYTE bt_char_bit_set;
00441         //int ch_pix_set;
00442         int i;
00443                 
00444         if (ch<0x20)return;
00445         if (ch>0x7f)return;
00446 
00447         for (i=0;i<5;i++) 
00448         {
00449                 if (ch<0x50)
00450                 {
00451                         tab_index=(((ch&0xff)-0x20)*5);
00452                         bt_char_bit_set=table1[(tab_index+i)];
00453                 } 
00454                 else if (ch>0x4f)
00455                 {
00456                         tab_index=(((ch&0xff)-0x50)*5);
00457                         tab_index=(((ch&0xff)-0x50)*5);
00458                         tab_index=(((ch&0xff)-0x50)*5);
00459                         bt_char_bit_set=table2[(tab_index+i)];
00460                 }
00461                 write_pix_set(row, col+i, bt_char_bit_set,1);           
00462         }       
00463         write_pix_set(row, col+5, 0x00,1);                      
00464 }

void bt_write_char_display int  display_no,
int  row,
int  col,
BYTE  ch
 

Writes a char to a named display.

Parameters:
display_no the display to write to.
row the row to write to.
col the column to start writing to.
ch the character to be written.

Definition at line 220 of file bt96040.c.

References bt_write_pix_set_display(), table1, and table2.

Referenced by bt_write_string_display().

00221 {
00222         int tab_index;
00223         BYTE bt_char_bit_set;
00224         //int ch_pix_set;
00225         int i;
00226                 
00227         if (ch<0x20)return;
00228         if (ch>0x7f)return;
00229 
00230         for (i=0;i<5;i++) {
00231                 if (ch<0x50){
00232                         tab_index=(((ch&0xff)-0x20)*5);
00233                         bt_char_bit_set=table1[(tab_index+i)];
00234                 } else if (ch>0x4f){
00235                         tab_index=(((ch&0xff)-0x50)*5);
00236                         tab_index=(((ch&0xff)-0x50)*5);
00237                         tab_index=(((ch&0xff)-0x50)*5);
00238                         bt_char_bit_set=table2[(tab_index+i)];
00239                 }
00240                 bt_write_pix_set_display(display_no, row, col+i, bt_char_bit_set,1);            
00241         }       
00242         bt_write_pix_set_display(display_no, row, col+5, 0x00,1);               
00243         
00244 }

void bt_write_hcilab_display int  display_no,
int  row,
int  col
 

Writes the string "HCILAB.ORG" in row at character column col. Attention: Character position is BT_CHARACTER_PIXEL_WIDTH*col. So the starting position is defined in characters, not pixels.

Parameters:
display_no the display to write to.
row the row to write to.
col the column to start writing to.

Definition at line 103 of file bt96040.c.

References bt_write_string_display().

00104 {
00105         char hcilab[11] = "HCILAB.ORG";
00106         bt_write_string_display(display_no, row, col, hcilab);
00107         /*
00108         int cur_pos = 0;
00109         cur_pos = BT_CHARACTER_PIXEL_WIDTH * col;
00110         bt_write_char_display(display_no, row,cur_pos, 'H'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00111         bt_write_char_display(display_no, row,cur_pos,'C'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00112         bt_write_char_display(display_no, row,cur_pos,'I'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00113         bt_write_char_display(display_no, row,cur_pos,'L'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00114         bt_write_char_display(display_no, row,cur_pos,'A'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00115         bt_write_char_display(display_no, row,cur_pos,'B'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00116         bt_write_char_display(display_no, row,cur_pos,'.'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00117         bt_write_char_display(display_no, row,cur_pos,'O'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00118         bt_write_char_display(display_no, row,cur_pos,'R'); cur_pos=cur_pos+BT_CHARACTER_PIXEL_WIDTH;
00119         bt_write_char_display(display_no, row,cur_pos,'G');
00120         */
00121 }

void bt_write_line int  row,
int  ch
 

Writes a line of the character ch to the standard display. The line starts in row and writes ch rows (binary representation of the int (ch), 1 = row 1, 2 = row 2, 3 = row 1 & 2, 4 = row 3, ...)

Parameters:
row the row to write to.
ch the caracter to be written.

Definition at line 382 of file bt96040.c.

Referenced by bt_clear().

00383 {
00384         int i;
00385         i2c_start();
00386         // send address 0x7A
00387         i2c_write(0x7A);                        
00388         i2c_write(0b01100000+row);
00389         i2c_write(0b00000000);
00390         for(i=0;i<100;i++)
00391         {
00392                 i2c_write(ch);
00393         }
00394         // end transfer
00395         i2c_stop();             
00396 }

void bt_write_line_display int  display_no,
int  row,
int  ch
 

Writes a line of the character ch to a named display.

Parameters:
display_no the display to write to.
row the row to write to.
ch the character to be written.

Definition at line 129 of file bt96040.c.

Referenced by bt_clear_display().

00130 {
00131         int i;
00132         if (display_no == 0) {
00133                 #use i2c(master, sda=PIN_DISPLAY_1_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00134 
00135                 i2c_start();
00136                 i2c_write(0x7A);                        // send address 0x7A
00137                 i2c_write(0b01100000+row);
00138                 i2c_write(0b00000000);
00139                 for(i=0;i<100;i++){
00140                         i2c_write(ch);
00141                 }
00142                 i2c_stop();             // end transfer
00143         }
00144 
00145         if (display_no == 1) {
00146                 #use i2c(master, sda=PIN_DISPLAY_2_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00147                 
00148                 i2c_start();
00149                 i2c_write(0x7A);                        // send address 0x7A
00150                 i2c_write(0b01100000+row);
00151                 i2c_write(0b00000000);
00152                 for(i=0;i<100;i++){
00153                         i2c_write(ch);
00154                 }
00155                 i2c_stop();             // end transfer
00156         }
00157 
00158         if (display_no == 2) {
00159                 #use i2c(master, sda=PIN_B2, scl=PIN_DISPLAY_1_I2C_SCL)
00160                 
00161                 i2c_start();
00162                 i2c_write(0x7A);                        // send address 0x7A
00163                 i2c_write(0b01100000+row);
00164                 i2c_write(0b00000000);
00165                 for(i=0;i<100;i++){
00166                         i2c_write(ch);
00167                 }
00168                 i2c_stop();             // end transfer
00169         }
00170 
00171         if (display_no == 3) {
00172                 #use i2c(master, sda=PIN_B3, scl=PIN_DISPLAY_1_I2C_SCL)
00173                 
00174                 i2c_start();
00175                 i2c_write(0x7A);                        // send address 0x7A
00176                 i2c_write(0b01100000+row);
00177                 i2c_write(0b00000000);
00178                 for(i=0;i<100;i++){
00179                         i2c_write(ch);
00180                 }
00181                 i2c_stop();             // end transfer
00182         }
00183 
00184         if (display_no == 4) {
00185                 #use i2c(master, sda=PIN_B4, scl=PIN_DISPLAY_1_I2C_SCL)
00186                 
00187                 i2c_start();
00188                 i2c_write(0x7A);                        // send address 0x7A
00189                 i2c_write(0b01100000+row);
00190                 i2c_write(0b00000000);
00191                 for(i=0;i<100;i++){
00192                         i2c_write(ch);
00193                 }
00194                 i2c_stop();             // end transfer
00195         }
00196 
00197         if (display_no == 5) {
00198                 #use i2c(master, sda=PIN_B5, scl=PIN_DISPLAY_1_I2C_SCL)
00199                 
00200                 i2c_start();
00201                 i2c_write(0x7A);                        // send address 0x7A
00202                 i2c_write(0b01100000+row);
00203                 i2c_write(0b00000000);
00204                 for(i=0;i<100;i++){
00205                         i2c_write(ch);
00206                 }
00207                 i2c_stop();             // end transfer
00208         }
00209 
00210 }

void bt_write_long_display int  display_no,
int  row,
int  col,
long  long_val
 

void bt_write_pix_set_display int  display_no,
int  row,
int  col,
int  ch,
int  count
 

???

Parameters:
ch ???
count ???
display_no the display to write to.
row the row to write to.
col the column to start writing to.

Definition at line 254 of file bt96040.c.

Referenced by bt_write_char_display().

00255 {
00256         int i;
00257 
00258         if (display_no == 0) {
00259                 #use i2c(master, sda=PIN_DISPLAY_1_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00260                 
00261                 i2c_start();
00262                 i2c_write(0x7A);                        // send address 0x7A
00263                 i2c_write(0b01100000+row);
00264                 i2c_write(0b00000000+col);
00265                 for(i=0;i<count;i++){
00266                         i2c_write(ch);
00267                 }
00268                 i2c_stop();             // end transfer
00269         }
00270 
00271         if (display_no == 1) {
00272                 #use i2c(master, sda=PIN_DISPLAY_2_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00273                 
00274 
00275                 i2c_start();
00276                 i2c_write(0x7A);                        // send address 0x7A
00277                 i2c_write(0b01100000+row);
00278                 i2c_write(0b00000000+col);
00279                 for(i=0;i<count;i++){
00280                         i2c_write(ch);
00281                 }
00282                 i2c_stop();             // end transfer
00283         }
00284 
00285         if (display_no == 2) {
00286                 #use i2c(master, sda=PIN_DISPLAY_3_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00287                 //#use i2c(master, sda=PIN_B2, scl=PIN_DISPLAY_1_I2C_SCL)
00288                 
00289 
00290                 i2c_start();
00291                 i2c_write(0x7A);                        // send address 0x7A
00292                 i2c_write(0b01100000+row);
00293                 i2c_write(0b00000000+col);
00294                 for(i=0;i<count;i++){
00295                         i2c_write(ch);
00296                 }
00297                 i2c_stop();             // end transfer
00298         }
00299 
00300         if (display_no == 3) {
00301                 #use i2c(master, sda=PIN_DISPLAY_4_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00302                 //#use i2c(master, sda=PIN_B3, scl=PIN_DISPLAY_1_I2C_SCL)
00303                 
00304 
00305                 i2c_start();
00306                 i2c_write(0x7A);                        // send address 0x7A
00307                 i2c_write(0b01100000+row);
00308                 i2c_write(0b00000000+col);
00309                 for(i=0;i<count;i++){
00310                         i2c_write(ch);
00311                 }
00312                 i2c_stop();             // end transfer
00313         }
00314 
00315         if (display_no == 4) {
00316                 #use i2c(master, sda=PIN_DISPLAY_5_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00317                 //#use i2c(master, sda=PIN_B4, scl=PIN_DISPLAY_1_I2C_SCL)
00318                 
00319 
00320                 i2c_start();
00321                 i2c_write(0x7A);                        // send address 0x7A
00322                 i2c_write(0b01100000+row);
00323                 i2c_write(0b00000000+col);
00324                 for(i=0;i<count;i++){
00325                         i2c_write(ch);
00326                 }
00327                 i2c_stop();             // end transfer
00328         }
00329 
00330         if (display_no == 5) {
00331                 #use i2c(master, sda=PIN_DISPLAY_6_I2C_SDA, scl=PIN_DISPLAY_1_I2C_SCL)
00332                 //#use i2c(master, sda=PIN_B5, scl=PIN_DISPLAY_1_I2C_SCL)
00333                 
00334 
00335                 i2c_start();
00336                 i2c_write(0x7A);                        // send address 0x7A
00337                 i2c_write(0b01100000+row);
00338                 i2c_write(0b00000000+col);
00339                 for(i=0;i<count;i++){
00340                         i2c_write(ch);
00341                 }
00342                 i2c_stop();             // end transfer
00343         }
00344 
00345 
00346 }

void bt_write_string int  row,
int  col,
char *  str
 

Prints a character array to the standard display

Parameters:
row the row to write to.
col the column to start writing to.
str a pointer to a character array, terminated by '\0'

Definition at line 58 of file bt96040.c.

References BT_CHARACTER_PIXEL_WIDTH, and bt_write_char().

Referenced by bt_write_long4().

00059 {
00060         int strpos;
00061         strpos = 0;
00062         
00063         // change commented lines against for loop...
00064         for (; *str != '\0'; str++)
00065         //while (*str != '\0')
00066         {               
00067                 bt_write_char(row, (col + (strpos * BT_CHARACTER_PIXEL_WIDTH)), *str);
00068                 strpos++;
00069                 //str++;
00070         }       
00071 }

void bt_write_string_display int  display_no,
int  row,
int  col,
char *  str
 

Prints a character array to a named display

Parameters:
display_no the display to write to.
row the row to write to.
col the column to start writing to.
str a pointer to a character array, terminated by '\0'

Definition at line 80 of file bt96040.c.

References BT_CHARACTER_PIXEL_WIDTH, and bt_write_char_display().

Referenced by bt_write_hcilab_display(), and bt_write_long4_display().

00081 {
00082         int strpos;
00083         strpos = 0;
00084         
00085         // change commented lines against for loop...
00086         for (; *str != '\0'; str++)
00087         //while (*str != '\0')
00088         {               
00089                 bt_write_char_display(display_no, row, (col + (strpos * BT_CHARACTER_PIXEL_WIDTH)), *str);
00090                 strpos++;
00091                 //str++;
00092         }
00093 }


Variable Documentation

BYTE const table1[240]
 

ASCII table for the barton 96040 display, 96 rows * 5 bytes= 480 bytes, the fist half is in this table, the other half in the other table.

Definition at line 70 of file bt96040.h.

Referenced by bt_write_char(), and bt_write_char_display().

BYTE const table2[240]
 

ASCII table for the barton 96040 display, 96 rows * 5 bytes= 480 bytes, the fist half is in the other table, the second half in this table.

Definition at line 123 of file bt96040.h.

Referenced by bt_write_char(), and bt_write_char_display().


Generated on Tue Nov 30 09:16:48 2004 for Smart-Its Headers by  doxygen 1.3.9.1