Merge branch 'master' into luca/gsmmap

Introduced code for DSP auto-reset in error conditions
Disabled by default US bands (not working yet)
This commit is contained in:
Luca Melette 2012-05-03 02:21:08 +02:00
commit 1e9d9f4c08
122 changed files with 16000 additions and 2071 deletions

View File

@ -298,12 +298,15 @@ struct l1ctl_neigh_pm_req {
uint8_t n;
uint8_t padding[1];
uint16_t band_arfcn[64];
uint8_t tn[64];
} __attribute__((packed));
/* neighbour cell measurement results */
struct l1ctl_neigh_pm_ind {
uint16_t band_arfcn;
uint8_t pm[2];
uint8_t tn;
uint8_t padding;
} __attribute__((packed));
/* traffic data to network */

294
src/host/fb_tools/bdf_to_c.py Executable file
View File

@ -0,0 +1,294 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
This script converts a bdf-font to a c-source-file containing
selected glyphs in the format defined by the <fb/font.h> header.
'''
# (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
#
# All Rights Reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from optparse import OptionParser
import sys
import os
import string
def unique_name(thisname,existingnames) :
# return first of thisname, thisname_1, thisname_2, ...
# that does not yet exist in existingnames. This is used
# because somethings glyphs with non-unique names exist
# in fonts!
retname=thisname
N=1
while retname in existingnames :
N=N+1
retname='%s_%d'%(thisname,N)
return retname
# return number N (for a character), optionally including
# the ascii character
def ascii_charnum(n) :
if n >= 32 and n < 127 :
if n != 34 : # """ looks stupid
return '(%d, ASCII "%s")'%(n,chr(n))
else :
return '(%d, ASCII \'%s\')'%(n,chr(n))
return '(%d)'%(n)
def is_zeroes(s) :
# check if list s consists entirely of "00" strings
# (used to detect empty lines in fonts)
for x in s :
if s != '00' :
return False
return True
def byte_to_bits(x) :
# convert byte x to a string representing the bits #=1, .=0
# used for drawing pretty pictures in the comments of the
# generated C-file
ret = ''
for i in range(8) :
if x & 1<<(7-i) :
ret = ret + '#'
else :
ret = ret + '.'
return ret
class BDF_Font(object) :
# this class stores a read-in bdf font
def __init__(self,filename) :
self.filename = filename
self.glyphs = dict()
self.enc = dict()
self.height = None
self.registry = None
self.encoding = None
self.ascent = 0
self.descent = 0
self.read_font(filename)
def add_header(self,data) :
#print 'Header data: ',data
self.registry = data.get('charset_registry','none')
self.encoding = data.get('charset_encoding','unknown')
self.ascent = int(data['font_ascent'])
self.descent = int(data['font_descent'])
bbx = data['fontboundingbox'].split(None,3)
self.height = int(bbx[1])
def add_glyph(self,charname,data,bitmap) :
chnum = int(data['encoding'])
# print 'add_glyph(%s) -> %s'%(charname,ascii_charnum(chnum))
self.enc[chnum] = charname
self.glyphs[charname] = data
self.glyphs[charname]['bitmap']=bitmap
def read_font(self,filename) :
f = file(filename)
hdr_data = dict()
# read in header
for l in f :
l = l.strip()
if l == '' :
continue
arr = l.split(None,1)
if len(arr) > 1 :
hdr_data[ arr[0].lower() ] = arr[1]
if arr[0].lower() == 'chars' :
break
self.add_header(hdr_data)
# now read in characters
inchar = None
data = dict() # store glyph data
bitmap = None
for l in f :
l = l.strip()
if l == '' :
continue
# waiting for next glyph
if inchar == None :
if l.lower() == 'endfont' :
break # end of font :-)
arr = l.split(None,1)
if len(arr) < 2 and \
arr[0].lower() != 'STARTCHAR' :
print >>sys.stderr,'Not start of glyph: %s'%(l)
continue
inchar = unique_name(arr[1],self.glyphs)
continue
# ENDCHAR always ends the glyph
if l.lower() == 'endchar' :
self.add_glyph(inchar,data,bitmap)
inchar = None
bitmap = None
data = dict()
continue
# in bitmap
if bitmap != None :
bitmap.append(l)
continue
# else: metadata for this glyph
arr = l.split(None,1)
if arr[0].lower() == 'bitmap' :
bitmap = list() # start collecting pixels
continue
if len(arr) < 2 :
print >>sys.stderr,'Bad line in font: %s'%(l)
continue
data[arr[0].lower()] = arr[1]
if __name__ == '__main__' :
P = OptionParser(usage='%prog [options] bdf-file')
P.add_option('-o','--out',action='store', dest='out', default=None,
metavar='FILE',help='write .c-code representing font to FILE')
P.add_option('-b','--base',action='store',dest='base',default=None,
metavar='base_symbol',help='prefix for all generated symbols')
P.add_option('-f','--firstchar',action='store',dest='firstchar',type="int",
metavar='N',default=None,help='numeric value of first char')
P.add_option('-l','--lastchar',action='store',dest='lastchar',type="int",
metavar='N',default=None,help='numeric value of last char')
opts,args = P.parse_args()
if len(args) != 1 :
P.error('Please specify (exactly one) bdf input file.')
font = BDF_Font(args[0])
if opts.firstchar == None :
opts.firstchar = min(font.enc)
print 'First character in font: %d, %s'%(opts.firstchar,
font.enc[opts.firstchar])
if opts.lastchar == None :
opts.lastchar = max(font.enc)
print 'Last character in font: %d, %s'%(opts.lastchar,
font.enc[opts.lastchar])
if opts.base == None :
opts.base = 'font_'+os.path.basename(args[0])
if opts.base[-4:] == '.bdf' :
opts.base = opts.base[:-4]
print >>sys.stderr,'Guessing symbol prefix to be %s.'%(opts.base)
if opts.out == None :
opts.out = os.path.basename(args[0])
if opts.out[-4:] == '.bdf' :
opts.out = opts.out[:-4]
opts.out = opts.out + '.c'
print >>sys.stderr,'Guessing output filename to be %s.'%(opts.out)
if os.path.exists(opts.out) :
print >>sys.stderr,'Will *NOT* overwrite existing file when guessing output!'
sys.exit(1)
of = file(opts.out,'w')
print >>of,'#include <fb/font.h>'
print >>of,'/* file autogenerated by %s */'%(sys.argv[0])
offsets = list()
glyphnames = list()
print >>of,'static const uint8_t %s_data[] = {'%(opts.base)
pos = 0
# output font data, build up per-character information
for i in range(opts.firstchar,opts.lastchar+1) :
if not i in font.enc :
offsets.append(0xffff)
glyphnames.append('(no glyph)')
continue
charname = font.enc[i]
glyphnames.append('%s %s'%(charname,ascii_charnum(i)))
offsets.append(pos)
glyph = font.glyphs[charname]
bbx = map(int,glyph['bbx'].split(None,3))
bitmap = glyph['bitmap']
if bbx[1] != len(bitmap) :
print >>sys.stderr,'ERROR: glyph',charname,'has wrong number of lines of data!'
print >>sys.stderr,' want: ',bbx[1],'but have',len(bitmap)
sys.exit(1)
removedrows = 0
while len(bitmap) > 1 and is_zeroes(bitmap[0]) :
removedrows = removedrows + 1
bbx[1] = bbx[1] - 1 # decrease height
bitmap = bitmap[1:]
while len(bitmap) > 1 and is_zeroes(bitmap[-1]) :
removedrows = removedrows + 1
bbx[1] = bbx[1] - 1 # decrease height
bbx[3] = bbx[3] + 1 # increase y0
bitmap = bitmap[:-1]
if removedrows > 0 :
print "Glyph %s: removed %d rows."%(charname,removedrows)
w = int(glyph['dwidth'].split(None,1)[0])
print >>of,'/* --- new character %s %s starting at offset 0x%04x --- */'%(
charname,ascii_charnum(i),pos)
print >>of,'\t/*%04x:*/\t%d, %d, %d, %d, %d, /* width and bbox (w,h,x,y) */'%(
pos,w,bbx[0],bbx[1],bbx[2],bbx[3])
pos += 5
for k,l in enumerate(bitmap) :
bytes = [ int(l[i:i+2],16) for i in range(0,len(l),2) ]
if len(bytes) != (bbx[0]+7)/8 :
print >>sys.stderr,'ERROR: glyph',charname,'has wrong # of bytes'
print >>sys.stderr,' per line. Want',(bbx[0]+7)/8,'have',len(bytes)
sys.exit(1)
cdata = ','.join([ '0x%02x'%v for v in bytes ])
comment = ''.join([ byte_to_bits(b) for b in bytes ])
print >>of,'\t/*%04x:*/\t'%(pos)+cdata+', /* '+comment+' */'
pos += len(bytes)
print >>of,"};"
x = ',\n\t'.join(['0x%04x /* %s */'%(w,n) for w,n in zip(offsets,glyphnames)])
print >>of,'static const uint16_t %s_offsets[] = {\n\t%s\n};'%(opts.base,x)
height = font.ascent + font.descent
print >>of,'const struct fb_font %s = {'%(opts.base)
print >>of,'\t.height = %d,'%(height)
print >>of,'\t.ascent = %d,'%(font.ascent)
print >>of,'\t.firstchar = %d, /* %s */'%(opts.firstchar,font.enc.get(opts.firstchar,"?"))
print >>of,'\t.lastchar = %d, /* %s */'%(opts.lastchar,font.enc.get(opts.lastchar,"?"))
print >>of,'\t.chardata = %s_data,'%(opts.base)
print >>of,'\t.charoffs = %s_offsets,'%(opts.base)
print >>of,'};'

View File

@ -10,6 +10,7 @@ enum {
L23_OPT_TAP = 4,
L23_OPT_VTY = 8,
L23_OPT_DBG = 16,
L23_OPT_VTYIP = 32,
};
/* initialization, called once when starting the app, before entering

View File

@ -4,7 +4,7 @@
char *config_dir;
int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
const char *config_file, uint16_t vty_port);
const char *config_file, const char *vty_ip, uint16_t vty_port);
int l23_app_exit(void);
int l23_app_work(int *quit);
int mobile_delete(struct osmocom_ms *ms, int force);

View File

@ -87,6 +87,7 @@ struct gsm_settings {
/* radio */
uint16_t dsc_max;
uint8_t force_rekey;
/* dialing */
struct llist_head abbrev;

View File

@ -105,6 +105,7 @@ int gsm_subscr_dump_forbidden_plmn(struct osmocom_ms *ms,
void gsm_subscr_dump(struct gsm_subscriber *subscr,
void (*print)(void *, const char *, ...), void *priv);
char *gsm_check_imsi(const char *imsi);
int gsm_subscr_get_key_seq(struct osmocom_ms *ms, struct gsm_subscriber *subscr);
#endif /* _SUBSCRIBER_H */

View File

@ -900,8 +900,10 @@ int l1ctl_tx_neigh_pm_req(struct osmocom_ms *ms, int num, uint16_t *arfcn)
LOGP(DL1C, LOGL_INFO, "Tx NEIGH PM Req (num %u)\n", num);
pm_req = (struct l1ctl_neigh_pm_req *) msgb_put(msg, sizeof(*pm_req));
pm_req->n = num;
for (i = 0; i < num; i++)
for (i = 0; i < num; i++) {
pm_req->band_arfcn[i] = htons(*arfcn++);
pm_req->tn[i] = 0;
}
return osmo_send_l1(ms, msg);
}

View File

@ -56,6 +56,7 @@ static char *sap_socket_path = "/tmp/osmocom_sap";
struct llist_head ms_list;
static struct osmocom_ms *ms = NULL;
static char *gsmtap_ip = NULL;
static char *vty_ip = "127.0.0.1";
unsigned short vty_port = 4247;
int (*l23_app_work) (struct osmocom_ms *ms) = NULL;
@ -106,6 +107,10 @@ static void print_help()
if (options & L23_OPT_DBG)
printf(" -d --debug Change debug flags.\n");
if (options & L23_OPT_VTYIP)
printf(" -u --vty-ip The VTY IP to bind telnet to. "
"(default %s)\n", vty_ip);
if (app && app->cfg_print_help)
app->cfg_print_help();
}
@ -122,13 +127,14 @@ static void build_config(char **opt, struct option **option)
{"sap", 1, 0, 'S'},
{"arfcn", 1, 0, 'a'},
{"gsmtap-ip", 1, 0, 'i'},
{"vty-ip", 1, 0, 'u'},
{"vty-port", 1, 0, 'v'},
{"debug", 1, 0, 'd'},
};
app = l23_app_info();
*opt = talloc_asprintf(l23_ctx, "hs:S:a:i:v:d:%s",
*opt = talloc_asprintf(l23_ctx, "hs:S:a:i:v:d:u:%s",
app && app->getopt_string ? app->getopt_string : "");
len = ARRAY_SIZE(long_options);
@ -174,6 +180,9 @@ static void handle_options(int argc, char **argv)
case 'i':
gsmtap_ip = optarg;
break;
case 'u':
vty_ip = optarg;
break;
case 'v':
vty_port = atoi(optarg);
break;

View File

@ -69,7 +69,7 @@ enum {
/* ranges of bands */
static uint16_t *band_range = 0;
static uint16_t range_all[] = {0, 124, 128, 251, 512, 885, 955, 1023, 1024, 1322, 0, 0};
static uint16_t range_all[] = {0, 124, 512, 885, 955, 1023, 0, 0};
static uint16_t range_900[] = {0, 124, 955, 1023, 0, 0};
static uint16_t range_1800[] = {512, 885, 0, 0};
static uint16_t range_850[] = {128, 251, 0, 0};

View File

@ -352,7 +352,7 @@ static struct vty_app_info vty_info = {
/* global init */
int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
const char *config_file, uint16_t vty_port)
const char *config_file, const char *vty_ip, uint16_t vty_port)
{
struct telnet_connection dummy_conn;
int rc = 0;
@ -376,7 +376,7 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
}
}
vty_reading = 0;
telnet_init(l23_ctx, NULL, vty_port);
telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port);
if (rc < 0)
return rc;
printf("VTY available on port %u.\n", vty_port);

View File

@ -1840,10 +1840,11 @@ static int gsm322_cs_select(struct osmocom_ms *ms, int index, uint16_t mcc,
/* loop through all scanned frequencies and select cell.
* if an index is given (arfci), we just check this cell only */
if (index >= 0)
if (index >= 0) {
start = end = index;
else
} else {
start = 0; end = 1023+299;
}
for (i = start; i <= end; i++) {
cs->list[i].flags &= ~GSM322_CS_FLAG_TEMP_AA;
s = cs->list[i].sysinfo;

View File

@ -2344,7 +2344,7 @@ static int gsm48_mm_tx_loc_upd_req(struct osmocom_ms *ms)
/* location updating type */
nlu->type = mm->lupd_type;
/* cipering key */
nlu->key_seq = subscr->key_seq;
nlu->key_seq = gsm_subscr_get_key_seq(ms, subscr);
/* LAI (last SIM stored LAI)
*
* NOTE: The TMSI is only valid within a LAI!
@ -2806,7 +2806,7 @@ static int gsm48_mm_tx_cm_serv_req(struct osmocom_ms *ms, int rr_prim,
/* type and key */
nsr->cm_service_type = cm_serv;
nsr->cipher_key_seq = subscr->key_seq;
nsr->cipher_key_seq = gsm_subscr_get_key_seq(ms, subscr);
/* classmark 2 */
cm2lv[0] = sizeof(struct gsm48_classmark2);
gsm48_rr_enc_cm2(ms, (struct gsm48_classmark2 *)(cm2lv + 1),

View File

@ -3251,7 +3251,7 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
gh->msg_type = GSM48_MT_RR_PAG_RESP;
pr = (struct gsm48_pag_rsp *) msgb_put(nmsg, sizeof(*pr));
/* key sequence */
pr->key_seq = subscr->key_seq;
pr->key_seq = gsm_subscr_get_key_seq(ms, subscr);
/* classmark 2 */
pr->cm2_len = sizeof(pr->cm2);
gsm48_rr_enc_cm2(ms, &pr->cm2, rr->cd_now.arfcn);

View File

@ -52,6 +52,7 @@ void *l23_ctx = NULL;
struct llist_head ms_list;
static char *gsmtap_ip = 0;
struct gsmtap_inst *gsmtap_inst = NULL;
static char *vty_ip = "127.0.0.1";
unsigned short vty_port = 4247;
int debug_set = 0;
char *config_dir = NULL;
@ -88,6 +89,8 @@ static void print_help()
printf(" Some help...\n");
printf(" -h --help this text\n");
printf(" -i --gsmtap-ip The destination IP used for GSMTAP.\n");
printf(" -u --vty-ip The VTY IP to telnet to. "
"(default %s)\n", vty_ip);
printf(" -v --vty-port The VTY port number to telnet to. "
"(default %u)\n", vty_port);
printf(" -d --debug Change debug flags. default: %s\n",
@ -104,6 +107,7 @@ static void handle_options(int argc, char **argv)
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"gsmtap-ip", 1, 0, 'i'},
{"vty-ip", 1, 0, 'u'},
{"vty-port", 1, 0, 'v'},
{"debug", 1, 0, 'd'},
{"daemonize", 0, 0, 'D'},
@ -111,7 +115,7 @@ static void handle_options(int argc, char **argv)
{0, 0, 0, 0},
};
c = getopt_long(argc, argv, "hi:v:d:Dm",
c = getopt_long(argc, argv, "hi:u:v:d:Dm",
long_options, &option_index);
if (c == -1)
break;
@ -125,6 +129,9 @@ static void handle_options(int argc, char **argv)
case 'i':
gsmtap_ip = optarg;
break;
case 'u':
vty_ip = optarg;
break;
case 'v':
vty_port = atoi(optarg);
break;
@ -226,9 +233,9 @@ int main(int argc, char **argv)
config_dir = dirname(config_dir);
if (use_mncc_sock)
rc = l23_app_init(mncc_recv_socket, config_file, vty_port);
rc = l23_app_init(mncc_recv_socket, config_file, vty_ip, vty_port);
else
rc = l23_app_init(NULL, config_file, vty_port);
rc = l23_app_init(NULL, config_file, vty_ip, vty_port);
if (rc)
exit(rc);

View File

@ -1144,6 +1144,14 @@ int gsm_subscr_is_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc,
return 0;
}
int gsm_subscr_get_key_seq(struct osmocom_ms *ms, struct gsm_subscriber *subscr)
{
if (ms->settings.force_rekey)
return 7;
else
return subscr->key_seq;
}
int gsm_subscr_dump_forbidden_plmn(struct osmocom_ms *ms,
void (*print)(void *, const char *, ...), void *priv)
{

View File

@ -1300,6 +1300,9 @@ static void config_write_ms(struct vty *vty, struct osmocom_ms *ms)
if (!hide_default || set->auto_answer)
vty_out(vty, " %sauto-answer%s",
(set->auto_answer) ? "" : "no ", VTY_NEWLINE);
if (!hide_default || set->force_rekey)
vty_out(vty, " %sforce-rekey%s",
(set->force_rekey) ? "" : "no ", VTY_NEWLINE);
if (!hide_default || set->clip)
vty_out(vty, " %sclip%s", (set->clip) ? "" : "no ",
VTY_NEWLINE);
@ -1730,6 +1733,28 @@ DEFUN(cfg_auto_answer, cfg_ms_auto_answer_cmd, "auto-answer",
return CMD_SUCCESS;
}
DEFUN(cfg_no_force_rekey, cfg_ms_no_force_rekey_cmd, "no force-rekey",
NO_STR "Disable key renew forcing after every event")
{
struct osmocom_ms *ms = vty->index;
struct gsm_settings *set = &ms->settings;
set->force_rekey = 0;
return CMD_SUCCESS;
}
DEFUN(cfg_force_rekey, cfg_ms_force_rekey_cmd, "force-rekey",
"Enable key renew forcing after every event")
{
struct osmocom_ms *ms = vty->index;
struct gsm_settings *set = &ms->settings;
set->force_rekey = 1;
return CMD_SUCCESS;
}
DEFUN(cfg_clip, cfg_ms_clip_cmd, "clip",
"Force caller ID presentation")
{
@ -2782,6 +2807,8 @@ int ms_vty_init(void)
install_element(MS_NODE, &cfg_ms_no_cw_cmd);
install_element(MS_NODE, &cfg_ms_auto_answer_cmd);
install_element(MS_NODE, &cfg_ms_no_auto_answer_cmd);
install_element(MS_NODE, &cfg_ms_force_rekey_cmd);
install_element(MS_NODE, &cfg_ms_no_force_rekey_cmd);
install_element(MS_NODE, &cfg_ms_clip_cmd);
install_element(MS_NODE, &cfg_ms_clir_cmd);
install_element(MS_NODE, &cfg_ms_no_clip_cmd);

View File

@ -307,7 +307,7 @@ int read_file(const char *filename)
}
rc = fstat(fd, &st);
if (st.st_size > MAX_DNLOAD_SIZE) {
if ((st.st_size > MAX_DNLOAD_SIZE) && (dnload.mode != MODE_ROMLOAD)) {
fprintf(stderr, "The maximum file size is 64kBytes (%u bytes)\n",
MAX_DNLOAD_SIZE);
return -EFBIG;

View File

@ -53,6 +53,7 @@ tests/a5/a5_test
tests/auth/milenage_test
tests/conv/conv_test
tests/lapd/lapd_test
tests/gsm0808/gsm0808_test
utils/osmo-arfcn
utils/osmo-auc-gen

View File

@ -1,6 +1,6 @@
AC_INIT([libosmocore],
m4_esyscmd([./git-version-gen .tarball-version]),
[openbsc-devel@lists.openbsc.org])
[openbsc@lists.osmocom.org])
AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_TESTDIR(tests)
@ -168,6 +168,7 @@ AC_OUTPUT(
tests/auth/Makefile
tests/conv/Makefile
tests/lapd/Makefile
tests/gsm0808/Makefile
utils/Makefile
Doxyfile.core
Doxyfile.gsm

View File

@ -77,11 +77,19 @@
#define GSMTAP_CHANNEL_SDCCH8 0x08
#define GSMTAP_CHANNEL_TCH_F 0x09
#define GSMTAP_CHANNEL_TCH_H 0x0a
#define GSMTAP_CHANNEL_CBCH51 0x0b
#define GSMTAP_CHANNEL_PACCH 0x0b
#define GSMTAP_CHANNEL_CBCH52 0x0c
#define GSMTAP_CHANNEL_PDCH 0x0d
#define GSMTAP_CHANNEL_PTCCH 0x0e
#define GSMTAP_CHANNEL_PACCH 0x0f
#define GSMTAP_CHANNEL_CBCH51 0x0f
/* GPRS Coding Scheme CS1..4 */
#define GSMTAP_GPRS_CS_BASE 0x20
#define GSMTAP_GPRS_CS(N) (GSMTAP_GPRS_CS_BASE + N)
/* (E) GPRS Coding Scheme MCS0..9 */
#define GSMTAP_GPRS_MCS_BASE 0x30
#define GSMTAP_GPRS_MCS(N) (GSMTAP_GPRS_MCS_BASE + N)
#define GSMTAP_CHANNEL_ACCH 0x80
/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */

View File

@ -312,6 +312,32 @@ static inline void msgb_reserve(struct msgb *msg, int len)
msg->tail += len;
}
/*! \brief Trim the msgb to a given absolute length
* \param[in] msg message buffer
* \param[in] len new total length of buffer
* \returns 0 in case of success, negative in case of error
*/
static inline int msgb_trim(struct msgb *msg, int len)
{
if (len > msg->data_len)
return -1;
msg->len = len;
msg->tail = msg->data + len;
return 0;
}
/*! \brief Trim the msgb to a given layer3 length
* \pram[in] msg message buffer
* \param[in] l3len new layer3 length
* \returns 0 in case of success, negative in case of error
*/
static inline int msgb_l3trim(struct msgb *msg, int l3len)
{
return msgb_trim(msg, (msg->l3h - msg->data) + l3len);
}
/*! \brief Allocate message buffer with specified headroom
* \param[in] size size in bytes, including headroom
* \param[in] headroom headroom in bytes

View File

@ -12,6 +12,7 @@
#include <stdint.h>
struct sockaddr;
struct osmo_fd;
/* flags for osmo_sock_init. */
#define OSMO_SOCK_F_CONNECT (1 << 0)

View File

@ -33,6 +33,7 @@ struct osmo_sub_auth_data {
uint8_t k[16];
uint8_t amf[2];
uint64_t sqn;
int opc_is_op;
} umts;
struct {
uint8_t ki[16];

View File

@ -30,7 +30,8 @@ struct msgb *gsm0808_create_clear_command(uint8_t reason);
struct msgb *gsm0808_create_clear_complete(void);
struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id);
struct msgb *gsm0808_create_cipher_reject(uint8_t cause);
struct msgb *gsm0808_create_classmark_update(const uint8_t *classmark, uint8_t length);
struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
const uint8_t *cm3, uint8_t cm3_len);
struct msgb *gsm0808_create_sapi_reject(uint8_t link_id);
struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
uint8_t chosen_channel, uint8_t encr_alg_id,

View File

@ -108,7 +108,7 @@ int gsm48_encode_more(struct msgb *msg);
struct gsm_sysinfo_freq {
/* if the frequency included in the sysinfo */
uint8_t mask;
};
} __attribute__ ((packed));
/* decode "Cell Channel Description" (10.5.2.1b) and other frequency lists */
int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd,

View File

@ -213,15 +213,15 @@ struct gsm48_chan_desc {
tsc:3;
uint8_t hsn:6,
maio_low:2;
} h1;
} __attribute__ ((packed)) h1;
struct {
uint8_t arfcn_high:2,
spare:2,
h:1,
tsc:3;
uint8_t arfcn_low;
} h0;
};
} __attribute__ ((packed)) h0;
} __attribute__ ((packed));
} __attribute__ ((packed));
/* Chapter 10.5.2.20 */

View File

@ -178,28 +178,32 @@ static inline uint8_t *tv16_put(uint8_t *buf, uint8_t tag,
return buf;
}
/*! \brief put (append) a LV field to a \ref msgb */
/*! \brief put (append) a LV field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_lv_put(struct msgb *msg, uint8_t len, const uint8_t *val)
{
uint8_t *buf = msgb_put(msg, LV_GROSS_LEN(len));
return lv_put(buf, len, val);
}
/*! \brief put (append) a TLV field to a \ref msgb */
/*! \brief put (append) a TLV field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
{
uint8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len));
return tlv_put(buf, tag, len, val);
}
/*! \brief put (append) a TV field to a \ref msgb */
/*! \brief put (append) a TV field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
{
uint8_t *buf = msgb_put(msg, 2);
return tv_put(buf, tag, val);
}
/*! \brief put (append) a TVfixed field to a \ref msgb */
/*! \brief put (append) a TVfixed field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_tv_fixed_put(struct msgb *msg, uint8_t tag,
unsigned int len, const uint8_t *val)
{
@ -207,47 +211,57 @@ static inline uint8_t *msgb_tv_fixed_put(struct msgb *msg, uint8_t tag,
return tv_fixed_put(buf, tag, len, val);
}
/*! \brief put (append) a V field to a \ref msgb */
/*! \brief put (append) a V field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_v_put(struct msgb *msg, uint8_t val)
{
uint8_t *buf = msgb_put(msg, 1);
return v_put(buf, val);
}
/*! \brief put (append) a TV16 field to a \ref msgb */
/*! \brief put (append) a TV16 field to a \ref msgb
* \returns pointer to first byte after newly-put information */
static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
{
uint8_t *buf = msgb_put(msg, 3);
return tv16_put(buf, tag, val);
}
/*! \brief push (prepend) a TLV field to a \ref msgb */
/*! \brief push (prepend) a TLV field to a \ref msgb
* \returns pointer to first byte of newly-pushed information */
static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
{
uint8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len));
return tlv_put(buf, tag, len, val);
tlv_put(buf, tag, len, val);
return buf;
}
/*! \brief push (prepend) a TV field to a \ref msgb */
/*! \brief push (prepend) a TV field to a \ref msgb
* \returns pointer to first byte of newly-pushed information */
static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
{
uint8_t *buf = msgb_push(msg, 2);
return tv_put(buf, tag, val);
tv_put(buf, tag, val);
return buf;
}
/*! \brief push (prepend) a TV16 field to a \ref msgb */
/*! \brief push (prepend) a TV16 field to a \ref msgb
* \returns pointer to first byte of newly-pushed information */
static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
{
uint8_t *buf = msgb_push(msg, 3);
return tv16_put(buf, tag, val);
tv16_put(buf, tag, val);
return buf;
}
/*! \brief push (prepend) a TvLV field to a \ref msgb */
/*! \brief push (prepend) a TvLV field to a \ref msgb
* \returns pointer to first byte of newly-pushed information */
static inline uint8_t *msgb_tvlv_push(struct msgb *msg, uint8_t tag, uint16_t len,
const uint8_t *val)
{
uint8_t *buf = msgb_push(msg, TVLV_GROSS_LEN(len));
return tvlv_put(buf, tag, len, val);
tvlv_put(buf, tag, len, val);
return buf;
}
/* TLV parsing */

View File

@ -7,4 +7,7 @@
void vty_out_rate_ctr_group(struct vty *vty, const char *prefix,
struct rate_ctr_group *ctrg);
int osmo_vty_write_config_file(const char *filename);
int osmo_vty_save_config_file(void);
#endif

View File

@ -47,6 +47,7 @@ struct telnet_connection {
};
int telnet_init(void *tall_ctx, void *priv, int port);
int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port);
void telnet_exit(void);

View File

@ -89,10 +89,10 @@ osmo_a5(int n, const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul)
#define A5_R3_MASK ((1<<A5_R3_LEN)-1)
#define A5_R4_MASK ((1<<A5_R4_LEN)-1)
#define A5_R1_TAPS 0x072000 /* x^19 + x^5 + x^2 + x + 1 */
#define A5_R2_TAPS 0x300000 /* x^22 + x + 1 */
#define A5_R3_TAPS 0x700080 /* x^23 + x^15 + x^2 + x + 1 */
#define A5_R4_TAPS 0x010800 /* x^17 + x^5 + 1 */
#define A5_R1_TAPS 0x072000 /* x^19 + x^18 + x^17 + x^14 + 1 */
#define A5_R2_TAPS 0x300000 /* x^22 + x^21 + 1 */
#define A5_R3_TAPS 0x700080 /* x^23 + x^22 + x^21 + x^8 + 1 */
#define A5_R4_TAPS 0x010800 /* x^17 + x^12 + 1 */
/*! \brief Computes parity of a 32-bit word
* \param[in] x 32 bit word

View File

@ -83,10 +83,21 @@ static int milenage_gen_vec_auts(struct osmo_auth_vector *vec,
const uint8_t *_rand)
{
uint8_t sqn_out[6];
uint8_t gen_opc[16];
uint8_t *opc;
int rc;
rc = milenage_auts(aud->u.umts.opc, aud->u.umts.k,
rand_auts, auts, sqn_out);
/* Check if we only know OP and compute OPC if required */
if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) {
rc = milenage_opc_gen(gen_opc, aud->u.umts.k,
aud->u.umts.opc);
if (rc < 0)
return rc;
opc = gen_opc;
} else
opc = aud->u.umts.opc;
rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out);
if (rc < 0)
return rc;

View File

@ -27,69 +27,52 @@
#define BSSMAP_MSG_SIZE 512
#define BSSMAP_MSG_HEADROOM 128
static void put_data_16(uint8_t *data, const uint16_t val)
{
memcpy(data, &val, sizeof(val));
}
struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci)
{
uint8_t *data;
uint8_t *ci;
struct msgb* msg;
struct gsm48_loc_area_id *lai;
struct {
uint8_t ident;
struct gsm48_loc_area_id lai;
uint16_t ci;
} __attribute__ ((packed)) lai_ci;
msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"bssmap cmpl l3");
if (!msg)
return NULL;
/* create the bssmap header */
msg->l3h = msgb_put(msg, 2);
msg->l3h[0] = 0x0;
/* create layer 3 header */
data = msgb_put(msg, 1);
data[0] = BSS_MAP_MSG_COMPLETE_LAYER_3;
msgb_v_put(msg, BSS_MAP_MSG_COMPLETE_LAYER_3);
/* create the cell header */
data = msgb_put(msg, 3);
data[0] = GSM0808_IE_CELL_IDENTIFIER;
data[1] = 1 + sizeof(*lai) + 2;
data[2] = CELL_IDENT_WHOLE_GLOBAL;
lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai));
gsm48_generate_lai(lai, cc, nc, lac);
ci = msgb_put(msg, 2);
put_data_16(ci, htons(_ci));
lai_ci.ident = CELL_IDENT_WHOLE_GLOBAL;
gsm48_generate_lai(&lai_ci.lai, cc, nc, lac);
lai_ci.ci = htons(_ci);
msgb_tlv_put(msg, GSM0808_IE_CELL_IDENTIFIER, sizeof(lai_ci),
(uint8_t *) &lai_ci);
/* copy the layer3 data */
data = msgb_put(msg, msgb_l3len(msg_l3) + 2);
data[0] = GSM0808_IE_LAYER_3_INFORMATION;
data[1] = msgb_l3len(msg_l3);
memcpy(&data[2], msg_l3->l3h, data[1]);
msgb_tlv_put(msg, GSM0808_IE_LAYER_3_INFORMATION,
msgb_l3len(msg_l3), msg_l3->l3h);
/* update the size */
msg->l3h[1] = msgb_l3len(msg) - 2;
/* push the bssmap header */
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
return msg;
}
struct msgb *gsm0808_create_reset(void)
{
uint8_t cause = GSM0808_CAUSE_EQUIPMENT_FAILURE;
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"bssmap: reset");
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 6);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 0x04;
msg->l3h[2] = 0x30;
msg->l3h[3] = 0x04;
msg->l3h[4] = 0x01;
msg->l3h[5] = 0x20;
msgb_v_put(msg, BSS_MAP_MSG_RESET);
msgb_tlv_put(msg, GSM0808_IE_CAUSE, 1, &cause);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
return msg;
}
@ -97,13 +80,12 @@ struct msgb *gsm0808_create_clear_complete(void)
{
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"bssmap: clear complete");
uint8_t val = BSS_MAP_MSG_CLEAR_COMPLETE;
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 3);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 1;
msg->l3h[2] = BSS_MAP_MSG_CLEAR_COMPLETE;
msg->l3h = msg->data;
msgb_tlv_put(msg, BSSAP_MSG_BSS_MANAGEMENT, 1, &val);
return msg;
}
@ -118,6 +100,7 @@ struct msgb *gsm0808_create_clear_command(uint8_t reason)
msg->l3h = msgb_tv_put(msg, BSSAP_MSG_BSS_MANAGEMENT, 4);
msgb_v_put(msg, BSS_MAP_MSG_CLEAR_CMD);
msgb_tlv_put(msg, GSM0808_IE_CAUSE, 1, &reason);
return msg;
}
@ -129,26 +112,20 @@ struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id)
return NULL;
/* send response with BSS override for A5/1... cheating */
msg->l3h = msgb_put(msg, 3);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 0xff;
msg->l3h[2] = BSS_MAP_MSG_CIPHER_MODE_COMPLETE;
msgb_v_put(msg, BSS_MAP_MSG_CIPHER_MODE_COMPLETE);
/* include layer3 in case we have at least two octets */
if (layer3 && msgb_l3len(layer3) > 2) {
msg->l4h = msgb_put(msg, msgb_l3len(layer3) + 2);
msg->l4h[0] = GSM0808_IE_LAYER_3_MESSAGE_CONTENTS;
msg->l4h[1] = msgb_l3len(layer3);
memcpy(&msg->l4h[2], layer3->l3h, msgb_l3len(layer3));
msg->l4h = msgb_tlv_put(msg, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS,
msgb_l3len(layer3), layer3->l3h);
}
/* and the optional BSS message */
msg->l4h = msgb_put(msg, 2);
msg->l4h[0] = GSM0808_IE_CHOSEN_ENCR_ALG;
msg->l4h[1] = alg_id;
msgb_tv_put(msg, GSM0808_IE_CHOSEN_ENCR_ALG, alg_id);
/* pre-pend the header */
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
/* update the size */
msg->l3h[1] = msgb_l3len(msg) - 2;
return msg;
}
@ -159,32 +136,29 @@ struct msgb *gsm0808_create_cipher_reject(uint8_t cause)
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 4);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 2;
msg->l3h[2] = BSS_MAP_MSG_CIPHER_MODE_REJECT;
msg->l3h[3] = cause;
msgb_tv_put(msg, BSS_MAP_MSG_CIPHER_MODE_REJECT, cause);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
return msg;
}
struct msgb *gsm0808_create_classmark_update(const uint8_t *classmark_data, uint8_t length)
struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
const uint8_t *cm3, uint8_t cm3_len)
{
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"classmark-update");
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 3);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 0xff;
msg->l3h[2] = BSS_MAP_MSG_CLASSMARK_UPDATE;
msgb_v_put(msg, BSS_MAP_MSG_CLASSMARK_UPDATE);
msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T2, cm2_len, cm2);
if (cm3)
msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T3,
cm3_len, cm3);
msg->l4h = msgb_put(msg, length);
memcpy(msg->l4h, classmark_data, length);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
/* update the size */
msg->l3h[1] = msgb_l3len(msg) - 2;
return msg;
}
@ -195,12 +169,11 @@ struct msgb *gsm0808_create_sapi_reject(uint8_t link_id)
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 5);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 3;
msg->l3h[2] = BSS_MAP_MSG_SAPI_N_REJECT;
msg->l3h[3] = link_id;
msg->l3h[4] = GSM0808_CAUSE_BSS_NOT_EQUIPPED;
msgb_v_put(msg, BSS_MAP_MSG_SAPI_N_REJECT);
msgb_v_put(msg, link_id);
msgb_v_put(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
return msg;
}
@ -209,78 +182,56 @@ struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
uint8_t chosen_channel, uint8_t encr_alg_id,
uint8_t speech_mode)
{
uint8_t *data;
struct msgb *msg = msgb_alloc(35, "bssmap: ass compl");
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"bssmap: ass compl");
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 3);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 0xff;
msg->l3h[2] = BSS_MAP_MSG_ASSIGMENT_COMPLETE;
msgb_v_put(msg, BSS_MAP_MSG_ASSIGMENT_COMPLETE);
/* write 3.2.2.22 */
data = msgb_put(msg, 2);
data[0] = GSM0808_IE_RR_CAUSE;
data[1] = rr_cause;
msgb_tv_put(msg, GSM0808_IE_RR_CAUSE, rr_cause);
/* write cirtcuit identity code 3.2.2.2 */
/* write cell identifier 3.2.2.17 */
/* write chosen channel 3.2.2.33 when BTS picked it */
data = msgb_put(msg, 2);
data[0] = GSM0808_IE_CHOSEN_CHANNEL;
data[1] = chosen_channel;
msgb_tv_put(msg, GSM0808_IE_CHOSEN_CHANNEL, chosen_channel);
/* write chosen encryption algorithm 3.2.2.44 */
data = msgb_put(msg, 2);
data[0] = GSM0808_IE_CHOSEN_ENCR_ALG;
data[1] = encr_alg_id;
msgb_tv_put(msg, GSM0808_IE_CHOSEN_ENCR_ALG, encr_alg_id);
/* write circuit pool 3.2.2.45 */
/* write speech version chosen: 3.2.2.51 when BTS picked it */
if (speech_mode != 0) {
data = msgb_put(msg, 2);
data[0] = GSM0808_IE_SPEECH_VERSION;
data[1] = speech_mode;
}
if (speech_mode != 0)
msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, speech_mode);
/* write LSA identifier 3.2.2.15 */
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
/* update the size */
msg->l3h[1] = msgb_l3len(msg) - 2;
return msg;
}
struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause)
{
uint8_t *data;
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
"bssmap: ass fail");
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 6);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 0xff;
msg->l3h[2] = BSS_MAP_MSG_ASSIGMENT_FAILURE;
msg->l3h[3] = GSM0808_IE_CAUSE;
msg->l3h[4] = 1;
msg->l3h[5] = cause;
msgb_v_put(msg, BSS_MAP_MSG_ASSIGMENT_FAILURE);
msgb_tlv_put(msg, GSM0808_IE_CAUSE, 1, &cause);
/* RR cause 3.2.2.22 */
if (rr_cause) {
data = msgb_put(msg, 2);
data[0] = GSM0808_IE_RR_CAUSE;
data[1] = *rr_cause;
}
if (rr_cause)
msgb_tv_put(msg, GSM0808_IE_RR_CAUSE, *rr_cause);
/* Circuit pool 3.22.45 */
/* Circuit pool list 3.2.2.46 */
/* update the size */
msg->l3h[1] = msgb_l3len(msg) - 2;
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
return msg;
}
@ -293,14 +244,10 @@ struct msgb *gsm0808_create_clear_rqst(uint8_t cause)
if (!msg)
return NULL;
msg->l3h = msgb_put(msg, 2 + 4);
msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
msg->l3h[1] = 4;
msgb_v_put(msg, BSS_MAP_MSG_CLEAR_RQST);
msgb_tlv_put(msg, GSM0808_IE_CAUSE, 1, &cause);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
msg->l3h[2] = BSS_MAP_MSG_CLEAR_RQST;
msg->l3h[3] = GSM0808_IE_CAUSE;
msg->l3h[4] = 1;
msg->l3h[5] = cause;
return msg;
}

View File

@ -707,7 +707,7 @@ static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
{
struct lapd_datalink *dl = lctx->dl;
uint8_t nr = lctx->n_recv;
int s = 0, rej = 0, t200_reset = 0, t200_start = 0;
int s = 0, rej = 0, t200_reset = 0;
int i, h;
/* supervisory frame ? */
@ -758,7 +758,6 @@ static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
if (dl->tx_hist[sub_mod(dl->v_send, 1, dl->range_hist)].msg) {
LOGP(DLLAPD, LOGL_INFO, "start T200, due to unacked I "
"frame(s)\n");
t200_start = 1;
lapd_start_t200(dl);
}
}
@ -1731,7 +1730,15 @@ static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
struct lapd_datalink *dl = lctx->dl;
struct msgb *msg = dp->oph.msg;
LOGP(DLLAPD, LOGL_INFO, "writing message to send-queue\n");
if (msgb_l3len(msg) == 0) {
LOGP(DLLAPD, LOGL_ERROR,
"writing an empty message is not possible.\n");
msgb_free(msg);
return -1;
}
LOGP(DLLAPD, LOGL_INFO,
"writing message to send-queue: l3len: %d\n", msgb_l3len(msg));
/* Write data into the send queue */
msgb_enqueue(&dl->send_queue, msg);

View File

@ -792,7 +792,7 @@ static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
msg->tail = msg->data + length;
msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, PRIM_DL_EST, PRIM_OP_REQUEST, msg);
@ -845,7 +845,7 @@ static int rslms_rx_rll_udata_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
msg->tail = msg->data + length;
msg->tail = msg->l3h + length;
/* Push L1 + LAPDm header on msgb */
msg->l2h = msgb_push(msg, 4 + !ui_bts);
@ -881,7 +881,7 @@ static int rslms_rx_rll_data_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
msg->tail = msg->data + length;
msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, PRIM_DL_DATA, PRIM_OP_REQUEST, msg);
@ -938,7 +938,7 @@ static int rslms_rx_rll_res_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
msg->tail = msg->data + length;
msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, (msg_type == RSL_MT_RES_REQ) ? PRIM_DL_RES

View File

@ -327,3 +327,18 @@ int milenage_check(const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand,
return 0;
}
int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op)
{
int i;
/* Encrypt OP using K */
if (aes_128_encrypt_block(k, op, opc))
return -1;
/* XOR the resulting Ek(OP) with OP */
for (i = 0; i < 16; i++)
opc[i] = opc[i] ^ op[i];
return 0;
}

View File

@ -30,4 +30,6 @@ int milenage_f1(const u8 *opc, const u8 *k, const u8 *_rand,
int milenage_f2345(const u8 *opc, const u8 *k, const u8 *_rand,
u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar);
int milenage_opc_gen(u8 *opc, const u8 *k, const u8 *op);
#endif /* MILENAGE_H */

View File

@ -2268,31 +2268,19 @@ gDEFUN(config_list, config_list_cmd, "list", "Print command list\n")
return CMD_SUCCESS;
}
/* Write current configuration into file. */
DEFUN(config_write_file,
config_write_file_cmd,
"write file",
"Write running configuration to memory, network, or terminal\n"
"Write to configuration file\n")
static int write_config_file(const char *config_file, char **outpath)
{
unsigned int i;
int fd;
struct cmd_node *node;
char *config_file;
char *config_file_tmp = NULL;
char *config_file_sav = NULL;
struct vty *file_vty;
struct stat st;
*outpath = NULL;
/* Check and see if we are operating under vtysh configuration */
if (host.config == NULL) {
vty_out(vty, "Can't save to configuration file, using vtysh.%s",
VTY_NEWLINE);
return CMD_WARNING;
}
/* Get filename. */
config_file = host.config;
config_file_sav =
_talloc_zero(tall_vty_cmd_ctx,
strlen(config_file) + strlen(CONF_BACKUP_EXT) + 1,
@ -2307,11 +2295,10 @@ DEFUN(config_write_file,
/* Open file to configuration write. */
fd = mkstemp(config_file_tmp);
if (fd < 0) {
vty_out(vty, "Can't open configuration file %s.%s",
config_file_tmp, VTY_NEWLINE);
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file_tmp);
talloc_free(config_file_tmp);
talloc_free(config_file_sav);
return CMD_WARNING;
return -1;
}
/* Make vty for configuration file. */
@ -2334,38 +2321,37 @@ DEFUN(config_write_file,
if (unlink(config_file_sav) != 0)
if (errno != ENOENT) {
vty_out(vty,
"Can't unlink backup configuration file %s.%s",
config_file_sav, VTY_NEWLINE);
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file_sav);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return CMD_WARNING;
return -2;
}
/* Only link the .sav file if the original file exists */
if (stat(config_file, &st) == 0) {
if (link(config_file, config_file_sav) != 0) {
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file_sav);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return -3;
}
sync();
if (unlink(config_file) != 0) {
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return -4;
}
if (link(config_file, config_file_sav) != 0) {
vty_out(vty, "Can't backup old configuration file %s.%s",
config_file_sav, VTY_NEWLINE);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return CMD_WARNING;
}
sync();
if (unlink(config_file) != 0) {
vty_out(vty, "Can't unlink configuration file %s.%s",
config_file, VTY_NEWLINE);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return CMD_WARNING;
}
if (link(config_file_tmp, config_file) != 0) {
vty_out(vty, "Can't save configuration file %s.%s", config_file,
VTY_NEWLINE);
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file);
talloc_free(config_file_sav);
talloc_free(config_file_tmp);
unlink(config_file_tmp);
return CMD_WARNING;
return -5;
}
unlink(config_file_tmp);
sync();
@ -2374,13 +2360,70 @@ DEFUN(config_write_file,
talloc_free(config_file_tmp);
if (chmod(config_file, 0666 & ~CONFIGFILE_MASK) != 0) {
vty_out(vty, "Can't chmod configuration file %s: %s (%d).%s",
config_file, strerror(errno), errno, VTY_NEWLINE);
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file);
return -6;
}
return 0;
}
/* Write current configuration into file. */
DEFUN(config_write_file,
config_write_file_cmd,
"write file",
"Write running configuration to memory, network, or terminal\n"
"Write to configuration file\n")
{
char *failed_file;
int rc;
if (host.config == NULL) {
vty_out(vty, "Can't save to configuration file, using vtysh.%s",
VTY_NEWLINE);
return CMD_WARNING;
}
vty_out(vty, "Configuration saved to %s%s", config_file, VTY_NEWLINE);
return CMD_SUCCESS;
rc = write_config_file(host.config, &failed_file);
switch (rc) {
case -1:
vty_out(vty, "Can't open configuration file %s.%s",
failed_file, VTY_NEWLINE);
rc = CMD_WARNING;
break;
case -2:
vty_out(vty, "Can't unlink backup configuration file %s.%s",
failed_file, VTY_NEWLINE);
rc = CMD_WARNING;
break;
case -3:
vty_out(vty, "Can't backup old configuration file %s.%s",
failed_file, VTY_NEWLINE);
rc = CMD_WARNING;
break;
case -4:
vty_out(vty, "Can't unlink configuration file %s.%s",
failed_file, VTY_NEWLINE);
rc = CMD_WARNING;
break;
case -5:
vty_out(vty, "Can't save configuration file %s.%s", failed_file,
VTY_NEWLINE);
rc = CMD_WARNING;
break;
case -6:
vty_out(vty, "Can't chmod configuration file %s: %s (%d).%s",
failed_file, strerror(errno), errno, VTY_NEWLINE);
rc = CMD_WARNING;
break;
default:
vty_out(vty, "Configuration saved to %s%s", host.config, VTY_NEWLINE);
rc = CMD_SUCCESS;
break;
}
talloc_free(failed_file);
return rc;
}
ALIAS(config_write_file,
@ -3160,6 +3203,47 @@ void install_default(enum node_type node)
install_element(node, &show_running_config_cmd);
}
/**
* \brief Write the current running config to a given file
* \param[in] vty the vty of the code
* \param[in] filename where to store the file
* \return 0 in case of success.
*
* If the filename already exists create a filename.sav
* version with the current code.
*
*/
int osmo_vty_write_config_file(const char *filename)
{
char *failed_file;
int rc;
rc = write_config_file(filename, &failed_file);
talloc_free(failed_file);
return rc;
}
/**
* \brief Save the current state to the config file
* \return 0 in case of success.
*
* If the filename already exists create a filename.sav
* version with the current code.
*
*/
int osmo_vty_save_config_file(void)
{
char *failed_file;
int rc;
if (host.config == NULL)
return -7;
rc = write_config_file(host.config, &failed_file);
talloc_free(failed_file);
return rc;
}
/* Initialize command interface. Install basic nodes and commands. */
void cmd_init(int terminal)
{

View File

@ -20,12 +20,14 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
@ -52,53 +54,38 @@ static struct osmo_fd server_socket = {
.priv_nr = 0,
};
/*! \brief Initialize telnet based VTY interface
/*! \brief Initialize telnet based VTY interface listening to 127.0.0.1
* \param[in] tall_ctx \ref talloc context
* \param[in] priv private data to be passed to callback
* \param[in] port UDP port number
*/
int telnet_init(void *tall_ctx, void *priv, int port)
{
struct sockaddr_in sock_addr;
int fd, rc, on = 1;
return telnet_init_dynif(tall_ctx, priv, "127.0.0.1", port);
}
/*! \brief Initialize telnet based VTY interface
* \param[in] tall_ctx \ref talloc context
* \param[in] priv private data to be passed to callback
* \param[in] ip IP to listen to ('::1' for localhost, '::0' for all, ...)
* \param[in] port UDP port number
*/
int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port)
{
int rc;
tall_telnet_ctx = talloc_named_const(tall_ctx, 1,
"telnet_connection");
"telnet_connection");
/* FIXME: use new socket.c code of libosmocore */
fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (fd < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface socket creation failed\n");
return fd;
}
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = htons(port);
sock_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
rc = bind(fd, (struct sockaddr*)&sock_addr, sizeof(sock_addr));
if (rc < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface failed to bind\n");
close(fd);
return rc;
}
rc = listen(fd, 0);
if (rc < 0) {
LOGP(0, LOGL_ERROR, "Telnet interface failed to listen\n");
close(fd);
return rc;
}
rc = osmo_sock_init_ofd(
&server_socket,
AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP,
ip, port, OSMO_SOCK_F_BIND
);
server_socket.data = priv;
server_socket.fd = fd;
osmo_fd_register(&server_socket);
return 0;
return (rc < 0) ? -1 : 0;
}
extern struct host host;

View File

@ -1,5 +1,5 @@
if ENABLE_TESTS
SUBDIRS = timer sms ussd smscb bits a5 conv auth lapd
SUBDIRS = timer sms ussd smscb bits a5 conv auth lapd gsm0808
if ENABLE_MSGFILE
SUBDIRS += msgfile
endif

View File

@ -37,6 +37,24 @@ static struct osmo_sub_auth_data test_aud = {
},
};
static int opc_test(const struct osmo_sub_auth_data *aud)
{
int rc;
uint8_t opc[16];
#if 0
const uint8_t op[16] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f };
#else
const uint8_t op[16] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 };
#endif
rc = milenage_opc_gen(opc, aud->u.umts.k, op);
printf("OP:\t%s\n", osmo_hexdump(op, sizeof(op)));
printf("OPC:\t%s\n", osmo_hexdump(opc, sizeof(opc)));
return rc;
}
int main(int argc, char **argv)
{
struct osmo_auth_vector _vec;
@ -73,6 +91,8 @@ int main(int argc, char **argv)
printf("AUTS success: SEQ.MS = %lu\n", test_aud.u.umts.sqn);
}
opc_test(&test_aud);
exit(0);
}

View File

@ -6,3 +6,5 @@ RES: e9 fc 88 cc c8 a3 53 81
SRES: 21 5f db 4d
Kc: 6d e8 16 a7 59 a4 29 12
AUTS success: SEQ.MS = 33
OP: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
OPC: c6 a1 3b 37 87 8f 5b 82 6f 4f 81 62 a1 c8 d8 79

View File

@ -0,0 +1,6 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include
noinst_PROGRAMS = gsm0808_test
EXTRA_DIST = gsm0808_test.ok
gsm0808_test_SOURCES = gsm0808_test.c
gsm0808_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la

View File

@ -0,0 +1,269 @@
/*
* (C) 2012 by Holger Hans Peter Freyther
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <osmocom/gsm/gsm0808.h>
#include <stdio.h>
#include <stdlib.h>
#define VERIFY(msg, data, len) \
if (msgb_l3len(msg) != len) { \
printf("%s:%d Length don't match: %d vs. %d. %s\n", \
__func__, __LINE__, msgb_l3len(msg), len, \
osmo_hexdump(msg->l3h, msgb_l3len(msg))); \
abort(); \
} else if (memcmp(msg->l3h, data, len) != 0) { \
printf("%s:%d didn't match: got: %s\n", \
__func__, __LINE__, \
osmo_hexdump(msg->l3h, msgb_l3len(msg))); \
abort(); \
}
static void test_create_layer3(void)
{
static const uint8_t res[] = {
0x00, 0x0e, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62,
0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23 };
struct msgb *msg, *in_msg;
printf("Testing creating Layer3\n");
in_msg = msgb_alloc_headroom(512, 128, "foo");
in_msg->l3h = in_msg->data;
msgb_v_put(in_msg, 0x23);
msg = gsm0808_create_layer3(in_msg, 0x1122, 0x2244, 0x3366, 0x4488);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
msgb_free(in_msg);
}
static void test_create_reset()
{
static const uint8_t res[] = { 0x00, 0x04, 0x30, 0x04, 0x01, 0x20 };
struct msgb *msg;
printf("Testing creating Reset\n");
msg = gsm0808_create_reset();
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_clear_command()
{
static const uint8_t res[] = { 0x20, 0x04, 0x01, 0x23 };
struct msgb *msg;
printf("Testing creating Clear Command\n");
msg = gsm0808_create_clear_command(0x23);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_clear_complete()
{
static const uint8_t res[] = { 0x00, 0x01, 0x21 };
struct msgb *msg;
printf("Testing creating Clear Complete\n");
msg = gsm0808_create_clear_complete();
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_cipher_complete()
{
static const uint8_t res1[] = {
0x00, 0x08, 0x55, 0x20, 0x03, 0x23, 0x42, 0x21, 0x2c, 0x04 };
static const uint8_t res2[] = { 0x00, 0x03, 0x55, 0x2c, 0x04};
struct msgb *l3, *msg;
printf("Testing creating Cipher Complete\n");
l3 = msgb_alloc_headroom(512, 128, "l3h");
l3->l3h = l3->data;
msgb_v_put(l3, 0x23);
msgb_v_put(l3, 0x42);
msgb_v_put(l3, 0x21);
/* with l3 data */
msg = gsm0808_create_cipher_complete(l3, 4);
VERIFY(msg, res1, ARRAY_SIZE(res1));
msgb_free(msg);
/* with l3 data but short */
l3->len -= 1;
l3->tail -= 1;
msg = gsm0808_create_cipher_complete(l3, 4);
VERIFY(msg, res2, ARRAY_SIZE(res2));
msgb_free(msg);
/* without l3 data */
msg = gsm0808_create_cipher_complete(NULL, 4);
VERIFY(msg, res2, ARRAY_SIZE(res2));
msgb_free(msg);
msgb_free(l3);
}
static void test_create_cipher_reject()
{
static const uint8_t res[] = { 0x00, 0x02, 0x59, 0x23 };
struct msgb *msg;
printf("Testing creating Cipher Reject\n");
msg = gsm0808_create_cipher_reject(0x23);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_cm_u()
{
static const uint8_t res[] = {
0x00, 0x07, 0x54, 0x12, 0x01, 0x23, 0x13, 0x01, 0x42 };
static const uint8_t res2o[] = {
0x00, 0x04, 0x54, 0x12, 0x01, 0x23 };
struct msgb *msg;
const uint8_t cm2 = 0x23;
const uint8_t cm3 = 0x42;
printf("Testing creating CM U\n");
msg = gsm0808_create_classmark_update(&cm2, 1, &cm3, 1);
VERIFY(msg, res, ARRAY_SIZE(res));
msg = gsm0808_create_classmark_update(&cm2, 1, NULL, 0);
VERIFY(msg, res2o, ARRAY_SIZE(res2o));
msgb_free(msg);
}
static void test_create_sapi_reject()
{
static const uint8_t res[] = { 0x00, 0x03, 0x25, 0x03, 0x25 };
struct msgb *msg;
printf("Testing creating SAPI Reject\n");
msg = gsm0808_create_sapi_reject(3);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_ass_compl()
{
static const uint8_t res1[] = {
0x00, 0x09, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c,
0x11, 0x40, 0x22 };
static const uint8_t res2[] = {
0x00, 0x07, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11};
struct msgb *msg;
printf("Testing creating Assignment Complete\n");
msg = gsm0808_create_assignment_completed(0x23, 0x42, 0x11, 0x22);
VERIFY(msg, res1, ARRAY_SIZE(res1));
msgb_free(msg);
msg = gsm0808_create_assignment_completed(0x23, 0x42, 0x11, 0);
VERIFY(msg, res2, ARRAY_SIZE(res2));
msgb_free(msg);
}
static void test_create_ass_fail()
{
static const uint8_t res1[] = { 0x00, 0x04, 0x03, 0x04, 0x01, 0x23 };
static const uint8_t res2[] = {
0x00, 0x06, 0x03, 0x04, 0x01, 0x23, 0x15, 0x02};
uint8_t rr_res = 2;
struct msgb *msg;
printf("Testing creating Assignment Failure\n");
msg = gsm0808_create_assignment_failure(0x23, NULL);
VERIFY(msg, res1, ARRAY_SIZE(res1));
msgb_free(msg);
msg = gsm0808_create_assignment_failure(0x23, &rr_res);
VERIFY(msg, res2, ARRAY_SIZE(res2));
msgb_free(msg);
}
static void test_create_clear_rqst()
{
static const uint8_t res[] = { 0x00, 0x04, 0x22, 0x04, 0x01, 0x23 };
struct msgb *msg;
printf("Testing creating Clear Request\n");
msg = gsm0808_create_clear_rqst(0x23);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}
static void test_create_dtap()
{
static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 };
struct msgb *msg, *l3;
printf("Testing creating DTAP\n");
l3 = msgb_alloc_headroom(512, 128, "test");
l3->l3h = l3->data;
msgb_v_put(l3, 0x23);
msgb_v_put(l3, 0x42);
msg = gsm0808_create_dtap(l3, 0x3);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
msgb_free(l3);
}
static void test_prepend_dtap()
{
static const uint8_t res[] = { 0x01, 0x03, 0x02, 0x23, 0x42 };
struct msgb *in_msg;
printf("Testing prepend DTAP\n");
in_msg = msgb_alloc_headroom(512, 128, "test");
msgb_v_put(in_msg, 0x23);
msgb_v_put(in_msg, 0x42);
gsm0808_prepend_dtap_header(in_msg, 0x3);
in_msg->l3h = in_msg->data;
VERIFY(in_msg, res, ARRAY_SIZE(res));
msgb_free(in_msg);
}
int main(int argc, char **argv)
{
printf("Testing generation of GSM0808 messages\n");
test_create_layer3();
test_create_reset();
test_create_clear_command();
test_create_clear_complete();
test_create_cipher_complete();
test_create_cipher_reject();
test_create_cm_u();
test_create_sapi_reject();
test_create_ass_compl();
test_create_ass_fail();
test_create_clear_rqst();
test_create_dtap();
test_prepend_dtap();
printf("Done\n");
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,15 @@
Testing generation of GSM0808 messages
Testing creating Layer3
Testing creating Reset
Testing creating Clear Command
Testing creating Clear Complete
Testing creating Cipher Complete
Testing creating Cipher Reject
Testing creating CM U
Testing creating SAPI Reject
Testing creating Assignment Complete
Testing creating Assignment Failure
Testing creating Clear Request
Testing creating DTAP
Testing prepend DTAP
Done

View File

@ -73,8 +73,8 @@ static const uint8_t cm_padded[] = {
};
static const uint8_t mm[] = {
0x05, 0x24, 0x31, 0x03, 0x50, 0x18, 0x93, 0x08,
0x29, 0x47, 0x80, 0x00,
0x00, 0x0c, 0x00, 0x03, 0x01, 0x01, 0x20, 0x02,
0x00, 0x0b, 0x00, 0x03, 0x05, 0x04, 0x0d
};
static const uint8_t dummy1[] = {
@ -95,6 +95,20 @@ static struct msgb *create_mm_id_req(void)
struct msgb *msg;
msg = msgb_from_array(mm, sizeof(mm));
msg->l2h = msg->data + 3;
ASSERT(msgb_l2len(msg) == 12);
msg->l3h = msg->l2h + 6;
ASSERT(msgb_l3len(msg) == 6);
return msg;
}
static struct msgb *create_empty_msg(void)
{
struct msgb *msg;
msg = msgb_from_array(NULL, 0);
ASSERT(msgb_l3len(msg) == 0);
rsl_rll_push_l3(msg, RSL_MT_DATA_REQ, 0, 0, 1);
return msg;
}
@ -194,9 +208,9 @@ static int ms_to_bts_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *_ctx
/* ASSERT(msg->data[7] == 0x0 && msg->data[8] == 0x9c); */
/* this should be 0x0 and 0x0... but we have a bug */
} else if (state->ms_read == 1) {
printf("MS: Verifying incoming MM message.\n");
ASSERT(msgb_l3len(msg) == ARRAY_SIZE(mm));
ASSERT(memcmp(msg->l3h, mm, msgb_l3len(msg)) == 0);
printf("MS: Verifying incoming MM message: %d\n", msgb_l3len(msg));
ASSERT(msgb_l3len(msg) == 3);
ASSERT(memcmp(msg->l3h, &mm[12], msgb_l3len(msg)) == 0);
} else {
printf("MS: Do not know to verify: %d\n", state->ms_read);
}
@ -271,7 +285,7 @@ static void test_lapdm_polling()
lapdm_rslms_recvmsg(create_dummy_data_req(), &ms_to_bts_channel);
/* 4. And back to the MS */
/* 4. And back to the MS, but let's move data/l2h apart */
ASSERT(test_state.bts_read == 2)
ASSERT(test_state.ms_read == 2);
rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);
@ -284,6 +298,11 @@ static void test_lapdm_polling()
rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);
ASSERT(rc < 0);
/* check sending an empty L3 message fails */
rc = lapdm_rslms_recvmsg(create_empty_msg(), &bts_to_ms_channel);
ASSERT(rc == -1);
ASSERT(test_state.ms_read == 2);
/* clean up */
lapdm_channel_exit(&bts_to_ms_channel);
lapdm_channel_exit(&ms_to_bts_channel);

View File

@ -9,8 +9,8 @@ ms_to_bts_tx_cb: BTS->MS(us) message 9
MS: Verifying incoming primitive.
Sending back to MS
ms_to_bts_tx_cb: BTS->MS(us) message 21
MS: Verifying incoming MM message.
ms_to_bts_tx_cb: BTS->MS(us) message 12
MS: Verifying incoming MM message: 3
ms_to_bts_l1_cb: MS(us) -> BTS prim message
Sending back to BTS

View File

@ -65,3 +65,9 @@ AT_KEYWORDS([lapd])
cat $abs_srcdir/lapd/lapd_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/lapd/lapd_test], [], [expout], [ignore])
AT_CLEANUP
AT_SETUP([gsm0808])
AT_KEYWORDS([gsm0808])
cat $abs_srcdir/gsm0808/gsm0808_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/gsm0808/gsm0808_test], [], [expout], [ignore])
AT_CLEANUP

View File

@ -1,6 +1,6 @@
/* GSM/GPRS/3G authentication testing tool */
/* (C) 2010-2011 by Harald Welte <laforge@gnumonks.org>
/* (C) 2010-2012 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
@ -52,17 +52,34 @@ static struct osmo_sub_auth_data test_aud = {
.algo = OSMO_AUTH_ALG_NONE,
};
static void help()
{
printf( "-2 --2g\tUse 2G (GSM) authentication\n"
"-3 --3g\tUse 3G (UMTS) authentication\n"
"-a --algorithm\tSpecify name of the algorithm\n"
"-k --key\tSpecify Ki / K\n"
"-o --opc\tSpecify OPC (only for 3G)\n"
"-O --op\tSpecify OP (only for 3G)\n"
"-a --amf\tSpecify AMF (only for 3G)\n"
"-s --sqn\tSpecify SQN (only for 3G)\n"
"-A --auts\tSpecify AUTS (only for 3G)\n"
"-r --rand\tSpecify random value\n");
}
int main(int argc, char **argv)
{
struct osmo_auth_vector _vec;
struct osmo_auth_vector *vec = &_vec;
uint8_t _rand[16];
uint8_t _rand[16], _auts[16];
int rc, option_index;
int rand_is_set = 0;
int auts_is_set = 0;
printf("osmo-auc-gen (C) 2011 by Harald Welte\n");
printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n");
printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
memset(_auts, 0, sizeof(_auts));
while (1) {
int c;
unsigned long ul;
@ -72,15 +89,18 @@ int main(int argc, char **argv)
{ "algorithm", 1, 0, 'a' },
{ "key", 1, 0, 'k' },
{ "opc", 1, 0, 'o' },
{ "op", 1, 0, 'O' },
{ "amf", 1, 0, 'f' },
{ "sqn", 1, 0, 's' },
{ "rand", 1, 0, 'r' },
{ "auts", 1, 0, 'A' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
};
rc = 0;
c = getopt_long(argc, argv, "23a:k:o:f:s:r:", long_options,
c = getopt_long(argc, argv, "23a:k:o:f:s:r:hO:A:", long_options,
&option_index);
if (c == -1)
@ -120,6 +140,24 @@ int main(int argc, char **argv)
}
rc = osmo_hexparse(optarg, test_aud.u.umts.opc,
sizeof(test_aud.u.umts.opc));
test_aud.u.umts.opc_is_op = 0;
break;
case 'O':
if (test_aud.type != OSMO_AUTH_TYPE_UMTS) {
fprintf(stderr, "Only UMTS has OP\n");
exit(2);
}
rc = osmo_hexparse(optarg, test_aud.u.umts.opc,
sizeof(test_aud.u.umts.opc));
test_aud.u.umts.opc_is_op = 1;
break;
case 'A':
if (test_aud.type != OSMO_AUTH_TYPE_UMTS) {
fprintf(stderr, "Only UMTS has AUTS\n");
exit(2);
}
rc = osmo_hexparse(optarg, _auts, sizeof(_auts));
auts_is_set = 1;
break;
case 'f':
if (test_aud.type != OSMO_AUTH_TYPE_UMTS) {
@ -141,6 +179,12 @@ int main(int argc, char **argv)
rc = osmo_hexparse(optarg, _rand, sizeof(_rand));
rand_is_set = 1;
break;
case 'h':
help();
exit(0);
default:
help();
exit(1);
}
if (rc < 0) {
@ -158,26 +202,30 @@ int main(int argc, char **argv)
*(uint32_t *)(&_rand[12]) = rand();
}
if (test_aud.type == OSMO_AUTH_TYPE_NONE ||
test_aud.algo == OSMO_AUTH_ALG_NONE) {
help();
exit(2);
}
memset(vec, 0, sizeof(*vec));
rc = osmo_auth_gen_vec(vec, &test_aud, _rand);
if (!auts_is_set)
rc = osmo_auth_gen_vec(vec, &test_aud, _rand);
else
rc = osmo_auth_gen_vec_auts(vec, &test_aud, _auts, _rand, _rand);
if (rc < 0) {
fprintf(stderr, "error generating auth vector\n");
if (!auts_is_set)
fprintf(stderr, "error generating auth vector\n");
else
fprintf(stderr, "AUTS from MS seems incorrect\n");
exit(1);
}
dump_auth_vec(vec);
#if 0
const uint8_t auts[14] = { 0x87, 0x11, 0xa0, 0xec, 0x9e, 0x16, 0x37, 0xdf,
0x17, 0xf8, 0x0b, 0x38, 0x4e, 0xe4 };
rc = osmo_auth_gen_vec_auts(vec, &test_aud, auts, _rand, _rand);
if (rc < 0) {
printf("AUTS failed\n");
} else {
if (auts_is_set)
printf("AUTS success: SEQ.MS = %lu\n", test_aud.u.umts.sqn);
}
#endif
exit(0);
exit(0);
}

View File

@ -4,8 +4,20 @@
BOARDS?=compal_e88 compal_e86 compal_e99 se_j100 gta0x pirelli_dpl10
# List of all applications (meant to be overridden on command line)
APPLICATIONS?=hello_world compal_dsp_dump layer1 loader chainload
APPLICATIONS?=hello_world compal_dsp_dump layer1 loader chainload rssi
# Framebuffer support, board specific drivers
#
FB_OBJS=fb/framebuffer.o fb/font.o fb/helvR08.o fb/helvB14.o fb/c64.o \
fb/symbols.o
FB_e88_OBJS=$(FB_OBJS) fb/fb_bw8.o fb/fb_st7558.o
FB_e99_OBJS=$(FB_OBJS) fb/fb_rgb332.o fb/fb_ssd1783.o
FB_e86_OBJS=$(FB_OBJS) fb/fb_rgb332.o fb/fb_td014.o
FB_j100_OBJS=$(FB_OBJS) fb/fb_rgb332.o fb/fb_ssd1963.o
FB_dpl10_OBJS=$(FB_OBJS) fb/fb_rgb332.o fb/fb_s6b33b1x.o
FB_dummy_OBJS=$(FB_OBJS) fb/fb_dummy.o
# TI Calypso
@ -13,12 +25,14 @@ calypso_COMMON_OBJS=board/common/calypso_uart.o board/common/calypso_pwl.o
# OpenMoko GTA0x
gta0x_OBJS=$(calypso_COMMON_OBJS) board/gta0x/rffe_gta0x_triband.o board/gta0x/init.o board/gta0x/rf_power.o
gta0x_OBJS=$(calypso_COMMON_OBJS) board/gta0x/rffe_gta0x_triband.o board/gta0x/init.o \
board/gta0x/rf_power.o battery/dummy.o $(FB_dummy_OBJS)
gta0x_ENVIRONMENTS=highram
# Pirelli DP-L10
pirelli_dpl10_OBJS=$(calypso_COMMON_OBJS) board/pirelli_dpl10/rffe_dpl10_triband.o board/pirelli_dpl10/init.o board/pirelli_dpl10/rf_power.o
pirelli_dpl10_OBJS=$(calypso_COMMON_OBJS) board/pirelli_dpl10/rffe_dpl10_triband.o board/pirelli_dpl10/init.o \
board/pirelli_dpl10/rf_power.o battery/dummy.o $(FB_dpl10_OBJS)
pirelli_dpl10_ENVIRONMENTS=highram
# Compal Generic
@ -34,7 +48,7 @@ highram_OBJS=board/compal/start.ram.o board/compal/exceptions_redirected.o board
# Compal E88
compal_e88_OBJS=$(compal_COMMON_OBJS) board/compal_e88/init.o
compal_e88_OBJS=$(compal_COMMON_OBJS) board/compal_e88/init.o battery/compal_e88.o $(FB_e88_OBJS)
compal_e88_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS) e88loader e88flash
e88loader_LDS=board/compal_e88/loader.lds
@ -45,12 +59,13 @@ e88flash_OBJS=board/compal/start.rom.o board/compal/header.o board/compal/except
# Compal E86 (has a different RFFE configuration)
compal_e86_OBJS=$(calypso_COMMON_OBJS) board/compal_e86/rffe_dualband_e86.o board/compal/rf_power.o board/compal_e86/init.o
compal_e86_OBJS=$(calypso_COMMON_OBJS) board/compal_e86/rffe_dualband_e86.o board/compal/rf_power.o \
board/compal_e86/init.o battery/dummy.o $(FB_e86_OBJS)
compal_e86_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS)
# Compal E99
compal_e99_OBJS=$(compal_COMMON_OBJS) board/compal_e99/init.o
compal_e99_OBJS=$(compal_COMMON_OBJS) board/compal_e99/init.o battery/dummy.o $(FB_e99_OBJS)
compal_e99_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS)
e99loader_LDS=board/compal_e99/loader.lds
@ -59,7 +74,7 @@ e99flash_LDS=board/compal_e99/flash.lds
# Sony Ericsson J100 (made by Compal)
se_j100_OBJS=$(compal_COMMON_OBJS) board/se_j100/init.o
se_j100_OBJS=$(compal_COMMON_OBJS) board/se_j100/init.o battery/dummy.o $(FB_j100_OBJS)
se_j100_ENVIRONMENTS=$(compal_COMMON_ENVIRONMENTS)
# Global include path
@ -67,12 +82,11 @@ INCLUDES=-Iinclude/ -I../../../include -I../../shared/libosmocore/include
# Various objects that are currently linked into all applications
FLASH_OBJS=flash/cfi_flash.o
DISPLAY_OBJS=display/font_r8x8.o display/font_r8x8_horiz.o display/st7558.o display/td014.o display/ssd1783.o display/ssd1963.o display/display.o
ABB_OBJS=abb/twl3025.o
RF_OBJS=rf/trf6151.o
# Objects that go in all applications
ANY_APP_OBJS+=$(ABB_OBJS) $(RF_OBJS) $(DISPLAY_OBJS) $(FLASH_OBJS)
ANY_APP_OBJS+=$(ABB_OBJS) $(RF_OBJS) $(FLASH_OBJS)
ANY_APP_LIBS+=calypso/libcalypso.a layer1/liblayer1.a lib/libmini.a comm/libcomm.a ../../shared/libosmocore/build-target/src/.libs/libosmocore.a ../../shared/libosmocore/build-target/src/gsm/.libs/libosmogsm.a
# Libraries are defined in subdirectories

View File

@ -31,6 +31,7 @@
#include <calypso/tsp.h>
#include <calypso/tpu.h>
#include <abb/twl3025.h>
#include <asm/system.h>
/* TWL3025 */
#define REG_PAGE(n) (n >> 7)
@ -105,13 +106,6 @@ static void twl3025_irq(enum irq_nr nr)
case IRQ_EXTERNAL: // charger in/out, pwrbtn, adc done
src = twl3025_reg_read(ITSTATREG);
// printd("itstatreg 0x%02x\n", src);
if (src & 0x04) {
/* poll PWON status and power off the phone when the
* powerbutton has been released (otherwise it will
* poweron immediately again) */
while (!(twl3025_reg_read(VRPCSTS) & 0x10)) { };
twl3025_power_off();
}
if (src & 0x08)
handle_charger();
if (src & 0x20)
@ -193,6 +187,17 @@ static void twl3025_wait_ibic_access(void)
void twl3025_power_off(void)
{
unsigned long flags;
/* turn off all IRQs, since received frames cannot be
* handled form here. (otherwise the message allocation
* runs out of memory) */
local_firq_save(flags);
/* poll PWON status and power off the phone when the
* powerbutton has been released (otherwise it will
* poweron immediately again) */
while (!(twl3025_reg_read(VRPCSTS) & 0x10)) { };
twl3025_reg_write(VRPCDEV, 0x01);
}

View File

@ -29,6 +29,7 @@
#include <delay.h>
#include <calypso/clock.h>
#include <calypso/timer.h>
/* Main Program */

View File

@ -37,6 +37,7 @@
#include <calypso/irq.h>
#include <calypso/misc.h>
#include <comm/timer.h>
#include <fb/framebuffer.h>
/* Main Program */
const char *hr = "======================================================================\n";
@ -52,11 +53,33 @@ int main(void)
dump_dev_id();
puts(hr);
fb_clear();
fb_setfg(FB_COLOR_BLACK);
fb_setbg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVB14);
fb_gotoxy(2,20);
fb_putstr("DSP Dump",framebuffer->width-4);
fb_setfg(FB_COLOR_RED);
fb_setbg(FB_COLOR_BLUE);
fb_gotoxy(2,25);
fb_boxto(framebuffer->width-3,38);
fb_setfg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVR08);
fb_gotoxy(8,33);
fb_putstr("osmocom-bb",framebuffer->width-4);
fb_flush();
/* Dump DSP content */
dsp_dump();
while (1) {
update_timers();
osmo_timers_update();
}
}

View File

@ -31,7 +31,6 @@
#include <keypad.h>
#include <board.h>
#include <abb/twl3025.h>
#include <display.h>
#include <rf/trf6151.h>
#include <calypso/clock.h>
#include <calypso/tpu.h>
@ -41,6 +40,8 @@
#include <calypso/misc.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
#include <fb/framebuffer.h>
#include <battery/battery.h>
/* Main Program */
const char *hr = "======================================================================\n";
@ -55,7 +56,6 @@ static void console_rx_cb(uint8_t dlci, struct msgb *msg)
}
printf("Message on console DLCI: '%s'\n", msg->data);
display_puts((char *) msg->data);
msgb_free(msg);
}
@ -68,6 +68,36 @@ static void l1a_l23_rx_cb(uint8_t dlci, struct msgb *msg)
puts("\n");
}
void
write_battery_info(void *p){
char buf[128];
fb_setfg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_C64);
snprintf(buf,sizeof(buf),"B: %04d mV",battery_info.bat_volt_mV);
fb_gotoxy(8,41);
fb_putstr(buf,framebuffer->width-8);
snprintf(buf,sizeof(buf),"C: %04d mV",battery_info.charger_volt_mV);
fb_gotoxy(8,49);
fb_putstr(buf,framebuffer->width-8);
snprintf(buf,sizeof(buf),"F: %08x",battery_info.flags);
fb_gotoxy(8,57);
fb_putstr(buf,framebuffer->width-8);
fb_flush();
osmo_timer_schedule((struct osmo_timer_list*)p,100);
}
/* timer that fires the charging loop regularly */
static struct osmo_timer_list write_battery_info_timer = {
.cb = &write_battery_info,
.data = &write_battery_info_timer
};
int main(void)
{
board_init();
@ -89,6 +119,30 @@ int main(void)
calypso_clk_dump();
puts(hr);
fb_clear();
fb_setfg(FB_COLOR_BLACK);
fb_setbg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVB14);
fb_gotoxy(2,20);
fb_putstr("Hello World!",framebuffer->width-4);
fb_setfg(FB_COLOR_RED);
fb_setbg(FB_COLOR_BLUE);
fb_gotoxy(2,25);
fb_boxto(framebuffer->width-3,38);
fb_setfg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVR08);
fb_gotoxy(8,33);
fb_putstr("osmocom-bb",framebuffer->width-4);
fb_flush();
/* Dump all memory */
//dump_mem();
#if 0
@ -97,16 +151,15 @@ int main(void)
puts(hr);
#endif
display_set_attr(DISP_ATTR_INVERT);
display_puts("Hello World");
sercomm_register_rx_cb(SC_DLCI_CONSOLE, console_rx_cb);
sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx_cb);
osmo_timer_schedule(&write_battery_info_timer,100);
/* beyond this point we only react to interrupts */
puts("entering interrupt loop\n");
while (1) {
update_timers();
osmo_timers_update();
}
twl3025_power_off();
@ -132,16 +185,13 @@ void key_handler(enum key_codes code, enum key_states state)
case KEY_7:
case KEY_8:
case KEY_9:
sprintf(test, "%d", code - KEY_0);
display_puts(test);
// used to be display_puts...
break;
case KEY_STAR:
sprintf(test, "*", 0);
display_puts(test);
// used to be display puts...
break;
case KEY_HASH:
sprintf(test, "#", 0);
display_puts(test);
// used to be display puts...
break;
default:
break;

View File

@ -1,249 +0,0 @@
/* main program of Free Software for Calypso Phone */
/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <stdint.h>
#include <stdio.h>
#include <debug.h>
#include <memory.h>
#include <delay.h>
#include <rffe.h>
#include <keypad.h>
#include <board.h>
#include <abb/twl3025.h>
#include <display.h>
#include <rf/trf6151.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
#include <calypso/clock.h>
#include <calypso/tpu.h>
#include <calypso/tsp.h>
#include <calypso/irq.h>
#include <calypso/misc.h>
#include <layer1/sync.h>
#include <layer1/tpu_window.h>
#define SCAN
#ifdef SCAN
/* if scanning is enabled, scan from 0 ... 124 */
#define BASE_ARFCN 0
#else
/* fixed ARFCN in GSM1800 at which Harald has his GSM test license */
#define BASE_ARFCN 871
#endif
/* Main Program */
const char *hr = "======================================================================\n";
/* Best ARFCN MAP ************************************************************/
struct arfcn_map {
uint16_t arfcn;
int16_t dbm8;
};
static struct arfcn_map best_arfcn_map[10];
static void best_arfcn_update(uint16_t arfcn, int16_t dbm8)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(best_arfcn_map); i++) {
if (best_arfcn_map[i].dbm8 < dbm8 ||
best_arfcn_map[i].dbm8 == 0) {
best_arfcn_map[i].dbm8 = dbm8;
best_arfcn_map[i].arfcn = arfcn;
return;
}
}
}
static void best_arfcn_dump(void)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(best_arfcn_map); i++) {
if (best_arfcn_map[i].dbm8 == 0)
continue;
printf("ARFCN %3d: %d dBm\n",
best_arfcn_map[i].arfcn,
best_arfcn_map[i].dbm8/8);
}
}
/* MAIN program **************************************************************/
enum l1test_state {
STATE_NONE,
STATE_PM,
STATE_FB,
};
static void l1test_state_change(enum l1test_state new_state)
{
switch (new_state) {
case STATE_PM:
puts("Performing power measurement over GSM900\n");
l1s_pm_test(1, BASE_ARFCN);
break;
case STATE_FB:
puts("Starting FCCH Recognition\n");
l1s_fb_test(1, 0);
break;
case STATE_NONE:
/* disable frame interrupts */
tpu_frame_irq_en(0, 0);
break;
}
}
/* completion call-back for the L1 Sync Power Measurement */
static void l1s_signal_cb(struct l1_signal *sig)
{
uint16_t i, next_arfcn;
switch (sig->signum) {
case L1_SIG_PM:
best_arfcn_update(sig->arfcn, sig->pm.dbm8[0]);
next_arfcn = sig->arfcn + 1;
if (next_arfcn >= 124) {
puts("ARFCN Top 10 Rx Level\n");
best_arfcn_dump();
trf6151_rx_window(0, best_arfcn_map[0].arfcn, 40, 0);
tpu_end_scenario();
/* PM phase completed, do FB det */
l1test_state_change(STATE_FB);
break;
}
/* restart Power Measurement */
l1s_pm_test(1, next_arfcn);
break;
case L1_SIG_NB:
puts("NB SNR ");
for (i = 0; i < 4; i++) {
uint16_t snr = sig->nb.meas[i].snr;
printf("%d.%03u ", l1s_snr_int(snr), l1s_snr_fract(snr));
}
putchar('\n');
printf("--> Frame %d %d 0x%04X ", sig->nb.fire, sig->nb.crc, sig->nb.num_biterr);
for (i = 0; i < ARRAY_SIZE(sig->nb.frame); i++)
printf("%02X ", sig->nb.frame[i]);
putchar('\n');
break;
}
}
static void key_handler(enum key_codes code, enum key_states state);
int main(void)
{
board_init();
puts("\n\nHello World from " __FILE__ " program code\n");
puts(hr);
/* Dump device identification */
dump_dev_id();
puts(hr);
keypad_set_handler(&key_handler);
/* Dump clock config after PLL set */
calypso_clk_dump();
puts(hr);
display_set_attr(DISP_ATTR_INVERT);
display_puts("l1test.bin");
layer1_init();
l1s_set_handler(&l1s_signal_cb);
//dsp_checksum_task();
#ifdef SCAN
l1test_state_change(STATE_PM);
#else
l1test_state_change(STATE_FB);
#endif
tpu_frame_irq_en(1, 1);
while (1) {
update_timers();
}
/* NOT REACHED */
twl3025_power_off();
}
static int afcout = 0;
static void tspact_toggle(uint8_t num)
{
printf("TSPACT%u toggle\n", num);
tsp_act_toggle((1 << num));
tpu_enq_sleep();
tpu_enable(1);
tpu_wait_idle();
}
static void key_handler(enum key_codes code, enum key_states state)
{
if (state != PRESSED)
return;
switch (code) {
case KEY_4:
tspact_toggle(6); /* TRENA (RFFE) */
break;
case KEY_5:
tspact_toggle(8); /* GSM_TXEN (RFFE) */
break;
case KEY_6:
tspact_toggle(1); /* PAENA (RFFE) */
break;
case KEY_7: /* decrement AFC OUT */
afcout -= 100;
if (afcout < -4096)
afcout = -4096;
twl3025_afc_set(afcout);
printf("AFC OUT: %u\n", twl3025_afcout_get());
break;
case KEY_9: /* increase AFC OUT */
afcout += 100;
if (afcout > 4095)
afcout = 4095;
twl3025_afc_set(afcout);
printf("AFC OUT: %u\n", twl3025_afcout_get());
break;
default:
break;
}
}

View File

@ -32,7 +32,6 @@
#include <board.h>
#include <abb/twl3025.h>
#include <display.h>
#include <rf/trf6151.h>
#include <comm/sercomm.h>
@ -48,6 +47,9 @@
#include <layer1/sync.h>
#include <layer1/async.h>
#include <layer1/tpu_window.h>
#include <layer1/l23_api.h>
#include <fb/framebuffer.h>
const char *hr = "======================================================================\n";
@ -75,26 +77,44 @@ int main(void)
calypso_clk_dump();
puts(hr);
display_puts("layer1.bin");
fb_clear();
fb_setfg(FB_COLOR_BLACK);
fb_setbg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVB14);
fb_gotoxy(2,20);
fb_putstr("Layer 1",framebuffer->width-4);
fb_setfg(FB_COLOR_RED);
fb_setbg(FB_COLOR_BLUE);
fb_gotoxy(2,25);
fb_boxto(framebuffer->width-3,38);
fb_setfg(FB_COLOR_WHITE);
fb_setfont(FB_FONT_HELVR08);
fb_gotoxy(8,33);
fb_putstr("osmocom-bb",framebuffer->width-4);
fb_flush();
/* initialize SIM */
calypso_sim_init();
puts("Power up simcard:\n");
memset(atr,0,sizeof(atr));
atrLength = calypso_sim_powerup(atr);
calypso_sim_init();
puts("Power up simcard:\n");
memset(atr,0,sizeof(atr));
atrLength = calypso_sim_powerup(atr);
layer1_init();
display_unset_attr(DISP_ATTR_INVERT);
tpu_frame_irq_en(1, 1);
while (1) {
l1a_compl_execute();
update_timers();
osmo_timers_update();
sim_handler();
l1a_l23_handler();
}
/* NOT REACHED */

View File

@ -45,6 +45,7 @@
#include <calypso/tsp.h>
#include <calypso/irq.h>
#include <calypso/misc.h>
#include <calypso/backlight.h>
#include <uart.h>
#include <calypso/timer.h>

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,6 @@
#include <keypad.h>
#include <board.h>
#include <abb/twl3025.h>
#include <display.h>
#include <rf/trf6151.h>
#include <calypso/clock.h>
#include <calypso/tpu.h>
@ -338,9 +337,6 @@ int main(void)
puts(hr);
#endif
display_set_attr(DISP_ATTR_INVERT);
display_puts("SIM-TEST");
sercomm_register_rx_cb(SC_DLCI_CONSOLE, console_rx_cb);
do_sim_test();

View File

@ -0,0 +1,386 @@
/* Battery management for compal_e88 */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
* ___C123 (compal e88) very simplified diagram of charging circuitry___
*
* ICTL
* |
* v
* Charger -> OVP -------> P-Mosfet --->[0.15 Ohm]---> Battery
* (NCP345, | | |
* 6.85V) v v v
* VCHG VCCS VBAT &
* VBATS
*
* Inputs to IOTA:
* VCHG: senses voltage on the charger input
* VCSS/VBATS: to difference amplifier, to measure charge current
* VBAT: senses voltage on the battery terminal
* Outputs from IOTA:
* ICTL: Control signal for the switching mosfet
*
*/
#include <battery/battery.h>
#include <battery/compal_e88.h>
#include <stdint.h>
#include <abb/twl3025.h>
#include <comm/timer.h>
#include <stdio.h>
/* ADC calibration, scale is LSB/uV or LSB/uA, physical unit is mV or mA */
#define ADC_TO_PHYSICAL(adc,scale) (((adc)*(scale)+500)/1000)
#define PHYSICAL_TO_ADC(phy,scale) (((phy)*1000+(scale)/2)/(scale))
/* conversion factors for internal IOTA battery charging/sensing circuitry */
#define VREF_LSB_uV 1709 /* VREF = 1.75V --> 1.709 mV/LSB */
#define VBAT_LSB_uV 6836 /* VBAT = 7.0 V FS --> 6.836 mV/LSB */
#define VCHG_LSB_uV 8545 /* VCHG = 8.75V FS --> 8.545 mV/LSB */
#define ICHG_LSB_uA 854 /* ICHG = 875mA FS --> 0.854 mA/LSB */
/* battery is considered full/empty at these thresholds... */
#define VBAT_full PHYSICAL_TO_ADC(4000,VBAT_LSB_uV)
#define VBAT_empty PHYSICAL_TO_ADC(3200,VBAT_LSB_uV)
/* we declare overvoltage at this point... */
#define VBAT_fail PHYSICAL_TO_ADC(4250,VBAT_LSB_uV)
/* DAC to ADC offsets in CC mode with my C123
IMEI 358317015976471, P329431014
I/mA DAC ADC
----------------
100 117 108
150 176 168
200 234 227
250 293 291
300 351 349
350 410 410
*/
#define CHGDAC_GAIN 967 /* times 0.001 */
#define CHGDAC_OFFS 13
/* convert ADC reading to DAC value, according to calibration values
given above */
#define CHGDAC_ADJ(x) (CHGDAC_GAIN*(x)/1000+CHGDAC_OFFS)
/* charging current in DAC LSBs, same ref. and # of bits, but keep
the correction specified above in mind! */
#define ICHG_set CHGDAC_ADJ(PHYSICAL_TO_ADC(200,ICHG_LSB_uA))
#define VCHG_set CHGDAC_ADJ(VBAT_full)
struct battery_info battery_info; /* global battery info */
uint16_t bat_compal_e88_madc[MADC_NUM_CHANNELS]; /* MADC measurements */
static const int BATTERY_TIMER_DELAY=5000; /* 5000ms for control loop */
static const int ADC_TIMER_DELAY=100; /* 100ms for ADC conversion */
/* thermistor sense current, turn it up to eleven! */
#define TH_SENS (THSENS0|THSENS1|THSENS2|THEN)
#define BATTERY_ALL_SENSE (TH_SENS|MESBAT|TYPEN)
/*
* charger modes state machine
*
* +------------------+-------------------+
* | | | lost AC power
* | ^ ^
* V on AC power | @VBAT_full |
* +-----+ +------------+ -----> +------------+
* | OFF | -----> | CONST_CURR | | CONST_VOLT |
* +-----+ +------------+ +------------+
* ^ ^ | |
* | /failure v v failure
* +---------+ / gone | | condition
* | FAILURE | <----------+-------------------+
* +---------+
*
* Failure modes currently detected:
* + high battery voltage
* Failure modes TODO:
* + high battery temperature
*/
enum bat_compal_e88_chg_state {
CHARG_OFF,
CHARG_CONST_CURR,
CHARG_CONST_VOLT,
CHARG_FAIL
};
static enum bat_compal_e88_chg_state bat_compal_e88_chg_state;
static const char *bat_compal_e88_chg_state_names[]={
"Off",
"Constant Current",
"Constant Voltage",
"Battery Failure"
};
static void
bat_compal_e88_goto_state(enum bat_compal_e88_chg_state newstate){
if(bat_compal_e88_chg_state == newstate) /* already there? */
return;
printf("\033[34;1mCHARGER: %s --> %s.\033[0m\n",
bat_compal_e88_chg_state_names[bat_compal_e88_chg_state],
bat_compal_e88_chg_state_names[newstate]);
/* update user visible flags, set registers */
switch(newstate){
case CHARG_CONST_CURR:
battery_info.flags &= ~BATTERY_FAILURE;
battery_info.flags |= (BATTERY_CHG_ENABLED|
BATTERY_CHARGING);
twl3025_reg_write(BCICTL2,0);
twl3025_reg_write(CHGREG,0);
twl3025_reg_write(BCICTL2,CHEN|LEDC|CHIV);
twl3025_reg_write(CHGREG,ICHG_set);
break;
case CHARG_CONST_VOLT:
battery_info.flags &= ~( BATTERY_CHARGING |
BATTERY_FAILURE );
battery_info.flags |= BATTERY_CHG_ENABLED;
twl3025_reg_write(BCICTL2,0);
twl3025_reg_write(CHGREG,0);
twl3025_reg_write(BCICTL2,CHEN|LEDC);
twl3025_reg_write(CHGREG,VCHG_set);
break;
case CHARG_FAIL:
case CHARG_OFF:
default:
battery_info.flags &= ~( BATTERY_CHG_ENABLED |
BATTERY_CHARGING | BATTERY_FAILURE );
twl3025_reg_write(BCICTL2,0); /* turn off charger */
twl3025_reg_write(CHGREG,0);
break;
}
printf("BCICTL2 is 0x%03x, CHGREG=%d\n",
twl3025_reg_read(BCICTL2),
twl3025_reg_read(CHGREG));
bat_compal_e88_chg_state = newstate;
}
static void
bat_compal_e88_chg_control(){
/* with AC power disconnected, always go to off state */
if(!(battery_info.flags & BATTERY_CHG_CONNECTED)){
bat_compal_e88_goto_state(CHARG_OFF);
return;
}
/* if failure condition is detected, always goto failure state */
if(bat_compal_e88_madc[MADC_VBAT] > VBAT_fail){
bat_compal_e88_goto_state(CHARG_FAIL);
return;
}
/* now AC power is present and battery is not over failure
thresholds */
switch(bat_compal_e88_chg_state){
case CHARG_OFF:
if(bat_compal_e88_madc[MADC_VBAT] >= VBAT_full)
bat_compal_e88_goto_state(CHARG_CONST_VOLT);
else
bat_compal_e88_goto_state(CHARG_CONST_CURR);
break;
case CHARG_CONST_CURR:
if(bat_compal_e88_madc[MADC_VBAT] >= VBAT_full)
bat_compal_e88_goto_state(CHARG_CONST_VOLT);
break;
case CHARG_CONST_VOLT:
break;
default:
case CHARG_FAIL:
if(bat_compal_e88_madc[MADC_VBAT] < VBAT_full)
bat_compal_e88_goto_state(CHARG_CONST_CURR);
break;
}
}
/*
* Charging voltage connection - state machine, remembers
* state in battery_info.flags.
*
* VCHG > VCHG_thr_on
* +-----------------+ ------------------> +---------------+
* | ! CHG_CONNECTED | | CHG_CONNECTED |
* +-----------------+ <------------------ +---------------+
* VCHG < VCHG_thr_off
*/
static void
bat_compal_e88_chk_ac_presence(){
int vrpcsts = twl3025_reg_read(VRPCSTS);
/* check for presence of charging voltage */
if(!(battery_info.flags & BATTERY_CHG_CONNECTED)){
if(vrpcsts & CHGPRES){
puts("\033[34;1mCHARGER: external voltage connected!\033[0m\n");
battery_info.flags |= BATTERY_CHG_CONNECTED;
/* always keep ADC, voltage dividers and bias voltages on */
twl3025_unit_enable(TWL3025_UNIT_MAD,1);
twl3025_reg_write(BCICTL1,BATTERY_ALL_SENSE);
}
} else {
if(!(vrpcsts & CHGPRES)){
/* we'll only run ADC on demand */
twl3025_unit_enable(TWL3025_UNIT_MAD,0);
twl3025_reg_write(BCICTL1,0);
battery_info.flags &= ~ BATTERY_CHG_CONNECTED;
puts("\033[34;1mCHARGER: external voltage disconnected!\033[0m\n");
}
}
}
/* ---- update voltages visible to the user ---- */
static void
bat_compal_e88_upd_measurements(){
int adc,i;
battery_info.charger_volt_mV=
ADC_TO_PHYSICAL(bat_compal_e88_madc[MADC_VCHG],VCHG_LSB_uV);
battery_info.bat_volt_mV=
ADC_TO_PHYSICAL(bat_compal_e88_madc[MADC_VBAT],VBAT_LSB_uV);
battery_info.bat_chg_curr_mA=
ADC_TO_PHYSICAL(bat_compal_e88_madc[MADC_ICHG],ICHG_LSB_uA);
adc = bat_compal_e88_madc[MADC_VBAT];
if(adc <= VBAT_empty){ /* battery 0..100% */
battery_info.battery_percent = 0;
} else if (adc >= VBAT_full){
battery_info.battery_percent = 100;
} else {
battery_info.battery_percent =
(50+100*(adc-VBAT_empty))/(VBAT_full-VBAT_empty);
}
#if 0
/* DEBUG */
printf("BAT-ADC: ");
for(i=0;i<MADC_NUM_CHANNELS;i++)
printf("%3d ",bat_compal_e88_madc[i]);
printf("%c\n",32);
printf("\tCharger at %u mV.\n",battery_info.charger_volt_mV);
printf("\tBattery at %u mV.\n",battery_info.bat_volt_mV);
printf("\tCharging at %u mA.\n",battery_info.bat_chg_curr_mA);
printf("\tBattery capacity is %u%%.\n",battery_info.battery_percent);
printf("\tBattery range is %d..%d mV.\n",
ADC_TO_PHYSICAL(VBAT_empty,VBAT_LSB_uV),
ADC_TO_PHYSICAL(VBAT_full,VBAT_LSB_uV));
printf("\tBattery full at %d LSB .. full at %d LSB\n",VBAT_empty,VBAT_full);
printf("\tCharging at %d LSB (%d mA).\n",ICHG_set,
ADC_TO_PHYSICAL(ICHG_set,ICHG_LSB_uA));
i = twl3025_reg_read(BCICTL2);
printf("\tBCICTL2=0x%03x\n",i);
printf("\tbattery-info.flags=0x%08x\n",battery_info.flags);
printf("\tbat_compal_e88_chg_state=%d\n",bat_compal_e88_chg_state);
#endif
}
/* bat_compal_e88_adc_read() :
*
* Schedule a ADC conversion or read values from ADC. If we are
* running on battery, bias currents/voltage dividers are turned
* on on demand.
*
* Return 0 if new ADC values have been acquired, 1 if ADC
* has been scheduled for a new conversion or is not yet finished.
*
*/
enum bat_compal_e88_madc_stat {
ADC_CONVERSION = 1 << 0
};
static uint32_t bat_compal_e88_madc_stat=0;
static int
bat_compal_e88_adc_read(){
int i;
if(bat_compal_e88_madc_stat & ADC_CONVERSION){
i = twl3025_reg_read(MADCSTAT);
if(i & ADCBUSY)
return 1;
for(i=0;i<MADC_NUM_CHANNELS;i++)
bat_compal_e88_madc[i]=twl3025_reg_read(VBATREG+i);
/* if charger is connected, we keep the ADC and BIAS on
continuously, if running on battery, we try to save power */
if(!(battery_info.flags & BATTERY_CHG_CONNECTED)){
twl3025_reg_write(BCICTL1,0x00); /* turn off bias */
twl3025_unit_enable(TWL3025_UNIT_MAD,0); /* & ADC */
}
bat_compal_e88_madc_stat &= ~ ADC_CONVERSION;
return 0;
} else {
/* if running on battery, turn on ADC & BIAS on demand */
if(!(battery_info.flags & BATTERY_CHG_CONNECTED)){
twl3025_unit_enable(TWL3025_UNIT_MAD,1);
twl3025_reg_write(BCICTL1,BATTERY_ALL_SENSE);
}
twl3025_reg_write(MADCTRL,0xff); /* convert all channels */
twl3025_reg_write(VBATREG,0); /* trigger conversion */
bat_compal_e88_madc_stat |= ADC_CONVERSION;
return 1;
}
}
static void
battery_compal_e88_timer_cb(void *p){
struct osmo_timer_list *tmr = (struct osmo_timer_list*)p;
int i;
if(bat_compal_e88_adc_read()){ /* read back ADCs after a brief delay */
osmo_timer_schedule(tmr,ADC_TIMER_DELAY);
return;
}
bat_compal_e88_upd_measurements(); /* convert user-accessible information */
bat_compal_e88_chk_ac_presence(); /* detect AC charger presence */
bat_compal_e88_chg_control(); /* battery charger state machine */
osmo_timer_schedule(tmr,BATTERY_TIMER_DELAY);
}
/* timer that fires the charging loop regularly */
static struct osmo_timer_list battery_compal88_timer = {
.cb = &battery_compal_e88_timer_cb,
.data = &battery_compal88_timer
};
void
battery_compal_e88_init(){
printf("%s: starting up\n",__FUNCTION__);
osmo_timer_schedule(&battery_compal88_timer,BATTERY_TIMER_DELAY);
}

View File

@ -0,0 +1,9 @@
#include <battery/battery.h>
/* Battery Management: Dummy file when no charging logic exists. */
struct battery_info battery_info;
void battery_dummy_init(){
battery_info.flags = BATTERY_FAILURE; /* not implemented */
}

View File

@ -16,9 +16,9 @@ MEMORY
/* lowram: could be anything, we place exception vectors here */
XRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000
/* highram binary: our text, initialized data */
LRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00010000
LRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00014000
/* highram binary: our unitialized data, stacks, heap */
IRAM (rw) : ORIGIN = 0x00830000, LENGTH = 0x00010000
IRAM (rw) : ORIGIN = 0x00834000, LENGTH = 0x0000c000
}
SECTIONS
{

View File

@ -11,9 +11,9 @@ ENTRY(_start)
MEMORY
{
/* compal-loaded binary: our text, initialized data */
LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00010000
LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00014000
/* compal-loaded binary: our unitialized data, stacks, heap */
IRAM (rw) : ORIGIN = 0x00810000, LENGTH = 0x00010000
IRAM (rw) : ORIGIN = 0x00814000, LENGTH = 0x0000c000
}
SECTIONS
{

View File

@ -41,10 +41,12 @@
#include <calypso/backlight.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#include <fb/framebuffer.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
@ -128,9 +130,9 @@ void board_init(void)
timer_init();
/* Initialize LCD driver (uses UWire) */
display = &td014_display;
display_init();
bl_mode_pwl(0);
fb_init();
bl_mode_pwl(1);
bl_level(0);
/* Initialize keypad driver */
keypad_init(1);

13
src/target/firmware/board/compal_e88/init.c Normal file → Executable file
View File

@ -44,7 +44,8 @@
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#include <fb/framebuffer.h>
#include <battery/compal_e88.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
@ -124,13 +125,17 @@ void board_init(void)
timer_init();
/* Initialize LCD driver (uses I2C) and backlight */
display = &st7558_display;
display_init();
bl_mode_pwl(0);
fb_init();
bl_mode_pwl(1);
bl_level(0);
/* Initialize keypad driver */
keypad_init(1);
/* Initialize ABB driver (uses SPI) */
twl3025_init();
/* Initialize the charging controller */
battery_compal_e88_init();
}

View File

@ -41,10 +41,12 @@
#include <calypso/backlight.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#include <fb/framebuffer.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
@ -128,9 +130,10 @@ void board_init(void)
timer_init();
/* Initialize LCD driver (uses UWire) and backlight */
display = &ssd1783_display;
display_init();
bl_mode_pwl(0);
bl_mode_pwl(1);
bl_level(0);
fb_init();
/* Initialize keypad driver */
keypad_init(1);

View File

@ -44,7 +44,6 @@
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
@ -124,9 +123,8 @@ void board_init(void)
timer_init();
/* Initialize LCD driver (uses I2C) and backlight */
display = &st7558_display;
display_init();
bl_mode_pwl(0);
bl_mode_pwl(1);
bl_level(0);
/* Initialize keypad driver */
keypad_init(1);

View File

@ -1,7 +1,7 @@
/* Initialization for the Pirelli DP-L10 */
/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
* (C) 2011 by Steve Markgraf <steve@steve-m.de>
* (C) 2011-12 by Steve Markgraf <steve@steve-m.de>
*
* All Rights Reserved
*
@ -45,10 +45,13 @@
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#include <fb/framebuffer.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
#define ASIC_CONF_REG 0xfffef008
#define IO_CONF_REG 0xfffef00a
static void board_io_init(void)
{
@ -59,17 +62,36 @@ static void board_io_init(void)
reg |= ((1 << 12) | (1 << 7)); /* SCL / SDA */
/* TWL3025: Set SPI+RIF RX clock to rising edge */
reg |= (1 << 13) | (1 << 14);
reg &= ~(1 << 1);
writew(reg, ASIC_CONF_REG);
/* enable IO functionality */
reg = readw(IO_CONF_REG);
reg |= (1 << 9) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0);
writew(reg, IO_CONF_REG);
/* set IO directions */
reg = readw(IO_CNTL_REG);
reg &= ~((1 << 7) | (1 << 4) | (1 << 1));
writew(reg, IO_CNTL_REG);
/* reset display controller, disable bypass mode, set nCS4 to display */
reg = readw(ARMIO_LATCH_OUT);
reg &= ~(1 << 4);
writew(reg, ARMIO_LATCH_OUT);
reg &= ~(1 << 7);
reg |= (1 << 4) | (1 << 1);
writew(reg, ARMIO_LATCH_OUT);
}
void board_init(void)
{
/* Configure the memory interface */
calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS0, 4, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS1, 4, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
calypso_mem_cfg(CALYPSO_nCS3, 4, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_CS4, 7, CALYPSO_MEM_16bit, 1);
calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
@ -111,10 +133,11 @@ void board_init(void)
/* Initialize system timers (uses hwtimer 2) */
timer_init();
/* Initialize LCD driver (uses I2C) and backlight */
display = &st7558_display;
display_init();
bl_mode_pwl(0);
/* Initialize LCD driver and backlight (0 is max, 255 min brightness) */
bl_mode_pwl(1);
bl_level(255);
fb_init();
/* Initialize keypad driver */
keypad_init(1);

View File

@ -41,10 +41,12 @@
#include <calypso/backlight.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
#include <abb/twl3025.h>
#include <rf/trf6151.h>
#include <display.h>
#include <fb/framebuffer.h>
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
@ -127,8 +129,7 @@ void board_init(void)
timer_init();
/* Initialize LCD driver (uses UWire) and backlight */
display = &ssd1963_display;
display_init();
fb_init();
bl_mode_pwl(1);
bl_level(50);

View File

@ -31,6 +31,7 @@
#include <calypso/irq.h>
#include <abb/twl3025.h>
#include <comm/timer.h>
#define KBR_LATCH_REG 0xfffe480a
@ -44,16 +45,13 @@ void emit_key(uint8_t key, uint8_t state)
{
printf("key=%u %s\n", key, state == PRESSED ? "pressed" : "released");
if (state == RELEASED)
if (key == KEY_POWER)
twl3025_power_off();
if(key_handler) {
key_handler(key, state);
}
}
volatile uint32_t lastbuttons = 0;
unsigned long power_hold = 0;
#define BTN_TO_KEY(name) \
((diff & BTN_##name) == BTN_##name) \
@ -67,6 +65,17 @@ void dispatch_buttons(uint32_t buttons)
{
uint8_t state;
if ((buttons & BTN_POWER)) {
/* hold button 500ms to shut down */
if ((lastbuttons & BTN_POWER)) {
unsigned long elapsed = jiffies - power_hold;
if (elapsed > 50)
twl3025_power_off();
power_hold++;
} else
power_hold = jiffies;
}
if (buttons == lastbuttons)
return;

View File

@ -26,7 +26,6 @@
#include <defines.h>
#include <debug.h>
#include <memory.h>
#include <display.h>
#include <calypso/irq.h>
#define BASE_ADDR_RTC 0xfffe1800
@ -61,10 +60,6 @@ static int tick_ctr;
static void rtc_irq_tick(__unused enum irq_nr nr)
{
if (tick_ctr & 1)
display_set_attr(DISP_ATTR_INVERT);
else
display_unset_attr(DISP_ATTR_INVERT);
tick_ctr++;
}

View File

@ -26,6 +26,7 @@
#include <debug.h>
#include <delay.h>
#include <console.h>
#include <osmocom/core/msgb.h>

View File

@ -33,22 +33,20 @@ static LLIST_HEAD(timer_list);
unsigned long volatile jiffies;
#define TIMER_HZ 100
#define time_after(a,b) \
(typecheck(unsigned long, a) && \
typecheck(unsigned long, b) && \
((long)(b) - (long)(a) < 0))
#define time_before(a,b) time_after(b,a)
void add_timer(struct osmo_timer_list *timer)
void osmo_timer_add(struct osmo_timer_list *timer)
{
struct osmo_timer_list *list_timer;
/* TODO: Optimize and remember the closest item... */
timer->active = 1;
/* this might be called from within update_timers */
/* this might be called from within osmo_timers_update */
llist_for_each_entry(list_timer, &timer_list, entry)
if (timer == list_timer)
return;
@ -57,13 +55,13 @@ void add_timer(struct osmo_timer_list *timer)
llist_add(&timer->entry, &timer_list);
}
void schedule_timer(struct osmo_timer_list *timer, int milliseconds)
void osmo_timer_schedule(struct osmo_timer_list *timer, int milliseconds)
{
timer->expires = jiffies + ((milliseconds * TIMER_HZ) / 1000);
add_timer(timer);
timer->expires = jiffies + ((milliseconds * HZ) / 1000);
osmo_timer_add(timer);
}
void del_timer(struct osmo_timer_list *timer)
void osmo_timer_del(struct osmo_timer_list *timer)
{
if (timer->in_list) {
timer->active = 0;
@ -72,7 +70,7 @@ void del_timer(struct osmo_timer_list *timer)
}
}
int timer_pending(struct osmo_timer_list *timer)
int osmo_timer_pending(struct osmo_timer_list *timer)
{
return timer->active;
}
@ -131,7 +129,7 @@ void prepare_timers()
/*
* fire all timers... and remove them
*/
int update_timers(void)
int osmo_timers_update(void)
{
struct osmo_timer_list *timer, *tmp;
int work = 0;
@ -139,7 +137,7 @@ int update_timers(void)
/*
* The callbacks might mess with our list and in this case
* even llist_for_each_entry_safe is not safe to use. To allow
* del_timer, add_timer, schedule_timer to be called from within
* osmo_timer_del, osmo_timer_add, osmo_timer_schedule to be called from within
* the callback we jump through some loops.
*
* First we set the handled flag of each active timer to zero,
@ -149,7 +147,7 @@ int update_timers(void)
* is dispatched we will remove the non-active from the list.
*
* TODO: If this is a performance issue we can poison a global
* variable in add_timer and del_timer and only then restart.
* variable in osmo_timer_add and osmo_timer_del and only then restart.
*/
llist_for_each_entry(timer, &timer_list, entry) {
timer->handled = 0;
@ -169,14 +167,14 @@ restart:
llist_for_each_entry_safe(timer, tmp, &timer_list, entry) {
timer->handled = 0;
if (!timer->active) {
del_timer(timer);
osmo_timer_del(timer);
}
}
return work;
}
int timer_check(void)
int osmo_timers_check(void)
{
struct osmo_timer_list *timer;
int i = 0;
@ -200,10 +198,10 @@ void timer_init(void)
/* configure TIMER2 for our purpose */
hwtimer_enable(2, 1);
/* The timer runs at 13MHz / 32, i.e. 406.25kHz */
#if (TIMER_HZ == 100)
#if (HZ == 100)
hwtimer_load(2, 4062);
hwtimer_config(2, 0, 1);
#elif (TIMER_HZ == 10)
#elif (HZ == 10)
/* prescaler 4, 1015 ticks until expiry */
hwtimer_load(2, 1015);
hwtimer_config(2, 4, 1);

View File

@ -1,20 +0,0 @@
#include <stdint.h>
#include <display.h>
struct display_driver *display;
int display_puts(const char *str)
{
char c;
if (display->puts)
display->puts(str);
else {
while ((c = *str++))
display_putchar(c);
}
return 0;
}

View File

@ -1,261 +0,0 @@
/* 8x8 font, vertical scanning */
const unsigned char fontdata_r8x8[] ={
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x7e, 0x81, 0x95, 0xb1, 0xb1, 0x95, 0x81, 0x7e,
0x7e, 0xff, 0xeb, 0xcf, 0xcf, 0xeb, 0xff, 0x7e,
0x0e, 0x1f, 0x3f, 0x7e, 0x3f, 0x1f, 0x0e, 0x00,
0x00, 0x08, 0x1c, 0x3e, 0x7f, 0x3e, 0x1c, 0x08,
0x00, 0x38, 0x38, 0x9f, 0xff, 0x9f, 0x38, 0x38,
0x10, 0x38, 0xbc, 0xff, 0xbc, 0x38, 0x10, 0x00,
0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00,
0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff,
0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff,
0x70, 0xf8, 0x88, 0x88, 0xfd, 0x7f, 0x07, 0x0f,
0x00, 0x4e, 0x5f, 0xf1, 0xf1, 0x5f, 0x4e, 0x00,
0xc0, 0xe0, 0xff, 0x7f, 0x05, 0x05, 0x07, 0x07,
0xc0, 0xff, 0x7f, 0x05, 0x05, 0x65, 0x7f, 0x3f,
0x5a, 0x5a, 0x3c, 0xe7, 0xe7, 0x3c, 0x5a, 0x5a,
0x7f, 0x3e, 0x3e, 0x1c, 0x1c, 0x08, 0x08, 0x00,
0x08, 0x08, 0x1c, 0x1c, 0x3e, 0x3e, 0x7f, 0x00,
0x00, 0x24, 0x66, 0xff, 0xff, 0x66, 0x24, 0x00,
0x00, 0x5f, 0x5f, 0x00, 0x00, 0x5f, 0x5f, 0x00,
0x06, 0x0f, 0x09, 0x7f, 0x7f, 0x01, 0x7f, 0x7f,
0x40, 0xda, 0xbf, 0xa5, 0xfd, 0x59, 0x03, 0x02,
0x00, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x00,
0x80, 0x94, 0xb6, 0xff, 0xff, 0xb6, 0x94, 0x80,
0x00, 0x04, 0x06, 0x7f, 0x7f, 0x06, 0x04, 0x00,
0x00, 0x10, 0x30, 0x7f, 0x7f, 0x30, 0x10, 0x00,
0x08, 0x08, 0x08, 0x2a, 0x3e, 0x1c, 0x08, 0x00,
0x08, 0x1c, 0x3e, 0x2a, 0x08, 0x08, 0x08, 0x00,
0x3c, 0x3c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
0x08, 0x1c, 0x3e, 0x08, 0x08, 0x3e, 0x1c, 0x08,
0x30, 0x38, 0x3c, 0x3e, 0x3e, 0x3c, 0x38, 0x30,
0x06, 0x0e, 0x1e, 0x3e, 0x3e, 0x1e, 0x0e, 0x06,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x06, 0x5f, 0x5f, 0x06, 0x00, 0x00, 0x00,
0x00, 0x07, 0x07, 0x00, 0x07, 0x07, 0x00, 0x00,
0x14, 0x7f, 0x7f, 0x14, 0x7f, 0x7f, 0x14, 0x00,
0x00, 0x24, 0x2e, 0x6b, 0x6b, 0x3a, 0x12, 0x00,
0x00, 0x46, 0x66, 0x30, 0x18, 0x0c, 0x66, 0x62,
0x00, 0x30, 0x7a, 0x4f, 0x5d, 0x37, 0x7a, 0x48,
0x00, 0x04, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1c, 0x3e, 0x63, 0x41, 0x00, 0x00,
0x00, 0x00, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00,
0x08, 0x2a, 0x3e, 0x1c, 0x1c, 0x3e, 0x2a, 0x08,
0x08, 0x08, 0x3e, 0x3e, 0x08, 0x08, 0x00, 0x00,
0x00, 0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00,
0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00,
0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x01,
0x00, 0x3e, 0x7f, 0x71, 0x59, 0x4d, 0x7f, 0x3e,
0x00, 0x44, 0x42, 0x7f, 0x7f, 0x40, 0x40, 0x00,
0x00, 0x62, 0x73, 0x59, 0x49, 0x6f, 0x66, 0x00,
0x00, 0x22, 0x63, 0x49, 0x49, 0x7f, 0x36, 0x00,
0x00, 0x18, 0x1c, 0x16, 0x53, 0x7f, 0x7f, 0x50,
0x00, 0x27, 0x67, 0x45, 0x45, 0x7d, 0x39, 0x00,
0x00, 0x3c, 0x7e, 0x4b, 0x49, 0x79, 0x30, 0x00,
0x00, 0x03, 0x03, 0x71, 0x79, 0x0f, 0x07, 0x00,
0x00, 0x36, 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00,
0x00, 0x06, 0x4f, 0x49, 0x69, 0x3f, 0x1e, 0x00,
0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xe6, 0x66, 0x00, 0x00, 0x00,
0x00, 0x08, 0x1c, 0x36, 0x63, 0x41, 0x00, 0x00,
0x00, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00,
0x00, 0x00, 0x41, 0x63, 0x36, 0x1c, 0x08, 0x00,
0x00, 0x02, 0x03, 0x51, 0x59, 0x0f, 0x06, 0x00,
0x00, 0x3e, 0x7f, 0x41, 0x5d, 0x55, 0x57, 0x1e,
0x00, 0x7c, 0x7e, 0x13, 0x13, 0x7e, 0x7c, 0x00,
0x00, 0x41, 0x7f, 0x7f, 0x49, 0x49, 0x7f, 0x36,
0x00, 0x1c, 0x3e, 0x63, 0x41, 0x41, 0x63, 0x22,
0x00, 0x41, 0x7f, 0x7f, 0x41, 0x63, 0x3e, 0x1c,
0x00, 0x41, 0x7f, 0x7f, 0x49, 0x5d, 0x41, 0x63,
0x00, 0x41, 0x7f, 0x7f, 0x49, 0x1d, 0x01, 0x03,
0x00, 0x1c, 0x3e, 0x63, 0x41, 0x51, 0x73, 0x72,
0x00, 0x7f, 0x7f, 0x08, 0x08, 0x7f, 0x7f, 0x00,
0x00, 0x00, 0x41, 0x7f, 0x7f, 0x41, 0x00, 0x00,
0x00, 0x30, 0x70, 0x40, 0x41, 0x7f, 0x3f, 0x01,
0x00, 0x41, 0x7f, 0x7f, 0x08, 0x1c, 0x77, 0x63,
0x00, 0x41, 0x7f, 0x7f, 0x41, 0x40, 0x60, 0x70,
0x00, 0x7f, 0x7f, 0x0e, 0x1c, 0x0e, 0x7f, 0x7f,
0x00, 0x7f, 0x7f, 0x06, 0x0c, 0x18, 0x7f, 0x7f,
0x00, 0x3e, 0x7f, 0x41, 0x41, 0x41, 0x7f, 0x3e,
0x00, 0x41, 0x7f, 0x7f, 0x49, 0x09, 0x0f, 0x06,
0x00, 0x1e, 0x3f, 0x21, 0x71, 0x7f, 0x5e, 0x00,
0x00, 0x41, 0x7f, 0x7f, 0x09, 0x19, 0x7f, 0x66,
0x00, 0x22, 0x67, 0x4d, 0x59, 0x73, 0x22, 0x00,
0x00, 0x03, 0x41, 0x7f, 0x7f, 0x41, 0x03, 0x00,
0x00, 0x7f, 0x7f, 0x40, 0x40, 0x7f, 0x7f, 0x00,
0x00, 0x1f, 0x3f, 0x60, 0x60, 0x3f, 0x1f, 0x00,
0x00, 0x7f, 0x7f, 0x30, 0x18, 0x30, 0x7f, 0x7f,
0x00, 0x43, 0x67, 0x3c, 0x18, 0x3c, 0x67, 0x43,
0x00, 0x07, 0x4f, 0x78, 0x78, 0x4f, 0x07, 0x00,
0x00, 0x47, 0x63, 0x71, 0x59, 0x4d, 0x67, 0x73,
0x00, 0x00, 0x7f, 0x7f, 0x41, 0x41, 0x00, 0x00,
0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60,
0x00, 0x00, 0x41, 0x41, 0x7f, 0x7f, 0x00, 0x00,
0x00, 0x08, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x08,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x00, 0x00, 0x00, 0x03, 0x07, 0x04, 0x00, 0x00,
0x00, 0x20, 0x74, 0x54, 0x54, 0x3c, 0x78, 0x40,
0x00, 0x41, 0x7f, 0x3f, 0x48, 0x48, 0x78, 0x30,
0x00, 0x38, 0x7c, 0x44, 0x44, 0x6c, 0x28, 0x00,
0x00, 0x30, 0x78, 0x48, 0x49, 0x3f, 0x7f, 0x40,
0x00, 0x38, 0x7c, 0x54, 0x54, 0x5c, 0x18, 0x00,
0x00, 0x48, 0x7e, 0x7f, 0x49, 0x03, 0x02, 0x00,
0x00, 0x98, 0xbc, 0xa4, 0xa4, 0xf8, 0x7c, 0x04,
0x00, 0x41, 0x7f, 0x7f, 0x08, 0x04, 0x7c, 0x78,
0x00, 0x00, 0x44, 0x7d, 0x7d, 0x40, 0x00, 0x00,
0x00, 0x60, 0xe0, 0x80, 0x80, 0xfd, 0x7d, 0x00,
0x00, 0x41, 0x7f, 0x7f, 0x10, 0x38, 0x6c, 0x44,
0x00, 0x00, 0x41, 0x7f, 0x7f, 0x40, 0x00, 0x00,
0x00, 0x7c, 0x7c, 0x18, 0x38, 0x1c, 0x7c, 0x78,
0x00, 0x7c, 0x7c, 0x04, 0x04, 0x7c, 0x78, 0x00,
0x00, 0x38, 0x7c, 0x44, 0x44, 0x7c, 0x38, 0x00,
0x00, 0x84, 0xfc, 0xf8, 0xa4, 0x24, 0x3c, 0x18,
0x00, 0x18, 0x3c, 0x24, 0xa4, 0xf8, 0xfc, 0x84,
0x00, 0x44, 0x7c, 0x78, 0x4c, 0x04, 0x1c, 0x18,
0x00, 0x48, 0x5c, 0x54, 0x54, 0x74, 0x24, 0x00,
0x00, 0x00, 0x04, 0x3e, 0x7f, 0x44, 0x24, 0x00,
0x00, 0x3c, 0x7c, 0x40, 0x40, 0x3c, 0x7c, 0x40,
0x00, 0x1c, 0x3c, 0x60, 0x60, 0x3c, 0x1c, 0x00,
0x00, 0x3c, 0x7c, 0x70, 0x38, 0x70, 0x7c, 0x3c,
0x00, 0x44, 0x6c, 0x38, 0x10, 0x38, 0x6c, 0x44,
0x00, 0x9c, 0xbc, 0xa0, 0xa0, 0xfc, 0x7c, 0x00,
0x00, 0x4c, 0x64, 0x74, 0x5c, 0x4c, 0x64, 0x00,
0x00, 0x08, 0x08, 0x3e, 0x77, 0x41, 0x41, 0x00,
0x00, 0x00, 0x00, 0x00, 0x77, 0x77, 0x00, 0x00,
0x00, 0x41, 0x41, 0x77, 0x3e, 0x08, 0x08, 0x00,
0x00, 0x02, 0x03, 0x01, 0x03, 0x02, 0x03, 0x01,
0x00, 0x70, 0x78, 0x4c, 0x46, 0x4c, 0x78, 0x70,
0x00, 0x0e, 0x9f, 0x91, 0xb1, 0xfb, 0x4a, 0x00,
0x00, 0x3a, 0x7a, 0x40, 0x40, 0x7a, 0x7a, 0x40,
0x38, 0x7c, 0x54, 0x55, 0x5d, 0x19, 0x00, 0x00,
0x02, 0x23, 0x75, 0x55, 0x55, 0x7d, 0x7b, 0x42,
0x00, 0x21, 0x75, 0x54, 0x54, 0x7d, 0x79, 0x40,
0x00, 0x21, 0x75, 0x55, 0x54, 0x7c, 0x78, 0x40,
0x00, 0x20, 0x74, 0x57, 0x57, 0x7c, 0x78, 0x40,
0x00, 0x18, 0x3c, 0xa4, 0xa4, 0xe4, 0x40, 0x00,
0x02, 0x3b, 0x7d, 0x55, 0x55, 0x5d, 0x1b, 0x02,
0x39, 0x7d, 0x54, 0x54, 0x5d, 0x19, 0x00, 0x00,
0x00, 0x39, 0x7d, 0x55, 0x54, 0x5c, 0x18, 0x00,
0x00, 0x01, 0x45, 0x7c, 0x7c, 0x41, 0x01, 0x00,
0x00, 0x02, 0x03, 0x45, 0x7d, 0x7d, 0x43, 0x02,
0x00, 0x01, 0x45, 0x7d, 0x7c, 0x40, 0x00, 0x00,
0x00, 0x79, 0x7d, 0x16, 0x12, 0x16, 0x7d, 0x79,
0x00, 0x70, 0x78, 0x2b, 0x2b, 0x78, 0x70, 0x00,
0x44, 0x7c, 0x7c, 0x55, 0x55, 0x45, 0x00, 0x00,
0x20, 0x74, 0x54, 0x54, 0x7c, 0x7c, 0x54, 0x54,
0x00, 0x7c, 0x7e, 0x0b, 0x09, 0x7f, 0x7f, 0x49,
0x00, 0x32, 0x7b, 0x49, 0x49, 0x7b, 0x32, 0x00,
0x00, 0x32, 0x7a, 0x48, 0x48, 0x7a, 0x32, 0x00,
0x00, 0x32, 0x7a, 0x4a, 0x48, 0x78, 0x30, 0x00,
0x00, 0x3a, 0x7b, 0x41, 0x41, 0x7b, 0x7a, 0x40,
0x00, 0x3a, 0x7a, 0x42, 0x40, 0x78, 0x78, 0x40,
0x9a, 0xba, 0xa0, 0xa0, 0xfa, 0x7a, 0x00, 0x00,
0x01, 0x19, 0x3c, 0x66, 0x66, 0x3c, 0x19, 0x01,
0x00, 0x3d, 0x7d, 0x40, 0x40, 0x7d, 0x3d, 0x00,
0x00, 0x18, 0x3c, 0x24, 0xe7, 0xe7, 0x24, 0x24,
0x00, 0x68, 0x7e, 0x7f, 0x49, 0x43, 0x66, 0x20,
0x00, 0x2b, 0x2f, 0xfc, 0xfc, 0x2f, 0x2b, 0x00,
0xff, 0xff, 0x09, 0x09, 0x2f, 0xf6, 0xf8, 0xa0,
0x40, 0xc0, 0x88, 0xfe, 0x7f, 0x09, 0x03, 0x02,
0x00, 0x20, 0x74, 0x54, 0x55, 0x7d, 0x79, 0x40,
0x00, 0x00, 0x44, 0x7d, 0x7d, 0x41, 0x00, 0x00,
0x00, 0x30, 0x78, 0x48, 0x4a, 0x7a, 0x32, 0x00,
0x00, 0x38, 0x78, 0x40, 0x42, 0x7a, 0x7a, 0x40,
0x00, 0x7a, 0x7a, 0x0a, 0x0a, 0x7a, 0x70, 0x00,
0x00, 0x7d, 0x7d, 0x19, 0x31, 0x7d, 0x7d, 0x00,
0x00, 0x00, 0x26, 0x2f, 0x29, 0x2f, 0x2f, 0x28,
0x00, 0x00, 0x26, 0x2f, 0x29, 0x2f, 0x26, 0x00,
0x00, 0x30, 0x78, 0x4d, 0x45, 0x60, 0x20, 0x00,
0x00, 0x38, 0x38, 0x08, 0x08, 0x08, 0x08, 0x00,
0x08, 0x08, 0x08, 0x08, 0x38, 0x38, 0x00, 0x00,
0x4f, 0x6f, 0x30, 0x18, 0xcc, 0xee, 0xbb, 0x91,
0x4f, 0x6f, 0x30, 0x18, 0x6c, 0x76, 0xfb, 0xf9,
0x00, 0x00, 0x00, 0x7b, 0x7b, 0x00, 0x00, 0x00,
0x08, 0x1c, 0x36, 0x22, 0x08, 0x1c, 0x36, 0x22,
0x22, 0x36, 0x1c, 0x08, 0x22, 0x36, 0x1c, 0x08,
0xaa, 0x00, 0x55, 0x00, 0xaa, 0x00, 0x55, 0x00,
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55,
0xdd, 0xff, 0xaa, 0x77, 0xdd, 0xaa, 0xff, 0x77,
0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
0x10, 0x10, 0x10, 0xff, 0xff, 0x00, 0x00, 0x00,
0x14, 0x14, 0x14, 0xff, 0xff, 0x00, 0x00, 0x00,
0x10, 0x10, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00,
0x10, 0x10, 0xf0, 0xf0, 0x10, 0xf0, 0xf0, 0x00,
0x14, 0x14, 0x14, 0xfc, 0xfc, 0x00, 0x00, 0x00,
0x14, 0x14, 0xf7, 0xf7, 0x00, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00,
0x14, 0x14, 0xf4, 0xf4, 0x04, 0xfc, 0xfc, 0x00,
0x14, 0x14, 0x17, 0x17, 0x10, 0x1f, 0x1f, 0x00,
0x10, 0x10, 0x1f, 0x1f, 0x10, 0x1f, 0x1f, 0x00,
0x14, 0x14, 0x14, 0x1f, 0x1f, 0x00, 0x00, 0x00,
0x10, 0x10, 0x10, 0xf0, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1f, 0x1f, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x1f, 0x1f, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0xf0, 0xf0, 0x10, 0x10, 0x10,
0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0xff, 0xff, 0x10, 0x10, 0x10,
0x00, 0x00, 0x00, 0xff, 0xff, 0x14, 0x14, 0x14,
0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x10,
0x00, 0x00, 0x1f, 0x1f, 0x10, 0x17, 0x17, 0x14,
0x00, 0x00, 0xfc, 0xfc, 0x04, 0xf4, 0xf4, 0x14,
0x14, 0x14, 0x17, 0x17, 0x10, 0x17, 0x17, 0x14,
0x14, 0x14, 0xf4, 0xf4, 0x04, 0xf4, 0xf4, 0x14,
0x00, 0x00, 0xff, 0xff, 0x00, 0xf7, 0xf7, 0x14,
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
0x14, 0x14, 0xf7, 0xf7, 0x00, 0xf7, 0xf7, 0x14,
0x14, 0x14, 0x14, 0x17, 0x17, 0x14, 0x14, 0x14,
0x10, 0x10, 0x1f, 0x1f, 0x10, 0x1f, 0x1f, 0x10,
0x14, 0x14, 0x14, 0xf4, 0xf4, 0x14, 0x14, 0x14,
0x10, 0x10, 0xf0, 0xf0, 0x10, 0xf0, 0xf0, 0x10,
0x00, 0x00, 0x1f, 0x1f, 0x10, 0x1f, 0x1f, 0x10,
0x00, 0x00, 0x00, 0x1f, 0x1f, 0x14, 0x14, 0x14,
0x00, 0x00, 0x00, 0xfc, 0xfc, 0x14, 0x14, 0x14,
0x00, 0x00, 0xf0, 0xf0, 0x10, 0xf0, 0xf0, 0x10,
0x10, 0x10, 0xff, 0xff, 0x10, 0xff, 0xff, 0x10,
0x14, 0x14, 0x14, 0xff, 0xff, 0x14, 0x14, 0x14,
0x10, 0x10, 0x10, 0x1f, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xf0, 0x10, 0x10, 0x10,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x00, 0x38, 0x7c, 0x44, 0x6c, 0x38, 0x6c, 0x44,
0x00, 0xfc, 0xfe, 0x2a, 0x2a, 0x3e, 0x14, 0x00,
0x00, 0x7e, 0x7e, 0x02, 0x02, 0x06, 0x06, 0x00,
0x00, 0x02, 0x7e, 0x7e, 0x02, 0x7e, 0x7e, 0x02,
0x00, 0x63, 0x77, 0x5d, 0x49, 0x63, 0x63, 0x00,
0x00, 0x38, 0x7c, 0x44, 0x7c, 0x3c, 0x04, 0x04,
0x00, 0x80, 0xfe, 0x7e, 0x20, 0x20, 0x3e, 0x1e,
0x00, 0x04, 0x06, 0x02, 0x7e, 0x7c, 0x06, 0x02,
0x00, 0x99, 0xbd, 0xe7, 0xe7, 0xbd, 0x99, 0x00,
0x00, 0x1c, 0x3e, 0x6b, 0x49, 0x6b, 0x3e, 0x1c,
0x00, 0x4c, 0x7e, 0x73, 0x01, 0x73, 0x7e, 0x4c,
0x00, 0x30, 0x78, 0x4a, 0x4f, 0x7d, 0x39, 0x00,
0x18, 0x3c, 0x24, 0x3c, 0x3c, 0x24, 0x3c, 0x18,
0x98, 0xfc, 0x64, 0x3c, 0x3e, 0x27, 0x3d, 0x18,
0x00, 0x1c, 0x3e, 0x6b, 0x49, 0x49, 0x00, 0x00,
0x00, 0x7e, 0x7f, 0x01, 0x01, 0x7f, 0x7e, 0x00,
0x00, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x00,
0x00, 0x44, 0x44, 0x5f, 0x5f, 0x44, 0x44, 0x00,
0x00, 0x40, 0x51, 0x5b, 0x4e, 0x44, 0x40, 0x00,
0x00, 0x40, 0x44, 0x4e, 0x5b, 0x51, 0x40, 0x00,
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x07, 0x06,
0x60, 0xe0, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x08, 0x08, 0x6b, 0x6b, 0x08, 0x08, 0x00,
0x00, 0x24, 0x36, 0x12, 0x36, 0x24, 0x36, 0x12,
0x00, 0x00, 0x06, 0x0f, 0x09, 0x0f, 0x06, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00,
0x10, 0x30, 0x70, 0xc0, 0xff, 0xff, 0x01, 0x01,
0x00, 0x1f, 0x1f, 0x01, 0x1f, 0x1e, 0x00, 0x00,
0x00, 0x19, 0x1d, 0x17, 0x12, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

View File

@ -1,261 +0,0 @@
/* 8x8 font, right aligned, horizontal scanning */
const unsigned char fontdata_r8x8_horiz[] ={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7e,0x81,0xa5,0x81,0xbd,0x99,0x81,0x7e,
0x7e,0xff,0xdb,0xff,0xc3,0xe7,0xff,0x7e,
0x6c,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,
0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x08,0x00,
0x1c,0x1c,0x1c,0x7f,0x7f,0x6b,0x08,0x1c,
0x10,0x10,0x38,0x7c,0xfe,0x7c,0x10,0x38,
0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,
0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,
0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,
0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,
0x0f,0x07,0x0f,0x7d,0xcc,0xcc,0xcc,0x78,
0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,
0x3f,0x33,0x3f,0x30,0x30,0x70,0xf0,0xe0,
0x7f,0x63,0x7f,0x63,0x63,0x67,0xe6,0xc0,
0x18,0xdb,0x3c,0xe7,0xe7,0x3c,0xdb,0x18,
0x80,0xe0,0xf8,0xfe,0xf8,0xe0,0x80,0x00,
0x02,0x0e,0x3e,0xfe,0x3e,0x0e,0x02,0x00,
0x18,0x3c,0x7e,0x18,0x18,0x7e,0x3c,0x18,
0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x00,
0x7f,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x00,
0x3e,0x63,0x38,0x6c,0x6c,0x38,0xcc,0x78,
0x00,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x00,
0x18,0x3c,0x7e,0x18,0x7e,0x3c,0x18,0xff,
0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x00,
0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,
0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,
0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,
0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,
0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,
0x00,0x18,0x3c,0x7e,0xff,0xff,0x00,0x00,
0x00,0xff,0xff,0x7e,0x3c,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x78,0x78,0x30,0x30,0x00,0x30,0x00,
0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,
0x6c,0x6c,0xfe,0x6c,0xfe,0x6c,0x6c,0x00,
0x18,0x3e,0x60,0x3c,0x06,0x7c,0x18,0x00,
0x00,0x63,0x66,0x0c,0x18,0x33,0x63,0x00,
0x1c,0x36,0x1c,0x3b,0x6e,0x66,0x3b,0x00,
0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,
0x0c,0x18,0x30,0x30,0x30,0x18,0x0c,0x00,
0x30,0x18,0x0c,0x0c,0x0c,0x18,0x30,0x00,
0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,
0x00,0x30,0x30,0xfc,0x30,0x30,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30,
0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,
0x03,0x06,0x0c,0x18,0x30,0x60,0x40,0x00,
0x3e,0x63,0x67,0x6f,0x7b,0x73,0x3e,0x00,
0x18,0x38,0x58,0x18,0x18,0x18,0x7e,0x00,
0x3c,0x66,0x06,0x1c,0x30,0x66,0x7e,0x00,
0x3c,0x66,0x06,0x1c,0x06,0x66,0x3c,0x00,
0x0e,0x1e,0x36,0x66,0x7f,0x06,0x0f,0x00,
0x7e,0x60,0x7c,0x06,0x06,0x66,0x3c,0x00,
0x1c,0x30,0x60,0x7c,0x66,0x66,0x3c,0x00,
0x7e,0x66,0x06,0x0c,0x18,0x18,0x18,0x00,
0x3c,0x66,0x66,0x3c,0x66,0x66,0x3c,0x00,
0x3c,0x66,0x66,0x3e,0x06,0x0c,0x38,0x00,
0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00,
0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x30,
0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,
0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,
0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,
0x3c,0x66,0x06,0x0c,0x18,0x00,0x18,0x00,
0x3e,0x63,0x6f,0x69,0x6f,0x60,0x3e,0x00,
0x18,0x3c,0x66,0x66,0x7e,0x66,0x66,0x00,
0x7e,0x33,0x33,0x3e,0x33,0x33,0x7e,0x00,
0x1e,0x33,0x60,0x60,0x60,0x33,0x1e,0x00,
0x7c,0x36,0x33,0x33,0x33,0x36,0x7c,0x00,
0x7f,0x31,0x34,0x3c,0x34,0x31,0x7f,0x00,
0x7f,0x31,0x34,0x3c,0x34,0x30,0x78,0x00,
0x1e,0x33,0x60,0x60,0x67,0x33,0x1f,0x00,
0x66,0x66,0x66,0x7e,0x66,0x66,0x66,0x00,
0x3c,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,
0x0f,0x06,0x06,0x06,0x66,0x66,0x3c,0x00,
0x73,0x33,0x36,0x3c,0x36,0x33,0x73,0x00,
0x78,0x30,0x30,0x30,0x31,0x33,0x7f,0x00,
0x63,0x77,0x7f,0x7f,0x6b,0x63,0x63,0x00,
0x63,0x73,0x7b,0x6f,0x67,0x63,0x63,0x00,
0x3e,0x63,0x63,0x63,0x63,0x63,0x3e,0x00,
0x7e,0x33,0x33,0x3e,0x30,0x30,0x78,0x00,
0x3c,0x66,0x66,0x66,0x6e,0x3c,0x0e,0x00,
0x7e,0x33,0x33,0x3e,0x36,0x33,0x73,0x00,
0x3c,0x66,0x30,0x18,0x0c,0x66,0x3c,0x00,
0x7e,0x5a,0x18,0x18,0x18,0x18,0x3c,0x00,
0x66,0x66,0x66,0x66,0x66,0x66,0x7e,0x00,
0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,
0x63,0x63,0x63,0x6b,0x7f,0x77,0x63,0x00,
0x63,0x63,0x36,0x1c,0x1c,0x36,0x63,0x00,
0x66,0x66,0x66,0x3c,0x18,0x18,0x3c,0x00,
0x7f,0x63,0x46,0x0c,0x19,0x33,0x7f,0x00,
0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,
0x60,0x30,0x18,0x0c,0x06,0x03,0x01,0x00,
0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,
0x08,0x1c,0x36,0x63,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0x18,0x18,0x0c,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3c,0x06,0x3e,0x66,0x3b,0x00,
0x70,0x30,0x30,0x3e,0x33,0x33,0x6e,0x00,
0x00,0x00,0x3c,0x66,0x60,0x66,0x3c,0x00,
0x0e,0x06,0x06,0x3e,0x66,0x66,0x3b,0x00,
0x00,0x00,0x3c,0x66,0x7e,0x60,0x3c,0x00,
0x1c,0x36,0x30,0x78,0x30,0x30,0x78,0x00,
0x00,0x00,0x3b,0x66,0x66,0x3e,0x06,0x7c,
0x70,0x30,0x36,0x3b,0x33,0x33,0x73,0x00,
0x18,0x00,0x38,0x18,0x18,0x18,0x3c,0x00,
0x06,0x00,0x06,0x06,0x06,0x66,0x66,0x3c,
0x70,0x30,0x33,0x36,0x3c,0x36,0x73,0x00,
0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,
0x00,0x00,0x66,0x7f,0x7f,0x6b,0x63,0x00,
0x00,0x00,0x7c,0x66,0x66,0x66,0x66,0x00,
0x00,0x00,0x3c,0x66,0x66,0x66,0x3c,0x00,
0x00,0x00,0x6e,0x33,0x33,0x3e,0x30,0x78,
0x00,0x00,0x3b,0x66,0x66,0x3e,0x06,0x0f,
0x00,0x00,0x6e,0x3b,0x33,0x30,0x78,0x00,
0x00,0x00,0x3e,0x60,0x3c,0x06,0x7c,0x00,
0x08,0x18,0x3e,0x18,0x18,0x1a,0x0c,0x00,
0x00,0x00,0x66,0x66,0x66,0x66,0x3b,0x00,
0x00,0x00,0x66,0x66,0x66,0x3c,0x18,0x00,
0x00,0x00,0x63,0x6b,0x7f,0x7f,0x36,0x00,
0x00,0x00,0x63,0x36,0x1c,0x36,0x63,0x00,
0x00,0x00,0x66,0x66,0x66,0x3e,0x06,0x7c,
0x00,0x00,0x7e,0x4c,0x18,0x32,0x7e,0x00,
0x0e,0x18,0x18,0x70,0x18,0x18,0x0e,0x00,
0x0c,0x0c,0x0c,0x00,0x0c,0x0c,0x0c,0x00,
0x70,0x18,0x18,0x0e,0x18,0x18,0x70,0x00,
0x3b,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x08,0x1c,0x36,0x63,0x63,0x7f,0x00,
0x3c,0x66,0x60,0x66,0x3c,0x0c,0x06,0x3c,
0x00,0x66,0x00,0x66,0x66,0x66,0x3f,0x00,
0x1c,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
0x7e,0xc3,0x3c,0x06,0x3e,0x66,0x3f,0x00,
0x66,0x00,0x3c,0x06,0x3e,0x66,0x3f,0x00,
0x70,0x00,0x3c,0x06,0x3e,0x66,0x3f,0x00,
0x18,0x18,0x3c,0x06,0x3e,0x66,0x3f,0x00,
0x00,0x00,0x3c,0x60,0x60,0x3c,0x06,0x1c,
0x7e,0xc3,0x3c,0x66,0x7e,0x60,0x3c,0x00,
0xcc,0x00,0x78,0xcc,0xfc,0xc0,0x78,0x00,
0x70,0x00,0x3c,0x66,0x7e,0x60,0x3c,0x00,
0x66,0x00,0x38,0x18,0x18,0x18,0x3c,0x00,
0x3e,0x63,0x1c,0x0c,0x0c,0x0c,0x1e,0x00,
0x70,0x00,0x38,0x18,0x18,0x18,0x3c,0x00,
0x63,0x1c,0x36,0x63,0x7f,0x63,0x63,0x00,
0x18,0x18,0x00,0x3c,0x66,0x7e,0x66,0x00,
0x1c,0x00,0xfc,0x60,0x78,0x60,0xfc,0x00,
0x00,0x00,0x7f,0x0c,0x7f,0xcc,0x7f,0x00,
0x1f,0x36,0x66,0x7f,0x66,0x66,0x67,0x00,
0x3c,0x66,0x00,0x3c,0x66,0x66,0x3c,0x00,
0x00,0x66,0x00,0x3c,0x66,0x66,0x3c,0x00,
0x00,0x70,0x00,0x3c,0x66,0x66,0x3c,0x00,
0x3c,0x66,0x00,0x66,0x66,0x66,0x3f,0x00,
0x00,0x70,0x00,0x66,0x66,0x66,0x3f,0x00,
0x00,0xcc,0x00,0xcc,0xcc,0x7c,0x0c,0xf8,
0xc3,0x18,0x3c,0x66,0x66,0x3c,0x18,0x00,
0x66,0x00,0x66,0x66,0x66,0x66,0x3c,0x00,
0x0c,0x0c,0x3f,0x60,0x60,0x3f,0x0c,0x0c,
0x1c,0x36,0x32,0x78,0x30,0x73,0x7e,0x00,
0x66,0x66,0x3c,0x7e,0x18,0x7e,0x18,0x18,
0xf8,0xcc,0xcc,0xfa,0xc6,0xcf,0xc6,0xc7,
0x0e,0x1b,0x18,0x3c,0x18,0x18,0xd8,0x70,
0x0e,0x00,0x3c,0x06,0x3e,0x66,0x3f,0x00,
0x1c,0x00,0x38,0x18,0x18,0x18,0x3c,0x00,
0x00,0x0e,0x00,0x3c,0x66,0x66,0x3c,0x00,
0x00,0x0e,0x00,0x66,0x66,0x66,0x3f,0x00,
0x00,0x7c,0x00,0x7c,0x66,0x66,0x66,0x00,
0x7e,0x00,0x66,0x76,0x7e,0x6e,0x66,0x00,
0x1e,0x36,0x36,0x1f,0x00,0x3f,0x00,0x00,
0x1c,0x36,0x36,0x1c,0x00,0x3e,0x00,0x00,
0x18,0x00,0x18,0x30,0x60,0x66,0x3c,0x00,
0x00,0x00,0x00,0x7e,0x60,0x60,0x00,0x00,
0x00,0x00,0x00,0xfc,0x0c,0x0c,0x00,0x00,
0xc3,0xc6,0xcc,0xde,0x33,0x66,0xcc,0x0f,
0xc3,0xc6,0xcc,0xdb,0x37,0x6f,0xcf,0x03,
0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,
0x00,0x33,0x66,0xcc,0x66,0x33,0x00,0x00,
0x00,0xcc,0x66,0x33,0x66,0xcc,0x00,0x00,
0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,
0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,
0xdb,0x77,0xdb,0xee,0xdb,0x77,0xdb,0xee,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,
0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,
0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,
0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,
0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,
0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,
0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,
0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,
0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,
0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,
0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,
0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,
0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,
0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,
0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,
0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,
0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,
0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,
0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,
0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,
0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,
0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,
0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,
0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
0x00,0x00,0x3b,0x6e,0x64,0x6e,0x3b,0x00,
0x00,0x3c,0x66,0x7c,0x66,0x7c,0x60,0x60,
0x00,0x7e,0x66,0x60,0x60,0x60,0x60,0x00,
0x00,0x7f,0x36,0x36,0x36,0x36,0x36,0x00,
0x7e,0x66,0x30,0x18,0x30,0x66,0x7e,0x00,
0x00,0x00,0x3f,0x6c,0x6c,0x6c,0x38,0x00,
0x00,0x33,0x33,0x33,0x33,0x3e,0x30,0x60,
0x00,0x3b,0x6e,0x0c,0x0c,0x0c,0x0c,0x00,
0x7e,0x18,0x3c,0x66,0x66,0x3c,0x18,0x7e,
0x1c,0x36,0x63,0x7f,0x63,0x36,0x1c,0x00,
0x1c,0x36,0x63,0x63,0x36,0x36,0x77,0x00,
0x0e,0x18,0x0c,0x3e,0x66,0x66,0x3c,0x00,
0x00,0x00,0x7e,0xdb,0xdb,0x7e,0x00,0x00,
0x06,0x0c,0x7e,0xdb,0xdb,0x7e,0x60,0xc0,
0x1c,0x30,0x60,0x7c,0x60,0x30,0x1c,0x00,
0x3c,0x66,0x66,0x66,0x66,0x66,0x66,0x00,
0x00,0x7e,0x00,0x7e,0x00,0x7e,0x00,0x00,
0x18,0x18,0x7e,0x18,0x18,0x00,0x7e,0x00,
0x30,0x18,0x0c,0x18,0x30,0x00,0x7e,0x00,
0x0c,0x18,0x30,0x18,0x0c,0x00,0x7e,0x00,
0x0e,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0x70,
0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,
0x00,0x3b,0x6e,0x00,0x3b,0x6e,0x00,0x00,
0x1c,0x36,0x36,0x1c,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0c,0x0c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
0x0f,0x0c,0x0c,0x0c,0xec,0x6c,0x3c,0x1c,
0x78,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,
0x70,0x18,0x30,0x60,0x78,0x00,0x00,0x00,
0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

View File

@ -1,257 +0,0 @@
/* Solomon SSD1783 LCD Driver (Epson S1D15G10D08B000 clone) */
/* (C) 2010 by Steve Markgraf <steve@steve-m.de>
* (C) 2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <stdint.h>
#include <stdio.h>
//#define DEBUG
#include <debug.h>
#include <delay.h>
#include <uwire.h>
#include <display.h>
#include <display/ssd1783.h>
#include <calypso/clock.h>
#define LCD_COLUMNS 98
#define LCD_ROWS 67
#define LCD_TOP_FREE_ROWS 3
#define LCD_LEFT_FREE_COLS 0
#define PIXEL_BYTES 3
#define SSD1783_UWIRE_BITLEN 9
#define SSD1783_DEV_ID 0
#define FONT_HEIGHT 8
#define FONT_WIDTH 8
static const uint8_t rgb8_palette[] ={
0x00, //P01 Intermediate red tone 000
0x03, //P02 Intermediate red tone 001
0x05, //P03 Intermediate red tone 010
0x07, //P04 Intermediate red tone 011
0x09, //P05 Intermediate red tone 100
0x0b, //P06 Intermediate red tone 101
0x0d, //P07 Intermediate red tone 110
0x0f, //P08 Intermediate red tone 111
0x00, //P09 Intermediate green tone 000
0x03, //P10 Intermediate green tone 001
0x05, //P11 Intermediate green tone 010
0x07, //P12 Intermediate green tone 011
0x09, //P13 Intermediate green tone 100
0x0b, //P14 Intermediate green tone 101
0x0d, //P15 Intermediate green tone 110
0x0f, //P16 Intermediate green tone 111
0x00, //P17 Intermediate blue tone 00
0x05, //P18 Intermediate blue tone 01
0x0a, //P19 Intermediate blue tone 10
0x0f, //P20 Intermediate blue tone 11
};
static void ssd1783_cmd_write(const uint8_t cmd)
{
uint16_t cmd_out = cmd;
uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN, &cmd_out, NULL);
}
static void ssd1783_data_write(const uint8_t data)
{
uint16_t data_out = ((0x01 << 8) + data);
uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN, &data_out, NULL);
}
static void ssd1783_clrscr(void)
{
uint16_t i;
/* Select the whole display area for clearing */
ssd1783_cmd_write(CMD_PASET); /* Page address set [2] */
ssd1783_data_write(0x00); /* Start page: 0x00 */
ssd1783_data_write(LCD_ROWS-1); /* End page */
ssd1783_cmd_write(CMD_CASET); /* Column address set [2] */
ssd1783_data_write(0x00); /* Start column: 0x00 */
ssd1783_data_write((LCD_COLUMNS/2)-1); /* End column (2 pixels per column) */
ssd1783_cmd_write(CMD_RAMWR); /* Write to memory */
/* Fill the display with white */
for(i=0; i < (LCD_ROWS * (LCD_COLUMNS/2) * PIXEL_BYTES); i++){
ssd1783_data_write(0xff);
}
ssd1783_cmd_write(CMD_NOP); /* Terminate RAMWR with NOP */
}
static void ssd1783_init(void)
{
unsigned int i;
calypso_reset_set(RESET_EXT, 0);
uwire_init();
delay_ms(3);
/* Begin SSD1783 initialization sequence */
ssd1783_cmd_write(CMD_OSCON); /* Internal OSC on */
ssd1783_cmd_write(CMD_SLPOUT); /* Sleep out (Leave sleep mode) */
ssd1783_cmd_write(CMD_COMSCN); /* Common scan direction [1] */
ssd1783_data_write(0x01); /* Scan 1 -> 68, 132 <- 69 */
ssd1783_cmd_write(CMD_DATCTL); /* Data Scan Direction [3] */
ssd1783_data_write(0x00); /* Normal page address, normal rotation,
* scan direction in column direction */
ssd1783_data_write(0x00); /* RGB arrangement: RGB-RGB */
ssd1783_data_write(0x02); /* Gray-scale setup: 16 gray-scale Type A, 8-bit mode */
/* Initialize RGB8 palette for 8-Bit color mode */
ssd1783_cmd_write(CMD_RGBSET8); /* 256-color position set [20] */
for(i=0; i < sizeof(rgb8_palette); i++){
ssd1783_data_write(rgb8_palette[i]);
}
ssd1783_cmd_write(CMD_DISCTL); /* Display control [3] */
ssd1783_data_write(0xff); /* no clock division, F1, F2 switching period = field */
ssd1783_data_write(0x10); /* Drive duty, P24 = 1 */
ssd1783_data_write(0x01); /* FR inverse set, P30=1 */
ssd1783_cmd_write(CMD_SCSTART); /* Scroll start set [1] */
ssd1783_data_write(0x00); /* Start block address 0x00 */
/* Turn on the power regulator which generates VLCD */
ssd1783_cmd_write(CMD_PWRCTR); /* Power Control [1] */
ssd1783_data_write(0x0b); /* Booster, follower and regulator circuit on */
/* FIXME: put this in a separate function (ssd1783_set_contrast) */
ssd1783_cmd_write(CMD_VOLCTR); /* Electronic Volume Control [2] */
ssd1783_data_write(0x29); /* Set contrast */
ssd1783_data_write(0x05); /* Set contrast */
ssd1783_cmd_write(CMD_DISINV); /* Invert Display */
ssd1783_cmd_write(CMD_TMPGRD); /* Temperature gradient set */
ssd1783_data_write(0x00); /* default temperature gradient (-0.05% / °C) */
ssd1783_cmd_write(CMD_BIASSET); /* Set biasing ratio [1] */
ssd1783_data_write(0x03); /* 1/10 bias */
ssd1783_cmd_write(CMD_FREQSET); /* Set frequency and n-line inversion [2] */
ssd1783_data_write(0x08); /* frequency: 75Hz (POR) */
ssd1783_data_write(0x06); /* n-line inversion: 6 lines */
ssd1783_cmd_write(CMD_RESCMD); /* reserved command in datasheet? */
ssd1783_cmd_write(CMD_PWMSEL); /* Select PWM/FRC, Full/8 color mode [3] */
ssd1783_data_write(0x28); /* fixed */
ssd1783_data_write(0x2c); /* 5 bits PWM + 1 bit FRC (POR) */
ssd1783_data_write(0x05); /* Full color mode (0x45 would be 8 color powersaving) */
ssd1783_cmd_write(CMD_DISON); /* Display ON */
ssd1783_clrscr(); /* Clear the display */
}
extern const unsigned char fontdata_r8x8_horiz[];
/*
* Pixel format for 8-bit mode, 12-bit color, 2 Pixel per 3 byte
* D7, D6, D5, D4, D3, D2, D1, D0: RRRRGGGG (8 bits) 1st write
* D7, D6, D5, D4, D3, D2, D1, D0: BBBBRRRR (8 bits) 2nd write
* D7, D6, D5, D4, D3, D2, D1, D0: GGGGBBBB (8 bits) 3rd write
*/
static void ssd1783_goto_xy(int xpos, int ypos)
{
ssd1783_cmd_write(CMD_PASET);
ssd1783_data_write(xpos);
ssd1783_data_write(xpos + (FONT_HEIGHT-1));
ssd1783_cmd_write(CMD_CASET);
ssd1783_data_write(ypos);
ssd1783_data_write(ypos + ((FONT_WIDTH/2)-1));
ssd1783_cmd_write(CMD_NOP);
}
static int ssd1783_putc_col(unsigned char c, int fColor, int bColor)
{
int i, j;
uint8_t cols = FONT_WIDTH;
uint8_t rows = FONT_HEIGHT;
uint8_t row_slice;
uint8_t rowmask;
uint16_t pixel0; /* left pixel */
uint16_t pixel1; /* right pixel */
ssd1783_cmd_write(CMD_RAMWR);
for (i = 0; i < rows; i++) {
row_slice = fontdata_r8x8_horiz[(FONT_WIDTH * c)+i];
printd("\nSSD1783 FontData=0x%02hx", row_slice);
rowmask = 0x80;
for (j = 0; j < cols; j += 2) {
if (!(row_slice & rowmask))
pixel0 = bColor;
else
pixel0 = fColor;
rowmask = rowmask >> 1;
if (!(row_slice & rowmask))
pixel1 = bColor;
else
pixel1 = fColor;
rowmask = rowmask >> 1;
/* Write the RGB-RGB pixel data */
ssd1783_data_write((pixel0 >> 4) & 0xff);
ssd1783_data_write(((pixel0 & 0x00f) << 4) | ((pixel1 >> 8) & 0x00f));
ssd1783_data_write(pixel1 & 0xff);
}
}
ssd1783_cmd_write(CMD_NOP);
return c;
}
static int ssd1783_puts_col(const char *str, int txtline, int fColor, int bColor)
{
int i;
for (i = 0; *str != 0x00; i += (FONT_WIDTH/2)) {
ssd1783_goto_xy(((txtline*FONT_HEIGHT)+LCD_TOP_FREE_ROWS),
(i + LCD_LEFT_FREE_COLS));
ssd1783_putc_col(*str++, fColor, bColor);
}
return 0;
}
/* interface to display driver core */
static void ssd1783_set_attr(unsigned long attr)
{
/* FIXME */
}
static int ssd1783_putc(unsigned int c)
{
return ssd1783_putc_col(c, BLACK, WHITE);
}
static int ssd1783_puts(const char *str)
{
return ssd1783_puts_col(str, 0, BLACK, WHITE);
}
const struct display_driver ssd1783_display = {
.name = "ssd1783",
.init = &ssd1783_init,
.set_attr = &ssd1783_set_attr,
.unset_attr = &ssd1783_set_attr,
.clrscr = &ssd1783_clrscr,
.goto_xy = &ssd1783_goto_xy,
.putc = &ssd1783_putc,
.puts = &ssd1783_puts,
};

View File

@ -1,210 +0,0 @@
/* Solomon SSD1963 LCD Driver (probably not exactly the SSD1963)
* as used in the Sony Ericsson J100i */
/* (C) 2010-11 by Steve Markgraf <steve@steve-m.de>
* (C) 2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <stdint.h>
#include <stdio.h>
#include <debug.h>
#include <delay.h>
#include <uwire.h>
#include <display.h>
#include <calypso/clock.h>
#define LCD_COLUMNS 96
#define LCD_ROWS 64
#define LCD_TOP_FREE_ROWS 3
#define LCD_LEFT_FREE_COLS 0
#define PIXEL_BYTES 3
#define SSD1963_UWIRE_BITLEN 9
#define SSD1963_DEV_ID 0
#define FONT_HEIGHT 8
#define FONT_WIDTH 8
#define BLACK 0x0000
#define WHITE 0x0fff
static void ssd1963_cmd_write(const uint8_t cmd)
{
uint16_t cmd_out = cmd;
uwire_xfer(SSD1963_DEV_ID, SSD1963_UWIRE_BITLEN, &cmd_out, NULL);
}
static void ssd1963_data_write(const uint8_t data)
{
uint16_t data_out = ((0x01 << 8) + data);
uwire_xfer(SSD1963_DEV_ID, SSD1963_UWIRE_BITLEN, &data_out, NULL);
}
static void ssd1963_clrscr(void)
{
uint16_t i;
/* Select the whole display area for clearing */
ssd1963_cmd_write(0x2b);
ssd1963_data_write(0x00);
ssd1963_data_write(LCD_ROWS-1);
ssd1963_cmd_write(0x2a);
ssd1963_data_write(0x00);
ssd1963_data_write(LCD_COLUMNS-1);
ssd1963_cmd_write(0x2c);
/* Fill the display with white */
for(i=0; i < (LCD_ROWS * (LCD_COLUMNS/2) * PIXEL_BYTES); i++){
ssd1963_data_write(0xff);
}
}
static void ssd1963_init(void)
{
unsigned int i;
calypso_reset_set(RESET_EXT, 0);
uwire_init();
delay_ms(3);
/* Begin SSD1963 initialization sequence */
ssd1963_cmd_write(0xb6); /* Set vertical period */
ssd1963_data_write(0x4b);
ssd1963_data_write(0xf1);
ssd1963_data_write(0x40);
ssd1963_data_write(0x40);
ssd1963_data_write(0x00);
ssd1963_data_write(0x8c);
ssd1963_data_write(0x00);
ssd1963_cmd_write(0x3a); /* Set pixel format */
ssd1963_data_write(0x03); /* 0x03: 12 bit, 0x05: 16 Bit / pixel */
ssd1963_cmd_write(0x11);
/* Contrast/Electronic Volume Control */
ssd1963_cmd_write(0xba);
ssd1963_data_write(0x5b);
ssd1963_data_write(0x84);
ssd1963_cmd_write(0x36);
ssd1963_data_write(0x00);
ssd1963_cmd_write(0x13); /* Enter normal mode */
ssd1963_clrscr();
ssd1963_cmd_write(0x29); /* Display ON */
}
extern const unsigned char fontdata_r8x8_horiz[];
/*
* Pixel format for 8-bit mode, 12-bit color, 2 Pixel per 3 byte
* D7, D6, D5, D4, D3, D2, D1, D0: RRRRGGGG (8 bits) 1st write
* D7, D6, D5, D4, D3, D2, D1, D0: BBBBRRRR (8 bits) 2nd write
* D7, D6, D5, D4, D3, D2, D1, D0: GGGGBBBB (8 bits) 3rd write
*/
static void ssd1963_goto_xy(int xpos, int ypos)
{
ssd1963_cmd_write(0x2b);
ssd1963_data_write(xpos);
ssd1963_data_write(xpos + FONT_HEIGHT-1);
ssd1963_cmd_write(0x2a);
ssd1963_data_write(ypos);
ssd1963_data_write(ypos + FONT_WIDTH-1);
}
static int ssd1963_putc_col(unsigned char c, int fColor, int bColor)
{
int i, j;
uint8_t cols = FONT_WIDTH;
uint8_t rows = FONT_HEIGHT;
uint8_t row_slice;
uint8_t rowmask;
uint16_t pixel0; /* left pixel */
uint16_t pixel1; /* right pixel */
ssd1963_cmd_write(0x2c);
for (i = 0; i < rows; i++) {
row_slice = fontdata_r8x8_horiz[(FONT_WIDTH * c)+i];
rowmask = 0x80;
for (j = 0; j < cols; j += 2) {
if (!(row_slice & rowmask))
pixel0 = bColor;
else
pixel0 = fColor;
rowmask = rowmask >> 1;
if (!(row_slice & rowmask))
pixel1 = bColor;
else
pixel1 = fColor;
rowmask = rowmask >> 1;
/* Write the RGB-RGB pixel data */
ssd1963_data_write((pixel0 >> 4) & 0xff);
ssd1963_data_write(((pixel0 & 0x00f) << 4) | ((pixel1 >> 8) & 0x00f));
ssd1963_data_write(pixel1 & 0xff);
}
}
ssd1963_cmd_write(0x00);
return c;
}
static int ssd1963_puts_col(const char *str, int txtline, int fColor, int bColor)
{
int i;
for (i = 0; *str != 0x00; i += FONT_WIDTH) {
ssd1963_goto_xy(((txtline*FONT_HEIGHT)+LCD_TOP_FREE_ROWS),
(i + LCD_LEFT_FREE_COLS));
ssd1963_putc_col(*str++, fColor, bColor);
}
return 0;
}
/* interface to display driver core */
static void ssd1963_set_attr(unsigned long attr)
{
/* FIXME */
}
static int ssd1963_putc(unsigned int c)
{
return ssd1963_putc_col(c, BLACK, WHITE);
}
static int ssd1963_puts(const char *str)
{
return ssd1963_puts_col(str, 0, BLACK, WHITE);
}
const struct display_driver ssd1963_display = {
.name = "ssd1963",
.init = &ssd1963_init,
.set_attr = &ssd1963_set_attr,
.unset_attr = &ssd1963_set_attr,
.clrscr = &ssd1963_clrscr,
.goto_xy = &ssd1963_goto_xy,
.putc = &ssd1963_putc,
.puts = &ssd1963_puts,
};

View File

@ -1,121 +0,0 @@
/* Sitronix ST7558 LCD Driver */
/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <stdint.h>
#include <stdio.h>
#include <debug.h>
#include <delay.h>
#include <memory.h>
#include <i2c.h>
#include <display.h>
#include <calypso/clock.h>
#define MORE_CONTROL 0x80
#define CONTROL_RS_RAM 0x40
#define CONTROL_RS_CMD 0x00
#define Y_ADDR(n) (0x40|((n)&0xf))
#define X_ADDR(n) (0x80|((n)&0x3f))
static const uint8_t setup[] = { CONTROL_RS_CMD, 0x2e, 0x21, 0x12, 0xc0, 0x0b,
0x20, 0x11, 0x00, 0x40, 0x80 };
static const uint8_t home[] = { CONTROL_RS_CMD, Y_ADDR(0), X_ADDR(0) };
/* video modes */
static const uint8_t invert[] = { CONTROL_RS_CMD, 0x20, 0x0d };
static const uint8_t normal[] = { CONTROL_RS_CMD, 0x20, 0x0c };
static const uint8_t off[] = { CONTROL_RS_CMD, 0x20, 0x08 };
#define ST7558_SLAVE_ADDR 0x3c
static int st7558_write(const uint8_t *data, int len)
{
int rc = i2c_write(ST7558_SLAVE_ADDR, data[0], 1, data+1, len-1);
return rc;
}
static const uint8_t zero16[] = { CONTROL_RS_RAM,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 };
static void st7558_clrscr(void)
{
int i;
st7558_write(home, sizeof(home));
for (i = 0; i < 102*9; i += 16)
st7558_write(zero16, sizeof(zero16));
st7558_write(home, sizeof(home));
}
static void st7558_init(void)
{
/* Release nRESET */
calypso_reset_set(RESET_EXT, 0);
i2c_init(0,0);
st7558_write(setup, sizeof(setup));
st7558_clrscr();
}
static void st7558_set_attr(unsigned long attr)
{
if (attr & DISP_ATTR_INVERT)
st7558_write(invert, sizeof(invert));
}
static void st7558_unset_attr(unsigned long attr)
{
if (attr & DISP_ATTR_INVERT)
st7558_write(normal, sizeof(normal));
}
/* FIXME: we need a mini-libc */
static void *mcpy(uint8_t *dst, const uint8_t *src, int len)
{
while (len--)
*dst++ = *src++;
return dst;
}
extern const unsigned char fontdata_r8x8[];
static void st7558_putc(unsigned char c)
{
uint8_t putc_buf[16];
uint8_t bytes_per_char = 8;
putc_buf[0] = CONTROL_RS_RAM;
mcpy(putc_buf+1, fontdata_r8x8+(c*bytes_per_char), bytes_per_char);
st7558_write(putc_buf, 1+bytes_per_char);
}
const struct display_driver st7558_display = {
.name = "st7558",
.init = &st7558_init,
.clrscr = &st7558_clrscr,
.set_attr = &st7558_set_attr,
.unset_attr = &st7558_unset_attr,
.putc = &st7558_putc,
};

View File

@ -1,185 +0,0 @@
/* Toppoly TD014 LCD Driver, as used in the Motorola C139/C140 */
/* (C) 2010 by Steve Markgraf <steve@steve-m.de>
* (C) 2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <stdint.h>
#include <stdio.h>
#include <debug.h>
#include <delay.h>
#include <uwire.h>
#include <display.h>
#include <calypso/clock.h>
#define LCD_COLUMNS 96
#define LCD_ROWS 64
#define LCD_TOP_FREE_ROWS 3
#define LCD_LEFT_FREE_COLS 0
#define PIXEL_BYTES 2
#define TD014_UWIRE_BITLEN 9
#define TD014_DEV_ID 0
#define FONT_HEIGHT 8
#define FONT_WIDTH 8
#define BLACK 0x0000
#define WHITE 0xffff
static void td014_cmd_write(const uint8_t cmd)
{
uint16_t cmd_out = cmd;
uwire_xfer(TD014_DEV_ID, TD014_UWIRE_BITLEN, &cmd_out, NULL);
}
static void td014_data_write(const uint8_t data)
{
uint16_t data_out = ((0x01 << 8) + data);
uwire_xfer(TD014_DEV_ID, TD014_UWIRE_BITLEN, &data_out, NULL);
}
static void td014_clrscr(void)
{
uint16_t i;
/* Select the whole display area for clearing */
td014_cmd_write(0x10);
td014_data_write(0x00);
td014_cmd_write(0x11);
td014_data_write(0x00);
td014_cmd_write(0x12);
td014_data_write(LCD_COLUMNS-1);
td014_cmd_write(0x13);
td014_data_write(LCD_ROWS-1);
td014_cmd_write(0x14);
td014_data_write(0x00);
td014_cmd_write(0x15);
td014_data_write(0x00);
/* Fill the display with white */
for(i=0; i < (LCD_ROWS * LCD_COLUMNS * PIXEL_BYTES); i++) {
td014_data_write(0xff);
}
}
static void td014_init(void)
{
calypso_reset_set(RESET_EXT, 0);
uwire_init();
delay_ms(3);
td014_cmd_write(0x3f);
td014_data_write(0x01);
td014_cmd_write(0x20);
td014_data_write(0x03);
td014_cmd_write(0x31);
td014_data_write(0x03);
td014_clrscr();
}
extern const unsigned char fontdata_r8x8_horiz[];
static void td014_goto_xy(int xpos, int ypos)
{
td014_cmd_write(0x10);
td014_data_write(ypos);
td014_cmd_write(0x11);
td014_data_write(xpos);
td014_cmd_write(0x12);
td014_data_write(ypos + FONT_HEIGHT-1);
td014_cmd_write(0x13);
td014_data_write(xpos + FONT_WIDTH-1);
td014_cmd_write(0x14);
td014_data_write(ypos);
td014_cmd_write(0x15);
td014_data_write(xpos);
}
/* RGB 556 Byte 1 | Byte 2 *
* Pixel format: RRRRRGGG|GGBBBBBB */
static int td014_putc_col(unsigned char c, int fColor, int bColor)
{
int i, j;
uint8_t cols = FONT_WIDTH;
uint8_t rows = FONT_HEIGHT;
uint8_t row_slice;
uint8_t rowmask;
uint16_t pixel;
for (i = 0; i < rows; i++) {
row_slice = fontdata_r8x8_horiz[(FONT_WIDTH * c)+i];
rowmask = 0x80;
for (j = 0; j < cols; j++) {
if (!(row_slice & rowmask))
pixel = bColor;
else
pixel = fColor;
rowmask = rowmask >> 1;
/* Write the pixel data */
td014_data_write((pixel >> 8) & 0xff);
td014_data_write(pixel & 0xff);
}
}
return c;
}
static int td014_puts_col(const char *str, int txtline, int fColor, int bColor)
{
int i;
for (i = 0; *str != 0x00; i += FONT_WIDTH) {
td014_goto_xy(((txtline*FONT_HEIGHT)+LCD_TOP_FREE_ROWS),
(i + LCD_LEFT_FREE_COLS));
td014_putc_col(*str++, fColor, bColor);
}
return 0;
}
/* interface to display driver core */
static void td014_set_attr(unsigned long attr)
{
/* FIXME */
}
static int td014_putc(unsigned int c)
{
return td014_putc_col(c, BLACK, WHITE);
}
static int td014_puts(const char *str)
{
return td014_puts_col(str, 0, BLACK, WHITE);
}
const struct display_driver td014_display = {
.name = "td014",
.init = &td014_init,
.set_attr = &td014_set_attr,
.unset_attr = &td014_set_attr,
.clrscr = &td014_clrscr,
.goto_xy = &td014_goto_xy,
.putc = &td014_putc,
.puts = &td014_puts,
};

View File

@ -0,0 +1,731 @@
#include <fb/font.h>
static const uint8_t font_4x6_data[] = {
/* --- new character space (32) starting at offset 0x0000 --- */
/*0000:*/ 4, 4, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*0005:*/ 0x00, /* ........ */
/* --- new character exclam (33) starting at offset 0x0006 --- */
/*0006:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*000b:*/ 0x40, /* .#...... */
/*000c:*/ 0x40, /* .#...... */
/*000d:*/ 0x40, /* .#...... */
/*000e:*/ 0x00, /* ........ */
/*000f:*/ 0x40, /* .#...... */
/* --- new character quotedbl (34) starting at offset 0x0010 --- */
/*0010:*/ 4, 4, 2, 0, 3, /* width and bbox (w,h,x,y) */
/*0015:*/ 0xa0, /* #.#..... */
/*0016:*/ 0xa0, /* #.#..... */
/* --- new character numbersign (35) starting at offset 0x0017 --- */
/*0017:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*001c:*/ 0xa0, /* #.#..... */
/*001d:*/ 0xf0, /* ####.... */
/*001e:*/ 0xa0, /* #.#..... */
/*001f:*/ 0xf0, /* ####.... */
/*0020:*/ 0xa0, /* #.#..... */
/* --- new character dollar (36) starting at offset 0x0021 --- */
/*0021:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0026:*/ 0x40, /* .#...... */
/*0027:*/ 0xe0, /* ###..... */
/*0028:*/ 0xc0, /* ##...... */
/*0029:*/ 0x20, /* ..#..... */
/*002a:*/ 0xe0, /* ###..... */
/*002b:*/ 0x40, /* .#...... */
/* --- new character percent (37) starting at offset 0x002c --- */
/*002c:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0031:*/ 0x80, /* #....... */
/*0032:*/ 0x20, /* ..#..... */
/*0033:*/ 0x40, /* .#...... */
/*0034:*/ 0x80, /* #....... */
/*0035:*/ 0x20, /* ..#..... */
/* --- new character ampersand (38) starting at offset 0x0036 --- */
/*0036:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*003b:*/ 0x40, /* .#...... */
/*003c:*/ 0xa0, /* #.#..... */
/*003d:*/ 0x40, /* .#...... */
/*003e:*/ 0xa0, /* #.#..... */
/*003f:*/ 0x50, /* .#.#.... */
/* --- new character quotesingle (39) starting at offset 0x0040 --- */
/*0040:*/ 4, 4, 2, 0, 3, /* width and bbox (w,h,x,y) */
/*0045:*/ 0x40, /* .#...... */
/*0046:*/ 0x40, /* .#...... */
/* --- new character parenleft (40) starting at offset 0x0047 --- */
/*0047:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*004c:*/ 0x20, /* ..#..... */
/*004d:*/ 0x40, /* .#...... */
/*004e:*/ 0x40, /* .#...... */
/*004f:*/ 0x40, /* .#...... */
/*0050:*/ 0x40, /* .#...... */
/*0051:*/ 0x20, /* ..#..... */
/* --- new character parenright (41) starting at offset 0x0052 --- */
/*0052:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0057:*/ 0x80, /* #....... */
/*0058:*/ 0x40, /* .#...... */
/*0059:*/ 0x40, /* .#...... */
/*005a:*/ 0x40, /* .#...... */
/*005b:*/ 0x40, /* .#...... */
/*005c:*/ 0x80, /* #....... */
/* --- new character asterisk (42) starting at offset 0x005d --- */
/*005d:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0062:*/ 0xa0, /* #.#..... */
/*0063:*/ 0x40, /* .#...... */
/*0064:*/ 0xe0, /* ###..... */
/*0065:*/ 0x40, /* .#...... */
/*0066:*/ 0xa0, /* #.#..... */
/* --- new character plus (43) starting at offset 0x0067 --- */
/*0067:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*006c:*/ 0x40, /* .#...... */
/*006d:*/ 0x40, /* .#...... */
/*006e:*/ 0xe0, /* ###..... */
/*006f:*/ 0x40, /* .#...... */
/*0070:*/ 0x40, /* .#...... */
/* --- new character comma (44) starting at offset 0x0071 --- */
/*0071:*/ 4, 4, 2, 0, -1, /* width and bbox (w,h,x,y) */
/*0076:*/ 0x40, /* .#...... */
/*0077:*/ 0x80, /* #....... */
/* --- new character hyphen (45) starting at offset 0x0078 --- */
/*0078:*/ 4, 4, 1, 0, 2, /* width and bbox (w,h,x,y) */
/*007d:*/ 0xe0, /* ###..... */
/* --- new character period (46) starting at offset 0x007e --- */
/*007e:*/ 4, 4, 1, 0, 0, /* width and bbox (w,h,x,y) */
/*0083:*/ 0x40, /* .#...... */
/* --- new character slash (47) starting at offset 0x0084 --- */
/*0084:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0089:*/ 0x20, /* ..#..... */
/*008a:*/ 0x20, /* ..#..... */
/*008b:*/ 0x40, /* .#...... */
/*008c:*/ 0x80, /* #....... */
/*008d:*/ 0x80, /* #....... */
/* --- new character zero (48) starting at offset 0x008e --- */
/*008e:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0093:*/ 0x40, /* .#...... */
/*0094:*/ 0xa0, /* #.#..... */
/*0095:*/ 0xe0, /* ###..... */
/*0096:*/ 0xa0, /* #.#..... */
/*0097:*/ 0x40, /* .#...... */
/* --- new character one (49) starting at offset 0x0098 --- */
/*0098:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*009d:*/ 0x40, /* .#...... */
/*009e:*/ 0xc0, /* ##...... */
/*009f:*/ 0x40, /* .#...... */
/*00a0:*/ 0x40, /* .#...... */
/*00a1:*/ 0xe0, /* ###..... */
/* --- new character two (50) starting at offset 0x00a2 --- */
/*00a2:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00a7:*/ 0x40, /* .#...... */
/*00a8:*/ 0xa0, /* #.#..... */
/*00a9:*/ 0x20, /* ..#..... */
/*00aa:*/ 0x40, /* .#...... */
/*00ab:*/ 0xe0, /* ###..... */
/* --- new character three (51) starting at offset 0x00ac --- */
/*00ac:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00b1:*/ 0xe0, /* ###..... */
/*00b2:*/ 0x20, /* ..#..... */
/*00b3:*/ 0x40, /* .#...... */
/*00b4:*/ 0x20, /* ..#..... */
/*00b5:*/ 0xc0, /* ##...... */
/* --- new character four (52) starting at offset 0x00b6 --- */
/*00b6:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00bb:*/ 0xa0, /* #.#..... */
/*00bc:*/ 0xa0, /* #.#..... */
/*00bd:*/ 0xe0, /* ###..... */
/*00be:*/ 0x20, /* ..#..... */
/*00bf:*/ 0x20, /* ..#..... */
/* --- new character five (53) starting at offset 0x00c0 --- */
/*00c0:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00c5:*/ 0xe0, /* ###..... */
/*00c6:*/ 0x80, /* #....... */
/*00c7:*/ 0xc0, /* ##...... */
/*00c8:*/ 0x20, /* ..#..... */
/*00c9:*/ 0xc0, /* ##...... */
/* --- new character six (54) starting at offset 0x00ca --- */
/*00ca:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00cf:*/ 0x60, /* .##..... */
/*00d0:*/ 0x80, /* #....... */
/*00d1:*/ 0xc0, /* ##...... */
/*00d2:*/ 0xa0, /* #.#..... */
/*00d3:*/ 0x40, /* .#...... */
/* --- new character seven (55) starting at offset 0x00d4 --- */
/*00d4:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00d9:*/ 0xe0, /* ###..... */
/*00da:*/ 0x20, /* ..#..... */
/*00db:*/ 0x40, /* .#...... */
/*00dc:*/ 0x80, /* #....... */
/*00dd:*/ 0x80, /* #....... */
/* --- new character eight (56) starting at offset 0x00de --- */
/*00de:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00e3:*/ 0x60, /* .##..... */
/*00e4:*/ 0xa0, /* #.#..... */
/*00e5:*/ 0x40, /* .#...... */
/*00e6:*/ 0xa0, /* #.#..... */
/*00e7:*/ 0xc0, /* ##...... */
/* --- new character nine (57) starting at offset 0x00e8 --- */
/*00e8:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*00ed:*/ 0x40, /* .#...... */
/*00ee:*/ 0xa0, /* #.#..... */
/*00ef:*/ 0x60, /* .##..... */
/*00f0:*/ 0x20, /* ..#..... */
/*00f1:*/ 0xc0, /* ##...... */
/* --- new character colon (58) starting at offset 0x00f2 --- */
/*00f2:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*00f7:*/ 0x40, /* .#...... */
/*00f8:*/ 0x00, /* ........ */
/*00f9:*/ 0x00, /* ........ */
/*00fa:*/ 0x40, /* .#...... */
/* --- new character semicolon (59) starting at offset 0x00fb --- */
/*00fb:*/ 4, 4, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*0100:*/ 0x40, /* .#...... */
/*0101:*/ 0x00, /* ........ */
/*0102:*/ 0x00, /* ........ */
/*0103:*/ 0x40, /* .#...... */
/*0104:*/ 0x80, /* #....... */
/* --- new character less (60) starting at offset 0x0105 --- */
/*0105:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*010a:*/ 0x20, /* ..#..... */
/*010b:*/ 0x40, /* .#...... */
/*010c:*/ 0x80, /* #....... */
/*010d:*/ 0x40, /* .#...... */
/*010e:*/ 0x20, /* ..#..... */
/* --- new character equal (61) starting at offset 0x010f --- */
/*010f:*/ 4, 4, 3, 0, 1, /* width and bbox (w,h,x,y) */
/*0114:*/ 0xe0, /* ###..... */
/*0115:*/ 0x00, /* ........ */
/*0116:*/ 0xe0, /* ###..... */
/* --- new character greater (62) starting at offset 0x0117 --- */
/*0117:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*011c:*/ 0x80, /* #....... */
/*011d:*/ 0x40, /* .#...... */
/*011e:*/ 0x20, /* ..#..... */
/*011f:*/ 0x40, /* .#...... */
/*0120:*/ 0x80, /* #....... */
/* --- new character question (63) starting at offset 0x0121 --- */
/*0121:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0126:*/ 0xc0, /* ##...... */
/*0127:*/ 0x20, /* ..#..... */
/*0128:*/ 0x40, /* .#...... */
/*0129:*/ 0x00, /* ........ */
/*012a:*/ 0x40, /* .#...... */
/* --- new character at (64) starting at offset 0x012b --- */
/*012b:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0130:*/ 0x60, /* .##..... */
/*0131:*/ 0xa0, /* #.#..... */
/*0132:*/ 0xa0, /* #.#..... */
/*0133:*/ 0x80, /* #....... */
/*0134:*/ 0x60, /* .##..... */
/* --- new character A (65) starting at offset 0x0135 --- */
/*0135:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*013a:*/ 0x40, /* .#...... */
/*013b:*/ 0xa0, /* #.#..... */
/*013c:*/ 0xe0, /* ###..... */
/*013d:*/ 0xa0, /* #.#..... */
/*013e:*/ 0xa0, /* #.#..... */
/* --- new character B (66) starting at offset 0x013f --- */
/*013f:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0144:*/ 0xc0, /* ##...... */
/*0145:*/ 0xa0, /* #.#..... */
/*0146:*/ 0xc0, /* ##...... */
/*0147:*/ 0xa0, /* #.#..... */
/*0148:*/ 0xc0, /* ##...... */
/* --- new character C (67) starting at offset 0x0149 --- */
/*0149:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*014e:*/ 0x40, /* .#...... */
/*014f:*/ 0xa0, /* #.#..... */
/*0150:*/ 0x80, /* #....... */
/*0151:*/ 0xa0, /* #.#..... */
/*0152:*/ 0x40, /* .#...... */
/* --- new character D (68) starting at offset 0x0153 --- */
/*0153:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0158:*/ 0xc0, /* ##...... */
/*0159:*/ 0xa0, /* #.#..... */
/*015a:*/ 0xa0, /* #.#..... */
/*015b:*/ 0xa0, /* #.#..... */
/*015c:*/ 0xc0, /* ##...... */
/* --- new character E (69) starting at offset 0x015d --- */
/*015d:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0162:*/ 0xe0, /* ###..... */
/*0163:*/ 0x80, /* #....... */
/*0164:*/ 0xc0, /* ##...... */
/*0165:*/ 0x80, /* #....... */
/*0166:*/ 0xe0, /* ###..... */
/* --- new character F (70) starting at offset 0x0167 --- */
/*0167:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*016c:*/ 0xe0, /* ###..... */
/*016d:*/ 0x80, /* #....... */
/*016e:*/ 0xc0, /* ##...... */
/*016f:*/ 0x80, /* #....... */
/*0170:*/ 0x80, /* #....... */
/* --- new character G (71) starting at offset 0x0171 --- */
/*0171:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0176:*/ 0x60, /* .##..... */
/*0177:*/ 0x80, /* #....... */
/*0178:*/ 0xa0, /* #.#..... */
/*0179:*/ 0xa0, /* #.#..... */
/*017a:*/ 0x60, /* .##..... */
/* --- new character H (72) starting at offset 0x017b --- */
/*017b:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0180:*/ 0xa0, /* #.#..... */
/*0181:*/ 0xa0, /* #.#..... */
/*0182:*/ 0xe0, /* ###..... */
/*0183:*/ 0xa0, /* #.#..... */
/*0184:*/ 0xa0, /* #.#..... */
/* --- new character I (73) starting at offset 0x0185 --- */
/*0185:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*018a:*/ 0xe0, /* ###..... */
/*018b:*/ 0x40, /* .#...... */
/*018c:*/ 0x40, /* .#...... */
/*018d:*/ 0x40, /* .#...... */
/*018e:*/ 0xe0, /* ###..... */
/* --- new character J (74) starting at offset 0x018f --- */
/*018f:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0194:*/ 0x20, /* ..#..... */
/*0195:*/ 0x20, /* ..#..... */
/*0196:*/ 0x20, /* ..#..... */
/*0197:*/ 0xa0, /* #.#..... */
/*0198:*/ 0x40, /* .#...... */
/* --- new character K (75) starting at offset 0x0199 --- */
/*0199:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*019e:*/ 0xa0, /* #.#..... */
/*019f:*/ 0xa0, /* #.#..... */
/*01a0:*/ 0xc0, /* ##...... */
/*01a1:*/ 0xa0, /* #.#..... */
/*01a2:*/ 0xa0, /* #.#..... */
/* --- new character L (76) starting at offset 0x01a3 --- */
/*01a3:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01a8:*/ 0x80, /* #....... */
/*01a9:*/ 0x80, /* #....... */
/*01aa:*/ 0x80, /* #....... */
/*01ab:*/ 0x80, /* #....... */
/*01ac:*/ 0xe0, /* ###..... */
/* --- new character M (77) starting at offset 0x01ad --- */
/*01ad:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01b2:*/ 0xa0, /* #.#..... */
/*01b3:*/ 0xe0, /* ###..... */
/*01b4:*/ 0xe0, /* ###..... */
/*01b5:*/ 0xa0, /* #.#..... */
/*01b6:*/ 0xa0, /* #.#..... */
/* --- new character N (78) starting at offset 0x01b7 --- */
/*01b7:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01bc:*/ 0x20, /* ..#..... */
/*01bd:*/ 0xa0, /* #.#..... */
/*01be:*/ 0xe0, /* ###..... */
/*01bf:*/ 0xa0, /* #.#..... */
/*01c0:*/ 0x80, /* #....... */
/* --- new character O (79) starting at offset 0x01c1 --- */
/*01c1:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01c6:*/ 0x40, /* .#...... */
/*01c7:*/ 0xa0, /* #.#..... */
/*01c8:*/ 0xa0, /* #.#..... */
/*01c9:*/ 0xa0, /* #.#..... */
/*01ca:*/ 0x40, /* .#...... */
/* --- new character P (80) starting at offset 0x01cb --- */
/*01cb:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01d0:*/ 0xc0, /* ##...... */
/*01d1:*/ 0xa0, /* #.#..... */
/*01d2:*/ 0xc0, /* ##...... */
/*01d3:*/ 0x80, /* #....... */
/*01d4:*/ 0x80, /* #....... */
/* --- new character Q (81) starting at offset 0x01d5 --- */
/*01d5:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*01da:*/ 0x40, /* .#...... */
/*01db:*/ 0xa0, /* #.#..... */
/*01dc:*/ 0xa0, /* #.#..... */
/*01dd:*/ 0xa0, /* #.#..... */
/*01de:*/ 0x40, /* .#...... */
/*01df:*/ 0x20, /* ..#..... */
/* --- new character R (82) starting at offset 0x01e0 --- */
/*01e0:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01e5:*/ 0xc0, /* ##...... */
/*01e6:*/ 0xa0, /* #.#..... */
/*01e7:*/ 0xc0, /* ##...... */
/*01e8:*/ 0xa0, /* #.#..... */
/*01e9:*/ 0xa0, /* #.#..... */
/* --- new character S (83) starting at offset 0x01ea --- */
/*01ea:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01ef:*/ 0x60, /* .##..... */
/*01f0:*/ 0x80, /* #....... */
/*01f1:*/ 0x40, /* .#...... */
/*01f2:*/ 0x20, /* ..#..... */
/*01f3:*/ 0xc0, /* ##...... */
/* --- new character T (84) starting at offset 0x01f4 --- */
/*01f4:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*01f9:*/ 0xe0, /* ###..... */
/*01fa:*/ 0x40, /* .#...... */
/*01fb:*/ 0x40, /* .#...... */
/*01fc:*/ 0x40, /* .#...... */
/*01fd:*/ 0x40, /* .#...... */
/* --- new character U (85) starting at offset 0x01fe --- */
/*01fe:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0203:*/ 0xa0, /* #.#..... */
/*0204:*/ 0xa0, /* #.#..... */
/*0205:*/ 0xa0, /* #.#..... */
/*0206:*/ 0xa0, /* #.#..... */
/*0207:*/ 0xe0, /* ###..... */
/* --- new character V (86) starting at offset 0x0208 --- */
/*0208:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*020d:*/ 0xa0, /* #.#..... */
/*020e:*/ 0xa0, /* #.#..... */
/*020f:*/ 0xa0, /* #.#..... */
/*0210:*/ 0xe0, /* ###..... */
/*0211:*/ 0x40, /* .#...... */
/* --- new character W (87) starting at offset 0x0212 --- */
/*0212:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0217:*/ 0xa0, /* #.#..... */
/*0218:*/ 0xa0, /* #.#..... */
/*0219:*/ 0xe0, /* ###..... */
/*021a:*/ 0xe0, /* ###..... */
/*021b:*/ 0xa0, /* #.#..... */
/* --- new character X (88) starting at offset 0x021c --- */
/*021c:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0221:*/ 0xa0, /* #.#..... */
/*0222:*/ 0xa0, /* #.#..... */
/*0223:*/ 0x40, /* .#...... */
/*0224:*/ 0xa0, /* #.#..... */
/*0225:*/ 0xa0, /* #.#..... */
/* --- new character Y (89) starting at offset 0x0226 --- */
/*0226:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*022b:*/ 0xa0, /* #.#..... */
/*022c:*/ 0xa0, /* #.#..... */
/*022d:*/ 0x40, /* .#...... */
/*022e:*/ 0x40, /* .#...... */
/*022f:*/ 0x40, /* .#...... */
/* --- new character Z (90) starting at offset 0x0230 --- */
/*0230:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0235:*/ 0xe0, /* ###..... */
/*0236:*/ 0x20, /* ..#..... */
/*0237:*/ 0x40, /* .#...... */
/*0238:*/ 0x80, /* #....... */
/*0239:*/ 0xe0, /* ###..... */
/* --- new character bracketleft (91) starting at offset 0x023a --- */
/*023a:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*023f:*/ 0x60, /* .##..... */
/*0240:*/ 0x40, /* .#...... */
/*0241:*/ 0x40, /* .#...... */
/*0242:*/ 0x40, /* .#...... */
/*0243:*/ 0x60, /* .##..... */
/* --- new character backslash (92) starting at offset 0x0244 --- */
/*0244:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0249:*/ 0x80, /* #....... */
/*024a:*/ 0x80, /* #....... */
/*024b:*/ 0x40, /* .#...... */
/*024c:*/ 0x20, /* ..#..... */
/*024d:*/ 0x20, /* ..#..... */
/* --- new character bracketright (93) starting at offset 0x024e --- */
/*024e:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0253:*/ 0xc0, /* ##...... */
/*0254:*/ 0x40, /* .#...... */
/*0255:*/ 0x40, /* .#...... */
/*0256:*/ 0x40, /* .#...... */
/*0257:*/ 0xc0, /* ##...... */
/* --- new character asciicircum (94) starting at offset 0x0258 --- */
/*0258:*/ 4, 4, 2, 0, 3, /* width and bbox (w,h,x,y) */
/*025d:*/ 0x40, /* .#...... */
/*025e:*/ 0xa0, /* #.#..... */
/* --- new character underscore (95) starting at offset 0x025f --- */
/*025f:*/ 4, 4, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*0264:*/ 0xe0, /* ###..... */
/* --- new character grave (96) starting at offset 0x0265 --- */
/*0265:*/ 4, 4, 2, 0, 3, /* width and bbox (w,h,x,y) */
/*026a:*/ 0x40, /* .#...... */
/*026b:*/ 0x20, /* ..#..... */
/* --- new character a (97) starting at offset 0x026c --- */
/*026c:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0271:*/ 0x60, /* .##..... */
/*0272:*/ 0xa0, /* #.#..... */
/*0273:*/ 0xa0, /* #.#..... */
/*0274:*/ 0x60, /* .##..... */
/* --- new character b (98) starting at offset 0x0275 --- */
/*0275:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*027a:*/ 0x80, /* #....... */
/*027b:*/ 0xc0, /* ##...... */
/*027c:*/ 0xa0, /* #.#..... */
/*027d:*/ 0xa0, /* #.#..... */
/*027e:*/ 0xc0, /* ##...... */
/* --- new character c (99) starting at offset 0x027f --- */
/*027f:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0284:*/ 0x60, /* .##..... */
/*0285:*/ 0x80, /* #....... */
/*0286:*/ 0x80, /* #....... */
/*0287:*/ 0x60, /* .##..... */
/* --- new character d (100) starting at offset 0x0288 --- */
/*0288:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*028d:*/ 0x20, /* ..#..... */
/*028e:*/ 0x60, /* .##..... */
/*028f:*/ 0xa0, /* #.#..... */
/*0290:*/ 0xa0, /* #.#..... */
/*0291:*/ 0x60, /* .##..... */
/* --- new character e (101) starting at offset 0x0292 --- */
/*0292:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0297:*/ 0x40, /* .#...... */
/*0298:*/ 0xa0, /* #.#..... */
/*0299:*/ 0xc0, /* ##...... */
/*029a:*/ 0x60, /* .##..... */
/* --- new character f (102) starting at offset 0x029b --- */
/*029b:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02a0:*/ 0x20, /* ..#..... */
/*02a1:*/ 0x40, /* .#...... */
/*02a2:*/ 0xe0, /* ###..... */
/*02a3:*/ 0x40, /* .#...... */
/*02a4:*/ 0x40, /* .#...... */
/* --- new character g (103) starting at offset 0x02a5 --- */
/*02a5:*/ 4, 4, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*02aa:*/ 0x60, /* .##..... */
/*02ab:*/ 0xa0, /* #.#..... */
/*02ac:*/ 0x60, /* .##..... */
/*02ad:*/ 0x20, /* ..#..... */
/*02ae:*/ 0xc0, /* ##...... */
/* --- new character h (104) starting at offset 0x02af --- */
/*02af:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02b4:*/ 0x80, /* #....... */
/*02b5:*/ 0xc0, /* ##...... */
/*02b6:*/ 0xa0, /* #.#..... */
/*02b7:*/ 0xa0, /* #.#..... */
/*02b8:*/ 0xa0, /* #.#..... */
/* --- new character i (105) starting at offset 0x02b9 --- */
/*02b9:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02be:*/ 0x40, /* .#...... */
/*02bf:*/ 0x00, /* ........ */
/*02c0:*/ 0xc0, /* ##...... */
/*02c1:*/ 0x40, /* .#...... */
/*02c2:*/ 0xe0, /* ###..... */
/* --- new character j (106) starting at offset 0x02c3 --- */
/*02c3:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*02c8:*/ 0x20, /* ..#..... */
/*02c9:*/ 0x00, /* ........ */
/*02ca:*/ 0x20, /* ..#..... */
/*02cb:*/ 0x20, /* ..#..... */
/*02cc:*/ 0x20, /* ..#..... */
/*02cd:*/ 0xc0, /* ##...... */
/* --- new character k (107) starting at offset 0x02ce --- */
/*02ce:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02d3:*/ 0x80, /* #....... */
/*02d4:*/ 0xa0, /* #.#..... */
/*02d5:*/ 0xc0, /* ##...... */
/*02d6:*/ 0xa0, /* #.#..... */
/*02d7:*/ 0xa0, /* #.#..... */
/* --- new character l (108) starting at offset 0x02d8 --- */
/*02d8:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02dd:*/ 0xc0, /* ##...... */
/*02de:*/ 0x40, /* .#...... */
/*02df:*/ 0x40, /* .#...... */
/*02e0:*/ 0x40, /* .#...... */
/*02e1:*/ 0xe0, /* ###..... */
/* --- new character m (109) starting at offset 0x02e2 --- */
/*02e2:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02e7:*/ 0xa0, /* #.#..... */
/*02e8:*/ 0xe0, /* ###..... */
/*02e9:*/ 0xa0, /* #.#..... */
/*02ea:*/ 0xa0, /* #.#..... */
/* --- new character n (110) starting at offset 0x02eb --- */
/*02eb:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02f0:*/ 0xc0, /* ##...... */
/*02f1:*/ 0xa0, /* #.#..... */
/*02f2:*/ 0xa0, /* #.#..... */
/*02f3:*/ 0xa0, /* #.#..... */
/* --- new character o (111) starting at offset 0x02f4 --- */
/*02f4:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02f9:*/ 0x40, /* .#...... */
/*02fa:*/ 0xa0, /* #.#..... */
/*02fb:*/ 0xa0, /* #.#..... */
/*02fc:*/ 0x40, /* .#...... */
/* --- new character p (112) starting at offset 0x02fd --- */
/*02fd:*/ 4, 4, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*0302:*/ 0xc0, /* ##...... */
/*0303:*/ 0xa0, /* #.#..... */
/*0304:*/ 0xc0, /* ##...... */
/*0305:*/ 0x80, /* #....... */
/*0306:*/ 0x80, /* #....... */
/* --- new character q (113) starting at offset 0x0307 --- */
/*0307:*/ 4, 4, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*030c:*/ 0x60, /* .##..... */
/*030d:*/ 0xa0, /* #.#..... */
/*030e:*/ 0xa0, /* #.#..... */
/*030f:*/ 0x60, /* .##..... */
/*0310:*/ 0x20, /* ..#..... */
/* --- new character r (114) starting at offset 0x0311 --- */
/*0311:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0316:*/ 0xa0, /* #.#..... */
/*0317:*/ 0xc0, /* ##...... */
/*0318:*/ 0x80, /* #....... */
/*0319:*/ 0x80, /* #....... */
/* --- new character s (115) starting at offset 0x031a --- */
/*031a:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*031f:*/ 0x60, /* .##..... */
/*0320:*/ 0xc0, /* ##...... */
/*0321:*/ 0x20, /* ..#..... */
/*0322:*/ 0xc0, /* ##...... */
/* --- new character t (116) starting at offset 0x0323 --- */
/*0323:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0328:*/ 0x40, /* .#...... */
/*0329:*/ 0xe0, /* ###..... */
/*032a:*/ 0x40, /* .#...... */
/*032b:*/ 0x40, /* .#...... */
/*032c:*/ 0x20, /* ..#..... */
/* --- new character u (117) starting at offset 0x032d --- */
/*032d:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0332:*/ 0xa0, /* #.#..... */
/*0333:*/ 0xa0, /* #.#..... */
/*0334:*/ 0xa0, /* #.#..... */
/*0335:*/ 0x60, /* .##..... */
/* --- new character v (118) starting at offset 0x0336 --- */
/*0336:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*033b:*/ 0xa0, /* #.#..... */
/*033c:*/ 0xa0, /* #.#..... */
/*033d:*/ 0xa0, /* #.#..... */
/*033e:*/ 0x40, /* .#...... */
/* --- new character w (119) starting at offset 0x033f --- */
/*033f:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0344:*/ 0xa0, /* #.#..... */
/*0345:*/ 0xa0, /* #.#..... */
/*0346:*/ 0xe0, /* ###..... */
/*0347:*/ 0xa0, /* #.#..... */
/* --- new character x (120) starting at offset 0x0348 --- */
/*0348:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*034d:*/ 0xa0, /* #.#..... */
/*034e:*/ 0x40, /* .#...... */
/*034f:*/ 0x40, /* .#...... */
/*0350:*/ 0xa0, /* #.#..... */
/* --- new character y (121) starting at offset 0x0351 --- */
/*0351:*/ 4, 4, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*0356:*/ 0xa0, /* #.#..... */
/*0357:*/ 0xa0, /* #.#..... */
/*0358:*/ 0x60, /* .##..... */
/*0359:*/ 0x20, /* ..#..... */
/*035a:*/ 0xc0, /* ##...... */
/* --- new character z (122) starting at offset 0x035b --- */
/*035b:*/ 4, 4, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0360:*/ 0xe0, /* ###..... */
/*0361:*/ 0x20, /* ..#..... */
/*0362:*/ 0x40, /* .#...... */
/*0363:*/ 0xe0, /* ###..... */
/* --- new character braceleft (123) starting at offset 0x0364 --- */
/*0364:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0369:*/ 0x20, /* ..#..... */
/*036a:*/ 0x40, /* .#...... */
/*036b:*/ 0xc0, /* ##...... */
/*036c:*/ 0x40, /* .#...... */
/*036d:*/ 0x40, /* .#...... */
/*036e:*/ 0x20, /* ..#..... */
/* --- new character bar (124) starting at offset 0x036f --- */
/*036f:*/ 4, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0374:*/ 0x40, /* .#...... */
/*0375:*/ 0x40, /* .#...... */
/*0376:*/ 0x40, /* .#...... */
/*0377:*/ 0x40, /* .#...... */
/*0378:*/ 0x40, /* .#...... */
/* --- new character braceright (125) starting at offset 0x0379 --- */
/*0379:*/ 4, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*037e:*/ 0x80, /* #....... */
/*037f:*/ 0x40, /* .#...... */
/*0380:*/ 0x60, /* .##..... */
/*0381:*/ 0x40, /* .#...... */
/*0382:*/ 0x40, /* .#...... */
/*0383:*/ 0x80, /* #....... */
/* --- new character asciitilde (126) starting at offset 0x0384 --- */
/*0384:*/ 4, 4, 2, 0, 3, /* width and bbox (w,h,x,y) */
/*0389:*/ 0x50, /* .#.#.... */
/*038a:*/ 0xa0, /* #.#..... */
};
static const uint16_t font_4x6_offsets[] = {
0x0000 /* space */,
0x0006 /* exclam */,
0x0010 /* quotedbl */,
0x0017 /* numbersign */,
0x0021 /* dollar */,
0x002c /* percent */,
0x0036 /* ampersand */,
0x0040 /* quotesingle */,
0x0047 /* parenleft */,
0x0052 /* parenright */,
0x005d /* asterisk */,
0x0067 /* plus */,
0x0071 /* comma */,
0x0078 /* hyphen */,
0x007e /* period */,
0x0084 /* slash */,
0x008e /* zero */,
0x0098 /* one */,
0x00a2 /* two */,
0x00ac /* three */,
0x00b6 /* four */,
0x00c0 /* five */,
0x00ca /* six */,
0x00d4 /* seven */,
0x00de /* eight */,
0x00e8 /* nine */,
0x00f2 /* colon */,
0x00fb /* semicolon */,
0x0105 /* less */,
0x010f /* equal */,
0x0117 /* greater */,
0x0121 /* question */,
0x012b /* at */,
0x0135 /* A */,
0x013f /* B */,
0x0149 /* C */,
0x0153 /* D */,
0x015d /* E */,
0x0167 /* F */,
0x0171 /* G */,
0x017b /* H */,
0x0185 /* I */,
0x018f /* J */,
0x0199 /* K */,
0x01a3 /* L */,
0x01ad /* M */,
0x01b7 /* N */,
0x01c1 /* O */,
0x01cb /* P */,
0x01d5 /* Q */,
0x01e0 /* R */,
0x01ea /* S */,
0x01f4 /* T */,
0x01fe /* U */,
0x0208 /* V */,
0x0212 /* W */,
0x021c /* X */,
0x0226 /* Y */,
0x0230 /* Z */,
0x023a /* bracketleft */,
0x0244 /* backslash */,
0x024e /* bracketright */,
0x0258 /* asciicircum */,
0x025f /* underscore */,
0x0265 /* grave */,
0x026c /* a */,
0x0275 /* b */,
0x027f /* c */,
0x0288 /* d */,
0x0292 /* e */,
0x029b /* f */,
0x02a5 /* g */,
0x02af /* h */,
0x02b9 /* i */,
0x02c3 /* j */,
0x02ce /* k */,
0x02d8 /* l */,
0x02e2 /* m */,
0x02eb /* n */,
0x02f4 /* o */,
0x02fd /* p */,
0x0307 /* q */,
0x0311 /* r */,
0x031a /* s */,
0x0323 /* t */,
0x032d /* u */,
0x0336 /* v */,
0x033f /* w */,
0x0348 /* x */,
0x0351 /* y */,
0x035b /* z */,
0x0364 /* braceleft */,
0x036f /* bar */,
0x0379 /* braceright */,
0x0384 /* asciitilde */,
0xffff /* (no glyph) */
};
const struct fb_font font_4x6 = {
.height = 6,
.ascent = 5,
.firstchar = 32, /* space */
.lastchar = 127, /* ? */
.chardata = font_4x6_data,
.charoffs = font_4x6_offsets,
};

View File

@ -0,0 +1,802 @@
#include <fb/font.h>
static const uint8_t font_5x8_data[] = {
/* --- new character space (32) starting at offset 0x0000 --- */
/*0000:*/ 5, 5, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*0005:*/ 0x00, /* ........ */
/* --- new character exclam (33) starting at offset 0x0006 --- */
/*0006:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*000b:*/ 0x20, /* ..#..... */
/*000c:*/ 0x20, /* ..#..... */
/*000d:*/ 0x20, /* ..#..... */
/*000e:*/ 0x20, /* ..#..... */
/*000f:*/ 0x00, /* ........ */
/*0010:*/ 0x20, /* ..#..... */
/* --- new character quotedbl (34) starting at offset 0x0011 --- */
/*0011:*/ 5, 5, 3, 0, 3, /* width and bbox (w,h,x,y) */
/*0016:*/ 0x50, /* .#.#.... */
/*0017:*/ 0x50, /* .#.#.... */
/*0018:*/ 0x50, /* .#.#.... */
/* --- new character numbersign (35) starting at offset 0x0019 --- */
/*0019:*/ 5, 5, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*001e:*/ 0x50, /* .#.#.... */
/*001f:*/ 0x50, /* .#.#.... */
/*0020:*/ 0xf8, /* #####... */
/*0021:*/ 0x50, /* .#.#.... */
/*0022:*/ 0xf8, /* #####... */
/*0023:*/ 0x50, /* .#.#.... */
/*0024:*/ 0x50, /* .#.#.... */
/* --- new character dollar (36) starting at offset 0x0025 --- */
/*0025:*/ 5, 5, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*002a:*/ 0x20, /* ..#..... */
/*002b:*/ 0x70, /* .###.... */
/*002c:*/ 0xa0, /* #.#..... */
/*002d:*/ 0x70, /* .###.... */
/*002e:*/ 0x28, /* ..#.#... */
/*002f:*/ 0x70, /* .###.... */
/*0030:*/ 0x20, /* ..#..... */
/* --- new character percent (37) starting at offset 0x0031 --- */
/*0031:*/ 5, 5, 5, 0, 1, /* width and bbox (w,h,x,y) */
/*0036:*/ 0x40, /* .#...... */
/*0037:*/ 0x50, /* .#.#.... */
/*0038:*/ 0x20, /* ..#..... */
/*0039:*/ 0x50, /* .#.#.... */
/*003a:*/ 0x10, /* ...#.... */
/* --- new character ampersand (38) starting at offset 0x003b --- */
/*003b:*/ 5, 5, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*0040:*/ 0x40, /* .#...... */
/*0041:*/ 0xa0, /* #.#..... */
/*0042:*/ 0xa0, /* #.#..... */
/*0043:*/ 0x40, /* .#...... */
/*0044:*/ 0xa0, /* #.#..... */
/*0045:*/ 0xa0, /* #.#..... */
/*0046:*/ 0x50, /* .#.#.... */
/* --- new character quotesingle (39) starting at offset 0x0047 --- */
/*0047:*/ 5, 5, 3, 0, 3, /* width and bbox (w,h,x,y) */
/*004c:*/ 0x20, /* ..#..... */
/*004d:*/ 0x20, /* ..#..... */
/*004e:*/ 0x20, /* ..#..... */
/* --- new character parenleft (40) starting at offset 0x004f --- */
/*004f:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0054:*/ 0x20, /* ..#..... */
/*0055:*/ 0x40, /* .#...... */
/*0056:*/ 0x40, /* .#...... */
/*0057:*/ 0x40, /* .#...... */
/*0058:*/ 0x40, /* .#...... */
/*0059:*/ 0x20, /* ..#..... */
/* --- new character parenright (41) starting at offset 0x005a --- */
/*005a:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*005f:*/ 0x40, /* .#...... */
/*0060:*/ 0x20, /* ..#..... */
/*0061:*/ 0x20, /* ..#..... */
/*0062:*/ 0x20, /* ..#..... */
/*0063:*/ 0x20, /* ..#..... */
/*0064:*/ 0x40, /* .#...... */
/* --- new character asterisk (42) starting at offset 0x0065 --- */
/*0065:*/ 5, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*006a:*/ 0x90, /* #..#.... */
/*006b:*/ 0x60, /* .##..... */
/*006c:*/ 0xf0, /* ####.... */
/*006d:*/ 0x60, /* .##..... */
/*006e:*/ 0x90, /* #..#.... */
/* --- new character plus (43) starting at offset 0x006f --- */
/*006f:*/ 5, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0074:*/ 0x20, /* ..#..... */
/*0075:*/ 0x20, /* ..#..... */
/*0076:*/ 0xf8, /* #####... */
/*0077:*/ 0x20, /* ..#..... */
/*0078:*/ 0x20, /* ..#..... */
/* --- new character comma (44) starting at offset 0x0079 --- */
/*0079:*/ 5, 5, 3, 0, -1, /* width and bbox (w,h,x,y) */
/*007e:*/ 0x30, /* ..##.... */
/*007f:*/ 0x20, /* ..#..... */
/*0080:*/ 0x40, /* .#...... */
/* --- new character hyphen (45) starting at offset 0x0081 --- */
/*0081:*/ 5, 5, 1, 0, 2, /* width and bbox (w,h,x,y) */
/*0086:*/ 0x70, /* .###.... */
/* --- new character period (46) starting at offset 0x0087 --- */
/*0087:*/ 5, 5, 3, 0, -1, /* width and bbox (w,h,x,y) */
/*008c:*/ 0x20, /* ..#..... */
/*008d:*/ 0x70, /* .###.... */
/*008e:*/ 0x20, /* ..#..... */
/* --- new character slash (47) starting at offset 0x008f --- */
/*008f:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0094:*/ 0x10, /* ...#.... */
/*0095:*/ 0x10, /* ...#.... */
/*0096:*/ 0x20, /* ..#..... */
/*0097:*/ 0x40, /* .#...... */
/*0098:*/ 0x80, /* #....... */
/*0099:*/ 0x80, /* #....... */
/* --- new character zero (48) starting at offset 0x009a --- */
/*009a:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*009f:*/ 0x20, /* ..#..... */
/*00a0:*/ 0x50, /* .#.#.... */
/*00a1:*/ 0x50, /* .#.#.... */
/*00a2:*/ 0x50, /* .#.#.... */
/*00a3:*/ 0x50, /* .#.#.... */
/*00a4:*/ 0x20, /* ..#..... */
/* --- new character one (49) starting at offset 0x00a5 --- */
/*00a5:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00aa:*/ 0x20, /* ..#..... */
/*00ab:*/ 0x60, /* .##..... */
/*00ac:*/ 0x20, /* ..#..... */
/*00ad:*/ 0x20, /* ..#..... */
/*00ae:*/ 0x20, /* ..#..... */
/*00af:*/ 0x70, /* .###.... */
/* --- new character two (50) starting at offset 0x00b0 --- */
/*00b0:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00b5:*/ 0x60, /* .##..... */
/*00b6:*/ 0x90, /* #..#.... */
/*00b7:*/ 0x10, /* ...#.... */
/*00b8:*/ 0x60, /* .##..... */
/*00b9:*/ 0x80, /* #....... */
/*00ba:*/ 0xf0, /* ####.... */
/* --- new character three (51) starting at offset 0x00bb --- */
/*00bb:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00c0:*/ 0xf0, /* ####.... */
/*00c1:*/ 0x20, /* ..#..... */
/*00c2:*/ 0x60, /* .##..... */
/*00c3:*/ 0x10, /* ...#.... */
/*00c4:*/ 0x90, /* #..#.... */
/*00c5:*/ 0x60, /* .##..... */
/* --- new character four (52) starting at offset 0x00c6 --- */
/*00c6:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00cb:*/ 0x20, /* ..#..... */
/*00cc:*/ 0x60, /* .##..... */
/*00cd:*/ 0xa0, /* #.#..... */
/*00ce:*/ 0xf0, /* ####.... */
/*00cf:*/ 0x20, /* ..#..... */
/*00d0:*/ 0x20, /* ..#..... */
/* --- new character five (53) starting at offset 0x00d1 --- */
/*00d1:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00d6:*/ 0xf0, /* ####.... */
/*00d7:*/ 0x80, /* #....... */
/*00d8:*/ 0xe0, /* ###..... */
/*00d9:*/ 0x10, /* ...#.... */
/*00da:*/ 0x90, /* #..#.... */
/*00db:*/ 0x60, /* .##..... */
/* --- new character six (54) starting at offset 0x00dc --- */
/*00dc:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00e1:*/ 0x60, /* .##..... */
/*00e2:*/ 0x80, /* #....... */
/*00e3:*/ 0xe0, /* ###..... */
/*00e4:*/ 0x90, /* #..#.... */
/*00e5:*/ 0x90, /* #..#.... */
/*00e6:*/ 0x60, /* .##..... */
/* --- new character seven (55) starting at offset 0x00e7 --- */
/*00e7:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00ec:*/ 0xf0, /* ####.... */
/*00ed:*/ 0x10, /* ...#.... */
/*00ee:*/ 0x20, /* ..#..... */
/*00ef:*/ 0x20, /* ..#..... */
/*00f0:*/ 0x40, /* .#...... */
/*00f1:*/ 0x40, /* .#...... */
/* --- new character eight (56) starting at offset 0x00f2 --- */
/*00f2:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00f7:*/ 0x60, /* .##..... */
/*00f8:*/ 0x90, /* #..#.... */
/*00f9:*/ 0x60, /* .##..... */
/*00fa:*/ 0x90, /* #..#.... */
/*00fb:*/ 0x90, /* #..#.... */
/*00fc:*/ 0x60, /* .##..... */
/* --- new character nine (57) starting at offset 0x00fd --- */
/*00fd:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0102:*/ 0x60, /* .##..... */
/*0103:*/ 0x90, /* #..#.... */
/*0104:*/ 0x90, /* #..#.... */
/*0105:*/ 0x70, /* .###.... */
/*0106:*/ 0x10, /* ...#.... */
/*0107:*/ 0x60, /* .##..... */
/* --- new character colon (58) starting at offset 0x0108 --- */
/*0108:*/ 5, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*010d:*/ 0x60, /* .##..... */
/*010e:*/ 0x60, /* .##..... */
/*010f:*/ 0x00, /* ........ */
/*0110:*/ 0x60, /* .##..... */
/*0111:*/ 0x60, /* .##..... */
/* --- new character semicolon (59) starting at offset 0x0112 --- */
/*0112:*/ 5, 5, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0117:*/ 0x30, /* ..##.... */
/*0118:*/ 0x30, /* ..##.... */
/*0119:*/ 0x00, /* ........ */
/*011a:*/ 0x30, /* ..##.... */
/*011b:*/ 0x20, /* ..#..... */
/*011c:*/ 0x40, /* .#...... */
/* --- new character less (60) starting at offset 0x011d --- */
/*011d:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0122:*/ 0x10, /* ...#.... */
/*0123:*/ 0x20, /* ..#..... */
/*0124:*/ 0x40, /* .#...... */
/*0125:*/ 0x40, /* .#...... */
/*0126:*/ 0x20, /* ..#..... */
/*0127:*/ 0x10, /* ...#.... */
/* --- new character equal (61) starting at offset 0x0128 --- */
/*0128:*/ 5, 5, 3, 0, 1, /* width and bbox (w,h,x,y) */
/*012d:*/ 0xf0, /* ####.... */
/*012e:*/ 0x00, /* ........ */
/*012f:*/ 0xf0, /* ####.... */
/* --- new character greater (62) starting at offset 0x0130 --- */
/*0130:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0135:*/ 0x40, /* .#...... */
/*0136:*/ 0x20, /* ..#..... */
/*0137:*/ 0x10, /* ...#.... */
/*0138:*/ 0x10, /* ...#.... */
/*0139:*/ 0x20, /* ..#..... */
/*013a:*/ 0x40, /* .#...... */
/* --- new character question (63) starting at offset 0x013b --- */
/*013b:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0140:*/ 0x20, /* ..#..... */
/*0141:*/ 0x50, /* .#.#.... */
/*0142:*/ 0x10, /* ...#.... */
/*0143:*/ 0x20, /* ..#..... */
/*0144:*/ 0x00, /* ........ */
/*0145:*/ 0x20, /* ..#..... */
/* --- new character at (64) starting at offset 0x0146 --- */
/*0146:*/ 5, 5, 8, 0, -1, /* width and bbox (w,h,x,y) */
/*014b:*/ 0x30, /* ..##.... */
/*014c:*/ 0x48, /* .#..#... */
/*014d:*/ 0x98, /* #..##... */
/*014e:*/ 0xa8, /* #.#.#... */
/*014f:*/ 0xa8, /* #.#.#... */
/*0150:*/ 0x90, /* #..#.... */
/*0151:*/ 0x40, /* .#...... */
/*0152:*/ 0x30, /* ..##.... */
/* --- new character A (65) starting at offset 0x0153 --- */
/*0153:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0158:*/ 0x60, /* .##..... */
/*0159:*/ 0x90, /* #..#.... */
/*015a:*/ 0x90, /* #..#.... */
/*015b:*/ 0xf0, /* ####.... */
/*015c:*/ 0x90, /* #..#.... */
/*015d:*/ 0x90, /* #..#.... */
/* --- new character B (66) starting at offset 0x015e --- */
/*015e:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0163:*/ 0xe0, /* ###..... */
/*0164:*/ 0x90, /* #..#.... */
/*0165:*/ 0xe0, /* ###..... */
/*0166:*/ 0x90, /* #..#.... */
/*0167:*/ 0x90, /* #..#.... */
/*0168:*/ 0xe0, /* ###..... */
/* --- new character C (67) starting at offset 0x0169 --- */
/*0169:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*016e:*/ 0x60, /* .##..... */
/*016f:*/ 0x90, /* #..#.... */
/*0170:*/ 0x80, /* #....... */
/*0171:*/ 0x80, /* #....... */
/*0172:*/ 0x90, /* #..#.... */
/*0173:*/ 0x60, /* .##..... */
/* --- new character D (68) starting at offset 0x0174 --- */
/*0174:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0179:*/ 0xe0, /* ###..... */
/*017a:*/ 0x90, /* #..#.... */
/*017b:*/ 0x90, /* #..#.... */
/*017c:*/ 0x90, /* #..#.... */
/*017d:*/ 0x90, /* #..#.... */
/*017e:*/ 0xe0, /* ###..... */
/* --- new character E (69) starting at offset 0x017f --- */
/*017f:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0184:*/ 0xf0, /* ####.... */
/*0185:*/ 0x80, /* #....... */
/*0186:*/ 0xe0, /* ###..... */
/*0187:*/ 0x80, /* #....... */
/*0188:*/ 0x80, /* #....... */
/*0189:*/ 0xf0, /* ####.... */
/* --- new character F (70) starting at offset 0x018a --- */
/*018a:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*018f:*/ 0xf0, /* ####.... */
/*0190:*/ 0x80, /* #....... */
/*0191:*/ 0xe0, /* ###..... */
/*0192:*/ 0x80, /* #....... */
/*0193:*/ 0x80, /* #....... */
/*0194:*/ 0x80, /* #....... */
/* --- new character G (71) starting at offset 0x0195 --- */
/*0195:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*019a:*/ 0x60, /* .##..... */
/*019b:*/ 0x90, /* #..#.... */
/*019c:*/ 0x80, /* #....... */
/*019d:*/ 0xb0, /* #.##.... */
/*019e:*/ 0x90, /* #..#.... */
/*019f:*/ 0x60, /* .##..... */
/* --- new character H (72) starting at offset 0x01a0 --- */
/*01a0:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01a5:*/ 0x90, /* #..#.... */
/*01a6:*/ 0x90, /* #..#.... */
/*01a7:*/ 0xf0, /* ####.... */
/*01a8:*/ 0x90, /* #..#.... */
/*01a9:*/ 0x90, /* #..#.... */
/*01aa:*/ 0x90, /* #..#.... */
/* --- new character I (73) starting at offset 0x01ab --- */
/*01ab:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01b0:*/ 0x70, /* .###.... */
/*01b1:*/ 0x20, /* ..#..... */
/*01b2:*/ 0x20, /* ..#..... */
/*01b3:*/ 0x20, /* ..#..... */
/*01b4:*/ 0x20, /* ..#..... */
/*01b5:*/ 0x70, /* .###.... */
/* --- new character J (74) starting at offset 0x01b6 --- */
/*01b6:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01bb:*/ 0x70, /* .###.... */
/*01bc:*/ 0x20, /* ..#..... */
/*01bd:*/ 0x20, /* ..#..... */
/*01be:*/ 0x20, /* ..#..... */
/*01bf:*/ 0xa0, /* #.#..... */
/*01c0:*/ 0x40, /* .#...... */
/* --- new character K (75) starting at offset 0x01c1 --- */
/*01c1:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01c6:*/ 0x90, /* #..#.... */
/*01c7:*/ 0xa0, /* #.#..... */
/*01c8:*/ 0xc0, /* ##...... */
/*01c9:*/ 0xa0, /* #.#..... */
/*01ca:*/ 0xa0, /* #.#..... */
/*01cb:*/ 0x90, /* #..#.... */
/* --- new character L (76) starting at offset 0x01cc --- */
/*01cc:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01d1:*/ 0x80, /* #....... */
/*01d2:*/ 0x80, /* #....... */
/*01d3:*/ 0x80, /* #....... */
/*01d4:*/ 0x80, /* #....... */
/*01d5:*/ 0x80, /* #....... */
/*01d6:*/ 0xf0, /* ####.... */
/* --- new character M (77) starting at offset 0x01d7 --- */
/*01d7:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01dc:*/ 0x90, /* #..#.... */
/*01dd:*/ 0xf0, /* ####.... */
/*01de:*/ 0xf0, /* ####.... */
/*01df:*/ 0x90, /* #..#.... */
/*01e0:*/ 0x90, /* #..#.... */
/*01e1:*/ 0x90, /* #..#.... */
/* --- new character N (78) starting at offset 0x01e2 --- */
/*01e2:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01e7:*/ 0x90, /* #..#.... */
/*01e8:*/ 0xd0, /* ##.#.... */
/*01e9:*/ 0xf0, /* ####.... */
/*01ea:*/ 0xb0, /* #.##.... */
/*01eb:*/ 0xb0, /* #.##.... */
/*01ec:*/ 0x90, /* #..#.... */
/* --- new character O (79) starting at offset 0x01ed --- */
/*01ed:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01f2:*/ 0x60, /* .##..... */
/*01f3:*/ 0x90, /* #..#.... */
/*01f4:*/ 0x90, /* #..#.... */
/*01f5:*/ 0x90, /* #..#.... */
/*01f6:*/ 0x90, /* #..#.... */
/*01f7:*/ 0x60, /* .##..... */
/* --- new character P (80) starting at offset 0x01f8 --- */
/*01f8:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01fd:*/ 0xe0, /* ###..... */
/*01fe:*/ 0x90, /* #..#.... */
/*01ff:*/ 0x90, /* #..#.... */
/*0200:*/ 0xe0, /* ###..... */
/*0201:*/ 0x80, /* #....... */
/*0202:*/ 0x80, /* #....... */
/* --- new character Q (81) starting at offset 0x0203 --- */
/*0203:*/ 5, 5, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*0208:*/ 0x60, /* .##..... */
/*0209:*/ 0x90, /* #..#.... */
/*020a:*/ 0x90, /* #..#.... */
/*020b:*/ 0xd0, /* ##.#.... */
/*020c:*/ 0xb0, /* #.##.... */
/*020d:*/ 0x60, /* .##..... */
/*020e:*/ 0x10, /* ...#.... */
/* --- new character R (82) starting at offset 0x020f --- */
/*020f:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0214:*/ 0xe0, /* ###..... */
/*0215:*/ 0x90, /* #..#.... */
/*0216:*/ 0x90, /* #..#.... */
/*0217:*/ 0xe0, /* ###..... */
/*0218:*/ 0x90, /* #..#.... */
/*0219:*/ 0x90, /* #..#.... */
/* --- new character S (83) starting at offset 0x021a --- */
/*021a:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*021f:*/ 0x60, /* .##..... */
/*0220:*/ 0x90, /* #..#.... */
/*0221:*/ 0x40, /* .#...... */
/*0222:*/ 0x20, /* ..#..... */
/*0223:*/ 0x90, /* #..#.... */
/*0224:*/ 0x60, /* .##..... */
/* --- new character T (84) starting at offset 0x0225 --- */
/*0225:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*022a:*/ 0x70, /* .###.... */
/*022b:*/ 0x20, /* ..#..... */
/*022c:*/ 0x20, /* ..#..... */
/*022d:*/ 0x20, /* ..#..... */
/*022e:*/ 0x20, /* ..#..... */
/*022f:*/ 0x20, /* ..#..... */
/* --- new character U (85) starting at offset 0x0230 --- */
/*0230:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0235:*/ 0x90, /* #..#.... */
/*0236:*/ 0x90, /* #..#.... */
/*0237:*/ 0x90, /* #..#.... */
/*0238:*/ 0x90, /* #..#.... */
/*0239:*/ 0x90, /* #..#.... */
/*023a:*/ 0x60, /* .##..... */
/* --- new character V (86) starting at offset 0x023b --- */
/*023b:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0240:*/ 0x90, /* #..#.... */
/*0241:*/ 0x90, /* #..#.... */
/*0242:*/ 0x90, /* #..#.... */
/*0243:*/ 0x90, /* #..#.... */
/*0244:*/ 0x60, /* .##..... */
/*0245:*/ 0x60, /* .##..... */
/* --- new character W (87) starting at offset 0x0246 --- */
/*0246:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*024b:*/ 0x90, /* #..#.... */
/*024c:*/ 0x90, /* #..#.... */
/*024d:*/ 0x90, /* #..#.... */
/*024e:*/ 0xf0, /* ####.... */
/*024f:*/ 0xf0, /* ####.... */
/*0250:*/ 0x90, /* #..#.... */
/* --- new character X (88) starting at offset 0x0251 --- */
/*0251:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0256:*/ 0x90, /* #..#.... */
/*0257:*/ 0x90, /* #..#.... */
/*0258:*/ 0x60, /* .##..... */
/*0259:*/ 0x60, /* .##..... */
/*025a:*/ 0x90, /* #..#.... */
/*025b:*/ 0x90, /* #..#.... */
/* --- new character Y (89) starting at offset 0x025c --- */
/*025c:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0261:*/ 0x88, /* #...#... */
/*0262:*/ 0x88, /* #...#... */
/*0263:*/ 0x50, /* .#.#.... */
/*0264:*/ 0x20, /* ..#..... */
/*0265:*/ 0x20, /* ..#..... */
/*0266:*/ 0x20, /* ..#..... */
/* --- new character Z (90) starting at offset 0x0267 --- */
/*0267:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*026c:*/ 0xf0, /* ####.... */
/*026d:*/ 0x10, /* ...#.... */
/*026e:*/ 0x20, /* ..#..... */
/*026f:*/ 0x40, /* .#...... */
/*0270:*/ 0x80, /* #....... */
/*0271:*/ 0xf0, /* ####.... */
/* --- new character bracketleft (91) starting at offset 0x0272 --- */
/*0272:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0277:*/ 0x70, /* .###.... */
/*0278:*/ 0x40, /* .#...... */
/*0279:*/ 0x40, /* .#...... */
/*027a:*/ 0x40, /* .#...... */
/*027b:*/ 0x40, /* .#...... */
/*027c:*/ 0x70, /* .###.... */
/* --- new character backslash (92) starting at offset 0x027d --- */
/*027d:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0282:*/ 0x80, /* #....... */
/*0283:*/ 0x80, /* #....... */
/*0284:*/ 0x40, /* .#...... */
/*0285:*/ 0x20, /* ..#..... */
/*0286:*/ 0x10, /* ...#.... */
/*0287:*/ 0x10, /* ...#.... */
/* --- new character bracketright (93) starting at offset 0x0288 --- */
/*0288:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*028d:*/ 0x70, /* .###.... */
/*028e:*/ 0x10, /* ...#.... */
/*028f:*/ 0x10, /* ...#.... */
/*0290:*/ 0x10, /* ...#.... */
/*0291:*/ 0x10, /* ...#.... */
/*0292:*/ 0x70, /* .###.... */
/* --- new character asciicircum (94) starting at offset 0x0293 --- */
/*0293:*/ 5, 5, 2, 0, 4, /* width and bbox (w,h,x,y) */
/*0298:*/ 0x20, /* ..#..... */
/*0299:*/ 0x50, /* .#.#.... */
/* --- new character underscore (95) starting at offset 0x029a --- */
/*029a:*/ 5, 5, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*029f:*/ 0xf0, /* ####.... */
/* --- new character grave (96) starting at offset 0x02a0 --- */
/*02a0:*/ 5, 5, 2, 0, 4, /* width and bbox (w,h,x,y) */
/*02a5:*/ 0x40, /* .#...... */
/*02a6:*/ 0x20, /* ..#..... */
/* --- new character a (97) starting at offset 0x02a7 --- */
/*02a7:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02ac:*/ 0x70, /* .###.... */
/*02ad:*/ 0x90, /* #..#.... */
/*02ae:*/ 0x90, /* #..#.... */
/*02af:*/ 0x70, /* .###.... */
/* --- new character b (98) starting at offset 0x02b0 --- */
/*02b0:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*02b5:*/ 0x80, /* #....... */
/*02b6:*/ 0x80, /* #....... */
/*02b7:*/ 0xe0, /* ###..... */
/*02b8:*/ 0x90, /* #..#.... */
/*02b9:*/ 0x90, /* #..#.... */
/*02ba:*/ 0xe0, /* ###..... */
/* --- new character c (99) starting at offset 0x02bb --- */
/*02bb:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02c0:*/ 0x30, /* ..##.... */
/*02c1:*/ 0x40, /* .#...... */
/*02c2:*/ 0x40, /* .#...... */
/*02c3:*/ 0x30, /* ..##.... */
/* --- new character d (100) starting at offset 0x02c4 --- */
/*02c4:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*02c9:*/ 0x10, /* ...#.... */
/*02ca:*/ 0x10, /* ...#.... */
/*02cb:*/ 0x70, /* .###.... */
/*02cc:*/ 0x90, /* #..#.... */
/*02cd:*/ 0x90, /* #..#.... */
/*02ce:*/ 0x70, /* .###.... */
/* --- new character e (101) starting at offset 0x02cf --- */
/*02cf:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*02d4:*/ 0x60, /* .##..... */
/*02d5:*/ 0xb0, /* #.##.... */
/*02d6:*/ 0xc0, /* ##...... */
/*02d7:*/ 0x60, /* .##..... */
/* --- new character f (102) starting at offset 0x02d8 --- */
/*02d8:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*02dd:*/ 0x20, /* ..#..... */
/*02de:*/ 0x50, /* .#.#.... */
/*02df:*/ 0x40, /* .#...... */
/*02e0:*/ 0xe0, /* ###..... */
/*02e1:*/ 0x40, /* .#...... */
/*02e2:*/ 0x40, /* .#...... */
/* --- new character g (103) starting at offset 0x02e3 --- */
/*02e3:*/ 5, 5, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*02e8:*/ 0x60, /* .##..... */
/*02e9:*/ 0x90, /* #..#.... */
/*02ea:*/ 0x70, /* .###.... */
/*02eb:*/ 0x10, /* ...#.... */
/*02ec:*/ 0x60, /* .##..... */
/* --- new character h (104) starting at offset 0x02ed --- */
/*02ed:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*02f2:*/ 0x80, /* #....... */
/*02f3:*/ 0x80, /* #....... */
/*02f4:*/ 0xe0, /* ###..... */
/*02f5:*/ 0x90, /* #..#.... */
/*02f6:*/ 0x90, /* #..#.... */
/*02f7:*/ 0x90, /* #..#.... */
/* --- new character i (105) starting at offset 0x02f8 --- */
/*02f8:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*02fd:*/ 0x20, /* ..#..... */
/*02fe:*/ 0x00, /* ........ */
/*02ff:*/ 0x60, /* .##..... */
/*0300:*/ 0x20, /* ..#..... */
/*0301:*/ 0x20, /* ..#..... */
/*0302:*/ 0x70, /* .###.... */
/* --- new character j (106) starting at offset 0x0303 --- */
/*0303:*/ 5, 5, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*0308:*/ 0x10, /* ...#.... */
/*0309:*/ 0x00, /* ........ */
/*030a:*/ 0x10, /* ...#.... */
/*030b:*/ 0x10, /* ...#.... */
/*030c:*/ 0x10, /* ...#.... */
/*030d:*/ 0x50, /* .#.#.... */
/*030e:*/ 0x20, /* ..#..... */
/* --- new character k (107) starting at offset 0x030f --- */
/*030f:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0314:*/ 0x80, /* #....... */
/*0315:*/ 0x80, /* #....... */
/*0316:*/ 0x90, /* #..#.... */
/*0317:*/ 0xe0, /* ###..... */
/*0318:*/ 0x90, /* #..#.... */
/*0319:*/ 0x90, /* #..#.... */
/* --- new character l (108) starting at offset 0x031a --- */
/*031a:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*031f:*/ 0x60, /* .##..... */
/*0320:*/ 0x20, /* ..#..... */
/*0321:*/ 0x20, /* ..#..... */
/*0322:*/ 0x20, /* ..#..... */
/*0323:*/ 0x20, /* ..#..... */
/*0324:*/ 0x70, /* .###.... */
/* --- new character m (109) starting at offset 0x0325 --- */
/*0325:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*032a:*/ 0xd0, /* ##.#.... */
/*032b:*/ 0xa8, /* #.#.#... */
/*032c:*/ 0xa8, /* #.#.#... */
/*032d:*/ 0xa8, /* #.#.#... */
/* --- new character n (110) starting at offset 0x032e --- */
/*032e:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0333:*/ 0xe0, /* ###..... */
/*0334:*/ 0x90, /* #..#.... */
/*0335:*/ 0x90, /* #..#.... */
/*0336:*/ 0x90, /* #..#.... */
/* --- new character o (111) starting at offset 0x0337 --- */
/*0337:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*033c:*/ 0x60, /* .##..... */
/*033d:*/ 0x90, /* #..#.... */
/*033e:*/ 0x90, /* #..#.... */
/*033f:*/ 0x60, /* .##..... */
/* --- new character p (112) starting at offset 0x0340 --- */
/*0340:*/ 5, 5, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*0345:*/ 0xe0, /* ###..... */
/*0346:*/ 0x90, /* #..#.... */
/*0347:*/ 0xe0, /* ###..... */
/*0348:*/ 0x80, /* #....... */
/*0349:*/ 0x80, /* #....... */
/* --- new character q (113) starting at offset 0x034a --- */
/*034a:*/ 5, 5, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*034f:*/ 0x70, /* .###.... */
/*0350:*/ 0x90, /* #..#.... */
/*0351:*/ 0x70, /* .###.... */
/*0352:*/ 0x10, /* ...#.... */
/*0353:*/ 0x10, /* ...#.... */
/* --- new character r (114) starting at offset 0x0354 --- */
/*0354:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0359:*/ 0xa0, /* #.#..... */
/*035a:*/ 0xd0, /* ##.#.... */
/*035b:*/ 0x80, /* #....... */
/*035c:*/ 0x80, /* #....... */
/* --- new character s (115) starting at offset 0x035d --- */
/*035d:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0362:*/ 0x30, /* ..##.... */
/*0363:*/ 0x60, /* .##..... */
/*0364:*/ 0x10, /* ...#.... */
/*0365:*/ 0x60, /* .##..... */
/* --- new character t (116) starting at offset 0x0366 --- */
/*0366:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*036b:*/ 0x40, /* .#...... */
/*036c:*/ 0x40, /* .#...... */
/*036d:*/ 0xe0, /* ###..... */
/*036e:*/ 0x40, /* .#...... */
/*036f:*/ 0x50, /* .#.#.... */
/*0370:*/ 0x20, /* ..#..... */
/* --- new character u (117) starting at offset 0x0371 --- */
/*0371:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0376:*/ 0x90, /* #..#.... */
/*0377:*/ 0x90, /* #..#.... */
/*0378:*/ 0x90, /* #..#.... */
/*0379:*/ 0x70, /* .###.... */
/* --- new character v (118) starting at offset 0x037a --- */
/*037a:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*037f:*/ 0x50, /* .#.#.... */
/*0380:*/ 0x50, /* .#.#.... */
/*0381:*/ 0x50, /* .#.#.... */
/*0382:*/ 0x20, /* ..#..... */
/* --- new character w (119) starting at offset 0x0383 --- */
/*0383:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0388:*/ 0x88, /* #...#... */
/*0389:*/ 0xa8, /* #.#.#... */
/*038a:*/ 0xa8, /* #.#.#... */
/*038b:*/ 0x50, /* .#.#.... */
/* --- new character x (120) starting at offset 0x038c --- */
/*038c:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*0391:*/ 0x90, /* #..#.... */
/*0392:*/ 0x60, /* .##..... */
/*0393:*/ 0x60, /* .##..... */
/*0394:*/ 0x90, /* #..#.... */
/* --- new character y (121) starting at offset 0x0395 --- */
/*0395:*/ 5, 5, 5, 0, -1, /* width and bbox (w,h,x,y) */
/*039a:*/ 0x90, /* #..#.... */
/*039b:*/ 0x90, /* #..#.... */
/*039c:*/ 0x70, /* .###.... */
/*039d:*/ 0x90, /* #..#.... */
/*039e:*/ 0x60, /* .##..... */
/* --- new character z (122) starting at offset 0x039f --- */
/*039f:*/ 5, 5, 4, 0, 0, /* width and bbox (w,h,x,y) */
/*03a4:*/ 0xf0, /* ####.... */
/*03a5:*/ 0x20, /* ..#..... */
/*03a6:*/ 0x40, /* .#...... */
/*03a7:*/ 0xf0, /* ####.... */
/* --- new character braceleft (123) starting at offset 0x03a8 --- */
/*03a8:*/ 5, 5, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*03ad:*/ 0x30, /* ..##.... */
/*03ae:*/ 0x40, /* .#...... */
/*03af:*/ 0x20, /* ..#..... */
/*03b0:*/ 0xc0, /* ##...... */
/*03b1:*/ 0x20, /* ..#..... */
/*03b2:*/ 0x40, /* .#...... */
/*03b3:*/ 0x30, /* ..##.... */
/* --- new character bar (124) starting at offset 0x03b4 --- */
/*03b4:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*03b9:*/ 0x20, /* ..#..... */
/*03ba:*/ 0x20, /* ..#..... */
/*03bb:*/ 0x20, /* ..#..... */
/*03bc:*/ 0x20, /* ..#..... */
/*03bd:*/ 0x20, /* ..#..... */
/*03be:*/ 0x20, /* ..#..... */
/* --- new character braceright (125) starting at offset 0x03bf --- */
/*03bf:*/ 5, 5, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*03c4:*/ 0xc0, /* ##...... */
/*03c5:*/ 0x20, /* ..#..... */
/*03c6:*/ 0x40, /* .#...... */
/*03c7:*/ 0x30, /* ..##.... */
/*03c8:*/ 0x40, /* .#...... */
/*03c9:*/ 0x20, /* ..#..... */
/*03ca:*/ 0xc0, /* ##...... */
/* --- new character asciitilde (126) starting at offset 0x03cb --- */
/*03cb:*/ 5, 5, 2, 0, 4, /* width and bbox (w,h,x,y) */
/*03d0:*/ 0x50, /* .#.#.... */
/*03d1:*/ 0xa0, /* #.#..... */
};
static const uint16_t font_5x8_offsets[] = {
0x0000 /* space */,
0x0006 /* exclam */,
0x0011 /* quotedbl */,
0x0019 /* numbersign */,
0x0025 /* dollar */,
0x0031 /* percent */,
0x003b /* ampersand */,
0x0047 /* quotesingle */,
0x004f /* parenleft */,
0x005a /* parenright */,
0x0065 /* asterisk */,
0x006f /* plus */,
0x0079 /* comma */,
0x0081 /* hyphen */,
0x0087 /* period */,
0x008f /* slash */,
0x009a /* zero */,
0x00a5 /* one */,
0x00b0 /* two */,
0x00bb /* three */,
0x00c6 /* four */,
0x00d1 /* five */,
0x00dc /* six */,
0x00e7 /* seven */,
0x00f2 /* eight */,
0x00fd /* nine */,
0x0108 /* colon */,
0x0112 /* semicolon */,
0x011d /* less */,
0x0128 /* equal */,
0x0130 /* greater */,
0x013b /* question */,
0x0146 /* at */,
0x0153 /* A */,
0x015e /* B */,
0x0169 /* C */,
0x0174 /* D */,
0x017f /* E */,
0x018a /* F */,
0x0195 /* G */,
0x01a0 /* H */,
0x01ab /* I */,
0x01b6 /* J */,
0x01c1 /* K */,
0x01cc /* L */,
0x01d7 /* M */,
0x01e2 /* N */,
0x01ed /* O */,
0x01f8 /* P */,
0x0203 /* Q */,
0x020f /* R */,
0x021a /* S */,
0x0225 /* T */,
0x0230 /* U */,
0x023b /* V */,
0x0246 /* W */,
0x0251 /* X */,
0x025c /* Y */,
0x0267 /* Z */,
0x0272 /* bracketleft */,
0x027d /* backslash */,
0x0288 /* bracketright */,
0x0293 /* asciicircum */,
0x029a /* underscore */,
0x02a0 /* grave */,
0x02a7 /* a */,
0x02b0 /* b */,
0x02bb /* c */,
0x02c4 /* d */,
0x02cf /* e */,
0x02d8 /* f */,
0x02e3 /* g */,
0x02ed /* h */,
0x02f8 /* i */,
0x0303 /* j */,
0x030f /* k */,
0x031a /* l */,
0x0325 /* m */,
0x032e /* n */,
0x0337 /* o */,
0x0340 /* p */,
0x034a /* q */,
0x0354 /* r */,
0x035d /* s */,
0x0366 /* t */,
0x0371 /* u */,
0x037a /* v */,
0x0383 /* w */,
0x038c /* x */,
0x0395 /* y */,
0x039f /* z */,
0x03a8 /* braceleft */,
0x03b4 /* bar */,
0x03bf /* braceright */,
0x03cb /* asciitilde */,
0xffff /* (no glyph) */
};
const struct fb_font font_5x8 = {
.height = 8,
.ascent = 7,
.firstchar = 32, /* space */
.lastchar = 127, /* ? */
.chardata = font_5x8_data,
.charoffs = font_5x8_offsets,
};

1069
src/target/firmware/fb/c64.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,311 @@
/* utility functions for a black-and-white framebuffer organized
as 8-vertically-stacked-pixels per byte. This matches the
ST7558 LC Display Controller used on the Motorola C123 */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_bw8.h>
#include <stdio.h> // debugging
void fb_bw8_clear(){
int i,n;
/* bytes to clear */
n = (framebuffer->height+7)/8 * framebuffer->width;
for(i=0;i<n;i++)
fb_bw8->mem[i]=0;
/* mark everything as dirty */
fb_bw8->damage_x1 = 0;
fb_bw8->damage_x2 = framebuffer->width;
fb_bw8->damage_y1 = 0;
fb_bw8->damage_y2 = framebuffer->height;
}
/* update damage rectangle to include the area
x1,y1 (upper left) to x2,y2 (lower right)
Note that all pixels *including* x1y2 and x2y2 are
marked as dirty */
static void fb_bw8_update_damage(
uint16_t x1,uint16_t y1, /* left upper corner (inclusive) */
uint16_t x2,uint16_t y2 /* right lower corner (inclusive) */
){
fb_sanitize_box(&x1,&y1,&x2,&y2);
x2++; /* see definition of fb_bw8->damage_x2/y2 */
y2++;
/* maybe currently everything is clean? */
if(fb_bw8->damage_x1 == fb_bw8->damage_x2 ||
fb_bw8->damage_y1 == fb_bw8->damage_y2){
fb_bw8->damage_x1 = x1;
fb_bw8->damage_y1 = y1;
fb_bw8->damage_x2 = x2;
fb_bw8->damage_y2 = y2;
/*
printf("%s: was clean! damage now %d %d %d %d\n",
__FUNCTION__,fb_bw8->damage_x1,fb_bw8->damage_y1,
fb_bw8->damage_x2,fb_bw8->damage_y2);
*/
return;
}
/* grow damage box */
if(x1 < fb_bw8->damage_x1)
fb_bw8->damage_x1 = x1;
if(y1 < fb_bw8->damage_y1)
fb_bw8->damage_y1 = y1;
if(x2 > fb_bw8->damage_x2)
fb_bw8->damage_x2 = x2;
if(y2 > fb_bw8->damage_y2)
fb_bw8->damage_y2 = y2;
#if 0
printf("%s: damage now %d %d %d %d\n",
__FUNCTION__,fb_bw8->damage_x1,fb_bw8->damage_y1,
fb_bw8->damage_x2,fb_bw8->damage_y2);
#endif
}
static void fb_bw8_line(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2){
fb_sanitize_box(&x1,&y1,&x2,&y2);
/* FIXME : this is currently unimplemented! */
}
void fb_bw8_lineto(uint16_t x,uint16_t y){
fb_bw8_line(framebuffer->cursor_x,framebuffer->cursor_y,x,y);
framebuffer->cursor_x = x;
framebuffer->cursor_y = y;
}
/* depending on color set (add to or_mask) or clear
(remove from and_mask) bit number bitnum */
static void set_pixel(uint8_t *and_mask,
uint8_t *or_mask,
int bitnum,
uint32_t color
){
if(color == FB_COLOR_TRANSP)
return;
if(color == FB_COLOR_WHITE)
*and_mask &= ~(1<<bitnum);
else
*or_mask |= 1<<bitnum;
}
static void set_fg_pixel(uint8_t *and_mask,uint8_t *or_mask,int bitnum){
set_pixel(and_mask,or_mask,bitnum,framebuffer->fg_color);
}
static void set_bg_pixel(uint8_t *and_mask,uint8_t *or_mask,int bitnum){
set_pixel(and_mask,or_mask,bitnum,framebuffer->bg_color);
}
static void fb_bw8_box(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2)
{
uint16_t y,w;
uint8_t *p;
uint8_t and_mask,or_mask; // filling
uint8_t and_mask_side,or_mask_side; // left and right side
fb_sanitize_box(&x1,&y1,&x2,&y2);
fb_bw8_update_damage(x1,y1,x2,y2);
for(y=y1&0xfff8;y<=y2;y+=8){
/* don't clear any pixels (white) */
and_mask = and_mask_side = 0xff;
or_mask = or_mask_side = 0;
for(w=0;w<8;w++){ /* check which pixels are affected */
if(y+w >= y1 && y+w <= y2){
set_bg_pixel(&and_mask,&or_mask,w);
set_fg_pixel(&and_mask_side,&or_mask_side,w);
}
if(y+w == y1 || y+w == y2){ /* top and bottom line */
set_fg_pixel(&and_mask,&or_mask,w);
}
}
p = fb_bw8->mem + (y/8)*framebuffer->width + x1;
for(w=x1;w<=x2;w++){
if(w == x1 || w == x2)
*p = (*p & and_mask_side)|or_mask_side;
else
*p = (*p & and_mask)|or_mask;
p++;
}
}
}
/* draw box from cursor to (x,y) */
void
fb_bw8_boxto(uint16_t x,uint16_t y){
fb_bw8_box(framebuffer->cursor_x,framebuffer->cursor_y,x,y);
framebuffer->cursor_x = x;
framebuffer->cursor_y = y;
}
/* this is the most ridiculous function ever, because it has to
fiddle with two braindead bitmaps at once, both being
organized differently */
/* draw text at current position, with current font and colours up
to a width of maxwidth pixels, return pixelwidth consumed */
int
fb_bw8_putstr(char *str,int maxwidth){
const struct fb_font *font = fb_fonts[framebuffer->font];
const struct fb_char *fchr;
int x1,y1,x2,y2; // will become bounding box
int w; // 0..7 while building bits per byte
int y; // coordinates in display
int char_x,char_y; // coordinates in font character
int bitmap_x,bitmap_y; // coordinates in character's bitmap
int byte_per_line; // depending on character width in font
int bitmap_offs,bitmap_bit; // offset inside bitmap, bit number of pixel
int fb8_offs; // offset to current pixel in framebuffer
uint8_t and_mask,or_mask; // to draw on framebuffer
uint8_t *p; // pointer into framebuffer memorya
int total_w; // total width
/* center, if maxwidth < 0 */
if (maxwidth < 0) {
total_w = 0;
/* count width of string */
for(p=(uint8_t *)str;*p;p++){
fchr = fb_font_get_char(font,*p);
if(!fchr) /* FIXME: Does '?' exist in every font? */
fchr = fb_font_get_char(font,'?');
total_w += fchr->width;
} // str
if (total_w <= framebuffer->width)
framebuffer->cursor_x =
(framebuffer->width - total_w) >> 1;
maxwidth = framebuffer->width;
}
x1 = framebuffer->cursor_x; // first col (incl!)
x2 = x1 + maxwidth - 1; // last col (incl!)
if(x2 >= framebuffer->width)
x2 = framebuffer->width - 1;
y1 = framebuffer->cursor_y - font->ascent + 1; // first row
y2 = y1 + font->height - 1; // last row
#if 0
printf("%s: %d %d %d %d\n",__FUNCTION__,x1,y1,x2,y2);
#endif
if(y1 < 0) // sanitize in case of overflow
y1 = 0;
if(y2 >= framebuffer->height)
y2 = framebuffer->height - 1;
fb8_offs = x1 + (y1 & 0xfff8)/8;
/* iterate over all characters */
for(;*str && framebuffer->cursor_x <= x2;str++){
fchr = fb_font_get_char(font,*str);
if(!fchr) /* FIXME: Does '?' exist in every font? */
fchr = fb_font_get_char(font,'?');
byte_per_line = (fchr->bbox_w+7)/8;;
/* character pixels, left to right */
for(char_x=0;
char_x<fchr->width && char_x + framebuffer->cursor_x <= x2;
char_x++
){
/* character pixels, top to bottom, in stripes
of 8 to match LCD RAM organisation */
for(y=y1&0xfff8;y<=y2;y+=8){ // display lines
/* bitmap coordinates, X= left to right */
bitmap_x = char_x - fchr->bbox_x;
/* character coords. Y increases from
cursor upwards */
char_y = framebuffer->cursor_y-y;
/* bitmap index = height-(bitmap coords)-1 */
bitmap_y = fchr->bbox_h -
(char_y - fchr->bbox_y) - 1;
fb8_offs = framebuffer->cursor_x +
char_x + (y/8)*framebuffer->width;
and_mask = 0xff;
or_mask = 0x00;
/* top to bottom inside of a 8bit column */
for(w=0;w<8;w++,bitmap_y++){
/* inside drawing area? */
if(y+w < y1 || y+w > y2)
continue;
/* outside pixel data of this
character? */
if(bitmap_x < 0 ||
bitmap_x >= fchr->bbox_w ||
bitmap_y < 0 ||
bitmap_y >= fchr->bbox_h
)
goto outside_char_bitmap;
/* check bit in pixel data for
this character */
bitmap_offs = bitmap_x/8+
bitmap_y*byte_per_line;
bitmap_bit = 7-(bitmap_x%8);
/* bit is set */
if(fchr->data[bitmap_offs] &
(1<<bitmap_bit)){
set_fg_pixel(&and_mask,
&or_mask,w);
} else { // unset, or outside bitmap
outside_char_bitmap:
set_bg_pixel(&and_mask,
&or_mask,w);
}
} // for(w...)
/* adjust byte in framebuffer */
p = fb_bw8->mem + fb8_offs;
*p = ( *p & and_mask ) | or_mask;
} // for(y...)
} // for(char_x...)
framebuffer->cursor_x += char_x;
} // str
x2 = framebuffer->cursor_x;
fb_bw8_update_damage(x1,y1,x2,y2);
return x2-x1;
}
int
fb_bw8_putchar(char c,int maxwidth){
char tmp[2];
tmp[0]=c;
tmp[1]=c;
return fb_bw8_putstr(tmp,maxwidth);
}

View File

@ -0,0 +1,70 @@
/*
"hardware" driver for a dummy framebuffer. Used when no
display hardware is supported
*/
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <defines.h>
static void
fb_dummy_init(){
}
static void
fb_dummy_clear(){
}
static void
fb_dummy_boxto(uint16_t x,uint16_t y){
framebuffer->cursor_x = x;
framebuffer->cursor_y = y;
}
static void
fb_dummy_lineto(uint16_t x,uint16_t y){
framebuffer->cursor_x = x;
framebuffer->cursor_y = y;
}
static int
fb_dummy_putstr(__unused char *c, __unused int maxwidth){
return 0;
}
static void
fb_dummy_flush(){
}
struct framebuffer fb_dummy_framebuffer = {
.name = "dummyfb",
.init = fb_dummy_init,
.clear = fb_dummy_clear,
.boxto = fb_dummy_boxto,
.lineto = fb_dummy_lineto,
.putstr = fb_dummy_putstr,
.flush = fb_dummy_flush,
.width = 128,
.height = 64
};
struct framebuffer *framebuffer = & fb_dummy_framebuffer;

View File

@ -0,0 +1,305 @@
/* utility functions for a color framebuffer organized
as one pixel per byte, with bits mapped as RRRGGGBB.
This matches the SSD1783 LC Display Controller used
on the Motorola C155 */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_rgb332.h>
#include <stdio.h>
#include <stdlib.h>
void
fb_rgb332_clear(){
int i,n;
/* bytes to clear */
n = framebuffer->height * framebuffer->width;
for(i=0;i<n;i++)
fb_rgb332->mem[i]=0xff; /* white */
/* mark everything as dirty */
fb_rgb332->damage_x1 = 0;
fb_rgb332->damage_x2 = framebuffer->width;
fb_rgb332->damage_y1 = 0;
fb_rgb332->damage_y2 = framebuffer->height;
}
/* update damage rectangle to include the area
x1,y1 (upper left) to x2,y2 (lower right)
Note that all pixels *including* x1y2 and x2y2 are
marked as dirty */
static void
fb_rgb332_update_damage(
uint16_t x1,uint16_t y1, /* left upper corner (inclusive) */
uint16_t x2,uint16_t y2 /* right lower corner (inclusive) */
){
fb_sanitize_box(&x1,&y1,&x2,&y2);
x2++; /* see definition of fb_rgb332->damage_x2/y2 */
y2++;
/* maybe currently everything is clean? */
if(fb_rgb332->damage_x1 == fb_rgb332->damage_x2 ||
fb_rgb332->damage_y1 == fb_rgb332->damage_y2
){
fb_rgb332->damage_x1 = x1;
fb_rgb332->damage_y1 = y1;
fb_rgb332->damage_x2 = x2;
fb_rgb332->damage_y2 = y2;
return;
}
/* grow damage box */
if(x1 < fb_rgb332->damage_x1)
fb_rgb332->damage_x1 = x1;
if(y1 < fb_rgb332->damage_y1)
fb_rgb332->damage_y1 = y1;
if(x2 > fb_rgb332->damage_x2)
fb_rgb332->damage_x2 = x2;
if(y2 > fb_rgb332->damage_y2)
fb_rgb332->damage_y2 = y2;
#if 0
printf("%s: damage now %d %d %d %d\n",
__FUNCTION__,fb_rgb332->damage_x1,fb_rgb332->damage_y1,
fb_rgb332->damage_x2,fb_rgb332->damage_y2);
#endif
}
/* we trust gcc to move this expensive bitshifting out of
the loops in the drawing funtcions */
static uint8_t rgb_to_pixel(uint32_t color){
uint8_t ret;
ret = (FB_COLOR_TO_R(color) & 0xe0); /* 765 = RRR */
ret |= (FB_COLOR_TO_G(color) & 0xe0) >> 3; /* 432 = GGG */
ret |= (FB_COLOR_TO_B(color) & 0xc0) >> 6; /* 10 = BB */
return ret;
}
static void set_pix(uint8_t *pixel,uint32_t color){
if(color == FB_COLOR_TRANSP)
return;
*pixel = rgb_to_pixel(color);
}
static void set_fg(uint8_t *pixel){
set_pix(pixel,framebuffer->fg_color);
}
static void set_bg(uint8_t *pixel){
set_pix(pixel,framebuffer->bg_color);
}
void fb_rgb332_boxto(uint16_t x2,uint16_t y2)
{
uint16_t x1 = framebuffer->cursor_x;
uint16_t y1 = framebuffer->cursor_y;
int x,y;
uint8_t *p;
framebuffer->cursor_x = x2;
framebuffer->cursor_y = y2;
fb_sanitize_box(&x1,&y1,&x2,&y2);
fb_rgb332_update_damage(x1,y1,x2,y2);
for(y=y1; y<=y2; y++){
p = & fb_rgb332->mem[x1 + framebuffer->width * y];
for(x=x1;x<=x2;x++){
set_bg(p);
if(y==y1 || y==y2 || x==x1 || x==x2) /* border */
set_fg(p);
p++;
}
}
}
/* draw a line like Brensenham did... (roughly) */
void fb_rgb332_lineto(uint16_t x2,uint16_t y2){
uint8_t *p,pixel; /* framebuffer pointer */
int delta_regular; /* framebuffer offset per step */
int delta_step; /* " */
uint16_t x1 = framebuffer->cursor_x; /* start */
uint16_t y1 = framebuffer->cursor_y;
int t,tmax; /* counter for steps */
int err_inc,err_accu=0; /* error delta and accumulator for */
/* Brensenham's algorhithm */
fb_limit_fb_range(&x1,&y1);
fb_limit_fb_range(&x2,&y2);
fb_rgb332_update_damage(x1,y1,x2,y2);
framebuffer->cursor_x = x2; /* end pixel */
framebuffer->cursor_y = y2;
/* pointer to first pixel, pixel value in FB memory */
p = fb_rgb332->mem + framebuffer->width * y1 + x1;
pixel = rgb_to_pixel(framebuffer->fg_color);
if(abs(x2-x1) >= abs(y2-y1)){ /* shallow line */
/* set pointer deltas for directions */
delta_regular = 1; /* X */
if(x2 < x1)
delta_regular = -delta_regular;
delta_step = framebuffer->width; /* Y */
if(y2 < y1)
delta_step = -delta_step;
tmax = abs(x2-x1);
err_inc = abs(y2-y1);
} else { /* steep line */
delta_regular = framebuffer->width; /* Y */
if(y2 < y1)
delta_regular = -delta_regular;
delta_step = 1; /* X */
if(x2 < x1)
delta_step = -1;
tmax = abs(y2-y1);
err_inc = abs(x2-y1);
}
#if 0
printf("%s: (%d,%d) -> (%d,%d) step=%d regular=%d err_inc=%d tmax=%d\n",
__FUNCTION__,x1,y1,x2,y2,delta_step,delta_regular,err_inc,tmax);
#endif
for(t=0;t<=tmax;t++){
*p = pixel;
err_accu += err_inc;
if(err_accu >= tmax){
p += delta_step;
err_accu -= tmax;
}
p += delta_regular;
}
}
int fb_rgb332_putstr(char *str,int maxwidth){
const struct fb_font *font = fb_fonts[framebuffer->font];
const struct fb_char *fchr;
int x1,y1,x2,y2; // will become bounding box
int y; // coordinates in display
int char_x=0,char_y; // coordinates in font character
int bitmap_x,bitmap_y; // coordinates in character's bitmap
int byte_per_line; // depending on character width in font
int bitmap_offs,bitmap_bit; // offset inside bitmap, bit number of pixel
uint8_t *p,fgpixel,bgpixel,trans; // pointer into framebuffer memory
int total_w; // total width
/* center, if maxwidth < 0 */
if (maxwidth < 0) {
total_w = 0;
/* count width of string */
for(p=(uint8_t *)str;*p;p++){
fchr = fb_font_get_char(font,*p);
if(!fchr) /* FIXME: Does '?' exist in every font? */
fchr = fb_font_get_char(font,'?');
total_w += fchr->width;
} // str
if (total_w <= framebuffer->width)
framebuffer->cursor_x =
(framebuffer->width - total_w) >> 1;
else
framebuffer->cursor_x = 1;
maxwidth = framebuffer->width;
}
x1 = framebuffer->cursor_x; // first col (incl!)
x2 = x1 + maxwidth - 1; // last col (incl!)
if(x2 >= framebuffer->width)
x2 = framebuffer->width - 1;
y1 = framebuffer->cursor_y - font->ascent + 1; // first row
y2 = y1 + font->height - 1; // last row
fgpixel = rgb_to_pixel(framebuffer->fg_color);
bgpixel = rgb_to_pixel(framebuffer->bg_color);
trans = (framebuffer->bg_color == FB_COLOR_TRANSP);
if(y1 < 0) // sanitize in case of overflow
y1 = 0;
if(y2 >= framebuffer->height)
y2 = framebuffer->height - 1;
/* iterate over all characters */
for(;*str && framebuffer->cursor_x <= x2;str++){
fchr = fb_font_get_char(font,*str);
if(!fchr) /* FIXME: Does '?' exist in every font? */
fchr = fb_font_get_char(font,'?');
if(!fchr)
return 0;
byte_per_line = (fchr->bbox_w+7)/8;
for(y=y1;y<=y2;y++){
p=fb_rgb332->mem+y*framebuffer->width;
p+=framebuffer->cursor_x;
for(char_x=0;
char_x<fchr->width &&
char_x+framebuffer->cursor_x <= x2;
char_x++
){
/* bitmap coordinates, X= left to right */
bitmap_x = char_x - fchr->bbox_x;
/* character coords. Y increases from
cursor upwards */
char_y = framebuffer->cursor_y-y;
/* bitmap index = height-(bitmap coords)-1 */
bitmap_y = fchr->bbox_h -
(char_y - fchr->bbox_y) - 1;
/* outside pixel data of this
character? */
if(bitmap_x < 0 ||
bitmap_x >= fchr->bbox_w ||
bitmap_y < 0 ||
bitmap_y >= fchr->bbox_h
)
goto outside_char_bitmap;
/* check bit in pixel data for
this character */
bitmap_offs=bitmap_x/8+bitmap_y*byte_per_line;
bitmap_bit=7-(bitmap_x%8);
/* bit is set */
if(fchr->data[bitmap_offs]&(1<<bitmap_bit)){
*p = fgpixel;
} else { // unset, or outside bitmap
outside_char_bitmap:
if (!trans)
*p = bgpixel;
}
p++;
} // for(x...)
} // for(char_x...)
framebuffer->cursor_x += char_x;
} // str
x2 = framebuffer->cursor_x;
fb_rgb332_update_damage(x1,y1,x2,y2);
return x2-x1;
}

View File

@ -0,0 +1,193 @@
/* Framebuffer implementation - combined Sunplus SPCA552E and
* Samsung S6B33B1X LCD driver - as used in the Pirelli DP-L10 */
/* (C) 2012 by Steve Markgraf <steve@steve-m.de>
*
* based on fb_ssd1783.c:
* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_rgb332.h>
#include <stdint.h>
#include <stdio.h>
#include <delay.h>
#include <memory.h>
#define S6B33B1X_WIDTH 128
#define S6B33B1X_HEIGHT 128
#define LCD_INVIS_X_PIXELS 4
#define ARMIO_LATCH_OUT 0xfffe4802
#define nCS4_ADDR 0x02800000
static uint8_t fb_s6b33b1x_mem[S6B33B1X_WIDTH * S6B33B1X_HEIGHT];
enum s6b33b1x_cmdflag { CMD, DATA, END };
struct s6b33b1x_cmdlist {
enum s6b33b1x_cmdflag is_cmd:8; /* 1: is a command, 0: is data, 2: end marker! */
uint8_t data; /* 8 bit to send to LC display */
} __attribute__((packed));
static const struct s6b33b1x_cmdlist
s6b33b1x_initdata[] = {
{ CMD, 0x26 }, /* CMD DCDC and AMP ON/OFF set */
{ DATA, 0x00 }, /* DATA: everything off */
{ CMD, 0x02 }, /* CMD Oscillation Mode Set */
{ DATA, 0x00 }, /* DATA: oscillator off */
{ CMD, 0x2c }, /* CMD Standby Mode off */
{ CMD, 0x50 }, /* CMD Display off */
{ CMD, 0x02 }, /* CMD Oscillation Mode Set */
{ DATA, 0x01 }, /* DATA: oscillator on */
{ CMD, 0x26 }, /* CMD DCDC and AMP ON/OFF set */
{ DATA, 0x01 }, /* DATA: Booster 1 on */
{ CMD, 0x26 }, /* CMD DCDC and AMP ON/OFF set */
{ DATA, 0x09 }, /* DATA: Booster 1 on, OP-AMP on */
{ CMD, 0x26 }, /* CMD DCDC and AMP ON/OFF set */
{ DATA, 0x0b }, /* DATA: Booster 1 + 2 on, OP-AMP on */
{ CMD, 0x26 }, /* CMD DCDC and AMP ON/OFF set */
{ DATA, 0x0f }, /* DATA: Booster 1 + 2 + 3 on, OP-AMP on */
{ CMD, 0x20 }, /* CMD DC-DC Select */
{ DATA, 0x01 }, /* DATA: step up x1.5 */
{ CMD, 0x24 }, /* CMD DCDC Clock Division Set */
{ DATA, 0x0a }, /* DATA: fPCK = fOSC/6 */
{ CMD, 0x2a }, /* CMD Contrast Control */
{ DATA, 0x2d }, /* DATA: default contrast */
{ CMD, 0x30 }, /* CMD Adressing mode set */
{ DATA, 0x0b }, /* DATA: 65536 color mode */
{ CMD, 0x10 }, /* CMD Driver output mode set */
{ DATA, 0x03 }, /* DATA: Display duty: 1/132 */
{ CMD, 0x34 }, /* CMD N-line inversion set */
{ DATA, 0x88 }, /* DATA: inversion on, one frame, every 8 blocks */
{ CMD, 0x40 }, /* CMD Entry mode set */
{ DATA, 0x00 }, /* DATA: Y address counter mode */
{ CMD, 0x28 }, /* CMD Temperature Compensation set */
{ DATA, 0x01 }, /* DATA: slope -0.05%/degC */
{ CMD, 0x32 }, /* CMD ROW vector mode set */
{ DATA, 0x01 }, /* DATA: every 2 subgroup */
{ CMD, 0x51 }, /* CMD Display on */
{ END, 0x00 }, /* MARKER: end of list */
};
static void fb_s6b33b1x_send_cmdlist(const struct s6b33b1x_cmdlist *p)
{
while(p->is_cmd != END){
writew(p->data, nCS4_ADDR);
p++;
}
}
static void fb_spca_write(uint16_t addr, uint16_t val)
{
writew(addr, nCS4_ADDR);
writew(val , nCS4_ADDR | 2);
}
static void fb_spca_init(void)
{
uint16_t reg;
/* Initialize Sunplus SPCA552E Media Controller for bypass mode */
fb_spca_write(0x7e, 0x00); /* internal register access */
delay_ms(10);
fb_spca_write(0x7a, 0x00); /* keep CPU in reset state */
delay_ms(10);
fb_spca_write(0x7f, 0x00); /* select main page */
delay_ms(5);
fb_spca_write(0x72, 0x07); /* don't reshape timing, 16 bit mode */
fb_spca_write(0x14, 0x03);
fb_spca_write(0x7f, 0x00); /* select main page */
delay_ms(5);
fb_spca_write(0x06, 0xff);
fb_spca_write(0x7f, 0x09);
fb_spca_write(0x19, 0x08); /* backlight: 0x08 is on, 0x0c is off */
fb_spca_write(0x23, 0x18);
/* enable bypass mode */
reg = readw(ARMIO_LATCH_OUT);
reg |= (1 << 7);
writew(reg, ARMIO_LATCH_OUT);
}
static void fb_s6b33b1x_init(void)
{
printf("%s: initializing LCD.\n",__FUNCTION__);
fb_spca_init();
fb_s6b33b1x_send_cmdlist(s6b33b1x_initdata);
}
static void fb_s6b33b1x_flush(void)
{
int x,y;
uint8_t *p;
struct s6b33b1x_cmdlist prepare_disp_write_cmds[] = {
{ CMD, 0x42 }, /* set column address */
{ DATA, fb_rgb332->damage_x1 + LCD_INVIS_X_PIXELS },
{ DATA, fb_rgb332->damage_x2 + LCD_INVIS_X_PIXELS - 1 },
{ CMD, 0x43 }, /* set page address (Y) */
{ DATA, fb_rgb332->damage_y1 },
{ DATA, fb_rgb332->damage_y2 - 1 },
{ END, 0x00 }
};
/* If everything's clean, just return */
if(fb_rgb332->damage_x1 == fb_rgb332->damage_x2 ||
fb_rgb332->damage_y1 == fb_rgb332->damage_y2) {
printf("%s: no damage\n",__FUNCTION__);
return;
}
fb_s6b33b1x_send_cmdlist(prepare_disp_write_cmds);
for(y=fb_rgb332->damage_y1;y<fb_rgb332->damage_y2;y++) {
p = & fb_rgb332->mem[y * framebuffer->width]; // start of line
p += fb_rgb332->damage_x1; // start of damage area
for(x=fb_rgb332->damage_x1; x<fb_rgb332->damage_x2; x++) {
uint16_t data = rgb332_to_565(*p++);
writew(data , nCS4_ADDR | 2);
}
}
fb_rgb332->damage_x1 = fb_rgb332->damage_x2 = 0;
fb_rgb332->damage_y1 = fb_rgb332->damage_y2 = 0;
}
static struct framebuffer fb_s6b33b1x_framebuffer = {
.name = "s6b33b1x",
.init = fb_s6b33b1x_init,
.clear = fb_rgb332_clear,
.boxto = fb_rgb332_boxto,
.lineto = fb_rgb332_lineto,
.putstr = fb_rgb332_putstr,
.flush = fb_s6b33b1x_flush,
.width = S6B33B1X_WIDTH,
.height = S6B33B1X_HEIGHT
};
static struct fb_rgb332 fb_s6b33b1x_rgb332 = {
.mem = fb_s6b33b1x_mem
};
struct framebuffer *framebuffer = &fb_s6b33b1x_framebuffer;
struct fb_rgb332 *fb_rgb332 = &fb_s6b33b1x_rgb332;

View File

@ -0,0 +1,204 @@
/* Framebuffer implementation - SSD1783 LCD driver for C155 */
/* Based on ssd1783.c by Steve Markgraf and Harald Welte */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_rgb332.h>
#include <stdint.h>
#include <stdio.h>
#include <delay.h>
#include <uwire.h>
#include <calypso/clock.h>
#define SSD1783_WIDTH 98
#define SSD1783_HEIGHT 67
#define SSD1783_UWIRE_BITLEN 9
#define SSD1783_DEV_ID 0
#define LCD_TOP_FREE_ROWS 3
#define LCD_LEFT_FREE_COLS 0
#define PIXEL_BYTES 3
#define FONT_HEIGHT 8
#define FONT_WIDTH 8
static uint8_t fb_ssd1783_mem[SSD1783_WIDTH * SSD1783_HEIGHT];
enum ssd1783_cmdflag { CMD, DATA, END };
struct ssd1783_cmdlist {
enum ssd1783_cmdflag is_cmd:8; /* 1: is a command, 0: is data, 2: end marker! */
uint8_t data; /* 8 bit to send to LC display */
} __attribute__((packed));
static const struct ssd1783_cmdlist
ssd1783_initdata[] = {
{ CMD, 0xD1 }, /* CMD set internal oscillator on */
{ CMD, 0x94 }, /* CMD leave sleep mode */
{ CMD, 0xbb }, /* CMD Set COM Output Scan Direction: */
{ DATA, 0x01 }, /* DATA: 01: COM0-79, then COM159-80 */
/* -------- DIFFERENT FROM ORIGINAL CODE: -------------- */
/* we use 8bit per pixel packed RGB 332 */
{ CMD, 0xbc }, /* CMD Set Data Output Scan Direction */
{ DATA, 0x00 }, /* DATA: column scan, normal rotation, normal display */
{ DATA, 0x00 }, /* DATA: RGB color arrangement R G B R G B ... */
/*-->*/ { DATA, 0x01 }, /* DATA: 8 bit per pixel mode MSB <RRRGGGBB> LSB */
/* --------- /DIFFERENT ---------- */
{ CMD, 0xce }, /* CMD Set 256 Color Look Up Table LUT */
{ DATA, 0x00 }, /* DATA red 000 */
{ DATA, 0x03 }, /* DATA red 001 */
{ DATA, 0x05 }, /* DATA red 010 */
{ DATA, 0x07 }, /* DATA red 011 */
{ DATA, 0x09 }, /* DATA red 100 */
{ DATA, 0x0b }, /* DATA red 101 */
{ DATA, 0x0d }, /* DATA red 110 */
{ DATA, 0x0f }, /* DATA red 111 */
{ DATA, 0x00 }, /* DATA green 000 */
{ DATA, 0x03 }, /* DATA green 001 */
{ DATA, 0x05 }, /* DATA green 010 */
{ DATA, 0x07 }, /* DATA green 011 */
{ DATA, 0x09 }, /* DATA green 100 */
{ DATA, 0x0b }, /* DATA green 101 */
{ DATA, 0x0d }, /* DATA green 110 */
{ DATA, 0x0f }, /* DATA green 111 */
{ DATA, 0x00 }, /* DATA blue 00 */
{ DATA, 0x05 }, /* DATA blue 01 */
{ DATA, 0x0a }, /* DATA blue 10 */
{ DATA, 0x0f }, /* DATA blue 11 */
{ CMD, 0xca }, /* CMD Set Display Control - Driver Duty Selection */
{ DATA, 0xff }, // can't find description of the values in the original
{ DATA, 0x10 }, // display/ssd1783.c in my datasheet :-(
{ DATA, 0x01 }, //
{ CMD, 0xab }, /* CMD Set Scroll Start */
{ DATA, 0x00 }, /* DATA: Starting address at block 0 */
{ CMD, 0x20 }, /* CMD Set power control register */
{ DATA, 0x0b }, /* DATA: booster 6x, reference gen. & int regulator */
{ CMD, 0x81 }, /* CMD Contrast Lvl & Int. Regul. Resistor Ratio */
{ DATA, 0x29 }, /* DATA: contrast = 0x29 */
{ DATA, 0x05 }, /* DATA: 0x05 = 0b101 -> 1+R2/R1 = 11.37 */
{ CMD, 0xa7 }, /* CMD Invert Display */
{ CMD, 0x82 }, /* CMD Set Temperature Compensation Coefficient */
{ DATA, 0x00 }, /* DATA: Gradient is -0.10 % / degC */
{ CMD, 0xfb }, /* CMD Set Biasing Ratio */
{ DATA, 0x03 }, /* DATA: 1/10 bias */
{ CMD, 0xf2 }, /* CMD Set Frame Frequency and N-line inversion */
{ DATA, 0x08 }, /* DATA: 75 Hz (POR) */
{ DATA, 0x06 }, /* DATA: n-line inversion: 6 lines */
{ CMD, 0xf7 }, /* CMD Select PWM/FRC Select Full Col./8col mode */
{ DATA, 0x28 }, /* DATA: always 0x28 */
{ DATA, 0x8c }, /* DATA: 4bit PWM + 2 bit FRC */
{ DATA, 0x05 }, /* DATA: full color mode */
{ CMD, 0xaf }, /* CMD Display On */
{ END, 0x00 }, /* MARKER: end of list */
};
static void
fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p){
int i=0;
while(p->is_cmd != END){
uint16_t sendcmd = p->data;
if(p->is_cmd == DATA)
sendcmd |= 0x0100; /* 9th bit is cmd/data flag */
uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN, &sendcmd, NULL);
p++;
i++;
}
}
static void
fb_ssd1783_init(void){
printf("%s: initializing LCD.\n",__FUNCTION__);
calypso_reset_set(RESET_EXT, 0);
delay_ms(5);
uwire_init();
delay_ms(5);
fb_ssd1783_send_cmdlist(ssd1783_initdata);
}
/* somehow the palette is messed up, RRR seems to have the
bits reversed! R0 R1 R2 G G G B B ---> R2 R1 R0 G G G B B */
static uint8_t fix_rrr(uint8_t v){
return (v & 0x5f) | (v & 0x80) >> 2 | (v & 0x20) << 2;
}
static void
fb_ssd1783_flush(void){
int x,y;
uint8_t *p;
struct ssd1783_cmdlist prepare_disp_write_cmds[] = {
{ CMD, 0x15 }, /* set column address */
{ DATA, fb_rgb332->damage_x1 },
{ DATA, fb_rgb332->damage_x2-1 },
{ CMD, 0x75 }, /* set page address (Y) */
{ DATA, fb_rgb332->damage_y1 },
{ DATA, fb_rgb332->damage_y2-1 },
{ CMD, 0x5c }, /* enter write display ram mode */
{ END, 0x00 }
};
struct ssd1783_cmdlist nop[] = {
{ CMD, 0x25 }, // NOP command
{ END, 0x00 }
};
/* If everything's clean, just return */
if(fb_rgb332->damage_x1 == fb_rgb332->damage_x2 ||
fb_rgb332->damage_y1 == fb_rgb332->damage_y2){
printf("%s: no damage\n",__FUNCTION__);
return;
}
fb_ssd1783_send_cmdlist(prepare_disp_write_cmds);
for(y=fb_rgb332->damage_y1;y<fb_rgb332->damage_y2;y++){
p = & fb_rgb332->mem[y * framebuffer->width]; // start of line
p += fb_rgb332->damage_x1; // start of damage area
for(x=fb_rgb332->damage_x1;x<fb_rgb332->damage_x2;x++){
uint16_t data = 0x0100 | fix_rrr(*p++); // dummy data
uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN,
&data, NULL);
}
}
fb_ssd1783_send_cmdlist(nop);
fb_rgb332->damage_x1 = fb_rgb332->damage_x2 = 0;
fb_rgb332->damage_y1 = fb_rgb332->damage_y2 = 0;
}
static struct framebuffer fb_ssd1783_framebuffer = {
.name = "ssd1783",
.init = fb_ssd1783_init,
.clear = fb_rgb332_clear,
.boxto = fb_rgb332_boxto,
.lineto = fb_rgb332_lineto,
.putstr = fb_rgb332_putstr,
.flush = fb_ssd1783_flush,
.width = SSD1783_WIDTH,
.height = SSD1783_HEIGHT
};
static struct fb_rgb332 fb_ssd1783_rgb332 = {
.mem = fb_ssd1783_mem
};
struct framebuffer *framebuffer = &fb_ssd1783_framebuffer;
struct fb_rgb332 *fb_rgb332 = &fb_ssd1783_rgb332;

View File

@ -0,0 +1,196 @@
/* Framebuffer implementation - SSD1963 (S1D15G14 clone) LCD driver for J100i */
/* Based on ssd1963.c by Steve Markgraf and Harald Welte */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
* (C) 2012 by Steve Markgraf <steve@steve-m.de>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_rgb332.h>
#include <stdint.h>
#include <stdio.h>
#include <delay.h>
#include <uwire.h>
#include <calypso/clock.h>
#define SSD1963_WIDTH 96
#define SSD1963_HEIGHT 64
#define SSD1963_UWIRE_BITLEN 9
#define SSD1963_DEV_ID 0
static uint8_t fb_ssd1963_mem[SSD1963_WIDTH * SSD1963_HEIGHT];
enum ssd1963_cmdflag { CMD, DATA, END };
struct ssd1963_cmdlist {
enum ssd1963_cmdflag is_cmd:8; /* 1: is a command, 0: is data, 2: end marker! */
uint8_t data; /* 8 bit to send to LC display */
} __attribute__((packed));
static const struct ssd1963_cmdlist
ssd1963_initdata[] = {
{ CMD, 0xb6 }, /* CMD Display Control, set panel parameters */
{ DATA, 0x4b },
{ DATA, 0xf1 },
{ DATA, 0x40 },
{ DATA, 0x40 },
{ DATA, 0x00 },
{ DATA, 0x8c },
{ DATA, 0x00 },
{ CMD, 0x3a }, /* CMD Set pixel format */
{ DATA, 0x02 }, /* DATA: 8 bit per pixel */
{ CMD, 0x2d }, /* Colour set, RGB332 -> RGB 565 mapping */
{ DATA, 0x00 }, /* DATA red 000 */
{ DATA, 0x04 }, /* DATA red 001 */
{ DATA, 0x09 }, /* DATA red 010 */
{ DATA, 0x0d }, /* DATA red 011 */
{ DATA, 0x12 }, /* DATA red 100 */
{ DATA, 0x16 }, /* DATA red 101 */
{ DATA, 0x1b }, /* DATA red 110 */
{ DATA, 0x1f }, /* DATA red 111 */
{ DATA, 0x00 }, /* Those bytes are probably a second palette */
{ DATA, 0x00 }, /* for an unused powersaving mode with reduced colors */
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 }, /* DATA green 000 */
{ DATA, 0x09 }, /* DATA green 001 */
{ DATA, 0x12 }, /* DATA green 010 */
{ DATA, 0x1b }, /* DATA green 011 */
{ DATA, 0x24 }, /* DATA green 100 */
{ DATA, 0x2d }, /* DATA green 101 */
{ DATA, 0x36 }, /* DATA green 110 */
{ DATA, 0x3f }, /* DATA green 111 */
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 }, /* DATA blue 00 */
{ DATA, 0x0a }, /* DATA blue 01 */
{ DATA, 0x15 }, /* DATA blue 10 */
{ DATA, 0x1f }, /* DATA blue 11 */
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ DATA, 0x00 },
{ CMD, 0x11 }, /* CMD Exit sleep mode*/
{ CMD, 0xba }, /* CMD Set contrast/Electronic Volume Control */
{ DATA, 0x5b }, /* DATA: */
{ DATA, 0x84 }, /* DATA: */
{ CMD, 0x36 }, /* CMD Memory access control */
{ DATA, 0x00 }, /* DATA: */
{ CMD, 0x13 }, /* CMD Enter normal mode */
{ CMD, 0x29 }, /* CMD Set display on */
{ END, 0x00 }, /* MARKER: end of list */
};
static void
fb_ssd1963_send_cmdlist(const struct ssd1963_cmdlist *p) {
int i=0;
while(p->is_cmd != END){
uint16_t sendcmd = p->data;
if(p->is_cmd == DATA)
sendcmd |= 0x0100; /* 9th bit is cmd/data flag */
uwire_xfer(SSD1963_DEV_ID, SSD1963_UWIRE_BITLEN, &sendcmd, NULL);
p++;
i++;
}
}
static void
fb_ssd1963_init(void){
printf("%s: initializing LCD.\n",__FUNCTION__);
calypso_reset_set(RESET_EXT, 0);
delay_ms(5);
uwire_init();
delay_ms(5);
fb_ssd1963_send_cmdlist(ssd1963_initdata);
}
static void
fb_ssd1963_flush(void){
int x,y;
uint8_t *p;
struct ssd1963_cmdlist prepare_disp_write_cmds[] = {
{ CMD, 0x2a }, /* set column address */
{ DATA, fb_rgb332->damage_x1 },
{ DATA, fb_rgb332->damage_x2-1 },
{ CMD, 0x2b }, /* set page address (Y) */
{ DATA, fb_rgb332->damage_y1 },
{ DATA, fb_rgb332->damage_y2-1 },
{ CMD, 0x2c }, /* enter write display ram mode */
{ END, 0x00 }
};
struct ssd1963_cmdlist nop[] = {
{ CMD, 0x00 }, // NOP command
{ END, 0x00 }
};
/* If everything's clean, just return */
if(fb_rgb332->damage_x1 == fb_rgb332->damage_x2 ||
fb_rgb332->damage_y1 == fb_rgb332->damage_y2) {
printf("%s: no damage\n",__FUNCTION__);
return;
}
fb_ssd1963_send_cmdlist(prepare_disp_write_cmds);
for(y=fb_rgb332->damage_y1;y<fb_rgb332->damage_y2;y++) {
p = & fb_rgb332->mem[y * framebuffer->width]; // start of line
p += fb_rgb332->damage_x1; // start of damage area
for(x=fb_rgb332->damage_x1;x<fb_rgb332->damage_x2;x++) {
uint16_t data = 0x0100 | *p++;
uwire_xfer(SSD1963_DEV_ID, SSD1963_UWIRE_BITLEN,
&data, NULL);
}
}
fb_ssd1963_send_cmdlist(nop);
fb_rgb332->damage_x1 = fb_rgb332->damage_x2 = 0;
fb_rgb332->damage_y1 = fb_rgb332->damage_y2 = 0;
}
static struct framebuffer fb_ssd1963_framebuffer = {
.name = "ssd1963",
.init = fb_ssd1963_init,
.clear = fb_rgb332_clear,
.boxto = fb_rgb332_boxto,
.lineto = fb_rgb332_lineto,
.putstr = fb_rgb332_putstr,
.flush = fb_ssd1963_flush,
.width = SSD1963_WIDTH,
.height = SSD1963_HEIGHT
};
static struct fb_rgb332 fb_ssd1963_rgb332 = {
.mem = fb_ssd1963_mem
};
struct framebuffer *framebuffer = &fb_ssd1963_framebuffer;
struct fb_rgb332 *fb_rgb332 = &fb_ssd1963_rgb332;

View File

@ -0,0 +1,132 @@
/* Framebuffer implementation - ST1783 LCD driver for C123 */
/* Based on st7558.c by Harald Welte */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_bw8.h>
#include <i2c.h>
#include <calypso/clock.h>
#include <delay.h>
#include <stdio.h>
/* Sitronix ST7558 LCD Driver for OSMOCOM framebuffer interface. */
/* (c) 2010 Christian Vogel <vogelchr@vogel.cx> */
/* Based on the initial LCD driver by Harald Welte */
#define CONTROL_RS_CMD
#define ST7558_SLAVE_ADDR 0x3c
#define ST7558_CMD_ADDR 0x00
#define ST7558_RAM_ADDR 0x40
#define ST7558_WIDTH 96 /* in pixels */
#define ST7558_HEIGHT 65
#define I2C_MAX_TRANSFER 16
static uint8_t
fb_st7558_mem[ST7558_WIDTH * ((ST7558_HEIGHT+7)/8)];
/* setup as initially proposed by Harald in st7558.c */
static const uint8_t st7558_setup[] = {
0x2e, /* ext. display control, set mirror X, set mirror Y*/
0x21, /* function set, enable extended instruction mode */
0x12, /* bias system BS[2,1,0] = [0,1,0] */
0xc0, /* set V_OP (V_OP6 = 1, V_OP[5:0] = 0) */
0x0b, /* booster stages PC1=1, PC0=1 */
0x20, /* function set, disable extended instruction mode */
0x11, /* V_LCD L/H select, PRS=1 */
0x00, /* NOP */
0x0c, /* normal video mode */
0x40, /* set X address to 0 */
0x80 /* set Y address to 0 */
};
static void
fb_st7558_init(){
calypso_reset_set(RESET_EXT, 0);
i2c_init(0,0);
/* initialize controller */
i2c_write(ST7558_SLAVE_ADDR,ST7558_CMD_ADDR,1,
st7558_setup,sizeof(st7558_setup));
}
static void
fb_st7558_flush(){
uint16_t x;
int page,chunksize,nbytes;
uint8_t *p;
uint8_t cmd[2];
if(fb_bw8->damage_y1 == fb_bw8->damage_y2 ||
fb_bw8->damage_x1 == fb_bw8->damage_x2)
return; /* nothing to update */
/* update display in stripes of 8 rows, called "pages" */
for(page=fb_bw8->damage_y1 >> 3;page <= fb_bw8->damage_y2>>3;page++){
/* base offset in RAM framebuffer */
x = fb_bw8->damage_x1;
nbytes = fb_bw8->damage_x2 - fb_bw8->damage_x1;
p = fb_bw8->mem + (page * framebuffer->width + x);
/* i2c fifo can only handle a maximum of 16 bytes */
while(nbytes){
cmd[0]=0x40 | page; /* Set Y address of RAM. */
cmd[1]=0x80 | x;
chunksize = nbytes > I2C_MAX_TRANSFER ? I2C_MAX_TRANSFER : nbytes;
i2c_write(ST7558_SLAVE_ADDR,ST7558_CMD_ADDR,1,cmd,sizeof(cmd));
i2c_write(ST7558_SLAVE_ADDR,ST7558_RAM_ADDR,1,p,chunksize);
nbytes -= chunksize;
p+=I2C_MAX_TRANSFER;
x+=I2C_MAX_TRANSFER;
}
}
/* mark current buffer as unmodified! */
fb_bw8->damage_x1 = fb_bw8->damage_x2 = 0;
fb_bw8->damage_y1 = fb_bw8->damage_y2 = 0;
}
static struct framebuffer fb_st7558_framebuffer = {
.name = "st7558",
.init = fb_st7558_init,
.clear = fb_bw8_clear,
.boxto = fb_bw8_boxto,
.lineto = fb_bw8_lineto,
.putstr = fb_bw8_putstr,
.flush = fb_st7558_flush,
.width = ST7558_WIDTH,
.height = ST7558_HEIGHT
};
static struct fb_bw8 fb_st7558_bw8 = {
.mem = fb_st7558_mem
};
struct framebuffer *framebuffer = &fb_st7558_framebuffer;
struct fb_bw8 *fb_bw8 = &fb_st7558_bw8;

View File

@ -0,0 +1,150 @@
/* Framebuffer implementation - Toppoly TD014 LCD driver for Motorola C139/40 */
/* Based on td014.c by Steve Markgraf and Harald Welte */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
* (C) 2012 by Steve Markgraf <steve@steve-m.de>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
#include <fb/fb_rgb332.h>
#include <stdint.h>
#include <stdio.h>
#include <delay.h>
#include <uwire.h>
#include <calypso/clock.h>
#define TD014_WIDTH 96
#define TD014_HEIGHT 64
#define TD014_UWIRE_BITLEN 9
#define TD014_DEV_ID 0
static uint8_t fb_td014_mem[TD014_WIDTH * TD014_HEIGHT];
enum td014_cmdflag { CMD, DATA, END };
struct td014_cmdlist {
enum td014_cmdflag is_cmd:8; /* 1: is a command, 0: is data, 2: end marker! */
uint8_t data; /* 8 bit to send to LC display */
} __attribute__((packed));
static const struct td014_cmdlist
td014_initdata[] = {
{ CMD, 0x3f },
{ DATA, 0x01 },
{ CMD, 0x20 },
{ DATA, 0x03 },
{ CMD, 0x31 },
{ DATA, 0x03 },
{ END, 0x00 }, /* MARKER: end of list */
};
static void
fb_td014_send_cmdlist(const struct td014_cmdlist *p) {
int i=0;
while(p->is_cmd != END){
uint16_t sendcmd = p->data;
if(p->is_cmd == DATA)
sendcmd |= 0x0100; /* 9th bit is cmd/data flag */
uwire_xfer(TD014_DEV_ID, TD014_UWIRE_BITLEN, &sendcmd, NULL);
p++;
i++;
}
}
static void
fb_td014_init(void) {
printf("%s: initializing LCD.\n",__FUNCTION__);
calypso_reset_set(RESET_EXT, 0);
delay_ms(5);
uwire_init();
delay_ms(5);
fb_td014_send_cmdlist(td014_initdata);
}
static void
fb_td014_flush(void) {
int x,y;
uint8_t *p;
struct td014_cmdlist prepare_disp_write_cmds[] = {
{ CMD, 0x10 },
{ DATA, fb_rgb332->damage_x1 },
{ CMD, 0x11 },
{ DATA, fb_rgb332->damage_y1 },
{ CMD, 0x12 },
{ DATA, fb_rgb332->damage_x2-1 },
{ CMD, 0x13 },
{ DATA, fb_rgb332->damage_y2-1 },
{ CMD, 0x14 },
{ DATA, fb_rgb332->damage_x1 },
{ CMD, 0x15 },
{ DATA, fb_rgb332->damage_y1 },
{ END, 0x00 }
};
/* If everything's clean, just return */
if(fb_rgb332->damage_x1 == fb_rgb332->damage_x2 ||
fb_rgb332->damage_y1 == fb_rgb332->damage_y2) {
printf("%s: no damage\n",__FUNCTION__);
return;
}
fb_td014_send_cmdlist(prepare_disp_write_cmds);
for(y=fb_rgb332->damage_y1;y<fb_rgb332->damage_y2;y++) {
p = & fb_rgb332->mem[y * framebuffer->width]; // start of line
p += fb_rgb332->damage_x1; // start of damage area
for(x=fb_rgb332->damage_x1; x<fb_rgb332->damage_x2; x++) {
uint16_t pixel = rgb332_to_565(*p++);
uint16_t data = 0x0100 | (pixel >> 8);
uwire_xfer(TD014_DEV_ID, TD014_UWIRE_BITLEN,
&data, NULL);
data = 0x0100 | (pixel & 0xff);
uwire_xfer(TD014_DEV_ID, TD014_UWIRE_BITLEN,
&data, NULL);
}
}
fb_rgb332->damage_x1 = fb_rgb332->damage_x2 = 0;
fb_rgb332->damage_y1 = fb_rgb332->damage_y2 = 0;
}
static struct framebuffer fb_td014_framebuffer = {
.name = "td014",
.init = fb_td014_init,
.clear = fb_rgb332_clear,
.boxto = fb_rgb332_boxto,
.lineto = fb_rgb332_lineto,
.putstr = fb_rgb332_putstr,
.flush = fb_td014_flush,
.width = TD014_WIDTH,
.height = TD014_HEIGHT
};
static struct fb_rgb332 fb_td014_rgb332 = {
.mem = fb_td014_mem
};
struct framebuffer *framebuffer = &fb_td014_framebuffer;
struct fb_rgb332 *fb_rgb332 = &fb_td014_rgb332;

View File

@ -0,0 +1,59 @@
/* Font Handling - Utility Functions */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/font.h>
/* what fonts are linked in? */
extern const struct fb_font font_4x6;
extern const struct fb_font font_5x8;
extern const struct fb_font font_helvR08;
extern const struct fb_font font_helvR14;
//extern const struct fb_font font_helvR24;
//extern const struct fb_font font_helvB08;
extern const struct fb_font font_helvB14;
// extern const struct fb_font font_helvB24;
extern const struct fb_font font_c64;
extern const struct fb_font font_symbols;
const struct fb_font *fb_fonts[]={
// &font_4x6,
// &font_5x8,
&font_helvR08,
// &font_helvR14,
// &font_helvR24,
// &font_helvB08,
&font_helvB14,
// &font_helvB24,
&font_c64,
&font_symbols,
};
const struct fb_char *
fb_font_get_char(const struct fb_font *fnt,unsigned char c){
if(c < fnt->firstchar || c > fnt->lastchar)
return NULL;
uint16_t offs = fnt->charoffs[c-fnt->firstchar];
if(offs == FB_FONT_NOCHAR)
return NULL;
return (struct fb_char *)(fnt->chardata + offs);
}

View File

@ -0,0 +1,28 @@
/* Framebuffer - Utility Functions */
/* (C) 2010 by Christian Vogel <vogelchr@vogel.cx>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <fb/framebuffer.h>
/* currently everything's inline in framebuffer .h */

View File

@ -0,0 +1,833 @@
#include <fb/font.h>
static const uint8_t font_helvB08_data[] = {
/* --- new character space (32) starting at offset 0x0000 --- */
/*0000:*/ 2, 1, 1, 0, 0, /* width and bbox (w,h,x,y) */
/*0005:*/ 0x00, /* ........ */
/* --- new character exclam (33) starting at offset 0x0006 --- */
/*0006:*/ 3, 2, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*000b:*/ 0xc0, /* ##...... */
/*000c:*/ 0xc0, /* ##...... */
/*000d:*/ 0xc0, /* ##...... */
/*000e:*/ 0x80, /* #....... */
/*000f:*/ 0x00, /* ........ */
/*0010:*/ 0x80, /* #....... */
/*0011:*/ 0x80, /* #....... */
/* --- new character quotedbl (34) starting at offset 0x0012 --- */
/*0012:*/ 4, 3, 2, 0, 4, /* width and bbox (w,h,x,y) */
/*0017:*/ 0xa0, /* #.#..... */
/*0018:*/ 0xa0, /* #.#..... */
/* --- new character numbersign (35) starting at offset 0x0019 --- */
/*0019:*/ 5, 5, 6, -1, 0, /* width and bbox (w,h,x,y) */
/*001e:*/ 0x50, /* .#.#.... */
/*001f:*/ 0xf8, /* #####... */
/*0020:*/ 0x50, /* .#.#.... */
/*0021:*/ 0xf8, /* #####... */
/*0022:*/ 0xa0, /* #.#..... */
/*0023:*/ 0xa0, /* #.#..... */
/* --- new character dollar (36) starting at offset 0x0024 --- */
/*0024:*/ 5, 4, 8, 0, -1, /* width and bbox (w,h,x,y) */
/*0029:*/ 0x20, /* ..#..... */
/*002a:*/ 0x70, /* .###.... */
/*002b:*/ 0xc0, /* ##...... */
/*002c:*/ 0xe0, /* ###..... */
/*002d:*/ 0x70, /* .###.... */
/*002e:*/ 0x30, /* ..##.... */
/*002f:*/ 0xe0, /* ###..... */
/*0030:*/ 0x40, /* .#...... */
/* --- new character percent (37) starting at offset 0x0031 --- */
/*0031:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0036:*/ 0x68, /* .##.#... */
/*0037:*/ 0xb0, /* #.##.... */
/*0038:*/ 0xe0, /* ###..... */
/*0039:*/ 0x38, /* ..###... */
/*003a:*/ 0x68, /* .##.#... */
/*003b:*/ 0xb0, /* #.##.... */
/* --- new character ampersand (38) starting at offset 0x003c --- */
/*003c:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0041:*/ 0x70, /* .###.... */
/*0042:*/ 0x50, /* .#.#.... */
/*0043:*/ 0x60, /* .##..... */
/*0044:*/ 0xf8, /* #####... */
/*0045:*/ 0xd0, /* ##.#.... */
/*0046:*/ 0x68, /* .##.#... */
/* --- new character quotesingle (39) starting at offset 0x0047 --- */
/*0047:*/ 3, 1, 3, 1, 5, /* width and bbox (w,h,x,y) */
/*004c:*/ 0x80, /* #....... */
/*004d:*/ 0x80, /* #....... */
/*004e:*/ 0x80, /* #....... */
/* --- new character parenleft (40) starting at offset 0x004f --- */
/*004f:*/ 3, 2, 8, 0, -2, /* width and bbox (w,h,x,y) */
/*0054:*/ 0x40, /* .#...... */
/*0055:*/ 0x40, /* .#...... */
/*0056:*/ 0x80, /* #....... */
/*0057:*/ 0x80, /* #....... */
/*0058:*/ 0x80, /* #....... */
/*0059:*/ 0x80, /* #....... */
/*005a:*/ 0x40, /* .#...... */
/*005b:*/ 0x40, /* .#...... */
/* --- new character parenright (41) starting at offset 0x005c --- */
/*005c:*/ 3, 2, 8, 0, -2, /* width and bbox (w,h,x,y) */
/*0061:*/ 0x80, /* #....... */
/*0062:*/ 0x80, /* #....... */
/*0063:*/ 0x40, /* .#...... */
/*0064:*/ 0x40, /* .#...... */
/*0065:*/ 0x40, /* .#...... */
/*0066:*/ 0x40, /* .#...... */
/*0067:*/ 0x80, /* #....... */
/*0068:*/ 0x80, /* #....... */
/* --- new character asterisk (42) starting at offset 0x0069 --- */
/*0069:*/ 3, 3, 3, 0, 3, /* width and bbox (w,h,x,y) */
/*006e:*/ 0x40, /* .#...... */
/*006f:*/ 0xe0, /* ###..... */
/*0070:*/ 0x40, /* .#...... */
/* --- new character plus (43) starting at offset 0x0071 --- */
/*0071:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0076:*/ 0x20, /* ..#..... */
/*0077:*/ 0x20, /* ..#..... */
/*0078:*/ 0xf0, /* ####.... */
/*0079:*/ 0x20, /* ..#..... */
/*007a:*/ 0x20, /* ..#..... */
/* --- new character comma (44) starting at offset 0x007b --- */
/*007b:*/ 2, 2, 3, -1, -1, /* width and bbox (w,h,x,y) */
/*0080:*/ 0x40, /* .#...... */
/*0081:*/ 0x40, /* .#...... */
/*0082:*/ 0x80, /* #....... */
/* --- new character hyphen (45) starting at offset 0x0083 --- */
/*0083:*/ 4, 3, 1, 0, 2, /* width and bbox (w,h,x,y) */
/*0088:*/ 0xe0, /* ###..... */
/* --- new character period (46) starting at offset 0x0089 --- */
/*0089:*/ 2, 1, 2, 0, 0, /* width and bbox (w,h,x,y) */
/*008e:*/ 0x80, /* #....... */
/*008f:*/ 0x80, /* #....... */
/* --- new character slash (47) starting at offset 0x0090 --- */
/*0090:*/ 3, 3, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0095:*/ 0x20, /* ..#..... */
/*0096:*/ 0x20, /* ..#..... */
/*0097:*/ 0x40, /* .#...... */
/*0098:*/ 0x40, /* .#...... */
/*0099:*/ 0x80, /* #....... */
/*009a:*/ 0x80, /* #....... */
/* --- new character zero (48) starting at offset 0x009b --- */
/*009b:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00a0:*/ 0x60, /* .##..... */
/*00a1:*/ 0xd0, /* ##.#.... */
/*00a2:*/ 0xd0, /* ##.#.... */
/*00a3:*/ 0xd0, /* ##.#.... */
/*00a4:*/ 0xd0, /* ##.#.... */
/*00a5:*/ 0x60, /* .##..... */
/* --- new character one (49) starting at offset 0x00a6 --- */
/*00a6:*/ 5, 3, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00ab:*/ 0x20, /* ..#..... */
/*00ac:*/ 0xe0, /* ###..... */
/*00ad:*/ 0x60, /* .##..... */
/*00ae:*/ 0x60, /* .##..... */
/*00af:*/ 0x60, /* .##..... */
/*00b0:*/ 0x60, /* .##..... */
/* --- new character two (50) starting at offset 0x00b1 --- */
/*00b1:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00b6:*/ 0x60, /* .##..... */
/*00b7:*/ 0xb0, /* #.##.... */
/*00b8:*/ 0x30, /* ..##.... */
/*00b9:*/ 0x60, /* .##..... */
/*00ba:*/ 0xc0, /* ##...... */
/*00bb:*/ 0xf0, /* ####.... */
/* --- new character three (51) starting at offset 0x00bc --- */
/*00bc:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00c1:*/ 0x60, /* .##..... */
/*00c2:*/ 0xb0, /* #.##.... */
/*00c3:*/ 0x60, /* .##..... */
/*00c4:*/ 0x30, /* ..##.... */
/*00c5:*/ 0xb0, /* #.##.... */
/*00c6:*/ 0x60, /* .##..... */
/* --- new character four (52) starting at offset 0x00c7 --- */
/*00c7:*/ 5, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00cc:*/ 0x30, /* ..##.... */
/*00cd:*/ 0x50, /* .#.#.... */
/*00ce:*/ 0xd0, /* ##.#.... */
/*00cf:*/ 0xf8, /* #####... */
/*00d0:*/ 0x30, /* ..##.... */
/*00d1:*/ 0x30, /* ..##.... */
/* --- new character five (53) starting at offset 0x00d2 --- */
/*00d2:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00d7:*/ 0x70, /* .###.... */
/*00d8:*/ 0xc0, /* ##...... */
/*00d9:*/ 0xe0, /* ###..... */
/*00da:*/ 0x30, /* ..##.... */
/*00db:*/ 0xb0, /* #.##.... */
/*00dc:*/ 0x60, /* .##..... */
/* --- new character six (54) starting at offset 0x00dd --- */
/*00dd:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00e2:*/ 0x70, /* .###.... */
/*00e3:*/ 0xc0, /* ##...... */
/*00e4:*/ 0xe0, /* ###..... */
/*00e5:*/ 0xd0, /* ##.#.... */
/*00e6:*/ 0xd0, /* ##.#.... */
/*00e7:*/ 0x60, /* .##..... */
/* --- new character seven (55) starting at offset 0x00e8 --- */
/*00e8:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00ed:*/ 0xf0, /* ####.... */
/*00ee:*/ 0x30, /* ..##.... */
/*00ef:*/ 0x30, /* ..##.... */
/*00f0:*/ 0x60, /* .##..... */
/*00f1:*/ 0x40, /* .#...... */
/*00f2:*/ 0xc0, /* ##...... */
/* --- new character eight (56) starting at offset 0x00f3 --- */
/*00f3:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*00f8:*/ 0x60, /* .##..... */
/*00f9:*/ 0xd0, /* ##.#.... */
/*00fa:*/ 0x60, /* .##..... */
/*00fb:*/ 0xd0, /* ##.#.... */
/*00fc:*/ 0xd0, /* ##.#.... */
/*00fd:*/ 0x60, /* .##..... */
/* --- new character nine (57) starting at offset 0x00fe --- */
/*00fe:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0103:*/ 0x60, /* .##..... */
/*0104:*/ 0xb0, /* #.##.... */
/*0105:*/ 0xb0, /* #.##.... */
/*0106:*/ 0x70, /* .###.... */
/*0107:*/ 0x30, /* ..##.... */
/*0108:*/ 0xe0, /* ###..... */
/* --- new character colon (58) starting at offset 0x0109 --- */
/*0109:*/ 2, 1, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*010e:*/ 0x80, /* #....... */
/*010f:*/ 0x80, /* #....... */
/*0110:*/ 0x00, /* ........ */
/*0111:*/ 0x80, /* #....... */
/*0112:*/ 0x80, /* #....... */
/* --- new character semicolon (59) starting at offset 0x0113 --- */
/*0113:*/ 2, 2, 6, -1, -1, /* width and bbox (w,h,x,y) */
/*0118:*/ 0x40, /* .#...... */
/*0119:*/ 0x40, /* .#...... */
/*011a:*/ 0x00, /* ........ */
/*011b:*/ 0x40, /* .#...... */
/*011c:*/ 0x40, /* .#...... */
/*011d:*/ 0x80, /* #....... */
/* --- new character less (60) starting at offset 0x011e --- */
/*011e:*/ 4, 3, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0123:*/ 0x20, /* ..#..... */
/*0124:*/ 0x40, /* .#...... */
/*0125:*/ 0x80, /* #....... */
/*0126:*/ 0x40, /* .#...... */
/*0127:*/ 0x20, /* ..#..... */
/* --- new character equal (61) starting at offset 0x0128 --- */
/*0128:*/ 5, 4, 3, 0, 1, /* width and bbox (w,h,x,y) */
/*012d:*/ 0xf0, /* ####.... */
/*012e:*/ 0x00, /* ........ */
/*012f:*/ 0xf0, /* ####.... */
/* --- new character greater (62) starting at offset 0x0130 --- */
/*0130:*/ 4, 3, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0135:*/ 0x80, /* #....... */
/*0136:*/ 0x40, /* .#...... */
/*0137:*/ 0x20, /* ..#..... */
/*0138:*/ 0x40, /* .#...... */
/*0139:*/ 0x80, /* #....... */
/* --- new character question (63) starting at offset 0x013a --- */
/*013a:*/ 5, 4, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*013f:*/ 0xe0, /* ###..... */
/*0140:*/ 0x30, /* ..##.... */
/*0141:*/ 0x60, /* .##..... */
/*0142:*/ 0x40, /* .#...... */
/*0143:*/ 0x00, /* ........ */
/*0144:*/ 0x40, /* .#...... */
/*0145:*/ 0x40, /* .#...... */
/* --- new character at (64) starting at offset 0x0146 --- */
/*0146:*/ 9, 8, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*014b:*/ 0x7e, /* .######. */
/*014c:*/ 0xc3, /* ##....## */
/*014d:*/ 0x99, /* #..##..# */
/*014e:*/ 0xa9, /* #.#.#..# */
/*014f:*/ 0x99, /* #..##..# */
/*0150:*/ 0xce, /* ##..###. */
/*0151:*/ 0x60, /* .##..... */
/* --- new character A (65) starting at offset 0x0152 --- */
/*0152:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0157:*/ 0x70, /* .###.... */
/*0158:*/ 0xd8, /* ##.##... */
/*0159:*/ 0xd8, /* ##.##... */
/*015a:*/ 0xf8, /* #####... */
/*015b:*/ 0xd8, /* ##.##... */
/*015c:*/ 0xd8, /* ##.##... */
/* --- new character B (66) starting at offset 0x015d --- */
/*015d:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0162:*/ 0xf0, /* ####.... */
/*0163:*/ 0xd8, /* ##.##... */
/*0164:*/ 0xf0, /* ####.... */
/*0165:*/ 0xd8, /* ##.##... */
/*0166:*/ 0xd8, /* ##.##... */
/*0167:*/ 0xf0, /* ####.... */
/* --- new character C (67) starting at offset 0x0168 --- */
/*0168:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*016d:*/ 0x78, /* .####... */
/*016e:*/ 0xc8, /* ##..#... */
/*016f:*/ 0xc0, /* ##...... */
/*0170:*/ 0xc0, /* ##...... */
/*0171:*/ 0xc8, /* ##..#... */
/*0172:*/ 0x78, /* .####... */
/* --- new character D (68) starting at offset 0x0173 --- */
/*0173:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0178:*/ 0xf0, /* ####.... */
/*0179:*/ 0xd8, /* ##.##... */
/*017a:*/ 0xd8, /* ##.##... */
/*017b:*/ 0xd8, /* ##.##... */
/*017c:*/ 0xd8, /* ##.##... */
/*017d:*/ 0xf0, /* ####.... */
/* --- new character E (69) starting at offset 0x017e --- */
/*017e:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0183:*/ 0xf0, /* ####.... */
/*0184:*/ 0xc0, /* ##...... */
/*0185:*/ 0xf0, /* ####.... */
/*0186:*/ 0xc0, /* ##...... */
/*0187:*/ 0xc0, /* ##...... */
/*0188:*/ 0xf0, /* ####.... */
/* --- new character F (70) starting at offset 0x0189 --- */
/*0189:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*018e:*/ 0xf0, /* ####.... */
/*018f:*/ 0xc0, /* ##...... */
/*0190:*/ 0xf0, /* ####.... */
/*0191:*/ 0xc0, /* ##...... */
/*0192:*/ 0xc0, /* ##...... */
/*0193:*/ 0xc0, /* ##...... */
/* --- new character G (71) starting at offset 0x0194 --- */
/*0194:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0199:*/ 0x78, /* .####... */
/*019a:*/ 0xc8, /* ##..#... */
/*019b:*/ 0xc0, /* ##...... */
/*019c:*/ 0xd8, /* ##.##... */
/*019d:*/ 0xc8, /* ##..#... */
/*019e:*/ 0x78, /* .####... */
/* --- new character H (72) starting at offset 0x019f --- */
/*019f:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01a4:*/ 0xd8, /* ##.##... */
/*01a5:*/ 0xd8, /* ##.##... */
/*01a6:*/ 0xf8, /* #####... */
/*01a7:*/ 0xd8, /* ##.##... */
/*01a8:*/ 0xd8, /* ##.##... */
/*01a9:*/ 0xd8, /* ##.##... */
/* --- new character I (73) starting at offset 0x01aa --- */
/*01aa:*/ 2, 1, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01af:*/ 0x80, /* #....... */
/*01b0:*/ 0x80, /* #....... */
/*01b1:*/ 0x80, /* #....... */
/*01b2:*/ 0x80, /* #....... */
/*01b3:*/ 0x80, /* #....... */
/*01b4:*/ 0x80, /* #....... */
/* --- new character J (74) starting at offset 0x01b5 --- */
/*01b5:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01ba:*/ 0x30, /* ..##.... */
/*01bb:*/ 0x30, /* ..##.... */
/*01bc:*/ 0x30, /* ..##.... */
/*01bd:*/ 0x30, /* ..##.... */
/*01be:*/ 0xb0, /* #.##.... */
/*01bf:*/ 0x60, /* .##..... */
/* --- new character K (75) starting at offset 0x01c0 --- */
/*01c0:*/ 6, 6, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01c5:*/ 0xd8, /* ##.##... */
/*01c6:*/ 0xd0, /* ##.#.... */
/*01c7:*/ 0xe0, /* ###..... */
/*01c8:*/ 0xf0, /* ####.... */
/*01c9:*/ 0xd8, /* ##.##... */
/*01ca:*/ 0xcc, /* ##..##.. */
/* --- new character L (76) starting at offset 0x01cb --- */
/*01cb:*/ 5, 4, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01d0:*/ 0xc0, /* ##...... */
/*01d1:*/ 0xc0, /* ##...... */
/*01d2:*/ 0xc0, /* ##...... */
/*01d3:*/ 0xc0, /* ##...... */
/*01d4:*/ 0xc0, /* ##...... */
/*01d5:*/ 0xf0, /* ####.... */
/* --- new character M (77) starting at offset 0x01d6 --- */
/*01d6:*/ 8, 7, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01db:*/ 0xc6, /* ##...##. */
/*01dc:*/ 0xc6, /* ##...##. */
/*01dd:*/ 0xee, /* ###.###. */
/*01de:*/ 0xfe, /* #######. */
/*01df:*/ 0xd6, /* ##.#.##. */
/*01e0:*/ 0xd6, /* ##.#.##. */
/* --- new character N (78) starting at offset 0x01e1 --- */
/*01e1:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01e6:*/ 0xc8, /* ##..#... */
/*01e7:*/ 0xc8, /* ##..#... */
/*01e8:*/ 0xe8, /* ###.#... */
/*01e9:*/ 0xf8, /* #####... */
/*01ea:*/ 0xd8, /* ##.##... */
/*01eb:*/ 0xc8, /* ##..#... */
/* --- new character O (79) starting at offset 0x01ec --- */
/*01ec:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01f1:*/ 0x70, /* .###.... */
/*01f2:*/ 0xd8, /* ##.##... */
/*01f3:*/ 0xc8, /* ##..#... */
/*01f4:*/ 0xc8, /* ##..#... */
/*01f5:*/ 0xd8, /* ##.##... */
/*01f6:*/ 0x70, /* .###.... */
/* --- new character P (80) starting at offset 0x01f7 --- */
/*01f7:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*01fc:*/ 0xf0, /* ####.... */
/*01fd:*/ 0xd8, /* ##.##... */
/*01fe:*/ 0xd8, /* ##.##... */
/*01ff:*/ 0xf0, /* ####.... */
/*0200:*/ 0xc0, /* ##...... */
/*0201:*/ 0xc0, /* ##...... */
/* --- new character Q (81) starting at offset 0x0202 --- */
/*0202:*/ 6, 6, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*0207:*/ 0x70, /* .###.... */
/*0208:*/ 0xd8, /* ##.##... */
/*0209:*/ 0xc8, /* ##..#... */
/*020a:*/ 0xc8, /* ##..#... */
/*020b:*/ 0xd8, /* ##.##... */
/*020c:*/ 0x78, /* .####... */
/*020d:*/ 0x04, /* .....#.. */
/* --- new character R (82) starting at offset 0x020e --- */
/*020e:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0213:*/ 0xf0, /* ####.... */
/*0214:*/ 0xd8, /* ##.##... */
/*0215:*/ 0xd8, /* ##.##... */
/*0216:*/ 0xf0, /* ####.... */
/*0217:*/ 0xd8, /* ##.##... */
/*0218:*/ 0xd8, /* ##.##... */
/* --- new character S (83) starting at offset 0x0219 --- */
/*0219:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*021e:*/ 0x78, /* .####... */
/*021f:*/ 0xc0, /* ##...... */
/*0220:*/ 0xf0, /* ####.... */
/*0221:*/ 0x38, /* ..###... */
/*0222:*/ 0xd8, /* ##.##... */
/*0223:*/ 0x70, /* .###.... */
/* --- new character T (84) starting at offset 0x0224 --- */
/*0224:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0229:*/ 0xf8, /* #####... */
/*022a:*/ 0x60, /* .##..... */
/*022b:*/ 0x60, /* .##..... */
/*022c:*/ 0x60, /* .##..... */
/*022d:*/ 0x60, /* .##..... */
/*022e:*/ 0x60, /* .##..... */
/* --- new character U (85) starting at offset 0x022f --- */
/*022f:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0234:*/ 0xd8, /* ##.##... */
/*0235:*/ 0xd8, /* ##.##... */
/*0236:*/ 0xd8, /* ##.##... */
/*0237:*/ 0xd8, /* ##.##... */
/*0238:*/ 0xd8, /* ##.##... */
/*0239:*/ 0x70, /* .###.... */
/* --- new character V (86) starting at offset 0x023a --- */
/*023a:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*023f:*/ 0xe8, /* ###.#... */
/*0240:*/ 0x68, /* .##.#... */
/*0241:*/ 0x68, /* .##.#... */
/*0242:*/ 0x68, /* .##.#... */
/*0243:*/ 0x70, /* .###.... */
/*0244:*/ 0x20, /* ..#..... */
/* --- new character W (87) starting at offset 0x0245 --- */
/*0245:*/ 9, 8, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*024a:*/ 0xdb, /* ##.##.## */
/*024b:*/ 0xdb, /* ##.##.## */
/*024c:*/ 0xda, /* ##.##.#. */
/*024d:*/ 0xda, /* ##.##.#. */
/*024e:*/ 0x6c, /* .##.##.. */
/*024f:*/ 0x6c, /* .##.##.. */
/* --- new character X (88) starting at offset 0x0250 --- */
/*0250:*/ 6, 5, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0255:*/ 0xd8, /* ##.##... */
/*0256:*/ 0xd8, /* ##.##... */
/*0257:*/ 0x70, /* .###.... */
/*0258:*/ 0x70, /* .###.... */
/*0259:*/ 0xd8, /* ##.##... */
/*025a:*/ 0xd8, /* ##.##... */
/* --- new character Y (89) starting at offset 0x025b --- */
/*025b:*/ 7, 6, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0260:*/ 0xec, /* ###.##.. */
/*0261:*/ 0x68, /* .##.#... */
/*0262:*/ 0x68, /* .##.#... */
/*0263:*/ 0x78, /* .####... */
/*0264:*/ 0x30, /* ..##.... */
/*0265:*/ 0x30, /* ..##.... */
/* --- new character Z (90) starting at offset 0x0266 --- */
/*0266:*/ 6, 6, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*026b:*/ 0xfc, /* ######.. */
/*026c:*/ 0x38, /* ..###... */
/*026d:*/ 0x30, /* ..##.... */
/*026e:*/ 0x60, /* .##..... */
/*026f:*/ 0xe0, /* ###..... */
/*0270:*/ 0xf8, /* #####... */
/* --- new character bracketleft (91) starting at offset 0x0271 --- */
/*0271:*/ 3, 2, 8, 0, -2, /* width and bbox (w,h,x,y) */
/*0276:*/ 0xc0, /* ##...... */
/*0277:*/ 0x80, /* #....... */
/*0278:*/ 0x80, /* #....... */
/*0279:*/ 0x80, /* #....... */
/*027a:*/ 0x80, /* #....... */
/*027b:*/ 0x80, /* #....... */
/*027c:*/ 0x80, /* #....... */
/*027d:*/ 0xc0, /* ##...... */
/* --- new character backslash (92) starting at offset 0x027e --- */
/*027e:*/ 3, 3, 6, 0, 0, /* width and bbox (w,h,x,y) */
/*0283:*/ 0x80, /* #....... */
/*0284:*/ 0x80, /* #....... */
/*0285:*/ 0x40, /* .#...... */
/*0286:*/ 0x40, /* .#...... */
/*0287:*/ 0x20, /* ..#..... */
/*0288:*/ 0x20, /* ..#..... */
/* --- new character bracketright (93) starting at offset 0x0289 --- */
/*0289:*/ 3, 2, 8, 0, -2, /* width and bbox (w,h,x,y) */
/*028e:*/ 0xc0, /* ##...... */
/*028f:*/ 0x40, /* .#...... */
/*0290:*/ 0x40, /* .#...... */
/*0291:*/ 0x40, /* .#...... */
/*0292:*/ 0x40, /* .#...... */
/*0293:*/ 0x40, /* .#...... */
/*0294:*/ 0x40, /* .#...... */
/*0295:*/ 0xc0, /* ##...... */
/* --- new character asciicircum (94) starting at offset 0x0296 --- */
/*0296:*/ 4, 4, 3, 0, 3, /* width and bbox (w,h,x,y) */
/*029b:*/ 0x60, /* .##..... */
/*029c:*/ 0x60, /* .##..... */
/*029d:*/ 0x90, /* #..#.... */
/* --- new character underscore (95) starting at offset 0x029e --- */
/*029e:*/ 5, 5, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*02a3:*/ 0xf8, /* #####... */
/* --- new character grave (96) starting at offset 0x02a4 --- */
/*02a4:*/ 3, 2, 2, 0, 6, /* width and bbox (w,h,x,y) */
/*02a9:*/ 0x80, /* #....... */
/*02aa:*/ 0x40, /* .#...... */
/* --- new character a (97) starting at offset 0x02ab --- */
/*02ab:*/ 5, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02b0:*/ 0xe0, /* ###..... */
/*02b1:*/ 0x30, /* ..##.... */
/*02b2:*/ 0xf0, /* ####.... */
/*02b3:*/ 0xb0, /* #.##.... */
/*02b4:*/ 0xd8, /* ##.##... */
/* --- new character b (98) starting at offset 0x02b5 --- */
/*02b5:*/ 5, 4, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*02ba:*/ 0xc0, /* ##...... */
/*02bb:*/ 0xc0, /* ##...... */
/*02bc:*/ 0xe0, /* ###..... */
/*02bd:*/ 0xd0, /* ##.#.... */
/*02be:*/ 0xd0, /* ##.#.... */
/*02bf:*/ 0xd0, /* ##.#.... */
/*02c0:*/ 0xe0, /* ###..... */
/* --- new character c (99) starting at offset 0x02c1 --- */
/*02c1:*/ 4, 3, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02c6:*/ 0x60, /* .##..... */
/*02c7:*/ 0xc0, /* ##...... */
/*02c8:*/ 0xc0, /* ##...... */
/*02c9:*/ 0xc0, /* ##...... */
/*02ca:*/ 0x60, /* .##..... */
/* --- new character d (100) starting at offset 0x02cb --- */
/*02cb:*/ 5, 4, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*02d0:*/ 0x30, /* ..##.... */
/*02d1:*/ 0x30, /* ..##.... */
/*02d2:*/ 0x70, /* .###.... */
/*02d3:*/ 0xb0, /* #.##.... */
/*02d4:*/ 0xb0, /* #.##.... */
/*02d5:*/ 0xb0, /* #.##.... */
/*02d6:*/ 0x70, /* .###.... */
/* --- new character e (101) starting at offset 0x02d7 --- */
/*02d7:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*02dc:*/ 0x60, /* .##..... */
/*02dd:*/ 0xd0, /* ##.#.... */
/*02de:*/ 0xf0, /* ####.... */
/*02df:*/ 0xc0, /* ##...... */
/*02e0:*/ 0x60, /* .##..... */
/* --- new character f (102) starting at offset 0x02e1 --- */
/*02e1:*/ 3, 4, 7, -1, 0, /* width and bbox (w,h,x,y) */
/*02e6:*/ 0x30, /* ..##.... */
/*02e7:*/ 0x60, /* .##..... */
/*02e8:*/ 0xf0, /* ####.... */
/*02e9:*/ 0x60, /* .##..... */
/*02ea:*/ 0x60, /* .##..... */
/*02eb:*/ 0x60, /* .##..... */
/*02ec:*/ 0x60, /* .##..... */
/* --- new character g (103) starting at offset 0x02ed --- */
/*02ed:*/ 5, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*02f2:*/ 0xd0, /* ##.#.... */
/*02f3:*/ 0xb0, /* #.##.... */
/*02f4:*/ 0xb0, /* #.##.... */
/*02f5:*/ 0xf0, /* ####.... */
/*02f6:*/ 0x30, /* ..##.... */
/*02f7:*/ 0xe0, /* ###..... */
/* --- new character h (104) starting at offset 0x02f8 --- */
/*02f8:*/ 5, 4, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*02fd:*/ 0xc0, /* ##...... */
/*02fe:*/ 0xc0, /* ##...... */
/*02ff:*/ 0xe0, /* ###..... */
/*0300:*/ 0xd0, /* ##.#.... */
/*0301:*/ 0xd0, /* ##.#.... */
/*0302:*/ 0xd0, /* ##.#.... */
/*0303:*/ 0xd0, /* ##.#.... */
/* --- new character i (105) starting at offset 0x0304 --- */
/*0304:*/ 2, 1, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*0309:*/ 0x80, /* #....... */
/*030a:*/ 0x00, /* ........ */
/*030b:*/ 0x80, /* #....... */
/*030c:*/ 0x80, /* #....... */
/*030d:*/ 0x80, /* #....... */
/*030e:*/ 0x80, /* #....... */
/*030f:*/ 0x80, /* #....... */
/* --- new character j (106) starting at offset 0x0310 --- */
/*0310:*/ 2, 2, 8, -1, -1, /* width and bbox (w,h,x,y) */
/*0315:*/ 0x40, /* .#...... */
/*0316:*/ 0x00, /* ........ */
/*0317:*/ 0x40, /* .#...... */
/*0318:*/ 0x40, /* .#...... */
/*0319:*/ 0x40, /* .#...... */
/*031a:*/ 0x40, /* .#...... */
/*031b:*/ 0x40, /* .#...... */
/*031c:*/ 0x80, /* #....... */
/* --- new character k (107) starting at offset 0x031d --- */
/*031d:*/ 5, 4, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*0322:*/ 0xc0, /* ##...... */
/*0323:*/ 0xc0, /* ##...... */
/*0324:*/ 0xd0, /* ##.#.... */
/*0325:*/ 0xd0, /* ##.#.... */
/*0326:*/ 0xe0, /* ###..... */
/*0327:*/ 0xd0, /* ##.#.... */
/*0328:*/ 0xd0, /* ##.#.... */
/* --- new character l (108) starting at offset 0x0329 --- */
/*0329:*/ 2, 1, 7, 0, 0, /* width and bbox (w,h,x,y) */
/*032e:*/ 0x80, /* #....... */
/*032f:*/ 0x80, /* #....... */
/*0330:*/ 0x80, /* #....... */
/*0331:*/ 0x80, /* #....... */
/*0332:*/ 0x80, /* #....... */
/*0333:*/ 0x80, /* #....... */
/*0334:*/ 0x80, /* #....... */
/* --- new character m (109) starting at offset 0x0335 --- */
/*0335:*/ 7, 6, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*033a:*/ 0xe8, /* ###.#... */
/*033b:*/ 0xd4, /* ##.#.#.. */
/*033c:*/ 0xd4, /* ##.#.#.. */
/*033d:*/ 0xd4, /* ##.#.#.. */
/*033e:*/ 0xd4, /* ##.#.#.. */
/* --- new character n (110) starting at offset 0x033f --- */
/*033f:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0344:*/ 0xe0, /* ###..... */
/*0345:*/ 0xd0, /* ##.#.... */
/*0346:*/ 0xd0, /* ##.#.... */
/*0347:*/ 0xd0, /* ##.#.... */
/*0348:*/ 0xd0, /* ##.#.... */
/* --- new character o (111) starting at offset 0x0349 --- */
/*0349:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*034e:*/ 0x60, /* .##..... */
/*034f:*/ 0xd0, /* ##.#.... */
/*0350:*/ 0xd0, /* ##.#.... */
/*0351:*/ 0xd0, /* ##.#.... */
/*0352:*/ 0x60, /* .##..... */
/* --- new character p (112) starting at offset 0x0353 --- */
/*0353:*/ 5, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0358:*/ 0xe0, /* ###..... */
/*0359:*/ 0xd0, /* ##.#.... */
/*035a:*/ 0xd0, /* ##.#.... */
/*035b:*/ 0xd0, /* ##.#.... */
/*035c:*/ 0xe0, /* ###..... */
/*035d:*/ 0xc0, /* ##...... */
/* --- new character q (113) starting at offset 0x035e --- */
/*035e:*/ 5, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*0363:*/ 0x70, /* .###.... */
/*0364:*/ 0xb0, /* #.##.... */
/*0365:*/ 0xb0, /* #.##.... */
/*0366:*/ 0xb0, /* #.##.... */
/*0367:*/ 0x70, /* .###.... */
/*0368:*/ 0x30, /* ..##.... */
/* --- new character r (114) starting at offset 0x0369 --- */
/*0369:*/ 3, 3, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*036e:*/ 0xa0, /* #.#..... */
/*036f:*/ 0xe0, /* ###..... */
/*0370:*/ 0xc0, /* ##...... */
/*0371:*/ 0xc0, /* ##...... */
/*0372:*/ 0xc0, /* ##...... */
/* --- new character s (115) starting at offset 0x0373 --- */
/*0373:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0378:*/ 0x70, /* .###.... */
/*0379:*/ 0xc0, /* ##...... */
/*037a:*/ 0xf0, /* ####.... */
/*037b:*/ 0x30, /* ..##.... */
/*037c:*/ 0xe0, /* ###..... */
/* --- new character t (116) starting at offset 0x037d --- */
/*037d:*/ 3, 4, 7, -1, 0, /* width and bbox (w,h,x,y) */
/*0382:*/ 0x20, /* ..#..... */
/*0383:*/ 0x60, /* .##..... */
/*0384:*/ 0xf0, /* ####.... */
/*0385:*/ 0x60, /* .##..... */
/*0386:*/ 0x60, /* .##..... */
/*0387:*/ 0x60, /* .##..... */
/*0388:*/ 0x30, /* ..##.... */
/* --- new character u (117) starting at offset 0x0389 --- */
/*0389:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*038e:*/ 0xd0, /* ##.#.... */
/*038f:*/ 0xd0, /* ##.#.... */
/*0390:*/ 0xd0, /* ##.#.... */
/*0391:*/ 0xf0, /* ####.... */
/*0392:*/ 0x50, /* .#.#.... */
/* --- new character v (118) starting at offset 0x0393 --- */
/*0393:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*0398:*/ 0xd0, /* ##.#.... */
/*0399:*/ 0xd0, /* ##.#.... */
/*039a:*/ 0xd0, /* ##.#.... */
/*039b:*/ 0x60, /* .##..... */
/*039c:*/ 0x40, /* .#...... */
/* --- new character w (119) starting at offset 0x039d --- */
/*039d:*/ 6, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*03a2:*/ 0xa8, /* #.#.#... */
/*03a3:*/ 0xa8, /* #.#.#... */
/*03a4:*/ 0xf8, /* #####... */
/*03a5:*/ 0xf8, /* #####... */
/*03a6:*/ 0x48, /* .#..#... */
/* --- new character x (120) starting at offset 0x03a7 --- */
/*03a7:*/ 6, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*03ac:*/ 0xd8, /* ##.##... */
/*03ad:*/ 0xd8, /* ##.##... */
/*03ae:*/ 0x70, /* .###.... */
/*03af:*/ 0xd8, /* ##.##... */
/*03b0:*/ 0xd8, /* ##.##... */
/* --- new character y (121) starting at offset 0x03b1 --- */
/*03b1:*/ 5, 4, 6, 0, -1, /* width and bbox (w,h,x,y) */
/*03b6:*/ 0xd0, /* ##.#.... */
/*03b7:*/ 0xd0, /* ##.#.... */
/*03b8:*/ 0xd0, /* ##.#.... */
/*03b9:*/ 0x70, /* .###.... */
/*03ba:*/ 0x60, /* .##..... */
/*03bb:*/ 0x60, /* .##..... */
/* --- new character z (122) starting at offset 0x03bc --- */
/*03bc:*/ 5, 4, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*03c1:*/ 0xf0, /* ####.... */
/*03c2:*/ 0x30, /* ..##.... */
/*03c3:*/ 0x60, /* .##..... */
/*03c4:*/ 0xc0, /* ##...... */
/*03c5:*/ 0xf0, /* ####.... */
/* --- new character braceleft (123) starting at offset 0x03c6 --- */
/*03c6:*/ 4, 3, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*03cb:*/ 0x20, /* ..#..... */
/*03cc:*/ 0x40, /* .#...... */
/*03cd:*/ 0x40, /* .#...... */
/*03ce:*/ 0x80, /* #....... */
/*03cf:*/ 0x40, /* .#...... */
/*03d0:*/ 0x40, /* .#...... */
/*03d1:*/ 0x20, /* ..#..... */
/* --- new character bar (124) starting at offset 0x03d2 --- */
/*03d2:*/ 2, 1, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*03d7:*/ 0x80, /* #....... */
/*03d8:*/ 0x80, /* #....... */
/*03d9:*/ 0x80, /* #....... */
/*03da:*/ 0x80, /* #....... */
/*03db:*/ 0x80, /* #....... */
/*03dc:*/ 0x80, /* #....... */
/*03dd:*/ 0x80, /* #....... */
/* --- new character braceright (125) starting at offset 0x03de --- */
/*03de:*/ 4, 3, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*03e3:*/ 0x80, /* #....... */
/*03e4:*/ 0x40, /* .#...... */
/*03e5:*/ 0x40, /* .#...... */
/*03e6:*/ 0x20, /* ..#..... */
/*03e7:*/ 0x40, /* .#...... */
/*03e8:*/ 0x40, /* .#...... */
/*03e9:*/ 0x80, /* #....... */
/* --- new character asciitilde (126) starting at offset 0x03ea --- */
/*03ea:*/ 5, 5, 2, 0, 2, /* width and bbox (w,h,x,y) */
/*03ef:*/ 0x58, /* .#.##... */
/*03f0:*/ 0xb0, /* #.##.... */
};
static const uint16_t font_helvB08_offsets[] = {
0x0000 /* space */,
0x0006 /* exclam */,
0x0012 /* quotedbl */,
0x0019 /* numbersign */,
0x0024 /* dollar */,
0x0031 /* percent */,
0x003c /* ampersand */,
0x0047 /* quotesingle */,
0x004f /* parenleft */,
0x005c /* parenright */,
0x0069 /* asterisk */,
0x0071 /* plus */,
0x007b /* comma */,
0x0083 /* hyphen */,
0x0089 /* period */,
0x0090 /* slash */,
0x009b /* zero */,
0x00a6 /* one */,
0x00b1 /* two */,
0x00bc /* three */,
0x00c7 /* four */,
0x00d2 /* five */,
0x00dd /* six */,
0x00e8 /* seven */,
0x00f3 /* eight */,
0x00fe /* nine */,
0x0109 /* colon */,
0x0113 /* semicolon */,
0x011e /* less */,
0x0128 /* equal */,
0x0130 /* greater */,
0x013a /* question */,
0x0146 /* at */,
0x0152 /* A */,
0x015d /* B */,
0x0168 /* C */,
0x0173 /* D */,
0x017e /* E */,
0x0189 /* F */,
0x0194 /* G */,
0x019f /* H */,
0x01aa /* I */,
0x01b5 /* J */,
0x01c0 /* K */,
0x01cb /* L */,
0x01d6 /* M */,
0x01e1 /* N */,
0x01ec /* O */,
0x01f7 /* P */,
0x0202 /* Q */,
0x020e /* R */,
0x0219 /* S */,
0x0224 /* T */,
0x022f /* U */,
0x023a /* V */,
0x0245 /* W */,
0x0250 /* X */,
0x025b /* Y */,
0x0266 /* Z */,
0x0271 /* bracketleft */,
0x027e /* backslash */,
0x0289 /* bracketright */,
0x0296 /* asciicircum */,
0x029e /* underscore */,
0x02a4 /* grave */,
0x02ab /* a */,
0x02b5 /* b */,
0x02c1 /* c */,
0x02cb /* d */,
0x02d7 /* e */,
0x02e1 /* f */,
0x02ed /* g */,
0x02f8 /* h */,
0x0304 /* i */,
0x0310 /* j */,
0x031d /* k */,
0x0329 /* l */,
0x0335 /* m */,
0x033f /* n */,
0x0349 /* o */,
0x0353 /* p */,
0x035e /* q */,
0x0369 /* r */,
0x0373 /* s */,
0x037d /* t */,
0x0389 /* u */,
0x0393 /* v */,
0x039d /* w */,
0x03a7 /* x */,
0x03b1 /* y */,
0x03bc /* z */,
0x03c6 /* braceleft */,
0x03d2 /* bar */,
0x03de /* braceright */,
0x03ea /* asciitilde */,
0xffff /* (no glyph) */
};
const struct fb_font font_helvB08 = {
.height = 10,
.ascent = 8,
.firstchar = 32, /* space */
.lastchar = 127, /* ? */
.chardata = font_helvB08_data,
.charoffs = font_helvB08_offsets,
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,826 @@
#include <fb/font.h>
static const uint8_t font_helvR08_data[] = {
/* --- new character space (32) starting at offset 0x0000 --- */
/*0000:*/ 2, 1, 1, 0, 0, /* width and bbox (w,h,x,y) */
/*0005:*/ 0x00, /* ........ */
/* --- new character exclam (33) starting at offset 0x0006 --- */
/*0006:*/ 2, 1, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*000b:*/ 0x80, /* #....... */
/*000c:*/ 0x80, /* #....... */
/*000d:*/ 0x80, /* #....... */
/*000e:*/ 0x80, /* #....... */
/*000f:*/ 0x00, /* ........ */
/*0010:*/ 0x80, /* #....... */
/* --- new character quotedbl (34) starting at offset 0x0011 --- */
/*0011:*/ 3, 3, 3, 1, 3, /* width and bbox (w,h,x,y) */
/*0016:*/ 0xa0, /* #.#..... */
/*0017:*/ 0xa0, /* #.#..... */
/*0018:*/ 0xa0, /* #.#..... */
/* --- new character numbersign (35) starting at offset 0x0019 --- */
/*0019:*/ 5, 5, 5, 0, 0, /* width and bbox (w,h,x,y) */
/*001e:*/ 0x50, /* .#.#.... */
/*001f:*/ 0xf8, /* #####... */
/*0020:*/ 0x50, /* .#.#.... */
/*0021:*/ 0xf8, /* #####... */
/*0022:*/ 0x50, /* .#.#.... */
/* --- new character dollar (36) starting at offset 0x0023 --- */
/*0023:*/ 5, 4, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*0028:*/ 0x20, /* ..#..... */
/*0029:*/ 0x70, /* .###.... */
/*002a:*/ 0x80, /* #....... */
/*002b:*/ 0x60, /* .##..... */
/*002c:*/ 0x10, /* ...#.... */
/*002d:*/ 0xe0, /* ###..... */
/*002e:*/ 0x40, /* .#...... */
/* --- new character percent (37) starting at offset 0x002f --- */
/*002f:*/ 7, 6, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0034:*/ 0xe8, /* ###.#... */
/*0035:*/ 0xa8, /* #.#.#... */
/*0036:*/ 0xd0, /* ##.#.... */
/*0037:*/ 0x2c, /* ..#.##.. */
/*0038:*/ 0x54, /* .#.#.#.. */
/*0039:*/ 0x5c, /* .#.###.. */
/* --- new character ampersand (38) starting at offset 0x003a --- */
/*003a:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*003f:*/ 0x40, /* .#...... */
/*0040:*/ 0xa0, /* #.#..... */
/*0041:*/ 0x48, /* .#..#... */
/*0042:*/ 0xa8, /* #.#.#... */
/*0043:*/ 0xb0, /* #.##.... */
/*0044:*/ 0x58, /* .#.##... */
/* --- new character quotesingle (39) starting at offset 0x0045 --- */
/*0045:*/ 2, 1, 2, 0, 6, /* width and bbox (w,h,x,y) */
/*004a:*/ 0x80, /* #....... */
/*004b:*/ 0x80, /* #....... */
/* --- new character parenleft (40) starting at offset 0x004c --- */
/*004c:*/ 3, 2, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*0051:*/ 0x40, /* .#...... */
/*0052:*/ 0x80, /* #....... */
/*0053:*/ 0x80, /* #....... */
/*0054:*/ 0x80, /* #....... */
/*0055:*/ 0x80, /* #....... */
/*0056:*/ 0x80, /* #....... */
/*0057:*/ 0x40, /* .#...... */
/* --- new character parenright (41) starting at offset 0x0058 --- */
/*0058:*/ 3, 2, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*005d:*/ 0x80, /* #....... */
/*005e:*/ 0x40, /* .#...... */
/*005f:*/ 0x40, /* .#...... */
/*0060:*/ 0x40, /* .#...... */
/*0061:*/ 0x40, /* .#...... */
/*0062:*/ 0x40, /* .#...... */
/*0063:*/ 0x80, /* #....... */
/* --- new character asterisk (42) starting at offset 0x0064 --- */
/*0064:*/ 3, 3, 3, 1, 2, /* width and bbox (w,h,x,y) */
/*0069:*/ 0x40, /* .#...... */
/*006a:*/ 0xe0, /* ###..... */
/*006b:*/ 0x40, /* .#...... */
/* --- new character plus (43) starting at offset 0x006c --- */
/*006c:*/ 5, 5, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0071:*/ 0x20, /* ..#..... */
/*0072:*/ 0x20, /* ..#..... */
/*0073:*/ 0xf8, /* #####... */
/*0074:*/ 0x20, /* ..#..... */
/*0075:*/ 0x20, /* ..#..... */
/* --- new character comma (44) starting at offset 0x0076 --- */
/*0076:*/ 2, 2, 3, 0, -2, /* width and bbox (w,h,x,y) */
/*007b:*/ 0x40, /* .#...... */
/*007c:*/ 0x40, /* .#...... */
/*007d:*/ 0x80, /* #....... */
/* --- new character hyphen (45) starting at offset 0x007e --- */
/*007e:*/ 3, 2, 1, 0, 2, /* width and bbox (w,h,x,y) */
/*0083:*/ 0xc0, /* ##...... */
/* --- new character period (46) starting at offset 0x0084 --- */
/*0084:*/ 2, 1, 1, 1, 0, /* width and bbox (w,h,x,y) */
/*0089:*/ 0x80, /* #....... */
/* --- new character slash (47) starting at offset 0x008a --- */
/*008a:*/ 2, 2, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*008f:*/ 0x40, /* .#...... */
/*0090:*/ 0x40, /* .#...... */
/*0091:*/ 0x40, /* .#...... */
/*0092:*/ 0x80, /* #....... */
/*0093:*/ 0x80, /* #....... */
/*0094:*/ 0x80, /* #....... */
/*0095:*/ 0x80, /* #....... */
/* --- new character zero (48) starting at offset 0x0096 --- */
/*0096:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*009b:*/ 0x60, /* .##..... */
/*009c:*/ 0x90, /* #..#.... */
/*009d:*/ 0x90, /* #..#.... */
/*009e:*/ 0x90, /* #..#.... */
/*009f:*/ 0x90, /* #..#.... */
/*00a0:*/ 0x60, /* .##..... */
/* --- new character one (49) starting at offset 0x00a1 --- */
/*00a1:*/ 5, 2, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*00a6:*/ 0x40, /* .#...... */
/*00a7:*/ 0xc0, /* ##...... */
/*00a8:*/ 0x40, /* .#...... */
/*00a9:*/ 0x40, /* .#...... */
/*00aa:*/ 0x40, /* .#...... */
/*00ab:*/ 0x40, /* .#...... */
/* --- new character two (50) starting at offset 0x00ac --- */
/*00ac:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00b1:*/ 0x60, /* .##..... */
/*00b2:*/ 0x90, /* #..#.... */
/*00b3:*/ 0x10, /* ...#.... */
/*00b4:*/ 0x20, /* ..#..... */
/*00b5:*/ 0x40, /* .#...... */
/*00b6:*/ 0xf0, /* ####.... */
/* --- new character three (51) starting at offset 0x00b7 --- */
/*00b7:*/ 5, 3, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*00bc:*/ 0xc0, /* ##...... */
/*00bd:*/ 0x20, /* ..#..... */
/*00be:*/ 0xc0, /* ##...... */
/*00bf:*/ 0x20, /* ..#..... */
/*00c0:*/ 0x20, /* ..#..... */
/*00c1:*/ 0xc0, /* ##...... */
/* --- new character four (52) starting at offset 0x00c2 --- */
/*00c2:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00c7:*/ 0x20, /* ..#..... */
/*00c8:*/ 0x20, /* ..#..... */
/*00c9:*/ 0x60, /* .##..... */
/*00ca:*/ 0xf0, /* ####.... */
/*00cb:*/ 0x20, /* ..#..... */
/*00cc:*/ 0x20, /* ..#..... */
/* --- new character five (53) starting at offset 0x00cd --- */
/*00cd:*/ 5, 3, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*00d2:*/ 0xe0, /* ###..... */
/*00d3:*/ 0x80, /* #....... */
/*00d4:*/ 0xc0, /* ##...... */
/*00d5:*/ 0x20, /* ..#..... */
/*00d6:*/ 0x20, /* ..#..... */
/*00d7:*/ 0xc0, /* ##...... */
/* --- new character six (54) starting at offset 0x00d8 --- */
/*00d8:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00dd:*/ 0x70, /* .###.... */
/*00de:*/ 0x80, /* #....... */
/*00df:*/ 0xe0, /* ###..... */
/*00e0:*/ 0x90, /* #..#.... */
/*00e1:*/ 0x90, /* #..#.... */
/*00e2:*/ 0x60, /* .##..... */
/* --- new character seven (55) starting at offset 0x00e3 --- */
/*00e3:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00e8:*/ 0xf0, /* ####.... */
/*00e9:*/ 0x10, /* ...#.... */
/*00ea:*/ 0x20, /* ..#..... */
/*00eb:*/ 0x40, /* .#...... */
/*00ec:*/ 0x40, /* .#...... */
/*00ed:*/ 0x40, /* .#...... */
/* --- new character eight (56) starting at offset 0x00ee --- */
/*00ee:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00f3:*/ 0x60, /* .##..... */
/*00f4:*/ 0x90, /* #..#.... */
/*00f5:*/ 0x60, /* .##..... */
/*00f6:*/ 0x90, /* #..#.... */
/*00f7:*/ 0x90, /* #..#.... */
/*00f8:*/ 0x60, /* .##..... */
/* --- new character nine (57) starting at offset 0x00f9 --- */
/*00f9:*/ 5, 4, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*00fe:*/ 0x60, /* .##..... */
/*00ff:*/ 0x90, /* #..#.... */
/*0100:*/ 0x90, /* #..#.... */
/*0101:*/ 0x70, /* .###.... */
/*0102:*/ 0x10, /* ...#.... */
/*0103:*/ 0x60, /* .##..... */
/* --- new character colon (58) starting at offset 0x0104 --- */
/*0104:*/ 2, 1, 4, 1, 0, /* width and bbox (w,h,x,y) */
/*0109:*/ 0x80, /* #....... */
/*010a:*/ 0x00, /* ........ */
/*010b:*/ 0x00, /* ........ */
/*010c:*/ 0x80, /* #....... */
/* --- new character semicolon (59) starting at offset 0x010d --- */
/*010d:*/ 2, 2, 6, 0, -2, /* width and bbox (w,h,x,y) */
/*0112:*/ 0x40, /* .#...... */
/*0113:*/ 0x00, /* ........ */
/*0114:*/ 0x00, /* ........ */
/*0115:*/ 0x40, /* .#...... */
/*0116:*/ 0x40, /* .#...... */
/*0117:*/ 0x80, /* #....... */
/* --- new character less (60) starting at offset 0x0118 --- */
/*0118:*/ 5, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*011d:*/ 0x20, /* ..#..... */
/*011e:*/ 0x40, /* .#...... */
/*011f:*/ 0x80, /* #....... */
/*0120:*/ 0x40, /* .#...... */
/*0121:*/ 0x20, /* ..#..... */
/* --- new character equal (61) starting at offset 0x0122 --- */
/*0122:*/ 4, 3, 3, 1, 1, /* width and bbox (w,h,x,y) */
/*0127:*/ 0xe0, /* ###..... */
/*0128:*/ 0x00, /* ........ */
/*0129:*/ 0xe0, /* ###..... */
/* --- new character greater (62) starting at offset 0x012a --- */
/*012a:*/ 5, 3, 5, 2, 0, /* width and bbox (w,h,x,y) */
/*012f:*/ 0x80, /* #....... */
/*0130:*/ 0x40, /* .#...... */
/*0131:*/ 0x20, /* ..#..... */
/*0132:*/ 0x40, /* .#...... */
/*0133:*/ 0x80, /* #....... */
/* --- new character question (63) starting at offset 0x0134 --- */
/*0134:*/ 5, 3, 5, 2, 0, /* width and bbox (w,h,x,y) */
/*0139:*/ 0xc0, /* ##...... */
/*013a:*/ 0x20, /* ..#..... */
/*013b:*/ 0x40, /* .#...... */
/*013c:*/ 0x00, /* ........ */
/*013d:*/ 0x40, /* .#...... */
/* --- new character at (64) starting at offset 0x013e --- */
/*013e:*/ 9, 8, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*0143:*/ 0x3e, /* ..#####. */
/*0144:*/ 0x41, /* .#.....# */
/*0145:*/ 0x99, /* #..##..# */
/*0146:*/ 0xa5, /* #.#..#.# */
/*0147:*/ 0x9e, /* #..####. */
/*0148:*/ 0x80, /* #....... */
/*0149:*/ 0x78, /* .####... */
/* --- new character A (65) starting at offset 0x014a --- */
/*014a:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*014f:*/ 0x20, /* ..#..... */
/*0150:*/ 0x20, /* ..#..... */
/*0151:*/ 0x50, /* .#.#.... */
/*0152:*/ 0x70, /* .###.... */
/*0153:*/ 0x88, /* #...#... */
/*0154:*/ 0x88, /* #...#... */
/* --- new character B (66) starting at offset 0x0155 --- */
/*0155:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*015a:*/ 0xe0, /* ###..... */
/*015b:*/ 0x90, /* #..#.... */
/*015c:*/ 0xe0, /* ###..... */
/*015d:*/ 0x90, /* #..#.... */
/*015e:*/ 0x90, /* #..#.... */
/*015f:*/ 0xe0, /* ###..... */
/* --- new character C (67) starting at offset 0x0160 --- */
/*0160:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0165:*/ 0x70, /* .###.... */
/*0166:*/ 0x88, /* #...#... */
/*0167:*/ 0x80, /* #....... */
/*0168:*/ 0x80, /* #....... */
/*0169:*/ 0x88, /* #...#... */
/*016a:*/ 0x70, /* .###.... */
/* --- new character D (68) starting at offset 0x016b --- */
/*016b:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0170:*/ 0xf0, /* ####.... */
/*0171:*/ 0x88, /* #...#... */
/*0172:*/ 0x88, /* #...#... */
/*0173:*/ 0x88, /* #...#... */
/*0174:*/ 0x88, /* #...#... */
/*0175:*/ 0xf0, /* ####.... */
/* --- new character E (69) starting at offset 0x0176 --- */
/*0176:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*017b:*/ 0xf0, /* ####.... */
/*017c:*/ 0x80, /* #....... */
/*017d:*/ 0xe0, /* ###..... */
/*017e:*/ 0x80, /* #....... */
/*017f:*/ 0x80, /* #....... */
/*0180:*/ 0xf0, /* ####.... */
/* --- new character F (70) starting at offset 0x0181 --- */
/*0181:*/ 5, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*0186:*/ 0xf0, /* ####.... */
/*0187:*/ 0x80, /* #....... */
/*0188:*/ 0xe0, /* ###..... */
/*0189:*/ 0x80, /* #....... */
/*018a:*/ 0x80, /* #....... */
/*018b:*/ 0x80, /* #....... */
/* --- new character G (71) starting at offset 0x018c --- */
/*018c:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0191:*/ 0x70, /* .###.... */
/*0192:*/ 0x80, /* #....... */
/*0193:*/ 0x98, /* #..##... */
/*0194:*/ 0x88, /* #...#... */
/*0195:*/ 0x88, /* #...#... */
/*0196:*/ 0x70, /* .###.... */
/* --- new character H (72) starting at offset 0x0197 --- */
/*0197:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*019c:*/ 0x88, /* #...#... */
/*019d:*/ 0x88, /* #...#... */
/*019e:*/ 0xf8, /* #####... */
/*019f:*/ 0x88, /* #...#... */
/*01a0:*/ 0x88, /* #...#... */
/*01a1:*/ 0x88, /* #...#... */
/* --- new character I (73) starting at offset 0x01a2 --- */
/*01a2:*/ 2, 1, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*01a7:*/ 0x80, /* #....... */
/*01a8:*/ 0x80, /* #....... */
/*01a9:*/ 0x80, /* #....... */
/*01aa:*/ 0x80, /* #....... */
/*01ab:*/ 0x80, /* #....... */
/*01ac:*/ 0x80, /* #....... */
/* --- new character J (74) starting at offset 0x01ad --- */
/*01ad:*/ 4, 3, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*01b2:*/ 0x20, /* ..#..... */
/*01b3:*/ 0x20, /* ..#..... */
/*01b4:*/ 0x20, /* ..#..... */
/*01b5:*/ 0x20, /* ..#..... */
/*01b6:*/ 0xa0, /* #.#..... */
/*01b7:*/ 0x40, /* .#...... */
/* --- new character K (75) starting at offset 0x01b8 --- */
/*01b8:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*01bd:*/ 0x90, /* #..#.... */
/*01be:*/ 0xa0, /* #.#..... */
/*01bf:*/ 0xc0, /* ##...... */
/*01c0:*/ 0xe0, /* ###..... */
/*01c1:*/ 0x90, /* #..#.... */
/*01c2:*/ 0x90, /* #..#.... */
/* --- new character L (76) starting at offset 0x01c3 --- */
/*01c3:*/ 5, 3, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*01c8:*/ 0x80, /* #....... */
/*01c9:*/ 0x80, /* #....... */
/*01ca:*/ 0x80, /* #....... */
/*01cb:*/ 0x80, /* #....... */
/*01cc:*/ 0x80, /* #....... */
/*01cd:*/ 0xe0, /* ###..... */
/* --- new character M (77) starting at offset 0x01ce --- */
/*01ce:*/ 7, 5, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*01d3:*/ 0x88, /* #...#... */
/*01d4:*/ 0xd8, /* ##.##... */
/*01d5:*/ 0xa8, /* #.#.#... */
/*01d6:*/ 0xa8, /* #.#.#... */
/*01d7:*/ 0xa8, /* #.#.#... */
/*01d8:*/ 0xa8, /* #.#.#... */
/* --- new character N (78) starting at offset 0x01d9 --- */
/*01d9:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*01de:*/ 0x88, /* #...#... */
/*01df:*/ 0xc8, /* ##..#... */
/*01e0:*/ 0xa8, /* #.#.#... */
/*01e1:*/ 0xa8, /* #.#.#... */
/*01e2:*/ 0x98, /* #..##... */
/*01e3:*/ 0x88, /* #...#... */
/* --- new character O (79) starting at offset 0x01e4 --- */
/*01e4:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*01e9:*/ 0x70, /* .###.... */
/*01ea:*/ 0x88, /* #...#... */
/*01eb:*/ 0x88, /* #...#... */
/*01ec:*/ 0x88, /* #...#... */
/*01ed:*/ 0x88, /* #...#... */
/*01ee:*/ 0x70, /* .###.... */
/* --- new character P (80) starting at offset 0x01ef --- */
/*01ef:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*01f4:*/ 0xe0, /* ###..... */
/*01f5:*/ 0x90, /* #..#.... */
/*01f6:*/ 0x90, /* #..#.... */
/*01f7:*/ 0xe0, /* ###..... */
/*01f8:*/ 0x80, /* #....... */
/*01f9:*/ 0x80, /* #....... */
/* --- new character Q (81) starting at offset 0x01fa --- */
/*01fa:*/ 6, 5, 8, 1, -2, /* width and bbox (w,h,x,y) */
/*01ff:*/ 0x70, /* .###.... */
/*0200:*/ 0x88, /* #...#... */
/*0201:*/ 0x88, /* #...#... */
/*0202:*/ 0x88, /* #...#... */
/*0203:*/ 0x88, /* #...#... */
/*0204:*/ 0x70, /* .###.... */
/*0205:*/ 0x20, /* ..#..... */
/*0206:*/ 0x10, /* ...#.... */
/* --- new character R (82) starting at offset 0x0207 --- */
/*0207:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*020c:*/ 0xe0, /* ###..... */
/*020d:*/ 0x90, /* #..#.... */
/*020e:*/ 0x90, /* #..#.... */
/*020f:*/ 0xe0, /* ###..... */
/*0210:*/ 0x90, /* #..#.... */
/*0211:*/ 0x90, /* #..#.... */
/* --- new character S (83) starting at offset 0x0212 --- */
/*0212:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*0217:*/ 0x70, /* .###.... */
/*0218:*/ 0x80, /* #....... */
/*0219:*/ 0xe0, /* ###..... */
/*021a:*/ 0x10, /* ...#.... */
/*021b:*/ 0x10, /* ...#.... */
/*021c:*/ 0xe0, /* ###..... */
/* --- new character T (84) starting at offset 0x021d --- */
/*021d:*/ 4, 3, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0222:*/ 0xe0, /* ###..... */
/*0223:*/ 0x40, /* .#...... */
/*0224:*/ 0x40, /* .#...... */
/*0225:*/ 0x40, /* .#...... */
/*0226:*/ 0x40, /* .#...... */
/*0227:*/ 0x40, /* .#...... */
/* --- new character U (85) starting at offset 0x0228 --- */
/*0228:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*022d:*/ 0x88, /* #...#... */
/*022e:*/ 0x88, /* #...#... */
/*022f:*/ 0x88, /* #...#... */
/*0230:*/ 0x88, /* #...#... */
/*0231:*/ 0x88, /* #...#... */
/*0232:*/ 0x70, /* .###.... */
/* --- new character V (86) starting at offset 0x0233 --- */
/*0233:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*0238:*/ 0x90, /* #..#.... */
/*0239:*/ 0x90, /* #..#.... */
/*023a:*/ 0x90, /* #..#.... */
/*023b:*/ 0x90, /* #..#.... */
/*023c:*/ 0xa0, /* #.#..... */
/*023d:*/ 0x40, /* .#...... */
/* --- new character W (87) starting at offset 0x023e --- */
/*023e:*/ 7, 7, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0243:*/ 0x92, /* #..#..#. */
/*0244:*/ 0x92, /* #..#..#. */
/*0245:*/ 0x92, /* #..#..#. */
/*0246:*/ 0x6c, /* .##.##.. */
/*0247:*/ 0x48, /* .#..#... */
/*0248:*/ 0x48, /* .#..#... */
/* --- new character X (88) starting at offset 0x0249 --- */
/*0249:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*024e:*/ 0x90, /* #..#.... */
/*024f:*/ 0x90, /* #..#.... */
/*0250:*/ 0x60, /* .##..... */
/*0251:*/ 0x60, /* .##..... */
/*0252:*/ 0x90, /* #..#.... */
/*0253:*/ 0x90, /* #..#.... */
/* --- new character Y (89) starting at offset 0x0254 --- */
/*0254:*/ 6, 5, 6, 1, 0, /* width and bbox (w,h,x,y) */
/*0259:*/ 0xc8, /* ##..#... */
/*025a:*/ 0x48, /* .#..#... */
/*025b:*/ 0x48, /* .#..#... */
/*025c:*/ 0x30, /* ..##.... */
/*025d:*/ 0x20, /* ..#..... */
/*025e:*/ 0x20, /* ..#..... */
/* --- new character Z (90) starting at offset 0x025f --- */
/*025f:*/ 6, 4, 6, 2, 0, /* width and bbox (w,h,x,y) */
/*0264:*/ 0xf0, /* ####.... */
/*0265:*/ 0x10, /* ...#.... */
/*0266:*/ 0x20, /* ..#..... */
/*0267:*/ 0x40, /* .#...... */
/*0268:*/ 0x80, /* #....... */
/*0269:*/ 0xf0, /* ####.... */
/* --- new character bracketleft (91) starting at offset 0x026a --- */
/*026a:*/ 2, 2, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*026f:*/ 0xc0, /* ##...... */
/*0270:*/ 0x80, /* #....... */
/*0271:*/ 0x80, /* #....... */
/*0272:*/ 0x80, /* #....... */
/*0273:*/ 0x80, /* #....... */
/*0274:*/ 0x80, /* #....... */
/*0275:*/ 0xc0, /* ##...... */
/* --- new character backslash (92) starting at offset 0x0276 --- */
/*0276:*/ 2, 2, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*027b:*/ 0x80, /* #....... */
/*027c:*/ 0x80, /* #....... */
/*027d:*/ 0x80, /* #....... */
/*027e:*/ 0x40, /* .#...... */
/*027f:*/ 0x40, /* .#...... */
/*0280:*/ 0x40, /* .#...... */
/*0281:*/ 0x40, /* .#...... */
/* --- new character bracketright (93) starting at offset 0x0282 --- */
/*0282:*/ 2, 2, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*0287:*/ 0xc0, /* ##...... */
/*0288:*/ 0x40, /* .#...... */
/*0289:*/ 0x40, /* .#...... */
/*028a:*/ 0x40, /* .#...... */
/*028b:*/ 0x40, /* .#...... */
/*028c:*/ 0x40, /* .#...... */
/*028d:*/ 0xc0, /* ##...... */
/* --- new character asciicircum (94) starting at offset 0x028e --- */
/*028e:*/ 5, 5, 3, 0, 2, /* width and bbox (w,h,x,y) */
/*0293:*/ 0x20, /* ..#..... */
/*0294:*/ 0x50, /* .#.#.... */
/*0295:*/ 0x88, /* #...#... */
/* --- new character underscore (95) starting at offset 0x0296 --- */
/*0296:*/ 5, 5, 1, 0, -1, /* width and bbox (w,h,x,y) */
/*029b:*/ 0xf8, /* #####... */
/* --- new character grave (96) starting at offset 0x029c --- */
/*029c:*/ 3, 2, 2, 0, 6, /* width and bbox (w,h,x,y) */
/*02a1:*/ 0x80, /* #....... */
/*02a2:*/ 0x40, /* .#...... */
/* --- new character a (97) starting at offset 0x02a3 --- */
/*02a3:*/ 4, 4, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*02a8:*/ 0xc0, /* ##...... */
/*02a9:*/ 0x20, /* ..#..... */
/*02aa:*/ 0xe0, /* ###..... */
/*02ab:*/ 0xa0, /* #.#..... */
/*02ac:*/ 0xd0, /* ##.#.... */
/* --- new character b (98) starting at offset 0x02ad --- */
/*02ad:*/ 5, 4, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*02b2:*/ 0x80, /* #....... */
/*02b3:*/ 0x80, /* #....... */
/*02b4:*/ 0xe0, /* ###..... */
/*02b5:*/ 0x90, /* #..#.... */
/*02b6:*/ 0x90, /* #..#.... */
/*02b7:*/ 0x90, /* #..#.... */
/*02b8:*/ 0xe0, /* ###..... */
/* --- new character c (99) starting at offset 0x02b9 --- */
/*02b9:*/ 4, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*02be:*/ 0x60, /* .##..... */
/*02bf:*/ 0x80, /* #....... */
/*02c0:*/ 0x80, /* #....... */
/*02c1:*/ 0x80, /* #....... */
/*02c2:*/ 0x60, /* .##..... */
/* --- new character d (100) starting at offset 0x02c3 --- */
/*02c3:*/ 5, 4, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*02c8:*/ 0x10, /* ...#.... */
/*02c9:*/ 0x10, /* ...#.... */
/*02ca:*/ 0x70, /* .###.... */
/*02cb:*/ 0x90, /* #..#.... */
/*02cc:*/ 0x90, /* #..#.... */
/*02cd:*/ 0x90, /* #..#.... */
/*02ce:*/ 0x70, /* .###.... */
/* --- new character e (101) starting at offset 0x02cf --- */
/*02cf:*/ 4, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*02d4:*/ 0x40, /* .#...... */
/*02d5:*/ 0xa0, /* #.#..... */
/*02d6:*/ 0xe0, /* ###..... */
/*02d7:*/ 0x80, /* #....... */
/*02d8:*/ 0x60, /* .##..... */
/* --- new character f (102) starting at offset 0x02d9 --- */
/*02d9:*/ 4, 3, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*02de:*/ 0x20, /* ..#..... */
/*02df:*/ 0x40, /* .#...... */
/*02e0:*/ 0xe0, /* ###..... */
/*02e1:*/ 0x40, /* .#...... */
/*02e2:*/ 0x40, /* .#...... */
/*02e3:*/ 0x40, /* .#...... */
/*02e4:*/ 0x40, /* .#...... */
/* --- new character g (103) starting at offset 0x02e5 --- */
/*02e5:*/ 5, 4, 6, 1, -1, /* width and bbox (w,h,x,y) */
/*02ea:*/ 0x70, /* .###.... */
/*02eb:*/ 0x90, /* #..#.... */
/*02ec:*/ 0x90, /* #..#.... */
/*02ed:*/ 0x70, /* .###.... */
/*02ee:*/ 0x10, /* ...#.... */
/*02ef:*/ 0x60, /* .##..... */
/* --- new character h (104) starting at offset 0x02f0 --- */
/*02f0:*/ 5, 4, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*02f5:*/ 0x80, /* #....... */
/*02f6:*/ 0x80, /* #....... */
/*02f7:*/ 0xe0, /* ###..... */
/*02f8:*/ 0x90, /* #..#.... */
/*02f9:*/ 0x90, /* #..#.... */
/*02fa:*/ 0x90, /* #..#.... */
/*02fb:*/ 0x90, /* #..#.... */
/* --- new character i (105) starting at offset 0x02fc --- */
/*02fc:*/ 2, 1, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*0301:*/ 0x80, /* #....... */
/*0302:*/ 0x00, /* ........ */
/*0303:*/ 0x80, /* #....... */
/*0304:*/ 0x80, /* #....... */
/*0305:*/ 0x80, /* #....... */
/*0306:*/ 0x80, /* #....... */
/*0307:*/ 0x80, /* #....... */
/* --- new character j (106) starting at offset 0x0308 --- */
/*0308:*/ 2, 2, 9, 0, -2, /* width and bbox (w,h,x,y) */
/*030d:*/ 0x40, /* .#...... */
/*030e:*/ 0x00, /* ........ */
/*030f:*/ 0x40, /* .#...... */
/*0310:*/ 0x40, /* .#...... */
/*0311:*/ 0x40, /* .#...... */
/*0312:*/ 0x40, /* .#...... */
/*0313:*/ 0x40, /* .#...... */
/*0314:*/ 0x40, /* .#...... */
/*0315:*/ 0x80, /* #....... */
/* --- new character k (107) starting at offset 0x0316 --- */
/*0316:*/ 4, 3, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*031b:*/ 0x80, /* #....... */
/*031c:*/ 0x80, /* #....... */
/*031d:*/ 0xa0, /* #.#..... */
/*031e:*/ 0xc0, /* ##...... */
/*031f:*/ 0xc0, /* ##...... */
/*0320:*/ 0xa0, /* #.#..... */
/*0321:*/ 0xa0, /* #.#..... */
/* --- new character l (108) starting at offset 0x0322 --- */
/*0322:*/ 2, 1, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*0327:*/ 0x80, /* #....... */
/*0328:*/ 0x80, /* #....... */
/*0329:*/ 0x80, /* #....... */
/*032a:*/ 0x80, /* #....... */
/*032b:*/ 0x80, /* #....... */
/*032c:*/ 0x80, /* #....... */
/*032d:*/ 0x80, /* #....... */
/* --- new character m (109) starting at offset 0x032e --- */
/*032e:*/ 6, 5, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0333:*/ 0xf0, /* ####.... */
/*0334:*/ 0xa8, /* #.#.#... */
/*0335:*/ 0xa8, /* #.#.#... */
/*0336:*/ 0xa8, /* #.#.#... */
/*0337:*/ 0xa8, /* #.#.#... */
/* --- new character n (110) starting at offset 0x0338 --- */
/*0338:*/ 5, 4, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*033d:*/ 0xe0, /* ###..... */
/*033e:*/ 0x90, /* #..#.... */
/*033f:*/ 0x90, /* #..#.... */
/*0340:*/ 0x90, /* #..#.... */
/*0341:*/ 0x90, /* #..#.... */
/* --- new character o (111) starting at offset 0x0342 --- */
/*0342:*/ 5, 4, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0347:*/ 0x60, /* .##..... */
/*0348:*/ 0x90, /* #..#.... */
/*0349:*/ 0x90, /* #..#.... */
/*034a:*/ 0x90, /* #..#.... */
/*034b:*/ 0x60, /* .##..... */
/* --- new character p (112) starting at offset 0x034c --- */
/*034c:*/ 5, 4, 6, 1, -1, /* width and bbox (w,h,x,y) */
/*0351:*/ 0xe0, /* ###..... */
/*0352:*/ 0x90, /* #..#.... */
/*0353:*/ 0x90, /* #..#.... */
/*0354:*/ 0x90, /* #..#.... */
/*0355:*/ 0xe0, /* ###..... */
/*0356:*/ 0x80, /* #....... */
/* --- new character q (113) starting at offset 0x0357 --- */
/*0357:*/ 5, 4, 6, 1, -1, /* width and bbox (w,h,x,y) */
/*035c:*/ 0x70, /* .###.... */
/*035d:*/ 0x90, /* #..#.... */
/*035e:*/ 0x90, /* #..#.... */
/*035f:*/ 0x90, /* #..#.... */
/*0360:*/ 0x70, /* .###.... */
/*0361:*/ 0x10, /* ...#.... */
/* --- new character r (114) starting at offset 0x0362 --- */
/*0362:*/ 3, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0367:*/ 0xa0, /* #.#..... */
/*0368:*/ 0xc0, /* ##...... */
/*0369:*/ 0x80, /* #....... */
/*036a:*/ 0x80, /* #....... */
/*036b:*/ 0x80, /* #....... */
/* --- new character s (115) starting at offset 0x036c --- */
/*036c:*/ 4, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0371:*/ 0x60, /* .##..... */
/*0372:*/ 0x80, /* #....... */
/*0373:*/ 0x60, /* .##..... */
/*0374:*/ 0x20, /* ..#..... */
/*0375:*/ 0xc0, /* ##...... */
/* --- new character t (116) starting at offset 0x0376 --- */
/*0376:*/ 3, 3, 7, 1, 0, /* width and bbox (w,h,x,y) */
/*037b:*/ 0x40, /* .#...... */
/*037c:*/ 0x40, /* .#...... */
/*037d:*/ 0xe0, /* ###..... */
/*037e:*/ 0x40, /* .#...... */
/*037f:*/ 0x40, /* .#...... */
/*0380:*/ 0x40, /* .#...... */
/*0381:*/ 0x40, /* .#...... */
/* --- new character u (117) starting at offset 0x0382 --- */
/*0382:*/ 4, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0387:*/ 0xa0, /* #.#..... */
/*0388:*/ 0xa0, /* #.#..... */
/*0389:*/ 0xa0, /* #.#..... */
/*038a:*/ 0xa0, /* #.#..... */
/*038b:*/ 0x60, /* .##..... */
/* --- new character v (118) starting at offset 0x038c --- */
/*038c:*/ 5, 4, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*0391:*/ 0x90, /* #..#.... */
/*0392:*/ 0x90, /* #..#.... */
/*0393:*/ 0x90, /* #..#.... */
/*0394:*/ 0xa0, /* #.#..... */
/*0395:*/ 0x40, /* .#...... */
/* --- new character w (119) starting at offset 0x0396 --- */
/*0396:*/ 6, 5, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*039b:*/ 0xa8, /* #.#.#... */
/*039c:*/ 0xa8, /* #.#.#... */
/*039d:*/ 0xa8, /* #.#.#... */
/*039e:*/ 0x50, /* .#.#.... */
/*039f:*/ 0x50, /* .#.#.... */
/* --- new character x (120) starting at offset 0x03a0 --- */
/*03a0:*/ 5, 4, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*03a5:*/ 0x90, /* #..#.... */
/*03a6:*/ 0x90, /* #..#.... */
/*03a7:*/ 0x60, /* .##..... */
/*03a8:*/ 0x90, /* #..#.... */
/*03a9:*/ 0x90, /* #..#.... */
/* --- new character y (121) starting at offset 0x03aa --- */
/*03aa:*/ 4, 4, 6, 1, -1, /* width and bbox (w,h,x,y) */
/*03af:*/ 0x90, /* #..#.... */
/*03b0:*/ 0x90, /* #..#.... */
/*03b1:*/ 0x90, /* #..#.... */
/*03b2:*/ 0x60, /* .##..... */
/*03b3:*/ 0x40, /* .#...... */
/*03b4:*/ 0x80, /* #....... */
/* --- new character z (122) starting at offset 0x03b5 --- */
/*03b5:*/ 4, 3, 5, 1, 0, /* width and bbox (w,h,x,y) */
/*03ba:*/ 0xe0, /* ###..... */
/*03bb:*/ 0x20, /* ..#..... */
/*03bc:*/ 0x40, /* .#...... */
/*03bd:*/ 0x80, /* #....... */
/*03be:*/ 0xe0, /* ###..... */
/* --- new character braceleft (123) starting at offset 0x03bf --- */
/*03bf:*/ 2, 3, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*03c4:*/ 0x20, /* ..#..... */
/*03c5:*/ 0x40, /* .#...... */
/*03c6:*/ 0x40, /* .#...... */
/*03c7:*/ 0xc0, /* ##...... */
/*03c8:*/ 0x40, /* .#...... */
/*03c9:*/ 0x40, /* .#...... */
/*03ca:*/ 0x20, /* ..#..... */
/* --- new character bar (124) starting at offset 0x03cb --- */
/*03cb:*/ 2, 1, 7, 1, -1, /* width and bbox (w,h,x,y) */
/*03d0:*/ 0x80, /* #....... */
/*03d1:*/ 0x80, /* #....... */
/*03d2:*/ 0x80, /* #....... */
/*03d3:*/ 0x80, /* #....... */
/*03d4:*/ 0x80, /* #....... */
/*03d5:*/ 0x80, /* #....... */
/*03d6:*/ 0x80, /* #....... */
/* --- new character braceright (125) starting at offset 0x03d7 --- */
/*03d7:*/ 2, 3, 7, 0, -1, /* width and bbox (w,h,x,y) */
/*03dc:*/ 0x80, /* #....... */
/*03dd:*/ 0x40, /* .#...... */
/*03de:*/ 0x40, /* .#...... */
/*03df:*/ 0x60, /* .##..... */
/*03e0:*/ 0x40, /* .#...... */
/*03e1:*/ 0x40, /* .#...... */
/*03e2:*/ 0x80, /* #....... */
/* --- new character asciitilde (126) starting at offset 0x03e3 --- */
/*03e3:*/ 6, 5, 2, 1, 2, /* width and bbox (w,h,x,y) */
/*03e8:*/ 0x48, /* .#..#... */
/*03e9:*/ 0xb0, /* #.##.... */
};
static const uint16_t font_helvR08_offsets[] = {
0x0000 /* space */,
0x0006 /* exclam */,
0x0011 /* quotedbl */,
0x0019 /* numbersign */,
0x0023 /* dollar */,
0x002f /* percent */,
0x003a /* ampersand */,
0x0045 /* quotesingle */,
0x004c /* parenleft */,
0x0058 /* parenright */,
0x0064 /* asterisk */,
0x006c /* plus */,
0x0076 /* comma */,
0x007e /* hyphen */,
0x0084 /* period */,
0x008a /* slash */,
0x0096 /* zero */,
0x00a1 /* one */,
0x00ac /* two */,
0x00b7 /* three */,
0x00c2 /* four */,
0x00cd /* five */,
0x00d8 /* six */,
0x00e3 /* seven */,
0x00ee /* eight */,
0x00f9 /* nine */,
0x0104 /* colon */,
0x010d /* semicolon */,
0x0118 /* less */,
0x0122 /* equal */,
0x012a /* greater */,
0x0134 /* question */,
0x013e /* at */,
0x014a /* A */,
0x0155 /* B */,
0x0160 /* C */,
0x016b /* D */,
0x0176 /* E */,
0x0181 /* F */,
0x018c /* G */,
0x0197 /* H */,
0x01a2 /* I */,
0x01ad /* J */,
0x01b8 /* K */,
0x01c3 /* L */,
0x01ce /* M */,
0x01d9 /* N */,
0x01e4 /* O */,
0x01ef /* P */,
0x01fa /* Q */,
0x0207 /* R */,
0x0212 /* S */,
0x021d /* T */,
0x0228 /* U */,
0x0233 /* V */,
0x023e /* W */,
0x0249 /* X */,
0x0254 /* Y */,
0x025f /* Z */,
0x026a /* bracketleft */,
0x0276 /* backslash */,
0x0282 /* bracketright */,
0x028e /* asciicircum */,
0x0296 /* underscore */,
0x029c /* grave */,
0x02a3 /* a */,
0x02ad /* b */,
0x02b9 /* c */,
0x02c3 /* d */,
0x02cf /* e */,
0x02d9 /* f */,
0x02e5 /* g */,
0x02f0 /* h */,
0x02fc /* i */,
0x0308 /* j */,
0x0316 /* k */,
0x0322 /* l */,
0x032e /* m */,
0x0338 /* n */,
0x0342 /* o */,
0x034c /* p */,
0x0357 /* q */,
0x0362 /* r */,
0x036c /* s */,
0x0376 /* t */,
0x0382 /* u */,
0x038c /* v */,
0x0396 /* w */,
0x03a0 /* x */,
0x03aa /* y */,
0x03b5 /* z */,
0x03bf /* braceleft */,
0x03cb /* bar */,
0x03d7 /* braceright */,
0x03e3 /* asciitilde */,
0xffff /* (no glyph) */
};
const struct fb_font font_helvR08 = {
.height = 10,
.ascent = 8,
.firstchar = 32, /* space */
.lastchar = 127, /* ? */
.chardata = font_helvR08_data,
.charoffs = font_helvR08_offsets,
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
#include <fb/font.h>
static const uint8_t font_symbols_data[] = {
/* @ battery - */
/*0000:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0005:*/ 0x60, /* .##..... */
/*0006:*/ 0x40, /* .#...... */
/*0007:*/ 0x40, /* .#...... */
/*0008:*/ 0x40, /* .#...... */
/*0009:*/ 0x40, /* .#...... */
/*000a:*/ 0x40, /* .#...... */
/*000b:*/ 0x40, /* .#...... */
/*000c:*/ 0x60, /* .##..... */
/* A battery empty */
/*000d:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0012:*/ 0xe0, /* ###..... */
/*0013:*/ 0x00, /* ........ */
/*0014:*/ 0x00, /* ........ */
/*0015:*/ 0x00, /* ........ */
/*0016:*/ 0x00, /* ........ */
/*0017:*/ 0x00, /* ........ */
/*0018:*/ 0x00, /* ........ */
/*0019:*/ 0xe0, /* ###..... */
/* B battery full */
/*001a:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*001f:*/ 0xe0, /* ###..... */
/*0020:*/ 0x00, /* ........ */
/*0021:*/ 0xc0, /* ##...... */
/*0022:*/ 0xc0, /* ##...... */
/*0023:*/ 0xc0, /* ##...... */
/*0024:*/ 0xc0, /* ##...... */
/*0025:*/ 0x00, /* ........ */
/*0026:*/ 0xe0, /* ###..... */
/* C battery + */
/*0027:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*002c:*/ 0x80, /* #....... */
/*002d:*/ 0x80, /* #....... */
/*002e:*/ 0xc0, /* ##...... */
/*002f:*/ 0xc0, /* ##...... */
/*0030:*/ 0xc0, /* ##...... */
/*0031:*/ 0xc0, /* ##...... */
/*0032:*/ 0x80, /* #....... */
/*0033:*/ 0x80, /* #....... */
/* D radiation left */
/*0034:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0039:*/ 0x20, /* ..#..... */
/*003a:*/ 0x40, /* .#...... */
/*003b:*/ 0x20, /* ..#..... */
/*003c:*/ 0x00, /* ........ */
/*003d:*/ 0x00, /* ........ */
/*003e:*/ 0x00, /* ........ */
/*003f:*/ 0x00, /* ........ */
/*0040:*/ 0x00, /* ........ */
/* E tower */
/*0041:*/ 5, 5, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0046:*/ 0x20, /* ..#..... */
/*0047:*/ 0x50, /* .#.#.... */
/*0048:*/ 0x20, /* ..#..... */
/*0049:*/ 0x20, /* ..#..... */
/*004a:*/ 0x50, /* .#.#.... */
/*004b:*/ 0x50, /* .#.#.... */
/*004c:*/ 0x88, /* #...#... */
/*004d:*/ 0xf8, /* #####... */
/* F radiation right */
/*004e:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0053:*/ 0x80, /* #....... */
/*0054:*/ 0x40, /* .#...... */
/*0055:*/ 0x80, /* #....... */
/*0056:*/ 0x00, /* ........ */
/*0057:*/ 0x00, /* ........ */
/*0058:*/ 0x00, /* ........ */
/*0059:*/ 0x00, /* ........ */
/*005a:*/ 0x00, /* ........ */
/* G no radiation */
/*005b:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*0060:*/ 0x00, /* ........ */
/*0061:*/ 0x00, /* ........ */
/*0062:*/ 0x00, /* ........ */
/*0063:*/ 0x00, /* ........ */
/*0064:*/ 0x00, /* ........ */
/*0065:*/ 0x00, /* ........ */
/*0066:*/ 0x00, /* ........ */
/*0067:*/ 0x00, /* ........ */
/* H battery loaded */
/*0068:*/ 3, 3, 8, 0, 0, /* width and bbox (w,h,x,y) */
/*006d:*/ 0xe0, /* ###..... */
/*006e:*/ 0x00, /* ........ */
/*006f:*/ 0xe0, /* ###..... */
/*0070:*/ 0xe0, /* ###..... */
/*0071:*/ 0xe0, /* ###..... */
/*0072:*/ 0xe0, /* ###..... */
/*0073:*/ 0x00, /* ........ */
/*0074:*/ 0xe0, /* ###..... */
};
static const uint16_t font_symbols_offsets[] = {
0x0000 /* '@' */,
0x000d /* 'A' */,
0x001a /* 'B' */,
0x0027 /* 'C' */,
0x0034 /* 'D' */,
0x0041 /* 'E' */,
0x004e /* 'F' */,
0x005b /* 'G' */,
0x0068 /* 'H' */,
};
const struct fb_font font_symbols = {
.height = 8,
.ascent = 8,
.firstchar = 64, /* '@' */
.lastchar = 72,
.chardata = font_symbols_data,
.charoffs = font_symbols_offsets,
};

50
src/target/firmware/include/abb/twl3025.h Normal file → Executable file
View File

@ -69,6 +69,56 @@ enum twl3025_reg {
};
#define BULDATA2 BULDATA1
/* available ADC inputs on IOTA */
enum twl3025_dac_inputs {/* === Signal ============================= */
MADC_VBAT=0, /* battery voltage / 4 */
MADC_VCHG=1, /* charger voltage / 5 */
MADC_ICHG=2, /* I-sense amp or CHGREG DAC output */
MADC_VBKP=3, /* backup battery voltage / 4 */
MADC_ADIN1=4, /* VADCID, sense battery type, not used */
MADC_ADIN2=5, /* Temperature sensor in Battery */
MADC_ADIN3=6, /* Mode_detect: sense 2.5mm jack insertion */
MADC_ADIN4=7, /* RITA: TEMP_SEN */
MADC_NUM_CHANNELS=8
};
enum madcstat_reg_bits { /* monitoring ADC status register */
ADCBUSY = 0x01 /* if set, a conversion is currently going on */
};
/* BCICTL1 register bits */
enum bcictl1_reg_bits {
MESBAT = 1<<0, /* connect resistive divider for bat voltage */
DACNBUF = 1<<1, /* bypass DAC buffer */
THSENS0 = 1<<3, /* thermal sensor bias current (ADIN2), bit 0 */
THSENS1 = 1<<4, /* "" bit 1 */
THSENS2 = 1<<5, /* "" bit 2 */
THEN = 1<<6, /* enable thermal sensor bias current (ADIN1) */
TYPEN = 1<<7 /* enable bias current for battery type reading */
};
/* BCICTL1 register bits */
enum bcictl2_reg_bits {
CHEN = 1<<0, /* enable charger */
CHIV = 1<<1, /* 1=constant current, 0=constant voltage */
CHBPASSPA=1<<2, /* full charging of the battery during pulse radio */
CLIB = 1<<3, /* calibrate I-to-V amp (short input pins) */
CHDISPA = 1<<4, /* disabel charging during pulse radio (???) */
LEDC = 1<<5, /* enable LED during charge */
CGAIN4 = 1<<6, /* if set, I-to-V amp gain is reduced from 10 to 4 */
PREOFF = 1<<7 /* disable battery precharge */
};
enum vrpcsts_reg_bits {
ONBSTS = 1<<0, /* button push switched on the mobile */
ONRSTS = 1<<1, /* RPWON terminal switched on the mobile */
ITWSTS = 1<<2, /* ITWAKEUP terminal switched on the mobile */
CHGSTS = 1<<3, /* plugging in charger has switched on the mobile */
ONREFLT= 1<<4, /* state of PWON terminal after debouncing */
ONMRFLT= 1<<5, /* state of RPWON terminal after debouncing */
CHGPRES= 1<<6 /* charger is connected */
};
enum togbr2_bits {
TOGBR2_KEEPR = (1 << 0), /* Clear KEEPON bit */
TOGBR2_KEEPS = (1 << 1), /* Set KEEPON bit */

Some files were not shown because too many files have changed in this diff Show More