Revision 32:cadb9025f1e0

View differences:

fw/Pi/spd_prog_both.c
29 29
int main()
30 30
{
31 31
    int choice = 0;
32
    printf ("\033[22;34m/********************** :) DDR4s Project ************************/\n DDR3/DDR4 SPD read/write tool | (C) Planet, TiN \n Usage: ./spd_prog | $Revision$\n/***********************************************************************/\033[0m\n");
32
    printf ("\033[22;34m\033[34;1m/********************** :) DDR4s Project ************************/\n DDR3/DDR4 SPD read/write tool | (C) Planet, TiN \n Usage: ./spd_prog | $Revision$\n/***********************************************************************/\033[0m\n");
33 33
    printf(" 1: Write DDR3 SPD | 2: Verify DDR3 SPD | 3: Read DDR3 SPD \n 4: Write DDR4 SPD | 5: Verify DDR4 SPD | 6: Read DDR4 SPD with info \n 7. SPD Info \n");
34 34
    printf("\033[22;35mPlease make a selection: \033[0m\n");
35 35
    scanf("%d", &choice);
fw/WiringPi/wiringPi/wiringPiI2C.c
240 240
  if (rev == 1)
241 241
    device = "/dev/i2c-0" ;
242 242
  else
243
    device = "/dev/i2c-1" ;
243
    device = "/dev/i2c-0" ;
244 244

  
245 245
  return wiringPiI2CSetupInterface (device, devId) ;
246 246
}
fw/wiringPi/.git/HEAD
1
ref: refs/heads/master
fw/wiringPi/.git/config
1
[core]
2
	repositoryformatversion = 0
3
	filemode = true
4
	bare = false
5
	logallrefupdates = true
6
[remote "origin"]
7
	url = git://git.drogon.net/wiringPi
8
	fetch = +refs/heads/*:refs/remotes/origin/*
9
[branch "master"]
10
	remote = origin
11
	merge = refs/heads/master
fw/wiringPi/.git/description
1
Unnamed repository; edit this file 'description' to name the repository.
fw/wiringPi/.git/hooks/applypatch-msg.sample
1
#!/bin/sh
2
#
3
# An example hook script to check the commit log message taken by
4
# applypatch from an e-mail message.
5
#
6
# The hook should exit with non-zero status after issuing an
7
# appropriate message if it wants to stop the commit.  The hook is
8
# allowed to edit the commit message file.
9
#
10
# To enable this hook, rename this file to "applypatch-msg".
11

  
12
. git-sh-setup
13
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15
:
fw/wiringPi/.git/hooks/commit-msg.sample
1
#!/bin/sh
2
#
3
# An example hook script to check the commit log message.
4
# Called by "git commit" with one argument, the name of the file
5
# that has the commit message.  The hook should exit with non-zero
6
# status after issuing an appropriate message if it wants to stop the
7
# commit.  The hook is allowed to edit the commit message file.
8
#
9
# To enable this hook, rename this file to "commit-msg".
10

  
11
# Uncomment the below to add a Signed-off-by line to the message.
12
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13
# hook is more suited to it.
14
#
15
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17

  
18
# This example catches duplicate Signed-off-by lines.
19

  
20
test "" = "$(grep '^Signed-off-by: ' "$1" |
21
	 sort | uniq -c | sed -e '/^[ 	]*1[ 	]/d')" || {
22
	echo >&2 Duplicate Signed-off-by lines.
23
	exit 1
24
}
fw/wiringPi/.git/hooks/post-update.sample
1
#!/bin/sh
2
#
3
# An example hook script to prepare a packed repository for use over
4
# dumb transports.
5
#
6
# To enable this hook, rename this file to "post-update".
7

  
8
exec git update-server-info
fw/wiringPi/.git/hooks/pre-applypatch.sample
1
#!/bin/sh
2
#
3
# An example hook script to verify what is about to be committed
4
# by applypatch from an e-mail message.
5
#
6
# The hook should exit with non-zero status after issuing an
7
# appropriate message if it wants to stop the commit.
8
#
9
# To enable this hook, rename this file to "pre-applypatch".
10

  
11
. git-sh-setup
12
precommit="$(git rev-parse --git-path hooks/pre-commit)"
13
test -x "$precommit" && exec "$precommit" ${1+"$@"}
14
:
fw/wiringPi/.git/hooks/pre-commit.sample
1
#!/bin/sh
2
#
3
# An example hook script to verify what is about to be committed.
4
# Called by "git commit" with no arguments.  The hook should
5
# exit with non-zero status after issuing an appropriate message if
6
# it wants to stop the commit.
7
#
8
# To enable this hook, rename this file to "pre-commit".
9

  
10
if git rev-parse --verify HEAD >/dev/null 2>&1
11
then
12
	against=HEAD
13
else
14
	# Initial commit: diff against an empty tree object
15
	against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
16
fi
17

  
18
# If you want to allow non-ASCII filenames set this variable to true.
19
allownonascii=$(git config --bool hooks.allownonascii)
20

  
21
# Redirect output to stderr.
22
exec 1>&2
23

  
24
# Cross platform projects tend to avoid non-ASCII filenames; prevent
25
# them from being added to the repository. We exploit the fact that the
26
# printable range starts at the space character and ends with tilde.
27
if [ "$allownonascii" != "true" ] &&
28
	# Note that the use of brackets around a tr range is ok here, (it's
29
	# even required, for portability to Solaris 10's /usr/bin/tr), since
30
	# the square bracket bytes happen to fall in the designated range.
31
	test $(git diff --cached --name-only --diff-filter=A -z $against |
32
	  LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
33
then
34
	cat <<\EOF
35
Error: Attempt to add a non-ASCII file name.
36

  
37
This can cause problems if you want to work with people on other platforms.
38

  
39
To be portable it is advisable to rename the file.
40

  
41
If you know what you are doing you can disable this check using:
42

  
43
  git config hooks.allownonascii true
44
EOF
45
	exit 1
46
fi
47

  
48
# If there are whitespace errors, print the offending file names and fail.
49
exec git diff-index --check --cached $against --
fw/wiringPi/.git/hooks/pre-push.sample
1
#!/bin/sh
2

  
3
# An example hook script to verify what is about to be pushed.  Called by "git
4
# push" after it has checked the remote status, but before anything has been
5
# pushed.  If this script exits with a non-zero status nothing will be pushed.
6
#
7
# This hook is called with the following parameters:
8
#
9
# $1 -- Name of the remote to which the push is being done
10
# $2 -- URL to which the push is being done
11
#
12
# If pushing without using a named remote those arguments will be equal.
13
#
14
# Information about the commits which are being pushed is supplied as lines to
15
# the standard input in the form:
16
#
17
#   <local ref> <local sha1> <remote ref> <remote sha1>
18
#
19
# This sample shows how to prevent push of commits where the log message starts
20
# with "WIP" (work in progress).
21

  
22
remote="$1"
23
url="$2"
24

  
25
z40=0000000000000000000000000000000000000000
26

  
27
while read local_ref local_sha remote_ref remote_sha
28
do
29
	if [ "$local_sha" = $z40 ]
30
	then
31
		# Handle delete
32
		:
33
	else
34
		if [ "$remote_sha" = $z40 ]
35
		then
36
			# New branch, examine all commits
37
			range="$local_sha"
38
		else
39
			# Update to existing branch, examine new commits
40
			range="$remote_sha..$local_sha"
41
		fi
42

  
43
		# Check for WIP commit
44
		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
45
		if [ -n "$commit" ]
46
		then
47
			echo >&2 "Found WIP commit in $local_ref, not pushing"
48
			exit 1
49
		fi
50
	fi
51
done
52

  
53
exit 0
fw/wiringPi/.git/hooks/pre-rebase.sample
1
#!/bin/sh
2
#
3
# Copyright (c) 2006, 2008 Junio C Hamano
4
#
5
# The "pre-rebase" hook is run just before "git rebase" starts doing
6
# its job, and can prevent the command from running by exiting with
7
# non-zero status.
8
#
9
# The hook is called with the following parameters:
10
#
11
# $1 -- the upstream the series was forked from.
12
# $2 -- the branch being rebased (or empty when rebasing the current branch).
13
#
14
# This sample shows how to prevent topic branches that are already
15
# merged to 'next' branch from getting rebased, because allowing it
16
# would result in rebasing already published history.
17

  
18
publish=next
19
basebranch="$1"
20
if test "$#" = 2
21
then
22
	topic="refs/heads/$2"
23
else
24
	topic=`git symbolic-ref HEAD` ||
25
	exit 0 ;# we do not interrupt rebasing detached HEAD
26
fi
27

  
28
case "$topic" in
29
refs/heads/??/*)
30
	;;
31
*)
32
	exit 0 ;# we do not interrupt others.
33
	;;
34
esac
35

  
36
# Now we are dealing with a topic branch being rebased
37
# on top of master.  Is it OK to rebase it?
38

  
39
# Does the topic really exist?
40
git show-ref -q "$topic" || {
41
	echo >&2 "No such branch $topic"
42
	exit 1
43
}
44

  
45
# Is topic fully merged to master?
46
not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
47
if test -z "$not_in_master"
48
then
49
	echo >&2 "$topic is fully merged to master; better remove it."
50
	exit 1 ;# we could allow it, but there is no point.
51
fi
52

  
53
# Is topic ever merged to next?  If so you should not be rebasing it.
54
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
55
only_next_2=`git rev-list ^master           ${publish} | sort`
56
if test "$only_next_1" = "$only_next_2"
57
then
58
	not_in_topic=`git rev-list "^$topic" master`
59
	if test -z "$not_in_topic"
60
	then
61
		echo >&2 "$topic is already up-to-date with master"
62
		exit 1 ;# we could allow it, but there is no point.
63
	else
64
		exit 0
65
	fi
66
else
67
	not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
68
	/usr/bin/perl -e '
69
		my $topic = $ARGV[0];
70
		my $msg = "* $topic has commits already merged to public branch:\n";
71
		my (%not_in_next) = map {
72
			/^([0-9a-f]+) /;
73
			($1 => 1);
74
		} split(/\n/, $ARGV[1]);
75
		for my $elem (map {
76
				/^([0-9a-f]+) (.*)$/;
77
				[$1 => $2];
78
			} split(/\n/, $ARGV[2])) {
79
			if (!exists $not_in_next{$elem->[0]}) {
80
				if ($msg) {
81
					print STDERR $msg;
82
					undef $msg;
83
				}
84
				print STDERR " $elem->[1]\n";
85
			}
86
		}
87
	' "$topic" "$not_in_next" "$not_in_master"
88
	exit 1
89
fi
90

  
91
<<\DOC_END
92

  
93
This sample hook safeguards topic branches that have been
94
published from being rewound.
95

  
96
The workflow assumed here is:
97

  
98
 * Once a topic branch forks from "master", "master" is never
99
   merged into it again (either directly or indirectly).
100

  
101
 * Once a topic branch is fully cooked and merged into "master",
102
   it is deleted.  If you need to build on top of it to correct
103
   earlier mistakes, a new topic branch is created by forking at
104
   the tip of the "master".  This is not strictly necessary, but
105
   it makes it easier to keep your history simple.
106

  
107
 * Whenever you need to test or publish your changes to topic
108
   branches, merge them into "next" branch.
109

  
110
The script, being an example, hardcodes the publish branch name
111
to be "next", but it is trivial to make it configurable via
112
$GIT_DIR/config mechanism.
113

  
114
With this workflow, you would want to know:
115

  
116
(1) ... if a topic branch has ever been merged to "next".  Young
117
    topic branches can have stupid mistakes you would rather
118
    clean up before publishing, and things that have not been
119
    merged into other branches can be easily rebased without
120
    affecting other people.  But once it is published, you would
121
    not want to rewind it.
122

  
123
(2) ... if a topic branch has been fully merged to "master".
124
    Then you can delete it.  More importantly, you should not
125
    build on top of it -- other people may already want to
126
    change things related to the topic as patches against your
127
    "master", so if you need further changes, it is better to
128
    fork the topic (perhaps with the same name) afresh from the
129
    tip of "master".
130

  
131
Let's look at this example:
132

  
133
		   o---o---o---o---o---o---o---o---o---o "next"
134
		  /       /           /           /
135
		 /   a---a---b A     /           /
136
		/   /               /           /
137
	       /   /   c---c---c---c B         /
138
	      /   /   /             \         /
139
	     /   /   /   b---b C     \       /
140
	    /   /   /   /             \     /
141
    ---o---o---o---o---o---o---o---o---o---o---o "master"
142

  
143

  
144
A, B and C are topic branches.
145

  
146
 * A has one fix since it was merged up to "next".
147

  
148
 * B has finished.  It has been fully merged up to "master" and "next",
149
   and is ready to be deleted.
150

  
151
 * C has not merged to "next" at all.
152

  
153
We would want to allow C to be rebased, refuse A, and encourage
154
B to be deleted.
155

  
156
To compute (1):
157

  
158
	git rev-list ^master ^topic next
159
	git rev-list ^master        next
160

  
161
	if these match, topic has not merged in next at all.
162

  
163
To compute (2):
164

  
165
	git rev-list master..topic
166

  
167
	if this is empty, it is fully merged to "master".
168

  
169
DOC_END
fw/wiringPi/.git/hooks/pre-receive.sample
1
#!/bin/sh
2
#
3
# An example hook script to make use of push options.
4
# The example simply echoes all push options that start with 'echoback='
5
# and rejects all pushes when the "reject" push option is used.
6
#
7
# To enable this hook, rename this file to "pre-receive".
8

  
9
if test -n "$GIT_PUSH_OPTION_COUNT"
10
then
11
	i=0
12
	while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
13
	do
14
		eval "value=\$GIT_PUSH_OPTION_$i"
15
		case "$value" in
16
		echoback=*)
17
			echo "echo from the pre-receive-hook: ${value#*=}" >&2
18
			;;
19
		reject)
20
			exit 1
21
		esac
22
		i=$((i + 1))
23
	done
24
fi
fw/wiringPi/.git/hooks/prepare-commit-msg.sample
1
#!/bin/sh
2
#
3
# An example hook script to prepare the commit log message.
4
# Called by "git commit" with the name of the file that has the
5
# commit message, followed by the description of the commit
6
# message's source.  The hook's purpose is to edit the commit
7
# message file.  If the hook fails with a non-zero status,
8
# the commit is aborted.
9
#
10
# To enable this hook, rename this file to "prepare-commit-msg".
11

  
12
# This hook includes three examples.  The first comments out the
13
# "Conflicts:" part of a merge commit.
14
#
15
# The second includes the output of "git diff --name-status -r"
16
# into the message, just before the "git status" output.  It is
17
# commented because it doesn't cope with --amend or with squashed
18
# commits.
19
#
20
# The third example adds a Signed-off-by line to the message, that can
21
# still be edited.  This is rarely a good idea.
22

  
23
case "$2,$3" in
24
  merge,)
25
    /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
26

  
27
# ,|template,)
28
#   /usr/bin/perl -i.bak -pe '
29
#      print "\n" . `git diff --cached --name-status -r`
30
#	 if /^#/ && $first++ == 0' "$1" ;;
31

  
32
  *) ;;
33
esac
34

  
35
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
36
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
fw/wiringPi/.git/hooks/update.sample
1
#!/bin/sh
2
#
3
# An example hook script to block unannotated tags from entering.
4
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
5
#
6
# To enable this hook, rename this file to "update".
7
#
8
# Config
9
# ------
10
# hooks.allowunannotated
11
#   This boolean sets whether unannotated tags will be allowed into the
12
#   repository.  By default they won't be.
13
# hooks.allowdeletetag
14
#   This boolean sets whether deleting tags will be allowed in the
15
#   repository.  By default they won't be.
16
# hooks.allowmodifytag
17
#   This boolean sets whether a tag may be modified after creation. By default
18
#   it won't be.
19
# hooks.allowdeletebranch
20
#   This boolean sets whether deleting branches will be allowed in the
21
#   repository.  By default they won't be.
22
# hooks.denycreatebranch
23
#   This boolean sets whether remotely creating branches will be denied
24
#   in the repository.  By default this is allowed.
25
#
26

  
27
# --- Command line
28
refname="$1"
29
oldrev="$2"
30
newrev="$3"
31

  
32
# --- Safety check
33
if [ -z "$GIT_DIR" ]; then
34
	echo "Don't run this script from the command line." >&2
35
	echo " (if you want, you could supply GIT_DIR then run" >&2
36
	echo "  $0 <ref> <oldrev> <newrev>)" >&2
37
	exit 1
38
fi
39

  
40
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
41
	echo "usage: $0 <ref> <oldrev> <newrev>" >&2
42
	exit 1
43
fi
44

  
45
# --- Config
46
allowunannotated=$(git config --bool hooks.allowunannotated)
47
allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
48
denycreatebranch=$(git config --bool hooks.denycreatebranch)
49
allowdeletetag=$(git config --bool hooks.allowdeletetag)
50
allowmodifytag=$(git config --bool hooks.allowmodifytag)
51

  
52
# check for no description
53
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
54
case "$projectdesc" in
55
"Unnamed repository"* | "")
56
	echo "*** Project description file hasn't been set" >&2
57
	exit 1
58
	;;
59
esac
60

  
61
# --- Check types
62
# if $newrev is 0000...0000, it's a commit to delete a ref.
63
zero="0000000000000000000000000000000000000000"
64
if [ "$newrev" = "$zero" ]; then
65
	newrev_type=delete
66
else
67
	newrev_type=$(git cat-file -t $newrev)
68
fi
69

  
70
case "$refname","$newrev_type" in
71
	refs/tags/*,commit)
72
		# un-annotated tag
73
		short_refname=${refname##refs/tags/}
74
		if [ "$allowunannotated" != "true" ]; then
75
			echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
76
			echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
77
			exit 1
78
		fi
79
		;;
80
	refs/tags/*,delete)
81
		# delete tag
82
		if [ "$allowdeletetag" != "true" ]; then
83
			echo "*** Deleting a tag is not allowed in this repository" >&2
84
			exit 1
85
		fi
86
		;;
87
	refs/tags/*,tag)
88
		# annotated tag
89
		if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
90
		then
91
			echo "*** Tag '$refname' already exists." >&2
92
			echo "*** Modifying a tag is not allowed in this repository." >&2
93
			exit 1
94
		fi
95
		;;
96
	refs/heads/*,commit)
97
		# branch
98
		if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
99
			echo "*** Creating a branch is not allowed in this repository" >&2
100
			exit 1
101
		fi
102
		;;
103
	refs/heads/*,delete)
104
		# delete branch
105
		if [ "$allowdeletebranch" != "true" ]; then
106
			echo "*** Deleting a branch is not allowed in this repository" >&2
107
			exit 1
108
		fi
109
		;;
110
	refs/remotes/*,commit)
111
		# tracking branch
112
		;;
113
	refs/remotes/*,delete)
114
		# delete tracking branch
115
		if [ "$allowdeletebranch" != "true" ]; then
116
			echo "*** Deleting a tracking branch is not allowed in this repository" >&2
117
			exit 1
118
		fi
119
		;;
120
	*)
121
		# Anything else (is there anything else?)
122
		echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
123
		exit 1
124
		;;
125
esac
126

  
127
# --- Finished
128
exit 0
fw/wiringPi/.git/info/exclude
1
# git ls-files --others --exclude-from=.git/info/exclude
2
# Lines that start with '#' are comments.
3
# For a project mostly in C, the following would be a good set of
4
# exclude patterns (uncomment them if you want to use them):
5
# *.[oa]
6
# *~
fw/wiringPi/.git/logs/HEAD
1
0000000000000000000000000000000000000000 36fb7f187fcb40eb648109dc0fcce40e78b19333 root <root@hydrant_000.(none)> 1555641153 +0000	clone: from git://git.drogon.net/wiringPi
fw/wiringPi/.git/logs/refs/heads/master
1
0000000000000000000000000000000000000000 36fb7f187fcb40eb648109dc0fcce40e78b19333 root <root@hydrant_000.(none)> 1555641153 +0000	clone: from git://git.drogon.net/wiringPi
fw/wiringPi/.git/logs/refs/remotes/origin/HEAD
1
0000000000000000000000000000000000000000 36fb7f187fcb40eb648109dc0fcce40e78b19333 root <root@hydrant_000.(none)> 1555641153 +0000	clone: from git://git.drogon.net/wiringPi
fw/wiringPi/.git/packed-refs
1
# pack-refs with: peeled fully-peeled 
2
36fb7f187fcb40eb648109dc0fcce40e78b19333 refs/remotes/origin/master
3
d79506694d7ba1c3da865d095238289d6175057d refs/tags/2.29
4
bb6f08487cc8025c8e7d0260cfb493f2a07452a5 refs/tags/2.30
5
78b5c323b74de782df58ee558c249e4e4fadd25f refs/tags/2.31
6
b0a60c3302973ca1878d149d61f2f612c8f27fac refs/tags/2.32
7
b1dfc186efe327aa1d59de43ef631a2fa24e7c95 refs/tags/2.36
8
e77ee78b4d51ce2c85180a70c84c58c74b687600 refs/tags/2.38
9
e77ee78b4d51ce2c85180a70c84c58c74b687600 refs/tags/2.39
10
70fa99a127ff150ee2b0975afe5be9547ddb44e3 refs/tags/2.40
11
e8da87fbaced1edf75a5b37f78e8d4eb5ec0f18d refs/tags/2.42
12
e8da87fbaced1edf75a5b37f78e8d4eb5ec0f18d refs/tags/2.44
13
2533eac7b288c5d28cafd0aa83b244d2245482f8 refs/tags/2.46
14
^8d188fa0e00bb8c6ff6eddd07bf92857e9bd533a
15
8d188fa0e00bb8c6ff6eddd07bf92857e9bd533a refs/tags/2.50
fw/wiringPi/.git/refs/heads/master
1
36fb7f187fcb40eb648109dc0fcce40e78b19333
fw/wiringPi/.git/refs/remotes/origin/HEAD
1
ref: refs/remotes/origin/master
fw/wiringPi/.gitignore
1
*.o
2
*.so
3
lib*.so.*
4
*~
5
debian-template/wiringPi
6
debian-template/wiringpi-*.deb
7
gpio/gpio
fw/wiringPi/COPYING.LESSER
1
                   GNU LESSER GENERAL PUBLIC LICENSE
2
                       Version 3, 29 June 2007
3

  
4
 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
 Everyone is permitted to copy and distribute verbatim copies
6
 of this license document, but changing it is not allowed.
7

  
8

  
9
  This version of the GNU Lesser General Public License incorporates
10
the terms and conditions of version 3 of the GNU General Public
11
License, supplemented by the additional permissions listed below.
12

  
13
  0. Additional Definitions.
14

  
15
  As used herein, "this License" refers to version 3 of the GNU Lesser
16
General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
General Public License.
18

  
19
  "The Library" refers to a covered work governed by this License,
20
other than an Application or a Combined Work as defined below.
21

  
22
  An "Application" is any work that makes use of an interface provided
23
by the Library, but which is not otherwise based on the Library.
24
Defining a subclass of a class defined by the Library is deemed a mode
25
of using an interface provided by the Library.
26

  
27
  A "Combined Work" is a work produced by combining or linking an
28
Application with the Library.  The particular version of the Library
29
with which the Combined Work was made is also called the "Linked
30
Version".
31

  
32
  The "Minimal Corresponding Source" for a Combined Work means the
33
Corresponding Source for the Combined Work, excluding any source code
34
for portions of the Combined Work that, considered in isolation, are
35
based on the Application, and not on the Linked Version.
36

  
37
  The "Corresponding Application Code" for a Combined Work means the
38
object code and/or source code for the Application, including any data
39
and utility programs needed for reproducing the Combined Work from the
40
Application, but excluding the System Libraries of the Combined Work.
41

  
42
  1. Exception to Section 3 of the GNU GPL.
43

  
44
  You may convey a covered work under sections 3 and 4 of this License
45
without being bound by section 3 of the GNU GPL.
46

  
47
  2. Conveying Modified Versions.
48

  
49
  If you modify a copy of the Library, and, in your modifications, a
50
facility refers to a function or data to be supplied by an Application
51
that uses the facility (other than as an argument passed when the
52
facility is invoked), then you may convey a copy of the modified
53
version:
54

  
55
   a) under this License, provided that you make a good faith effort to
56
   ensure that, in the event an Application does not supply the
57
   function or data, the facility still operates, and performs
58
   whatever part of its purpose remains meaningful, or
59

  
60
   b) under the GNU GPL, with none of the additional permissions of
61
   this License applicable to that copy.
62

  
63
  3. Object Code Incorporating Material from Library Header Files.
64

  
65
  The object code form of an Application may incorporate material from
66
a header file that is part of the Library.  You may convey such object
67
code under terms of your choice, provided that, if the incorporated
68
material is not limited to numerical parameters, data structure
69
layouts and accessors, or small macros, inline functions and templates
70
(ten or fewer lines in length), you do both of the following:
71

  
72
   a) Give prominent notice with each copy of the object code that the
73
   Library is used in it and that the Library and its use are
74
   covered by this License.
75

  
76
   b) Accompany the object code with a copy of the GNU GPL and this license
77
   document.
78

  
79
  4. Combined Works.
80

  
81
  You may convey a Combined Work under terms of your choice that,
82
taken together, effectively do not restrict modification of the
83
portions of the Library contained in the Combined Work and reverse
84
engineering for debugging such modifications, if you also do each of
85
the following:
86

  
87
   a) Give prominent notice with each copy of the Combined Work that
88
   the Library is used in it and that the Library and its use are
89
   covered by this License.
90

  
91
   b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
   document.
93

  
94
   c) For a Combined Work that displays copyright notices during
95
   execution, include the copyright notice for the Library among
96
   these notices, as well as a reference directing the user to the
97
   copies of the GNU GPL and this license document.
98

  
99
   d) Do one of the following:
100

  
101
       0) Convey the Minimal Corresponding Source under the terms of this
102
       License, and the Corresponding Application Code in a form
103
       suitable for, and under terms that permit, the user to
104
       recombine or relink the Application with a modified version of
105
       the Linked Version to produce a modified Combined Work, in the
106
       manner specified by section 6 of the GNU GPL for conveying
107
       Corresponding Source.
108

  
109
       1) Use a suitable shared library mechanism for linking with the
110
       Library.  A suitable mechanism is one that (a) uses at run time
111
       a copy of the Library already present on the user's computer
112
       system, and (b) will operate properly with a modified version
113
       of the Library that is interface-compatible with the Linked
114
       Version.
115

  
116
   e) Provide Installation Information, but only if you would otherwise
117
   be required to provide such information under section 6 of the
118
   GNU GPL, and only to the extent that such information is
119
   necessary to install and execute a modified version of the
120
   Combined Work produced by recombining or relinking the
121
   Application with a modified version of the Linked Version. (If
122
   you use option 4d0, the Installation Information must accompany
123
   the Minimal Corresponding Source and Corresponding Application
124
   Code. If you use option 4d1, you must provide the Installation
125
   Information in the manner specified by section 6 of the GNU GPL
126
   for conveying Corresponding Source.)
127

  
128
  5. Combined Libraries.
129

  
130
  You may place library facilities that are a work based on the
131
Library side by side in a single library together with other library
132
facilities that are not Applications and are not covered by this
133
License, and convey such a combined library under terms of your
134
choice, if you do both of the following:
135

  
136
   a) Accompany the combined library with a copy of the same work based
137
   on the Library, uncombined with any other library facilities,
138
   conveyed under the terms of this License.
139

  
140
   b) Give prominent notice with the combined library that part of it
141
   is a work based on the Library, and explaining where to find the
142
   accompanying uncombined form of the same work.
143

  
144
  6. Revised Versions of the GNU Lesser General Public License.
145

  
146
  The Free Software Foundation may publish revised and/or new versions
147
of the GNU Lesser General Public License from time to time. Such new
148
versions will be similar in spirit to the present version, but may
149
differ in detail to address new problems or concerns.
150

  
151
  Each version is given a distinguishing version number. If the
152
Library as you received it specifies that a certain numbered version
153
of the GNU Lesser General Public License "or any later version"
154
applies to it, you have the option of following the terms and
155
conditions either of that published version or of any later version
156
published by the Free Software Foundation. If the Library as you
157
received it does not specify a version number of the GNU Lesser
158
General Public License, you may choose any version of the GNU Lesser
159
General Public License ever published by the Free Software Foundation.
160

  
161
  If the Library as you received it specifies that a proxy can decide
162
whether future versions of the GNU Lesser General Public License shall
163
apply, that proxy's public statement of acceptance of any version is
164
permanent authorization for you to choose that version for the
165
Library.
fw/wiringPi/INSTALL
1

  
2
How to install wiringPi
3
=======================
4

  
5
The easiest way is to use the supplied 'build' script:
6

  
7
  ./build
8

  
9
that should do a complete install or upgrade of wiringPi for you.
10

  
11
That will install a dynamic library.
12

  
13
Some distributions do not have /usr/local/lib in the default LD_LIBRARY_PATH. To
14
fix this, you need to edit /etc/ld.so.conf and add in a single line:
15

  
16
  /usr/local/lib
17

  
18
then run the ldconfig command.
19

  
20
  sudo ldconfig
21

  
22
To un-install wiringPi:
23

  
24
  ./build uninstall
25

  
26
Gordon Henderson
27

  
28
projects@drogon.net
29
https://projects.drogon.net/
fw/wiringPi/People
1

  
2
Just a quick note to some people who've provided help, suggestions,
3
bug-fixes, etc. along the way...
4

  
5
Nick Lott: (And others)
6
  Hints about making it work with C++
7

  
8
Philipp Stefan Neininger:
9
  Minor bug in the Makefile to do with cross compiling
10

  
11
Chris McSweeny
12
  Hints and tips about the use of arithmetic in gettimeofday()
13
    inside the dealyMicrosecondsHard() function.
14
  And spotting a couple of schoolboy errors in the (experimental)
15
  softServo code, prompting me to completely re-write it.
16

  
17
Armin (Via projects website)
18
  Some pointers about the i2c-dev.h files.
19

  
20
Arno Wagner
21
  Suggestions for the mmap calls in wiringPiSetup()
22

  
23
CHARLES Thibaut:
24
  A small issue in softTone
25

  
26
Xian Stannard
27
  Fixing some typos in the man page!
28

  
29
Andre Crone
30
  Suggested the __WIRING_PI.H__ round wiringPi.h
31

  
32
Rik Teerling
33
  Pointing out some silly mistooks in the I2C code...
fw/wiringPi/README.TXT
1

  
2
wiringPi README
3
===============
4

  
5
Please note that the official way to get wiringPi is via git from
6
git.drogon.net and not GitHub.
7

  
8
ie.
9

  
10
  git clone git://git.drogon.net/wiringPi
11

  
12
The version of wiringPi held on GitHub by "Gadgetoid" is used to build the
13
wiringPython, Ruby, Perl, etc. wrappers for these other languages. This
14
version may lag the official Drogon release.  Pull requests may not be
15
accepted to Github....
16

  
17
Please see
18

  
19
  http://wiringpi.com/
20

  
21
for the official documentation, etc. and the best way to submit bug reports, etc.
22
is by sending an email to projects@drogon.net
23

  
24
Thanks!
25

  
26
  -Gordon
fw/wiringPi/VERSION
1
2.50
fw/wiringPi/build
1
#!/bin/sh -e
2

  
3
# build
4
#	Simple wiringPi build and install script
5
#
6
#	Copyright (c) 2012-2015 Gordon Henderson
7
#################################################################################
8
# This file is part of wiringPi:
9
#	A "wiring" library for the Raspberry Pi
10
#
11
#    wiringPi is free software: you can redistribute it and/or modify
12
#    it under the terms of the GNU Lesser General Public License as published by
13
#    the Free Software Foundation, either version 3 of the License, or
14
#    (at your option) any later version.
15
#
16
#    wiringPi is distributed in the hope that it will be useful,
17
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
#    GNU Lesser General Public License for more details.
20
#
21
#    You should have received a copy of the GNU Lesser General Public License
22
#    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
23
#################################################################################
24
#
25
# wiringPi is designed to run on a Raspberry Pi only.
26
#	However if you're clever enough to actually look at this script to
27
#	see why it's not building for you, then good luck.
28
#
29
#	To everyone else: Stop using cheap alternatives. Support the
30
#	Raspberry Pi Foundation	as they're the only ones putting money
31
#	back into education!
32
#################################################################################
33

  
34
check_make_ok() {
35
  if [ $? != 0 ]; then
36
    echo ""
37
    echo "Make Failed..."
38
    echo "Please check the messages and fix any problems. If you're still stuck,"
39
    echo "then please email all the output and as many details as you can to"
40
    echo "  projects@drogon.net"
41
    echo ""
42
    exit 1
43
  fi
44
}
45

  
46
sudo=${WIRINGPI_SUDO-sudo}
47

  
48
if [ x$1 = "xclean" ]; then
49
  cd wiringPi
50
  echo -n "wiringPi:   "	; make clean
51
  cd ../devLib
52
  echo -n "DevLib:     "	; make clean
53
  cd ../gpio
54
  echo -n "gpio:       "	; make clean
55
  cd ../examples
56
  echo -n "Examples:   "	; make clean
57
  cd Gertboard
58
  echo -n "Gertboard:  "	; make clean
59
  cd ../PiFace
60
  echo -n "PiFace:     "	; make clean
61
  cd ../q2w
62
  echo -n "Quick2Wire: "	; make clean
63
  cd ../PiGlow
64
  echo -n "PiGlow:     "	; make clean
65
  cd ../scrollPhat
66
  echo -n "scrollPhat: "	; make clean
67
  cd ../..
68
  echo -n "Deb: " ; rm  -f debian-template/wiringpi*.deb
69
  echo
70
  exit
71
fi
72

  
73
if [ x$1 = "xuninstall" ]; then
74
  cd wiringPi
75
  echo -n "wiringPi: " ; $sudo make uninstall
76
  cd ../devLib
77
  echo -n "DevLib:   " ; $sudo make uninstall
78
  cd ../gpio
79
  echo -n "gpio:     " ; $sudo make uninstall
80
  exit
81
fi
82

  
83
# Only if you know what you're doing!
84

  
85
if [ x$1 = "xdebian" ]; then
86
  here=`pwd`
87
  cd debian-template/wiringPi
88
  rm -rf usr
89
  cd $here/wiringPi
90
  make install-deb
91
  cd $here/devLib
92
  make install-deb INCLUDE='-I. -I../wiringPi'
93
  cd $here/gpio
94
  make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib
95
  cd $here/debian-template
96
  fakeroot dpkg-deb --build wiringPi
97
  mv wiringPi.deb  wiringpi-`cat $here/VERSION`-1.deb
98
  exit
99
fi
100

  
101
if [ x$1 != "x" ]; then
102
  echo "Usage: $0 [clean | uninstall]"
103
  exit 1
104
fi
105

  
106
  echo "wiringPi Build script"
107
  echo "====================="
108
  echo
109

  
110
  hardware=`fgrep Hardware /proc/cpuinfo | head -1 | awk '{ print $3 }'`
111

  
112
#  if [ x$hardware != "xBCM2708" ]; then
113
#    echo ""
114
#    echo "   +------------------------------------------------------------+"
115
#    echo "   |   wiringPi is designed to run on the Raspberry Pi only.    |"
116
#    echo "   |   This processor does not appear to be a Raspberry Pi.     |"
117
#    echo "   +------------------------------------------------------------+"
118
#    echo "   | In the unlikely event that you think it is a Raspberry Pi, |"
119
#    echo "   | then please accept my apologies and email the contents of  |"
120
#    echo "   | /proc/cpuinfo to projects@drogon.net.                      |"
121
#    echo "   |    - Thanks, Gordon                                        |"
122
#    echo "   +------------------------------------------------------------+"
123
#    echo ""
124
#    exit 1
125
#  fi
126

  
127

  
128
  echo
129
  echo "WiringPi Library"
130
  cd wiringPi
131
  $sudo make uninstall
132
  if [ x$1 = "xstatic" ]; then
133
    make -j5 static
134
    check_make_ok
135
    $sudo make install-static
136
  else
137
    make -j5
138
    check_make_ok
139
    $sudo make install
140
  fi
141
  check_make_ok
142

  
143
  echo
144
  echo "WiringPi Devices Library"
145
  cd ../devLib
146
  $sudo make uninstall
147
  if [ x$1 = "xstatic" ]; then
148
    make -j5 static
149
    check_make_ok
150
    $sudo make install-static
151
  else
152
    make -j5
153
    check_make_ok
154
    $sudo make install
155
  fi
156
  check_make_ok
157

  
158
  echo
159
  echo "GPIO Utility"
160
  cd ../gpio
161
  make -j5
162
  check_make_ok
163
  $sudo make install
164
  check_make_ok
165

  
166
# echo
167
# echo "wiringPi Daemon"
168
# cd ../wiringPiD
169
# make -j5
170
# check_make_ok
171
# $sudo make install
172
# check_make_ok
173

  
174
# echo
175
# echo "Examples"
176
# cd ../examples
177
# make
178
# cd ..
179

  
180
echo
181
echo All Done.
182
echo ""
183
echo "NOTE: To compile programs with wiringPi, you need to add:"
184
echo "    -lwiringPi"
185
echo "  to your compile line(s) To use the Gertboard, MaxDetect, etc."
186
echo "  code (the devLib), you need to also add:"
187
echo "    -lwiringPiDev"
188
echo "  to your compile line(s)."
189
echo ""
fw/wiringPi/debian-template/wiringPi/DEBIAN/control
1
Package: wiringpi
2
Version: 2.50
3
Section: libraries
4
Priority: optional
5
Architecture: armhf
6
Depends: libc6
7
Maintainer: Gordon Henderson <projects@drogon.net>
8
Description: The wiringPi libraries, headers and gpio command
9
  Libraries to allow GPIO access on a Raspberry Pi from C and C++
10
  and BASIC programs as well as from the command-line
fw/wiringPi/debian-template/wiringPi/DEBIAN/postinst
1
#!/bin/sh
2
set -e
3
/bin/chown root.root	/usr/bin/gpio
4
/bin/chmod 4755		/usr/bin/gpio
5
/sbin/ldconfig
fw/wiringPi/debian-template/wiringPi/DEBIAN/postrm
1
#!/bin/sh
2
/sbin/ldconfig
fw/wiringPi/debian/.gitignore
1
*.debhelper.log
2
*.substvars
3
tmp
4
wiringpi
5
libwiringpi2
6
libwiringpi-dev
7
files
8
*.postinst.debhelper
9
*.postrm.debhelper
fw/wiringPi/debian/changelog
1
wiringpi (2.26~iwj) rpi-unstable; urgency=low
2

  
3
  * Initial version with real Debian source package build.
4

  
5
 -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Sat, 12 Sep 2015 18:31:35 +0100
6

  
fw/wiringPi/debian/compat
1
8
fw/wiringPi/debian/control
1
Source: wiringpi
2
Section: electronics
3
Priority: optional
4
Maintainer: Ian Jackson <ijackson@chiark.greenend.org.uk>
5
Standards-Version: 3.8.0
6
Homepage: http://wiringpi.com/
7
Build-Depends: debhelper (>= 8)
8

  
9
Package: libwiringpi2
10
Section: libs
11
Architecture: armhf
12
Depends: ${shlibs:Depends}, ${misc:Depends}
13
Description: GPIO librariees for Raspberry Pi (runtime).
14
 Runtime for the popular wiringPi library.
15

  
16
Package: wiringpi
17
Architecture: armhf
18
Depends: ${shlibs:Depends}, ${misc:Depends}
19
Description: gpio utility for Raspberry Pi
20
 The wiringPi gpio command line utility, for GPIO access on a
21
 Raspberry Pi from the command line.
22

  
23
Package: libwiringpi-dev
24
Architecture: armhf
25
Depends: libwiringpi2 (= ${binary:Version}), libc6-dev, ${misc:Depends}
26
Suggests: wiringpi
27
Description: GPIO development library for Raspberry Pi
28
 Development libraries to allow GPIO access on a Raspberry Pi from C
29
 and C++ programs.
fw/wiringPi/debian/copyright
1
wiringPi is Copyright (C) 2012-2015 Gordon Henderson.
2

  
3
wiringPi is free software; you can redistribute it and/or modify it
4
under the terms of the GNU Lesser General Public License, as published
5
by the Free Software Foundation, either version 3 of the License, or
6
(at your option) any later version.
7

  
8
wiringPi is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
GNU Lesser General Public License for more details.
12

  
13
On all Debian and Raspbian systems, a copy of the GNU Lesser General
14
Public License version 3 can be found in
15
`/usr/share/common-licenses/LGPL-3'.
fw/wiringPi/debian/libwiringpi-dev.dirs
1
usr/lib
2
usr/include
fw/wiringPi/debian/libwiringpi-dev.install
1
debian/tmp/usr/include
2
debian/tmp/usr/lib/*.so
3
examples		usr/share/doc/libwiringpi-dev
fw/wiringPi/debian/libwiringpi2.install
1
debian/tmp/usr/lib/lib*.so.*
fw/wiringPi/debian/libwiringpi2.shlibs
1
libwiringPi 2 libwiringpi2
2
libwiringPiDev 2 libwiringpi2
fw/wiringPi/debian/rules
1
#!/usr/bin/make -f
2

  
3
.PHONY: build
4

  
5
VERSION:=$(shell cat VERSION)
6
export VERSION
7

  
8
soname:=$(shell echo $${VERSION%%.*})
9
WIRINGPI_SONAME_SUFFIX:=.$(soname)
10
export soname
11
export WIRINGPI_SONAME_SUFFIX
12

  
13
build:
14
	dh $@
15

  
16
override_dh_auto_configure:
17

  
18
override_dh_prep:
19
	dh_prep -Xdebian/tmp
20

  
21
dirs:
22
	dh_installdirs -A
23
	mkdir debian/tmp
24
	set -e; for p in `dh_listpackages`; do \
25
		(cd debian/$$p; find -type d) | \
26
		(cd debian/tmp; xargs mkdir -p) \
27
	done
28

  
29
override_dh_clean:
30
	dh_clean
31
	WIRINGPI_SUDO= bash -xe ./build clean
32

  
33
override_dh_auto_build: dirs
34
	V=1 LDCONFIG=: WIRINGPI_SUDO= WIRINGPI_SUID=0 \
35
	    DESTDIR=`pwd`/debian/tmp/usr \
36
	    PREFIX= WIRINGPI_SUDO= \
37
	    bash -xe ./build
38

  
39
override_dh_auto_install:
40
	dh_install
41
	set -ex; for l in libwiringPi libwiringPiDev; do \
42
		ln -sf $$l.so.$${VERSION} \
43
			debian/libwiringpi$$soname/usr/lib/$$l.so.$$soname; \
44
		ln -sf $$l.so.$${VERSION} \
45
			debian/libwiringpi-dev/usr/lib/$$l.so; \
46
	done
47

  
48
%:
49
	dh $@
fw/wiringPi/debian/wiringpi.dirs
1
usr/bin
fw/wiringPi/debian/wiringpi.install
1
debian/tmp/usr/bin
2
debian/tmp/usr/man	usr/share
3
README.TXT		usr/share/doc/wiringpi
4
People			usr/share/doc/wiringpi
fw/wiringPi/devLib/Makefile
1
#
2
# Makefile:
3
#	wiringPi device - A "wiring" library for the Raspberry Pi
4
#
5
#	Copyright (c) 2012-2016 Gordon Henderson
6
#################################################################################
7
# This file is part of wiringPi:
8
#	https://projects.drogon.net/raspberry-pi/wiringpi/
9
#
10
#    wiringPi is free software: you can redistribute it and/or modify
11
#    it under the terms of the GNU Lesser General Public License as published by
12
#    the Free Software Foundation, either version 3 of the License, or
13
#    (at your option) any later version.
14
#
15
#    wiringPi is distributed in the hope that it will be useful,
16
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
#    GNU Lesser General Public License for more details.
19
#
20
#    You should have received a copy of the GNU Lesser General Public License
21
#    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
#################################################################################
23

  
24
VERSION=$(shell cat ../VERSION)
25
DESTDIR?=/usr
26
PREFIX?=/local
27

  
28
LDCONFIG?=ldconfig
29

  
30
ifneq ($V,1)
31
Q ?= @
32
endif
33

  
34
STATIC=libwiringPiDev.a
35
DYNAMIC=libwiringPiDev.so.$(VERSION)
36

  
37
#DEBUG	= -g -O0
38
DEBUG	= -O2
39
INCLUDE	= -I.
40
DEFS	= -D_GNU_SOURCE
41
CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
42

  
43
LIBS    =
44

  
45
###############################################################################
46

  
47
SRC	=	ds1302.c maxdetect.c  piNes.c		\
48
		gertboard.c piFace.c			\
49
		lcd128x64.c lcd.c			\
50
		scrollPhat.c				\
51
		piGlow.c
52

  
53
OBJ	=	$(SRC:.c=.o)
54

  
55
HEADERS	=	ds1302.h gertboard.h  lcd128x64.h  lcd.h  maxdetect.h piFace.h  piGlow.h  piNes.h\
56
		scrollPhat.h
57

  
58
all:		$(DYNAMIC)
59

  
60
static:		$(STATIC)
61

  
62
$(STATIC):	$(OBJ)
63
	$Q echo "[Link (Static)]"
64
	$Q ar rcs $(STATIC) $(OBJ)
65
	$Q ranlib $(STATIC)
66
#	@size   $(STATIC)
67

  
68
$(DYNAMIC):	$(OBJ)
69
	$Q echo "[Link (Dynamic)]"
70
	$Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
71

  
72
.c.o:
73
	$Q echo [Compile] $<
74
	$Q $(CC) -c $(CFLAGS) $< -o $@
75

  
76
.PHONY:	clean
77
clean:
78
	$Q echo "[Clean]"
79
	$Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
80

  
81
.PHONY:	tags
82
tags:	$(SRC)
83
	$Q echo [ctags]
84
	$Q ctags $(SRC)
85

  
86

  
87
.PHONY:	install
88
install:	$(DYNAMIC)
89
	$Q echo "[Install Headers]"
90
	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
91
	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
92
	$Q echo "[Install Dynamic Lib]"
93
	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
94
	$Q install -m 0755 libwiringPiDev.so.$(VERSION)			$(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
95
	$Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)	$(DESTDIR)/lib/libwiringPiDev.so
96
	$Q $(LDCONFIG)
97

  
98
.PHONY:	install-static
99
install-static:	$(STATIC)
100
	$Q echo "[Install Headers]"
101
	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/include
102
	$Q install -m 0644 $(HEADERS)					$(DESTDIR)$(PREFIX)/include
103
	$Q echo "[Install Static Lib]"
104
	$Q install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
105
	$Q install -m 0755 libwiringPiDev.a				$(DESTDIR)$(PREFIX)/lib
106

  
107
.PHONY:	install-deb
108
install-deb:	$(DYNAMIC)
109
	$Q echo "[Install Headers: deb]"
110
	$Q install -m 0755 -d							~/wiringPi/debian-template/wiringPi/usr/include
111
	$Q install -m 0644 $(HEADERS)						~/wiringPi/debian-template/wiringPi/usr/include
112
	$Q echo "[Install Dynamic Lib: deb]"
113
	install -m 0755 -d							~/wiringPi/debian-template/wiringPi/usr/lib
114
	install -m 0755 libwiringPiDev.so.$(VERSION)				~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
115
	ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)	~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so
116

  
117
.PHONY:	uninstall
118
uninstall:
119
	$Q echo "[UnInstall]"
120
	$Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
121
	$Q cd $(DESTDIR)$(PREFIX)/lib/     && rm -f libwiringPiDev.*
122
	$Q $(LDCONFIG)
123

  
124

  
125
.PHONY:	depend
126
depend:
127
	makedepend -Y $(SRC)
128

  
129
# DO NOT DELETE
130

  
131
ds1302.o: ds1302.h
132
maxdetect.o: maxdetect.h
133
piNes.o: piNes.h
134
gertboard.o: gertboard.h
135
piFace.o: piFace.h
136
lcd128x64.o: font.h lcd128x64.h
137
lcd.o: lcd.h
138
scrollPhat.o: scrollPhatFont.h scrollPhat.h
139
piGlow.o: piGlow.h
fw/wiringPi/devLib/ds1302.c
1
/*
2
 * ds1302.c:
3
 *	Real Time clock
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#include <stdio.h>
26
#include <stdlib.h>
27
#include <stdint.h>
28
#include <stdarg.h>
29

  
30
#include <wiringPi.h>
31

  
32
#include "ds1302.h"
33

  
34
// Register defines
35

  
36
#define	RTC_SECS	 0
37
#define	RTC_MINS	 1
38
#define	RTC_HOURS	 2
39
#define	RTC_DATE	 3
40
#define	RTC_MONTH	 4
41
#define	RTC_DAY		 5
42
#define	RTC_YEAR	 6
43
#define	RTC_WP		 7
44
#define	RTC_TC		 8
45
#define	RTC_BM		31
46

  
47

  
48
// Locals
49

  
50
static int dPin, cPin, sPin ;
51

  
52
/*
53
 * dsShiftIn:
54
 *	Shift a number in from the chip, LSB first. Note that the data is
55
 *	sampled on the trailing edge of the last clock, so it's valid immediately.
56
 *********************************************************************************
57
 */
58

  
59
static unsigned int dsShiftIn (void)
60
{
61
  uint8_t value = 0 ;
62
  int i ;
63

  
64
  pinMode (dPin, INPUT) ;	delayMicroseconds (1) ;
65

  
66
  for (i = 0 ; i < 8 ; ++i)
67
  {
68
    value |= (digitalRead (dPin) << i) ;
69
    digitalWrite (cPin, HIGH) ; delayMicroseconds (1) ;
70
    digitalWrite (cPin, LOW) ;	delayMicroseconds (1) ;
71
  }
72

  
73
  return value;
74
}
75

  
76

  
77
/*
78
 * dsShiftOut:
79
 *	A normal LSB-first shift-out, just slowed down a bit - the Pi is
80
 *	a bit faster than the chip can handle.
81
 *********************************************************************************
82
 */
83

  
84
static void dsShiftOut (unsigned int data)
85
{
86
  int i ;
87

  
88
  pinMode (dPin, OUTPUT) ;
89

  
90
  for (i = 0 ; i < 8 ; ++i)
91
  {
92
    digitalWrite (dPin, data & (1 << i)) ;	delayMicroseconds (1) ;
93
    digitalWrite (cPin, HIGH) ;			delayMicroseconds (1) ;
94
    digitalWrite (cPin, LOW) ;			delayMicroseconds (1) ;
95
  }
96
}
97

  
98

  
99
/*
100
 * ds1302regRead: ds1302regWrite:
101
 *	Read/Write a value to an RTC Register or RAM location on the chip
102
 *********************************************************************************
103
 */
104

  
105
static unsigned int ds1302regRead (const int reg)
106
{
107
  unsigned int data ;
108

  
109
  digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
110
    dsShiftOut (reg) ;
111
    data = dsShiftIn () ;
112
  digitalWrite (sPin, LOW)  ; delayMicroseconds (1) ;
113

  
114
  return data ;
115
}
116

  
117
static void ds1302regWrite (const int reg, const unsigned int data)
118
{
119
  digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
120
    dsShiftOut (reg) ;
121
    dsShiftOut (data) ;
122
  digitalWrite (sPin, LOW)  ; delayMicroseconds (1) ;
123
}
124

  
125

  
126
/*
127
 * ds1302rtcWrite: ds1302rtcRead:
128
 *	Writes/Reads the data to/from the RTC register
129
 *********************************************************************************
130
 */
131

  
132
unsigned int ds1302rtcRead (const int reg)
133
{
134
  return ds1302regRead (0x81 | ((reg & 0x1F) << 1)) ;
135
}
136

  
137
void ds1302rtcWrite (int reg, unsigned int data)
138
{
139
  ds1302regWrite (0x80 | ((reg & 0x1F) << 1), data) ;
140
}
141

  
142

  
143
/*
144
 * ds1302ramWrite: ds1302ramRead:
145
 *	Writes/Reads the data to/from the RTC register
146
 *********************************************************************************
147
 */
148

  
149
unsigned int ds1302ramRead (const int addr)
150
{
151
  return ds1302regRead (0xC1 | ((addr & 0x1F) << 1)) ;
152
}
153

  
154
void ds1302ramWrite (const int addr, const unsigned int data)
155
{
156
  ds1302regWrite ( 0xC0 | ((addr & 0x1F) << 1), data) ;
157
}
158

  
159
/*
160
 * ds1302clockRead:
161
 *	Read all 8 bytes of the clock in a single operation
162
 *********************************************************************************
163
 */
164

  
165
void ds1302clockRead (int clockData [8])
166
{
167
  int i ;
168
  unsigned int regVal = 0x81 | ((RTC_BM & 0x1F) << 1) ;
169

  
170
  digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
171

  
172
  dsShiftOut (regVal) ;
173
  for (i = 0 ; i < 8 ; ++i)
174
    clockData [i] = dsShiftIn () ;
175

  
176
  digitalWrite (sPin, LOW) ;  delayMicroseconds (1) ;
177
}
178

  
179

  
180
/*
181
 * ds1302clockWrite:
182
 *	Write all 8 bytes of the clock in a single operation
183
 *********************************************************************************
184
 */
185

  
186
void ds1302clockWrite (const int clockData [8])
187
{
188
  int i ;
189
  unsigned int regVal = 0x80 | ((RTC_BM & 0x1F) << 1) ;
190

  
191
  digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
192

  
193
  dsShiftOut (regVal) ;
194
  for (i = 0 ; i < 8 ; ++i)
195
    dsShiftOut (clockData [i]) ;
196

  
197
  digitalWrite (sPin, LOW) ;  delayMicroseconds (1) ;
198
}
199

  
200

  
201
/*
202
 * ds1302trickleCharge:
203
 *	Set the bits on the trickle charger.
204
 *	Probably best left alone...
205
 *********************************************************************************
206
 */
207

  
208
void ds1302trickleCharge (const int diodes, const int resistors)
209
{
210
  if (diodes + resistors == 0)
211
    ds1302rtcWrite (RTC_TC, 0x5C) ;	// Disabled
212
  else
213
    ds1302rtcWrite (RTC_TC, 0xA0 | ((diodes & 3) << 2) | (resistors & 3)) ;
214
}
215

  
216

  
217

  
218

  
219
/*
220
 * ds1302setup:
221
 *	Initialise the chip & remember the pins we're using
222
 *********************************************************************************
223
 */
224

  
225
void ds1302setup (const int clockPin, const int dataPin, const int csPin)
226
{
227
  dPin = dataPin ;
228
  cPin = clockPin ;
229
  sPin = csPin ;
230

  
231
  digitalWrite (dPin, LOW) ;
232
  digitalWrite (cPin, LOW) ;
233
  digitalWrite (sPin, LOW) ;
234

  
235
  pinMode (dPin, OUTPUT) ;
236
  pinMode (cPin, OUTPUT) ;
237
  pinMode (sPin, OUTPUT) ;
238

  
239
  ds1302rtcWrite (RTC_WP, 0) ;	// Remove write-protect
240
}
fw/wiringPi/devLib/ds1302.h
1
/*
2
 * ds1302.h:
3
 *	Real Time clock
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#ifdef __cplusplus
26
extern "C" {
27
#endif
28

  
29
extern unsigned int ds1302rtcRead       (const int reg) ;
30
extern void         ds1302rtcWrite      (const int reg, const unsigned int data) ;
31

  
32
extern unsigned int ds1302ramRead       (const int addr) ;
33
extern void         ds1302ramWrite      (const int addr, const unsigned int data) ;
34

  
35
extern void         ds1302clockRead     (int clockData [8]) ;
36
extern void         ds1302clockWrite    (const int clockData [8]) ;
37

  
38
extern void         ds1302trickleCharge (const int diodes, const int resistors) ;
39

  
40
extern void         ds1302setup         (const int clockPin, const int dataPin, const int csPin) ;
41

  
42
#ifdef __cplusplus
43
}
44
#endif
fw/wiringPi/devLib/font.h
1
/**********************************************/
2
/*                                            */
3
/*       Font file generated by cpi2fnt       */
4
/*       ------------------------------       */
5
/*       Combined with the alpha-numeric      */
6
/*       portion of Greg Harp's old PEARL     */
7
/*       font (from earlier versions of       */
8
/*       linux-m86k) by John Shifflett        */
9
/*                                            */
10
/**********************************************/
11

  
12
static const int fontHeight = 8 ;
13
static const int fontWidth  = 8 ;
14

  
15
static unsigned char font [] =
16
{
17
   /* 0 0x00 '^@' */
18
   0x00, /* 00000000 */
19
   0x00, /* 00000000 */
20
   0x00, /* 00000000 */
21
   0x00, /* 00000000 */
22
   0x00, /* 00000000 */
23
   0x00, /* 00000000 */
24
   0x00, /* 00000000 */
25
   0x00, /* 00000000 */
26

  
27
   /* 1 0x01 '^A' */
28
   0x7e, /* 01111110 */
29
   0x81, /* 10000001 */
30
   0xa5, /* 10100101 */
31
   0x81, /* 10000001 */
32
   0xbd, /* 10111101 */
33
   0x99, /* 10011001 */
34
   0x81, /* 10000001 */
35
   0x7e, /* 01111110 */
36

  
37
   /* 2 0x02 '^B' */
38
   0x7e, /* 01111110 */
39
   0xff, /* 11111111 */
40
   0xdb, /* 11011011 */
41
   0xff, /* 11111111 */
42
   0xc3, /* 11000011 */
43
   0xe7, /* 11100111 */
44
   0xff, /* 11111111 */
45
   0x7e, /* 01111110 */
46

  
47
   /* 3 0x03 '^C' */
48
   0x6c, /* 01101100 */
49
   0xfe, /* 11111110 */
50
   0xfe, /* 11111110 */
51
   0xfe, /* 11111110 */
52
   0x7c, /* 01111100 */
53
   0x38, /* 00111000 */
54
   0x10, /* 00010000 */
55
   0x00, /* 00000000 */
56

  
57
   /* 4 0x04 '^D' */
58
   0x10, /* 00010000 */
59
   0x38, /* 00111000 */
60
   0x7c, /* 01111100 */
61
   0xfe, /* 11111110 */
62
   0x7c, /* 01111100 */
63
   0x38, /* 00111000 */
64
   0x10, /* 00010000 */
65
   0x00, /* 00000000 */
66

  
67
   /* 5 0x05 '^E' */
68
   0x38, /* 00111000 */
69
   0x7c, /* 01111100 */
70
   0x38, /* 00111000 */
71
   0xfe, /* 11111110 */
72
   0xfe, /* 11111110 */
73
   0xd6, /* 11010110 */
74
   0x10, /* 00010000 */
75
   0x38, /* 00111000 */
76

  
77
   /* 6 0x06 '^F' */
78
   0x10, /* 00010000 */
79
   0x38, /* 00111000 */
80
   0x7c, /* 01111100 */
81
   0xfe, /* 11111110 */
82
   0xfe, /* 11111110 */
83
   0x7c, /* 01111100 */
84
   0x10, /* 00010000 */
85
   0x38, /* 00111000 */
86

  
87
   /* 7 0x07 '^G' */
88
   0x00, /* 00000000 */
89
   0x00, /* 00000000 */
90
   0x18, /* 00011000 */
91
   0x3c, /* 00111100 */
92
   0x3c, /* 00111100 */
93
   0x18, /* 00011000 */
94
   0x00, /* 00000000 */
95
   0x00, /* 00000000 */
96

  
97
   /* 8 0x08 '^H' */
98
   0xff, /* 11111111 */
99
   0xff, /* 11111111 */
100
   0xe7, /* 11100111 */
101
   0xc3, /* 11000011 */
102
   0xc3, /* 11000011 */
103
   0xe7, /* 11100111 */
104
   0xff, /* 11111111 */
105
   0xff, /* 11111111 */
106

  
107
   /* 9 0x09 '^I' */
108
   0x00, /* 00000000 */
109
   0x3c, /* 00111100 */
110
   0x66, /* 01100110 */
111
   0x42, /* 01000010 */
112
   0x42, /* 01000010 */
113
   0x66, /* 01100110 */
114
   0x3c, /* 00111100 */
115
   0x00, /* 00000000 */
116

  
117
   /* 10 0x0a '^J' */
118
   0xff, /* 11111111 */
119
   0xc3, /* 11000011 */
120
   0x99, /* 10011001 */
121
   0xbd, /* 10111101 */
122
   0xbd, /* 10111101 */
123
   0x99, /* 10011001 */
124
   0xc3, /* 11000011 */
125
   0xff, /* 11111111 */
126

  
127
   /* 11 0x0b '^K' */
128
   0x0f, /* 00001111 */
129
   0x07, /* 00000111 */
130
   0x0f, /* 00001111 */
131
   0x7d, /* 01111101 */
132
   0xcc, /* 11001100 */
133
   0xcc, /* 11001100 */
134
   0xcc, /* 11001100 */
135
   0x78, /* 01111000 */
136

  
137
   /* 12 0x0c '^L' */
138
   0x3c, /* 00111100 */
139
   0x66, /* 01100110 */
140
   0x66, /* 01100110 */
141
   0x66, /* 01100110 */
142
   0x3c, /* 00111100 */
143
   0x18, /* 00011000 */
144
   0x7e, /* 01111110 */
145
   0x18, /* 00011000 */
146

  
147
   /* 13 0x0d '^M' */
148
   0x3f, /* 00111111 */
149
   0x33, /* 00110011 */
150
   0x3f, /* 00111111 */
151
   0x30, /* 00110000 */
152
   0x30, /* 00110000 */
153
   0x70, /* 01110000 */
154
   0xf0, /* 11110000 */
155
   0xe0, /* 11100000 */
156

  
157
   /* 14 0x0e '^N' */
158
   0x7f, /* 01111111 */
159
   0x63, /* 01100011 */
160
   0x7f, /* 01111111 */
161
   0x63, /* 01100011 */
162
   0x63, /* 01100011 */
163
   0x67, /* 01100111 */
164
   0xe6, /* 11100110 */
165
   0xc0, /* 11000000 */
166

  
167
   /* 15 0x0f '^O' */
168
   0x18, /* 00011000 */
169
   0xdb, /* 11011011 */
170
   0x3c, /* 00111100 */
171
   0xe7, /* 11100111 */
172
   0xe7, /* 11100111 */
173
   0x3c, /* 00111100 */
174
   0xdb, /* 11011011 */
175
   0x18, /* 00011000 */
176

  
177
   /* 16 0x10 '^P' */
178
   0x80, /* 10000000 */
179
   0xe0, /* 11100000 */
180
   0xf8, /* 11111000 */
181
   0xfe, /* 11111110 */
182
   0xf8, /* 11111000 */
183
   0xe0, /* 11100000 */
184
   0x80, /* 10000000 */
185
   0x00, /* 00000000 */
186

  
187
   /* 17 0x11 '^Q' */
188
   0x02, /* 00000010 */
189
   0x0e, /* 00001110 */
190
   0x3e, /* 00111110 */
191
   0xfe, /* 11111110 */
192
   0x3e, /* 00111110 */
193
   0x0e, /* 00001110 */
194
   0x02, /* 00000010 */
195
   0x00, /* 00000000 */
196

  
197
   /* 18 0x12 '^R' */
198
   0x18, /* 00011000 */
199
   0x3c, /* 00111100 */
200
   0x7e, /* 01111110 */
201
   0x18, /* 00011000 */
202
   0x18, /* 00011000 */
203
   0x7e, /* 01111110 */
204
   0x3c, /* 00111100 */
205
   0x18, /* 00011000 */
206

  
207
   /* 19 0x13 '^S' */
208
   0x66, /* 01100110 */
209
   0x66, /* 01100110 */
210
   0x66, /* 01100110 */
211
   0x66, /* 01100110 */
212
   0x66, /* 01100110 */
213
   0x00, /* 00000000 */
214
   0x66, /* 01100110 */
215
   0x00, /* 00000000 */
216

  
217
   /* 20 0x14 '^T' */
218
   0x7f, /* 01111111 */
219
   0xdb, /* 11011011 */
220
   0xdb, /* 11011011 */
221
   0x7b, /* 01111011 */
222
   0x1b, /* 00011011 */
223
   0x1b, /* 00011011 */
224
   0x1b, /* 00011011 */
225
   0x00, /* 00000000 */
226

  
227
   /* 21 0x15 '^U' */
228
   0x3e, /* 00111110 */
229
   0x61, /* 01100001 */
230
   0x3c, /* 00111100 */
231
   0x66, /* 01100110 */
232
   0x66, /* 01100110 */
233
   0x3c, /* 00111100 */
234
   0x86, /* 10000110 */
235
   0x7c, /* 01111100 */
236

  
237
   /* 22 0x16 '^V' */
238
   0x00, /* 00000000 */
239
   0x00, /* 00000000 */
240
   0x00, /* 00000000 */
241
   0x00, /* 00000000 */
242
   0x7e, /* 01111110 */
243
   0x7e, /* 01111110 */
244
   0x7e, /* 01111110 */
245
   0x00, /* 00000000 */
246

  
247
   /* 23 0x17 '^W' */
248
   0x18, /* 00011000 */
249
   0x3c, /* 00111100 */
250
   0x7e, /* 01111110 */
251
   0x18, /* 00011000 */
252
   0x7e, /* 01111110 */
253
   0x3c, /* 00111100 */
254
   0x18, /* 00011000 */
255
   0xff, /* 11111111 */
256

  
257
   /* 24 0x18 '^X' */
258
   0x18, /* 00011000 */
259
   0x3c, /* 00111100 */
260
   0x7e, /* 01111110 */
261
   0x18, /* 00011000 */
262
   0x18, /* 00011000 */
263
   0x18, /* 00011000 */
264
   0x18, /* 00011000 */
265
   0x00, /* 00000000 */
266

  
267
   /* 25 0x19 '^Y' */
268
   0x18, /* 00011000 */
269
   0x18, /* 00011000 */
270
   0x18, /* 00011000 */
271
   0x18, /* 00011000 */
272
   0x7e, /* 01111110 */
273
   0x3c, /* 00111100 */
274
   0x18, /* 00011000 */
275
   0x00, /* 00000000 */
276

  
277
   /* 26 0x1a '^Z' */
278
   0x00, /* 00000000 */
279
   0x18, /* 00011000 */
280
   0x0c, /* 00001100 */
281
   0xfe, /* 11111110 */
282
   0x0c, /* 00001100 */
283
   0x18, /* 00011000 */
284
   0x00, /* 00000000 */
285
   0x00, /* 00000000 */
286

  
287
   /* 27 0x1b '^[' */
288
   0x00, /* 00000000 */
289
   0x30, /* 00110000 */
290
   0x60, /* 01100000 */
291
   0xfe, /* 11111110 */
292
   0x60, /* 01100000 */
293
   0x30, /* 00110000 */
294
   0x00, /* 00000000 */
295
   0x00, /* 00000000 */
296

  
297
   /* 28 0x1c '^\' */
298
   0x00, /* 00000000 */
299
   0x00, /* 00000000 */
300
   0xc0, /* 11000000 */
301
   0xc0, /* 11000000 */
302
   0xc0, /* 11000000 */
303
   0xfe, /* 11111110 */
304
   0x00, /* 00000000 */
305
   0x00, /* 00000000 */
306

  
307
   /* 29 0x1d '^]' */
308
   0x00, /* 00000000 */
309
   0x24, /* 00100100 */
310
   0x66, /* 01100110 */
311
   0xff, /* 11111111 */
312
   0x66, /* 01100110 */
313
   0x24, /* 00100100 */
314
   0x00, /* 00000000 */
315
   0x00, /* 00000000 */
316

  
317
   /* 30 0x1e '^^' */
318
   0x00, /* 00000000 */
319
   0x18, /* 00011000 */
320
   0x3c, /* 00111100 */
321
   0x7e, /* 01111110 */
322
   0xff, /* 11111111 */
323
   0xff, /* 11111111 */
324
   0x00, /* 00000000 */
325
   0x00, /* 00000000 */
326

  
327
   /* 31 0x1f '^_' */
328
   0x00, /* 00000000 */
329
   0xff, /* 11111111 */
330
   0xff, /* 11111111 */
331
   0x7e, /* 01111110 */
332
   0x3c, /* 00111100 */
333
   0x18, /* 00011000 */
334
   0x00, /* 00000000 */
335
   0x00, /* 00000000 */
336

  
337
   /* 32 0x20 ' ' */
338
   0x00, /* 00000000 */
339
   0x00, /* 00000000 */
340
   0x00, /* 00000000 */
341
   0x00, /* 00000000 */
342
   0x00, /* 00000000 */
343
   0x00, /* 00000000 */
344
   0x00, /* 00000000 */
345
   0x00, /* 00000000 */
346

  
347
   /* 33 0x21 '!' */
348
   0x18, /* 00011000 */
349
   0x3c, /* 00111100 */
350
   0x3c, /* 00111100 */
351
   0x3c, /* 00111100 */
352
   0x18, /* 00011000 */
353
   0x00, /* 00000000 */
354
   0x18, /* 00011000 */
355
   0x00, /* 00000000 */
356

  
357
   /* 34 0x22 '"' */
358
   0x6c, /* 01101100 */
359
   0x6c, /* 01101100 */
360
   0x00, /* 00000000 */
361
   0x00, /* 00000000 */
362
   0x00, /* 00000000 */
363
   0x00, /* 00000000 */
364
   0x00, /* 00000000 */
365
   0x00, /* 00000000 */
366

  
367
   /* 35 0x23 '#' */
368
   0x6c, /* 01101100 */
369
   0x6c, /* 01101100 */
370
   0xfe, /* 11111110 */
371
   0x6c, /* 01101100 */
372
   0xfe, /* 11111110 */
373
   0x6c, /* 01101100 */
374
   0x6c, /* 01101100 */
375
   0x00, /* 00000000 */
376

  
377
   /* 36 0x24 '$' */
378
   0x18, /* 00011000 */
379
   0x3e, /* 00111110 */
380
   0x60, /* 01100000 */
381
   0x3c, /* 00111100 */
382
   0x06, /* 00000110 */
383
   0x7c, /* 01111100 */
384
   0x18, /* 00011000 */
385
   0x00, /* 00000000 */
386

  
387
   /* 37 0x25 '%' */
388
   0x00, /* 00000000 */
389
   0xc6, /* 11000110 */
390
   0xcc, /* 11001100 */
391
   0x18, /* 00011000 */
392
   0x30, /* 00110000 */
393
   0x66, /* 01100110 */
394
   0xc6, /* 11000110 */
395
   0x00, /* 00000000 */
396

  
397
   /* 38 0x26 '&' */
398
   0x38, /* 00111000 */
399
   0x6c, /* 01101100 */
400
   0x68, /* 01101000 */
401
   0x76, /* 01110110 */
402
   0xdc, /* 11011100 */
403
   0xcc, /* 11001100 */
404
   0x76, /* 01110110 */
405
   0x00, /* 00000000 */
406

  
407
   /* 39 0x27 ''' */
408
   0x18, /* 00011000 */
409
   0x18, /* 00011000 */
410
   0x30, /* 00110000 */
411
   0x00, /* 00000000 */
412
   0x00, /* 00000000 */
413
   0x00, /* 00000000 */
414
   0x00, /* 00000000 */
415
   0x00, /* 00000000 */
416

  
417
   /* 40 0x28 '(' */
418
   0x0c, /* 00001100 */
419
   0x18, /* 00011000 */
420
   0x30, /* 00110000 */
421
   0x30, /* 00110000 */
422
   0x30, /* 00110000 */
423
   0x18, /* 00011000 */
424
   0x0c, /* 00001100 */
425
   0x00, /* 00000000 */
426

  
427
   /* 41 0x29 ')' */
428
   0x30, /* 00110000 */
429
   0x18, /* 00011000 */
430
   0x0c, /* 00001100 */
431
   0x0c, /* 00001100 */
432
   0x0c, /* 00001100 */
433
   0x18, /* 00011000 */
434
   0x30, /* 00110000 */
435
   0x00, /* 00000000 */
436

  
437
   /* 42 0x2a '*' */
438
   0x00, /* 00000000 */
439
   0x66, /* 01100110 */
440
   0x3c, /* 00111100 */
441
   0xff, /* 11111111 */
442
   0x3c, /* 00111100 */
443
   0x66, /* 01100110 */
444
   0x00, /* 00000000 */
445
   0x00, /* 00000000 */
446

  
447
   /* 43 0x2b '+' */
448
   0x00, /* 00000000 */
449
   0x18, /* 00011000 */
450
   0x18, /* 00011000 */
451
   0x7e, /* 01111110 */
452
   0x18, /* 00011000 */
453
   0x18, /* 00011000 */
454
   0x00, /* 00000000 */
455
   0x00, /* 00000000 */
456

  
457
   /* 44 0x2c ',' */
458
   0x00, /* 00000000 */
459
   0x00, /* 00000000 */
460
   0x00, /* 00000000 */
461
   0x00, /* 00000000 */
462
   0x00, /* 00000000 */
463
   0x18, /* 00011000 */
464
   0x18, /* 00011000 */
465
   0x30, /* 00110000 */
466

  
467
   /* 45 0x2d '-' */
468
   0x00, /* 00000000 */
469
   0x00, /* 00000000 */
470
   0x00, /* 00000000 */
471
   0x7e, /* 01111110 */
472
   0x00, /* 00000000 */
473
   0x00, /* 00000000 */
474
   0x00, /* 00000000 */
475
   0x00, /* 00000000 */
476

  
477
   /* 46 0x2e '.' */
478
   0x00, /* 00000000 */
479
   0x00, /* 00000000 */
480
   0x00, /* 00000000 */
481
   0x00, /* 00000000 */
482
   0x00, /* 00000000 */
483
   0x18, /* 00011000 */
484
   0x18, /* 00011000 */
485
   0x00, /* 00000000 */
486

  
487
   /* 47 0x2f '/' */
488
   0x03, /* 00000011 */
489
   0x06, /* 00000110 */
490
   0x0c, /* 00001100 */
491
   0x18, /* 00011000 */
492
   0x30, /* 00110000 */
493
   0x60, /* 01100000 */
494
   0xc0, /* 11000000 */
495
   0x00, /* 00000000 */
496

  
497
   /* 48 0x30 '0' */
498
   0x7c, /* 01111100 */
499
   0xc6, /* 11000110 */
500
   0xde, /* 11011110 */
501
   0xfe, /* 11111110 */
502
   0xf6, /* 11110110 */
503
   0xc6, /* 11000110 */
504
   0x7c, /* 01111100 */
505
   0x00, /* 00000000 */
506

  
507
   /* 49 0x31 '1' */
508
   0x18, /* 00011000 */
509
   0x78, /* 01111000 */
510
   0x18, /* 00011000 */
511
   0x18, /* 00011000 */
512
   0x18, /* 00011000 */
513
   0x18, /* 00011000 */
514
   0x18, /* 00011000 */
515
   0x00, /* 00000000 */
516

  
517
   /* 50 0x32 '2' */
518
   0x7c, /* 01111100 */
519
   0xc6, /* 11000110 */
520
   0x0c, /* 00001100 */
521
   0x18, /* 00011000 */
522
   0x30, /* 00110000 */
523
   0x60, /* 01100000 */
524
   0xfe, /* 11111110 */
525
   0x00, /* 00000000 */
526

  
527
   /* 51 0x33 '3' */
528
   0x7c, /* 01111100 */
529
   0xc6, /* 11000110 */
530
   0x06, /* 00000110 */
531
   0x1c, /* 00011100 */
532
   0x06, /* 00000110 */
533
   0xc6, /* 11000110 */
534
   0x7c, /* 01111100 */
535
   0x00, /* 00000000 */
536

  
537
   /* 52 0x34 '4' */
538
   0x1c, /* 00011100 */
539
   0x3c, /* 00111100 */
540
   0x6c, /* 01101100 */
541
   0xcc, /* 11001100 */
542
   0xfe, /* 11111110 */
543
   0x0c, /* 00001100 */
544
   0x0c, /* 00001100 */
545
   0x00, /* 00000000 */
546

  
547
   /* 53 0x35 '5' */
548
   0xfe, /* 11111110 */
549
   0xc0, /* 11000000 */
550
   0xfc, /* 11111100 */
551
   0x06, /* 00000110 */
552
   0x06, /* 00000110 */
553
   0xc6, /* 11000110 */
554
   0x7c, /* 01111100 */
555
   0x00, /* 00000000 */
556

  
557
   /* 54 0x36 '6' */
558
   0x38, /* 00111000 */
559
   0x60, /* 01100000 */
560
   0xc0, /* 11000000 */
561
   0xfc, /* 11111100 */
562
   0xc6, /* 11000110 */
563
   0xc6, /* 11000110 */
564
   0x7c, /* 01111100 */
565
   0x00, /* 00000000 */
566

  
567
   /* 55 0x37 '7' */
568
   0xfe, /* 11111110 */
569
   0x06, /* 00000110 */
570
   0x0c, /* 00001100 */
571
   0x18, /* 00011000 */
572
   0x30, /* 00110000 */
573
   0x60, /* 01100000 */
574
   0x60, /* 01100000 */
575
   0x00, /* 00000000 */
576

  
577
   /* 56 0x38 '8' */
578
   0x7c, /* 01111100 */
579
   0xc6, /* 11000110 */
580
   0xc6, /* 11000110 */
581
   0x7c, /* 01111100 */
582
   0xc6, /* 11000110 */
583
   0xc6, /* 11000110 */
584
   0x7c, /* 01111100 */
585
   0x00, /* 00000000 */
586

  
587
   /* 57 0x39 '9' */
588
   0x7c, /* 01111100 */
589
   0xc6, /* 11000110 */
590
   0xc6, /* 11000110 */
591
   0x7e, /* 01111110 */
592
   0x06, /* 00000110 */
593
   0x0c, /* 00001100 */
594
   0x38, /* 00111000 */
595
   0x00, /* 00000000 */
596

  
597
   /* 58 0x3a ':' */
598
   0x00, /* 00000000 */
599
   0x18, /* 00011000 */
600
   0x18, /* 00011000 */
601
   0x00, /* 00000000 */
602
   0x00, /* 00000000 */
603
   0x18, /* 00011000 */
604
   0x18, /* 00011000 */
605
   0x00, /* 00000000 */
606

  
607
   /* 59 0x3b ';' */
608
   0x00, /* 00000000 */
609
   0x18, /* 00011000 */
610
   0x18, /* 00011000 */
611
   0x00, /* 00000000 */
612
   0x00, /* 00000000 */
613
   0x18, /* 00011000 */
614
   0x18, /* 00011000 */
615
   0x30, /* 00110000 */
616

  
617
   /* 60 0x3c '<' */
618
   0x0c, /* 00001100 */
619
   0x18, /* 00011000 */
620
   0x30, /* 00110000 */
621
   0x60, /* 01100000 */
622
   0x30, /* 00110000 */
623
   0x18, /* 00011000 */
624
   0x0c, /* 00001100 */
625
   0x00, /* 00000000 */
626

  
627
   /* 61 0x3d '=' */
628
   0x00, /* 00000000 */
629
   0x00, /* 00000000 */
630
   0x7e, /* 01111110 */
631
   0x00, /* 00000000 */
632
   0x00, /* 00000000 */
633
   0x7e, /* 01111110 */
634
   0x00, /* 00000000 */
635
   0x00, /* 00000000 */
636

  
637
   /* 62 0x3e '>' */
638
   0x30, /* 00110000 */
639
   0x18, /* 00011000 */
640
   0x0c, /* 00001100 */
641
   0x06, /* 00000110 */
642
   0x0c, /* 00001100 */
643
   0x18, /* 00011000 */
644
   0x30, /* 00110000 */
645
   0x00, /* 00000000 */
646

  
647
   /* 63 0x3f '?' */
648
   0x3c, /* 00111100 */
649
   0x66, /* 01100110 */
650
   0x06, /* 00000110 */
651
   0x0c, /* 00001100 */
652
   0x18, /* 00011000 */
653
   0x00, /* 00000000 */
654
   0x18, /* 00011000 */
655
   0x00, /* 00000000 */
656

  
657
   /* 64 0x40 '@' */
658
   0x7c, /* 01111100 */
659
   0xc6, /* 11000110 */
660
   0xde, /* 11011110 */
661
   0xde, /* 11011110 */
662
   0xde, /* 11011110 */
663
   0xc0, /* 11000000 */
664
   0x7c, /* 01111100 */
665
   0x00, /* 00000000 */
666

  
667
   /* 65 0x41 'A' */
668
   0x10, /* 00010000 */
669
   0x38, /* 00111000 */
670
   0x6c, /* 01101100 */
671
   0xc6, /* 11000110 */
672
   0xfe, /* 11111110 */
673
   0xc6, /* 11000110 */
674
   0xc6, /* 11000110 */
675
   0x00, /* 00000000 */
676

  
677
   /* 66 0x42 'B' */
678
   0xfc, /* 11111100 */
679
   0xc6, /* 11000110 */
680
   0xc6, /* 11000110 */
681
   0xfc, /* 11111100 */
682
   0xc6, /* 11000110 */
683
   0xc6, /* 11000110 */
684
   0xfc, /* 11111100 */
685
   0x00, /* 00000000 */
686

  
687
   /* 67 0x43 'C' */
688
   0x7c, /* 01111100 */
689
   0xc6, /* 11000110 */
690
   0xc0, /* 11000000 */
691
   0xc0, /* 11000000 */
692
   0xc0, /* 11000000 */
693
   0xc6, /* 11000110 */
694
   0x7c, /* 01111100 */
695
   0x00, /* 00000000 */
696

  
697
   /* 68 0x44 'D' */
698
   0xfc, /* 11111100 */
699
   0xc6, /* 11000110 */
700
   0xc6, /* 11000110 */
701
   0xc6, /* 11000110 */
702
   0xc6, /* 11000110 */
703
   0xc6, /* 11000110 */
704
   0xfc, /* 11111100 */
705
   0x00, /* 00000000 */
706

  
707
   /* 69 0x45 'E' */
708
   0xfe, /* 11111110 */
709
   0xc0, /* 11000000 */
710
   0xc0, /* 11000000 */
711
   0xf8, /* 11111000 */
712
   0xc0, /* 11000000 */
713
   0xc0, /* 11000000 */
714
   0xfe, /* 11111110 */
715
   0x00, /* 00000000 */
716

  
717
   /* 70 0x46 'F' */
718
   0xfe, /* 11111110 */
719
   0xc0, /* 11000000 */
720
   0xc0, /* 11000000 */
721
   0xf8, /* 11111000 */
722
   0xc0, /* 11000000 */
723
   0xc0, /* 11000000 */
724
   0xc0, /* 11000000 */
725
   0x00, /* 00000000 */
726

  
727
   /* 71 0x47 'G' */
728
   0x7c, /* 01111100 */
729
   0xc6, /* 11000110 */
730
   0xc0, /* 11000000 */
731
   0xce, /* 11001110 */
732
   0xc6, /* 11000110 */
733
   0xc6, /* 11000110 */
734
   0x7c, /* 01111100 */
735
   0x00, /* 00000000 */
736

  
737
   /* 72 0x48 'H' */
738
   0xc6, /* 11000110 */
739
   0xc6, /* 11000110 */
740
   0xc6, /* 11000110 */
741
   0xfe, /* 11111110 */
742
   0xc6, /* 11000110 */
743
   0xc6, /* 11000110 */
744
   0xc6, /* 11000110 */
745
   0x00, /* 00000000 */
746

  
747
   /* 73 0x49 'I' */
748
   0x7e, /* 01111110 */
749
   0x18, /* 00011000 */
750
   0x18, /* 00011000 */
751
   0x18, /* 00011000 */
752
   0x18, /* 00011000 */
753
   0x18, /* 00011000 */
754
   0x7e, /* 01111110 */
755
   0x00, /* 00000000 */
756

  
757
   /* 74 0x4a 'J' */
758
   0x06, /* 00000110 */
759
   0x06, /* 00000110 */
760
   0x06, /* 00000110 */
761
   0x06, /* 00000110 */
762
   0xc6, /* 11000110 */
763
   0xc6, /* 11000110 */
764
   0x7c, /* 01111100 */
765
   0x00, /* 00000000 */
766

  
767
   /* 75 0x4b 'K' */
768
   0xc6, /* 11000110 */
769
   0xcc, /* 11001100 */
770
   0xd8, /* 11011000 */
771
   0xf0, /* 11110000 */
772
   0xd8, /* 11011000 */
773
   0xcc, /* 11001100 */
774
   0xc6, /* 11000110 */
775
   0x00, /* 00000000 */
776

  
777
   /* 76 0x4c 'L' */
778
   0xc0, /* 11000000 */
779
   0xc0, /* 11000000 */
780
   0xc0, /* 11000000 */
781
   0xc0, /* 11000000 */
782
   0xc0, /* 11000000 */
783
   0xc0, /* 11000000 */
784
   0xfe, /* 11111110 */
785
   0x00, /* 00000000 */
786

  
787
   /* 77 0x4d 'M' */
788
   0x82, /* 10000010 */
789
   0xc6, /* 11000110 */
790
   0xee, /* 11101110 */
791
   0xfe, /* 11111110 */
792
   0xd6, /* 11010110 */
793
   0xc6, /* 11000110 */
794
   0xc6, /* 11000110 */
795
   0x00, /* 00000000 */
796

  
797
   /* 78 0x4e 'N' */
798
   0xc6, /* 11000110 */
799
   0xe6, /* 11100110 */
800
   0xf6, /* 11110110 */
801
   0xde, /* 11011110 */
802
   0xce, /* 11001110 */
803
   0xc6, /* 11000110 */
804
   0xc6, /* 11000110 */
805
   0x00, /* 00000000 */
806

  
807
   /* 79 0x4f 'O' */
808
   0x7c, /* 01111100 */
809
   0xc6, /* 11000110 */
810
   0xc6, /* 11000110 */
811
   0xc6, /* 11000110 */
812
   0xc6, /* 11000110 */
813
   0xc6, /* 11000110 */
814
   0x7c, /* 01111100 */
815
   0x00, /* 00000000 */
816

  
817
   /* 80 0x50 'P' */
818
   0xfc, /* 11111100 */
819
   0xc6, /* 11000110 */
820
   0xc6, /* 11000110 */
821
   0xfc, /* 11111100 */
822
   0xc0, /* 11000000 */
823
   0xc0, /* 11000000 */
824
   0xc0, /* 11000000 */
825
   0x00, /* 00000000 */
826

  
827
   /* 81 0x51 'Q' */
828
   0x7c, /* 01111100 */
829
   0xc6, /* 11000110 */
830
   0xc6, /* 11000110 */
831
   0xc6, /* 11000110 */
832
   0xf6, /* 11110110 */
833
   0xde, /* 11011110 */
834
   0x7c, /* 01111100 */
835
   0x06, /* 00000110 */
836

  
837
   /* 82 0x52 'R' */
838
   0xfc, /* 11111100 */
839
   0xc6, /* 11000110 */
840
   0xc6, /* 11000110 */
841
   0xfc, /* 11111100 */
842
   0xd8, /* 11011000 */
843
   0xcc, /* 11001100 */
844
   0xc6, /* 11000110 */
845
   0x00, /* 00000000 */
846

  
847
   /* 83 0x53 'S' */
848
   0x7c, /* 01111100 */
849
   0xc6, /* 11000110 */
850
   0x60, /* 01100000 */
851
   0x38, /* 00111000 */
852
   0x0c, /* 00001100 */
853
   0xc6, /* 11000110 */
854
   0x7c, /* 01111100 */
855
   0x00, /* 00000000 */
856

  
857
   /* 84 0x54 'T' */
858
   0x7e, /* 01111110 */
859
   0x18, /* 00011000 */
860
   0x18, /* 00011000 */
861
   0x18, /* 00011000 */
862
   0x18, /* 00011000 */
863
   0x18, /* 00011000 */
864
   0x18, /* 00011000 */
865
   0x00, /* 00000000 */
866

  
867
   /* 85 0x55 'U' */
868
   0xc6, /* 11000110 */
869
   0xc6, /* 11000110 */
870
   0xc6, /* 11000110 */
871
   0xc6, /* 11000110 */
872
   0xc6, /* 11000110 */
873
   0xc6, /* 11000110 */
874
   0x7c, /* 01111100 */
875
   0x00, /* 00000000 */
876

  
877
   /* 86 0x56 'V' */
878
   0xc3, /* 11000011 */
879
   0xc3, /* 11000011 */
880
   0x66, /* 01100110 */
881
   0x66, /* 01100110 */
882
   0x3c, /* 00111100 */
883
   0x3c, /* 00111100 */
884
   0x18, /* 00011000 */
885
   0x00, /* 00000000 */
886

  
887
   /* 87 0x57 'W' */
888
   0xc6, /* 11000110 */
889
   0xc6, /* 11000110 */
890
   0xc6, /* 11000110 */
891
   0xd6, /* 11010110 */
892
   0xfe, /* 11111110 */
893
   0xee, /* 11101110 */
894
   0xc6, /* 11000110 */
895
   0x00, /* 00000000 */
896

  
897
   /* 88 0x58 'X' */
898
   0xc3, /* 11000011 */
899
   0x66, /* 01100110 */
900
   0x3c, /* 00111100 */
901
   0x18, /* 00011000 */
902
   0x3c, /* 00111100 */
903
   0x66, /* 01100110 */
904
   0xc3, /* 11000011 */
905
   0x00, /* 00000000 */
906

  
907
   /* 89 0x59 'Y' */
908
   0xc3, /* 11000011 */
909
   0xc3, /* 11000011 */
910
   0x66, /* 01100110 */
911
   0x3c, /* 00111100 */
912
   0x18, /* 00011000 */
913
   0x18, /* 00011000 */
914
   0x18, /* 00011000 */
915
   0x00, /* 00000000 */
916

  
917
   /* 90 0x5a 'Z' */
918
   0xfe, /* 11111110 */
919
   0x06, /* 00000110 */
920
   0x0c, /* 00001100 */
921
   0x18, /* 00011000 */
922
   0x30, /* 00110000 */
923
   0x60, /* 01100000 */
924
   0xfe, /* 11111110 */
925
   0x00, /* 00000000 */
926

  
927
   /* 91 0x5b '[' */
928
   0x3c, /* 00111100 */
929
   0x30, /* 00110000 */
930
   0x30, /* 00110000 */
931
   0x30, /* 00110000 */
932
   0x30, /* 00110000 */
933
   0x30, /* 00110000 */
934
   0x3c, /* 00111100 */
935
   0x00, /* 00000000 */
936

  
937
   /* 92 0x5c '\' */
938
   0xc0, /* 11000000 */
939
   0x60, /* 01100000 */
940
   0x30, /* 00110000 */
941
   0x18, /* 00011000 */
942
   0x0c, /* 00001100 */
943
   0x06, /* 00000110 */
944
   0x03, /* 00000011 */
945
   0x00, /* 00000000 */
946

  
947
   /* 93 0x5d ']' */
948
   0x3c, /* 00111100 */
949
   0x0c, /* 00001100 */
950
   0x0c, /* 00001100 */
951
   0x0c, /* 00001100 */
952
   0x0c, /* 00001100 */
953
   0x0c, /* 00001100 */
954
   0x3c, /* 00111100 */
955
   0x00, /* 00000000 */
956

  
957
   /* 94 0x5e '^' */
958
   0x10, /* 00010000 */
959
   0x38, /* 00111000 */
960
   0x6c, /* 01101100 */
961
   0xc6, /* 11000110 */
962
   0x00, /* 00000000 */
963
   0x00, /* 00000000 */
964
   0x00, /* 00000000 */
965
   0x00, /* 00000000 */
966

  
967
   /* 95 0x5f '_' */
968
   0x00, /* 00000000 */
969
   0x00, /* 00000000 */
970
   0x00, /* 00000000 */
971
   0x00, /* 00000000 */
972
   0x00, /* 00000000 */
973
   0x00, /* 00000000 */
974
   0x00, /* 00000000 */
975
   0xfe, /* 11111110 */
976

  
977
   /* 96 0x60 '`' */
978
   0x18, /* 00011000 */
979
   0x18, /* 00011000 */
980
   0x0c, /* 00001100 */
981
   0x00, /* 00000000 */
982
   0x00, /* 00000000 */
983
   0x00, /* 00000000 */
984
   0x00, /* 00000000 */
985
   0x00, /* 00000000 */
986

  
987
   /* 97 0x61 'a' */
988
   0x00, /* 00000000 */
989
   0x00, /* 00000000 */
990
   0x7c, /* 01111100 */
991
   0x06, /* 00000110 */
992
   0x7e, /* 01111110 */
993
   0xc6, /* 11000110 */
994
   0x7e, /* 01111110 */
995
   0x00, /* 00000000 */
996

  
997
   /* 98 0x62 'b' */
998
   0xc0, /* 11000000 */
999
   0xc0, /* 11000000 */
1000
   0xfc, /* 11111100 */
1001
   0xc6, /* 11000110 */
1002
   0xc6, /* 11000110 */
1003
   0xc6, /* 11000110 */
1004
   0xfc, /* 11111100 */
1005
   0x00, /* 00000000 */
1006

  
1007
   /* 99 0x63 'c' */
1008
   0x00, /* 00000000 */
1009
   0x00, /* 00000000 */
1010
   0x7c, /* 01111100 */
1011
   0xc6, /* 11000110 */
1012
   0xc0, /* 11000000 */
1013
   0xc6, /* 11000110 */
1014
   0x7c, /* 01111100 */
1015
   0x00, /* 00000000 */
1016

  
1017
   /* 100 0x64 'd' */
1018
   0x06, /* 00000110 */
1019
   0x06, /* 00000110 */
1020
   0x7e, /* 01111110 */
1021
   0xc6, /* 11000110 */
1022
   0xc6, /* 11000110 */
1023
   0xc6, /* 11000110 */
1024
   0x7e, /* 01111110 */
1025
   0x00, /* 00000000 */
1026

  
1027
   /* 101 0x65 'e' */
1028
   0x00, /* 00000000 */
1029
   0x00, /* 00000000 */
1030
   0x7c, /* 01111100 */
1031
   0xc6, /* 11000110 */
1032
   0xfe, /* 11111110 */
1033
   0xc0, /* 11000000 */
1034
   0x7c, /* 01111100 */
1035
   0x00, /* 00000000 */
1036

  
1037
   /* 102 0x66 'f' */
1038
   0x3c, /* 00111100 */
1039
   0x66, /* 01100110 */
1040
   0x60, /* 01100000 */
1041
   0xf0, /* 11110000 */
1042
   0x60, /* 01100000 */
1043
   0x60, /* 01100000 */
1044
   0x60, /* 01100000 */
1045
   0x00, /* 00000000 */
1046

  
1047
   /* 103 0x67 'g' */
1048
   0x00, /* 00000000 */
1049
   0x00, /* 00000000 */
1050
   0x7e, /* 01111110 */
1051
   0xc6, /* 11000110 */
1052
   0xc6, /* 11000110 */
1053
   0x7e, /* 01111110 */
1054
   0x06, /* 00000110 */
1055
   0x7c, /* 01111100 */
1056

  
1057
   /* 104 0x68 'h' */
1058
   0xc0, /* 11000000 */
1059
   0xc0, /* 11000000 */
1060
   0xfc, /* 11111100 */
1061
   0xc6, /* 11000110 */
1062
   0xc6, /* 11000110 */
1063
   0xc6, /* 11000110 */
1064
   0xc6, /* 11000110 */
1065
   0x00, /* 00000000 */
1066

  
1067
   /* 105 0x69 'i' */
1068
   0x18, /* 00011000 */
1069
   0x00, /* 00000000 */
1070
   0x38, /* 00111000 */
1071
   0x18, /* 00011000 */
1072
   0x18, /* 00011000 */
1073
   0x18, /* 00011000 */
1074
   0x18, /* 00011000 */
1075
   0x00, /* 00000000 */
1076

  
1077
   /* 106 0x6a 'j' */
1078
   0x06, /* 00000110 */
1079
   0x00, /* 00000000 */
1080
   0x06, /* 00000110 */
1081
   0x06, /* 00000110 */
1082
   0x06, /* 00000110 */
1083
   0x06, /* 00000110 */
1084
   0xc6, /* 11000110 */
1085
   0x7c, /* 01111100 */
1086

  
1087
   /* 107 0x6b 'k' */
1088
   0xc0, /* 11000000 */
1089
   0xc0, /* 11000000 */
1090
   0xcc, /* 11001100 */
1091
   0xd8, /* 11011000 */
1092
   0xf0, /* 11110000 */
1093
   0xd8, /* 11011000 */
1094
   0xcc, /* 11001100 */
1095
   0x00, /* 00000000 */
1096

  
1097
   /* 108 0x6c 'l' */
1098
   0x38, /* 00111000 */
1099
   0x18, /* 00011000 */
1100
   0x18, /* 00011000 */
1101
   0x18, /* 00011000 */
1102
   0x18, /* 00011000 */
1103
   0x18, /* 00011000 */
1104
   0x18, /* 00011000 */
1105
   0x00, /* 00000000 */
1106

  
1107
   /* 109 0x6d 'm' */
1108
   0x00, /* 00000000 */
1109
   0x00, /* 00000000 */
1110
   0xec, /* 11101100 */
1111
   0xfe, /* 11111110 */
1112
   0xd6, /* 11010110 */
1113
   0xc6, /* 11000110 */
1114
   0xc6, /* 11000110 */
1115
   0x00, /* 00000000 */
1116

  
1117
   /* 110 0x6e 'n' */
1118
   0x00, /* 00000000 */
1119
   0x00, /* 00000000 */
1120
   0xfc, /* 11111100 */
1121
   0xc6, /* 11000110 */
1122
   0xc6, /* 11000110 */
1123
   0xc6, /* 11000110 */
1124
   0xc6, /* 11000110 */
1125
   0x00, /* 00000000 */
1126

  
1127
   /* 111 0x6f 'o' */
1128
   0x00, /* 00000000 */
1129
   0x00, /* 00000000 */
1130
   0x7c, /* 01111100 */
1131
   0xc6, /* 11000110 */
1132
   0xc6, /* 11000110 */
1133
   0xc6, /* 11000110 */
1134
   0x7c, /* 01111100 */
1135
   0x00, /* 00000000 */
1136

  
1137
   /* 112 0x70 'p' */
1138
   0x00, /* 00000000 */
1139
   0x00, /* 00000000 */
1140
   0xfc, /* 11111100 */
1141
   0xc6, /* 11000110 */
1142
   0xc6, /* 11000110 */
1143
   0xfc, /* 11111100 */
1144
   0xc0, /* 11000000 */
1145
   0xc0, /* 11000000 */
1146

  
1147
   /* 113 0x71 'q' */
1148
   0x00, /* 00000000 */
1149
   0x00, /* 00000000 */
1150
   0x7e, /* 01111110 */
1151
   0xc6, /* 11000110 */
1152
   0xc6, /* 11000110 */
1153
   0x7e, /* 01111110 */
1154
   0x06, /* 00000110 */
1155
   0x06, /* 00000110 */
1156

  
1157
   /* 114 0x72 'r' */
1158
   0x00, /* 00000000 */
1159
   0x00, /* 00000000 */
1160
   0xdc, /* 11011100 */
1161
   0xe6, /* 11100110 */
1162
   0xc0, /* 11000000 */
1163
   0xc0, /* 11000000 */
1164
   0xc0, /* 11000000 */
1165
   0x00, /* 00000000 */
1166

  
1167
   /* 115 0x73 's' */
1168
   0x00, /* 00000000 */
1169
   0x00, /* 00000000 */
1170
   0x7e, /* 01111110 */
1171
   0xc0, /* 11000000 */
1172
   0x7c, /* 01111100 */
1173
   0x06, /* 00000110 */
1174
   0xfc, /* 11111100 */
1175
   0x00, /* 00000000 */
1176

  
1177
   /* 116 0x74 't' */
1178
   0x30, /* 00110000 */
1179
   0x30, /* 00110000 */
1180
   0x7c, /* 01111100 */
1181
   0x30, /* 00110000 */
1182
   0x30, /* 00110000 */
1183
   0x36, /* 00110110 */
1184
   0x1c, /* 00011100 */
1185
   0x00, /* 00000000 */
1186

  
1187
   /* 117 0x75 'u' */
1188
   0x00, /* 00000000 */
1189
   0x00, /* 00000000 */
1190
   0xc6, /* 11000110 */
1191
   0xc6, /* 11000110 */
1192
   0xc6, /* 11000110 */
1193
   0xc6, /* 11000110 */
1194
   0x7c, /* 01111100 */
1195
   0x00, /* 00000000 */
1196

  
1197
   /* 118 0x76 'v' */
1198
   0x00, /* 00000000 */
1199
   0x00, /* 00000000 */
1200
   0xc6, /* 11000110 */
1201
   0xc6, /* 11000110 */
1202
   0xc6, /* 11000110 */
1203
   0x6c, /* 01101100 */
1204
   0x38, /* 00111000 */
1205
   0x00, /* 00000000 */
1206

  
1207
   /* 119 0x77 'w' */
1208
   0x00, /* 00000000 */
1209
   0x00, /* 00000000 */
1210
   0xc6, /* 11000110 */
1211
   0xc6, /* 11000110 */
1212
   0xd6, /* 11010110 */
1213
   0xfe, /* 11111110 */
1214
   0x6c, /* 01101100 */
1215
   0x00, /* 00000000 */
1216

  
1217
   /* 120 0x78 'x' */
1218
   0x00, /* 00000000 */
1219
   0x00, /* 00000000 */
1220
   0xc6, /* 11000110 */
1221
   0x6c, /* 01101100 */
1222
   0x38, /* 00111000 */
1223
   0x6c, /* 01101100 */
1224
   0xc6, /* 11000110 */
1225
   0x00, /* 00000000 */
1226

  
1227
   /* 121 0x79 'y' */
1228
   0x00, /* 00000000 */
1229
   0x00, /* 00000000 */
1230
   0xc3, /* 11000011 */
1231
   0x66, /* 01100110 */
1232
   0x3c, /* 00111100 */
1233
   0x18, /* 00011000 */
1234
   0x30, /* 00110000 */
1235
   0x60, /* 01100000 */
1236

  
1237
   /* 122 0x7a 'z' */
1238
   0x00, /* 00000000 */
1239
   0x00, /* 00000000 */
1240
   0xfe, /* 11111110 */
1241
   0x0c, /* 00001100 */
1242
   0x38, /* 00111000 */
1243
   0x60, /* 01100000 */
1244
   0xfe, /* 11111110 */
1245
   0x00, /* 00000000 */
1246

  
1247
   /* 123 0x7b '{' */
1248
   0x0e, /* 00001110 */
1249
   0x18, /* 00011000 */
1250
   0x18, /* 00011000 */
1251
   0x70, /* 01110000 */
1252
   0x18, /* 00011000 */
1253
   0x18, /* 00011000 */
1254
   0x0e, /* 00001110 */
1255
   0x00, /* 00000000 */
1256

  
1257
   /* 124 0x7c '|' */
1258
   0x18, /* 00011000 */
1259
   0x18, /* 00011000 */
1260
   0x18, /* 00011000 */
1261
   0x18, /* 00011000 */
1262
   0x18, /* 00011000 */
1263
   0x18, /* 00011000 */
1264
   0x18, /* 00011000 */
1265
   0x00, /* 00000000 */
1266

  
1267
   /* 125 0x7d '}' */
1268
   0x70, /* 01110000 */
1269
   0x18, /* 00011000 */
1270
   0x18, /* 00011000 */
1271
   0x0e, /* 00001110 */
1272
   0x18, /* 00011000 */
1273
   0x18, /* 00011000 */
1274
   0x70, /* 01110000 */
1275
   0x00, /* 00000000 */
1276

  
1277
   /* 126 0x7e '~' */
1278
   0x72, /* 01110010 */
1279
   0x9c, /* 10011100 */
1280
   0x00, /* 00000000 */
1281
   0x00, /* 00000000 */
1282
   0x00, /* 00000000 */
1283
   0x00, /* 00000000 */
1284
   0x00, /* 00000000 */
1285
   0x00, /* 00000000 */
1286

  
1287
   /* 127 0x7f '' */
1288
   0x00, /* 00000000 */
1289
   0x10, /* 00010000 */
1290
   0x38, /* 00111000 */
1291
   0x6c, /* 01101100 */
1292
   0xc6, /* 11000110 */
1293
   0xc6, /* 11000110 */
1294
   0xfe, /* 11111110 */
1295
   0x00, /* 00000000 */
1296

  
1297
   /* 128 0x80 '€' */
1298
   0x7c, /* 01111100 */
1299
   0xc6, /* 11000110 */
1300
   0xc0, /* 11000000 */
1301
   0xc0, /* 11000000 */
1302
   0xc6, /* 11000110 */
1303
   0x7c, /* 01111100 */
1304
   0x0c, /* 00001100 */
1305
   0x78, /* 01111000 */
1306

  
1307
   /* 129 0x81 'Ѓ' */
1308
   0xcc, /* 11001100 */
1309
   0x00, /* 00000000 */
1310
   0xcc, /* 11001100 */
1311
   0xcc, /* 11001100 */
1312
   0xcc, /* 11001100 */
1313
   0xcc, /* 11001100 */
1314
   0x76, /* 01110110 */
1315
   0x00, /* 00000000 */
1316

  
1317
   /* 130 0x82 '‚' */
1318
   0x0c, /* 00001100 */
1319
   0x18, /* 00011000 */
1320
   0x7c, /* 01111100 */
1321
   0xc6, /* 11000110 */
1322
   0xfe, /* 11111110 */
1323
   0xc0, /* 11000000 */
1324
   0x7c, /* 01111100 */
1325
   0x00, /* 00000000 */
1326

  
1327
   /* 131 0x83 'ƒ' */
1328
   0x7c, /* 01111100 */
1329
   0x82, /* 10000010 */
1330
   0x78, /* 01111000 */
1331
   0x0c, /* 00001100 */
1332
   0x7c, /* 01111100 */
1333
   0xcc, /* 11001100 */
1334
   0x76, /* 01110110 */
1335
   0x00, /* 00000000 */
1336

  
1337
   /* 132 0x84 '„' */
1338
   0xc6, /* 11000110 */
1339
   0x00, /* 00000000 */
1340
   0x78, /* 01111000 */
1341
   0x0c, /* 00001100 */
1342
   0x7c, /* 01111100 */
1343
   0xcc, /* 11001100 */
1344
   0x76, /* 01110110 */
1345
   0x00, /* 00000000 */
1346

  
1347
   /* 133 0x85 '…' */
1348
   0x30, /* 00110000 */
1349
   0x18, /* 00011000 */
1350
   0x78, /* 01111000 */
1351
   0x0c, /* 00001100 */
1352
   0x7c, /* 01111100 */
1353
   0xcc, /* 11001100 */
1354
   0x76, /* 01110110 */
1355
   0x00, /* 00000000 */
1356

  
1357
   /* 134 0x86 '†' */
1358
   0x30, /* 00110000 */
1359
   0x30, /* 00110000 */
1360
   0x78, /* 01111000 */
1361
   0x0c, /* 00001100 */
1362
   0x7c, /* 01111100 */
1363
   0xcc, /* 11001100 */
1364
   0x76, /* 01110110 */
1365
   0x00, /* 00000000 */
1366

  
1367
   /* 135 0x87 '‡' */
1368
   0x00, /* 00000000 */
1369
   0x00, /* 00000000 */
1370
   0x7e, /* 01111110 */
1371
   0xc0, /* 11000000 */
1372
   0xc0, /* 11000000 */
1373
   0x7e, /* 01111110 */
1374
   0x0c, /* 00001100 */
1375
   0x38, /* 00111000 */
1376

  
1377
   /* 136 0x88 'ˆ' */
1378
   0x7c, /* 01111100 */
1379
   0x82, /* 10000010 */
1380
   0x7c, /* 01111100 */
1381
   0xc6, /* 11000110 */
1382
   0xfe, /* 11111110 */
1383
   0xc0, /* 11000000 */
1384
   0x7c, /* 01111100 */
1385
   0x00, /* 00000000 */
1386

  
1387
   /* 137 0x89 '‰' */
1388
   0xc6, /* 11000110 */
1389
   0x00, /* 00000000 */
1390
   0x7c, /* 01111100 */
1391
   0xc6, /* 11000110 */
1392
   0xfe, /* 11111110 */
1393
   0xc0, /* 11000000 */
1394
   0x7c, /* 01111100 */
1395
   0x00, /* 00000000 */
1396

  
1397
   /* 138 0x8a 'Š' */
1398
   0x30, /* 00110000 */
1399
   0x18, /* 00011000 */
1400
   0x7c, /* 01111100 */
1401
   0xc6, /* 11000110 */
1402
   0xfe, /* 11111110 */
1403
   0xc0, /* 11000000 */
1404
   0x7c, /* 01111100 */
1405
   0x00, /* 00000000 */
1406

  
1407
   /* 139 0x8b '‹' */
1408
   0x66, /* 01100110 */
1409
   0x00, /* 00000000 */
1410
   0x38, /* 00111000 */
1411
   0x18, /* 00011000 */
1412
   0x18, /* 00011000 */
1413
   0x18, /* 00011000 */
1414
   0x3c, /* 00111100 */
1415
   0x00, /* 00000000 */
1416

  
1417
   /* 140 0x8c 'Œ' */
1418
   0x7c, /* 01111100 */
1419
   0x82, /* 10000010 */
1420
   0x38, /* 00111000 */
1421
   0x18, /* 00011000 */
1422
   0x18, /* 00011000 */
1423
   0x18, /* 00011000 */
1424
   0x3c, /* 00111100 */
1425
   0x00, /* 00000000 */
1426

  
1427
   /* 141 0x8d 'Ќ' */
1428
   0x30, /* 00110000 */
1429
   0x18, /* 00011000 */
1430
   0x00, /* 00000000 */
1431
   0x38, /* 00111000 */
1432
   0x18, /* 00011000 */
1433
   0x18, /* 00011000 */
1434
   0x3c, /* 00111100 */
1435
   0x00, /* 00000000 */
1436

  
1437
   /* 142 0x8e 'Ž' */
1438
   0xc6, /* 11000110 */
1439
   0x38, /* 00111000 */
1440
   0x6c, /* 01101100 */
1441
   0xc6, /* 11000110 */
1442
   0xfe, /* 11111110 */
1443
   0xc6, /* 11000110 */
1444
   0xc6, /* 11000110 */
1445
   0x00, /* 00000000 */
1446

  
1447
   /* 143 0x8f 'Џ' */
1448
   0x38, /* 00111000 */
1449
   0x6c, /* 01101100 */
1450
   0x7c, /* 01111100 */
1451
   0xc6, /* 11000110 */
1452
   0xfe, /* 11111110 */
1453
   0xc6, /* 11000110 */
1454
   0xc6, /* 11000110 */
1455
   0x00, /* 00000000 */
1456

  
1457
   /* 144 0x90 'ђ' */
1458
   0x18, /* 00011000 */
1459
   0x30, /* 00110000 */
1460
   0xfe, /* 11111110 */
1461
   0xc0, /* 11000000 */
1462
   0xf8, /* 11111000 */
1463
   0xc0, /* 11000000 */
1464
   0xfe, /* 11111110 */
1465
   0x00, /* 00000000 */
1466

  
1467
   /* 145 0x91 '‘' */
1468
   0x00, /* 00000000 */
1469
   0x00, /* 00000000 */
1470
   0x7e, /* 01111110 */
1471
   0x18, /* 00011000 */
1472
   0x7e, /* 01111110 */
1473
   0xd8, /* 11011000 */
1474
   0x7e, /* 01111110 */
1475
   0x00, /* 00000000 */
1476

  
1477
   /* 146 0x92 '’' */
1478
   0x3e, /* 00111110 */
1479
   0x6c, /* 01101100 */
1480
   0xcc, /* 11001100 */
1481
   0xfe, /* 11111110 */
1482
   0xcc, /* 11001100 */
1483
   0xcc, /* 11001100 */
1484
   0xce, /* 11001110 */
1485
   0x00, /* 00000000 */
1486

  
1487
   /* 147 0x93 '“' */
1488
   0x7c, /* 01111100 */
1489
   0x82, /* 10000010 */
1490
   0x7c, /* 01111100 */
1491
   0xc6, /* 11000110 */
1492
   0xc6, /* 11000110 */
1493
   0xc6, /* 11000110 */
1494
   0x7c, /* 01111100 */
1495
   0x00, /* 00000000 */
1496

  
1497
   /* 148 0x94 '”' */
1498
   0xc6, /* 11000110 */
1499
   0x00, /* 00000000 */
1500
   0x7c, /* 01111100 */
1501
   0xc6, /* 11000110 */
1502
   0xc6, /* 11000110 */
1503
   0xc6, /* 11000110 */
1504
   0x7c, /* 01111100 */
1505
   0x00, /* 00000000 */
1506

  
1507
   /* 149 0x95 '•' */
1508
   0x30, /* 00110000 */
1509
   0x18, /* 00011000 */
1510
   0x7c, /* 01111100 */
1511
   0xc6, /* 11000110 */
1512
   0xc6, /* 11000110 */
1513
   0xc6, /* 11000110 */
1514
   0x7c, /* 01111100 */
1515
   0x00, /* 00000000 */
1516

  
1517
   /* 150 0x96 '–' */
1518
   0x78, /* 01111000 */
1519
   0x84, /* 10000100 */
1520
   0x00, /* 00000000 */
1521
   0xcc, /* 11001100 */
1522
   0xcc, /* 11001100 */
1523
   0xcc, /* 11001100 */
1524
   0x76, /* 01110110 */
1525
   0x00, /* 00000000 */
1526

  
1527
   /* 151 0x97 '—' */
1528
   0x60, /* 01100000 */
1529
   0x30, /* 00110000 */
1530
   0xcc, /* 11001100 */
1531
   0xcc, /* 11001100 */
1532
   0xcc, /* 11001100 */
1533
   0xcc, /* 11001100 */
1534
   0x76, /* 01110110 */
1535
   0x00, /* 00000000 */
1536

  
1537
   /* 152 0x98 '˜' */
1538
   0xc6, /* 11000110 */
1539
   0x00, /* 00000000 */
1540
   0xc6, /* 11000110 */
1541
   0xc6, /* 11000110 */
1542
   0xc6, /* 11000110 */
1543
   0x7e, /* 01111110 */
1544
   0x06, /* 00000110 */
1545
   0xfc, /* 11111100 */
1546

  
1547
   /* 153 0x99 '™' */
1548
   0xc6, /* 11000110 */
1549
   0x38, /* 00111000 */
1550
   0x6c, /* 01101100 */
1551
   0xc6, /* 11000110 */
1552
   0xc6, /* 11000110 */
1553
   0x6c, /* 01101100 */
1554
   0x38, /* 00111000 */
1555
   0x00, /* 00000000 */
1556

  
1557
   /* 154 0x9a 'š' */
1558
   0xc6, /* 11000110 */
1559
   0x00, /* 00000000 */
1560
   0xc6, /* 11000110 */
1561
   0xc6, /* 11000110 */
1562
   0xc6, /* 11000110 */
1563
   0xc6, /* 11000110 */
1564
   0x7c, /* 01111100 */
1565
   0x00, /* 00000000 */
1566

  
1567
   /* 155 0x9b '›' */
1568
   0x18, /* 00011000 */
1569
   0x18, /* 00011000 */
1570
   0x7e, /* 01111110 */
1571
   0xc0, /* 11000000 */
1572
   0xc0, /* 11000000 */
1573
   0x7e, /* 01111110 */
1574
   0x18, /* 00011000 */
1575
   0x18, /* 00011000 */
1576

  
1577
   /* 156 0x9c 'œ' */
1578
   0x38, /* 00111000 */
1579
   0x6c, /* 01101100 */
1580
   0x64, /* 01100100 */
1581
   0xf0, /* 11110000 */
1582
   0x60, /* 01100000 */
1583
   0x66, /* 01100110 */
1584
   0xfc, /* 11111100 */
1585
   0x00, /* 00000000 */
1586

  
1587
   /* 157 0x9d 'ќ' */
1588
   0x66, /* 01100110 */
1589
   0x66, /* 01100110 */
1590
   0x3c, /* 00111100 */
1591
   0x7e, /* 01111110 */
1592
   0x18, /* 00011000 */
1593
   0x7e, /* 01111110 */
1594
   0x18, /* 00011000 */
1595
   0x18, /* 00011000 */
1596

  
1597
   /* 158 0x9e 'ž' */
1598
   0xf8, /* 11111000 */
1599
   0xcc, /* 11001100 */
1600
   0xcc, /* 11001100 */
1601
   0xfa, /* 11111010 */
1602
   0xc6, /* 11000110 */
1603
   0xcf, /* 11001111 */
1604
   0xc6, /* 11000110 */
1605
   0xc7, /* 11000111 */
1606

  
1607
   /* 159 0x9f 'Ÿ' */
1608
   0x0e, /* 00001110 */
1609
   0x1b, /* 00011011 */
1610
   0x18, /* 00011000 */
1611
   0x3c, /* 00111100 */
1612
   0x18, /* 00011000 */
1613
   0xd8, /* 11011000 */
1614
   0x70, /* 01110000 */
1615
   0x00, /* 00000000 */
1616

  
1617
   /* 160 0xa0 ' ' */
1618
   0x18, /* 00011000 */
1619
   0x30, /* 00110000 */
1620
   0x78, /* 01111000 */
1621
   0x0c, /* 00001100 */
1622
   0x7c, /* 01111100 */
1623
   0xcc, /* 11001100 */
1624
   0x76, /* 01110110 */
1625
   0x00, /* 00000000 */
1626

  
1627
   /* 161 0xa1 '¡' */
1628
   0x0c, /* 00001100 */
1629
   0x18, /* 00011000 */
1630
   0x00, /* 00000000 */
1631
   0x38, /* 00111000 */
1632
   0x18, /* 00011000 */
1633
   0x18, /* 00011000 */
1634
   0x3c, /* 00111100 */
1635
   0x00, /* 00000000 */
1636

  
1637
   /* 162 0xa2 '¢' */
1638
   0x0c, /* 00001100 */
1639
   0x18, /* 00011000 */
1640
   0x7c, /* 01111100 */
1641
   0xc6, /* 11000110 */
1642
   0xc6, /* 11000110 */
1643
   0xc6, /* 11000110 */
1644
   0x7c, /* 01111100 */
1645
   0x00, /* 00000000 */
1646

  
1647
   /* 163 0xa3 '£' */
1648
   0x18, /* 00011000 */
1649
   0x30, /* 00110000 */
1650
   0xcc, /* 11001100 */
1651
   0xcc, /* 11001100 */
1652
   0xcc, /* 11001100 */
1653
   0xcc, /* 11001100 */
1654
   0x76, /* 01110110 */
1655
   0x00, /* 00000000 */
1656

  
1657
   /* 164 0xa4 '¤' */
1658
   0x76, /* 01110110 */
1659
   0xdc, /* 11011100 */
1660
   0x00, /* 00000000 */
1661
   0xdc, /* 11011100 */
1662
   0x66, /* 01100110 */
1663
   0x66, /* 01100110 */
1664
   0x66, /* 01100110 */
1665
   0x00, /* 00000000 */
1666

  
1667
   /* 165 0xa5 '¥' */
1668
   0x76, /* 01110110 */
1669
   0xdc, /* 11011100 */
1670
   0x00, /* 00000000 */
1671
   0xe6, /* 11100110 */
1672
   0xf6, /* 11110110 */
1673
   0xde, /* 11011110 */
1674
   0xce, /* 11001110 */
1675
   0x00, /* 00000000 */
1676

  
1677
   /* 166 0xa6 '¦' */
1678
   0x3c, /* 00111100 */
1679
   0x6c, /* 01101100 */
1680
   0x6c, /* 01101100 */
1681
   0x3e, /* 00111110 */
1682
   0x00, /* 00000000 */
1683
   0x7e, /* 01111110 */
1684
   0x00, /* 00000000 */
1685
   0x00, /* 00000000 */
1686

  
1687
   /* 167 0xa7 '§' */
1688
   0x38, /* 00111000 */
1689
   0x6c, /* 01101100 */
1690
   0x6c, /* 01101100 */
1691
   0x38, /* 00111000 */
1692
   0x00, /* 00000000 */
1693
   0x7c, /* 01111100 */
1694
   0x00, /* 00000000 */
1695
   0x00, /* 00000000 */
1696

  
1697
   /* 168 0xa8 '¨' */
1698
   0x18, /* 00011000 */
1699
   0x00, /* 00000000 */
1700
   0x18, /* 00011000 */
1701
   0x18, /* 00011000 */
1702
   0x30, /* 00110000 */
1703
   0x63, /* 01100011 */
1704
   0x3e, /* 00111110 */
1705
   0x00, /* 00000000 */
1706

  
1707
   /* 169 0xa9 '©' */
1708
   0x00, /* 00000000 */
1709
   0x00, /* 00000000 */
1710
   0x00, /* 00000000 */
1711
   0xfe, /* 11111110 */
1712
   0xc0, /* 11000000 */
1713
   0xc0, /* 11000000 */
1714
   0x00, /* 00000000 */
1715
   0x00, /* 00000000 */
1716

  
1717
   /* 170 0xaa 'ª' */
1718
   0x00, /* 00000000 */
1719
   0x00, /* 00000000 */
1720
   0x00, /* 00000000 */
1721
   0xfe, /* 11111110 */
1722
   0x06, /* 00000110 */
1723
   0x06, /* 00000110 */
1724
   0x00, /* 00000000 */
1725
   0x00, /* 00000000 */
1726

  
1727
   /* 171 0xab '«' */
1728
   0x63, /* 01100011 */
1729
   0xe6, /* 11100110 */
1730
   0x6c, /* 01101100 */
1731
   0x7e, /* 01111110 */
1732
   0x33, /* 00110011 */
1733
   0x66, /* 01100110 */
1734
   0xcc, /* 11001100 */
1735
   0x0f, /* 00001111 */
1736

  
1737
   /* 172 0xac '¬' */
1738
   0x63, /* 01100011 */
1739
   0xe6, /* 11100110 */
1740
   0x6c, /* 01101100 */
1741
   0x7a, /* 01111010 */
1742
   0x36, /* 00110110 */
1743
   0x6a, /* 01101010 */
1744
   0xdf, /* 11011111 */
1745
   0x06, /* 00000110 */
1746

  
1747
   /* 173 0xad '­' */
1748
   0x18, /* 00011000 */
1749
   0x00, /* 00000000 */
1750
   0x18, /* 00011000 */
1751
   0x18, /* 00011000 */
1752
   0x3c, /* 00111100 */
1753
   0x3c, /* 00111100 */
1754
   0x18, /* 00011000 */
1755
   0x00, /* 00000000 */
1756

  
1757
   /* 174 0xae '®' */
1758
   0x00, /* 00000000 */
1759
   0x33, /* 00110011 */
1760
   0x66, /* 01100110 */
1761
   0xcc, /* 11001100 */
1762
   0x66, /* 01100110 */
1763
   0x33, /* 00110011 */
1764
   0x00, /* 00000000 */
1765
   0x00, /* 00000000 */
1766

  
1767
   /* 175 0xaf '¯' */
1768
   0x00, /* 00000000 */
1769
   0xcc, /* 11001100 */
1770
   0x66, /* 01100110 */
1771
   0x33, /* 00110011 */
1772
   0x66, /* 01100110 */
1773
   0xcc, /* 11001100 */
1774
   0x00, /* 00000000 */
1775
   0x00, /* 00000000 */
1776

  
1777
   /* 176 0xb0 '°' */
1778
   0x22, /* 00100010 */
1779
   0x88, /* 10001000 */
1780
   0x22, /* 00100010 */
1781
   0x88, /* 10001000 */
1782
   0x22, /* 00100010 */
1783
   0x88, /* 10001000 */
1784
   0x22, /* 00100010 */
1785
   0x88, /* 10001000 */
1786

  
1787
   /* 177 0xb1 '±' */
1788
   0x55, /* 01010101 */
1789
   0xaa, /* 10101010 */
1790
   0x55, /* 01010101 */
1791
   0xaa, /* 10101010 */
1792
   0x55, /* 01010101 */
1793
   0xaa, /* 10101010 */
1794
   0x55, /* 01010101 */
1795
   0xaa, /* 10101010 */
1796

  
1797
   /* 178 0xb2 '²' */
1798
   0x77, /* 01110111 */
1799
   0xdd, /* 11011101 */
1800
   0x77, /* 01110111 */
1801
   0xdd, /* 11011101 */
1802
   0x77, /* 01110111 */
1803
   0xdd, /* 11011101 */
1804
   0x77, /* 01110111 */
1805
   0xdd, /* 11011101 */
1806

  
1807
   /* 179 0xb3 '³' */
1808
   0x18, /* 00011000 */
1809
   0x18, /* 00011000 */
1810
   0x18, /* 00011000 */
1811
   0x18, /* 00011000 */
1812
   0x18, /* 00011000 */
1813
   0x18, /* 00011000 */
1814
   0x18, /* 00011000 */
1815
   0x18, /* 00011000 */
1816

  
1817
   /* 180 0xb4 '´' */
1818
   0x18, /* 00011000 */
1819
   0x18, /* 00011000 */
1820
   0x18, /* 00011000 */
1821
   0x18, /* 00011000 */
1822
   0xf8, /* 11111000 */
1823
   0x18, /* 00011000 */
1824
   0x18, /* 00011000 */
1825
   0x18, /* 00011000 */
1826

  
1827
   /* 181 0xb5 'µ' */
1828
   0x18, /* 00011000 */
1829
   0x18, /* 00011000 */
1830
   0xf8, /* 11111000 */
1831
   0x18, /* 00011000 */
1832
   0xf8, /* 11111000 */
1833
   0x18, /* 00011000 */
1834
   0x18, /* 00011000 */
1835
   0x18, /* 00011000 */
1836

  
1837
   /* 182 0xb6 '¶' */
1838
   0x36, /* 00110110 */
1839
   0x36, /* 00110110 */
1840
   0x36, /* 00110110 */
1841
   0x36, /* 00110110 */
1842
   0xf6, /* 11110110 */
1843
   0x36, /* 00110110 */
1844
   0x36, /* 00110110 */
1845
   0x36, /* 00110110 */
1846

  
1847
   /* 183 0xb7 '·' */
1848
   0x00, /* 00000000 */
1849
   0x00, /* 00000000 */
1850
   0x00, /* 00000000 */
1851
   0x00, /* 00000000 */
1852
   0xfe, /* 11111110 */
1853
   0x36, /* 00110110 */
1854
   0x36, /* 00110110 */
1855
   0x36, /* 00110110 */
1856

  
1857
   /* 184 0xb8 '¸' */
1858
   0x00, /* 00000000 */
1859
   0x00, /* 00000000 */
1860
   0xf8, /* 11111000 */
1861
   0x18, /* 00011000 */
1862
   0xf8, /* 11111000 */
1863
   0x18, /* 00011000 */
1864
   0x18, /* 00011000 */
1865
   0x18, /* 00011000 */
1866

  
1867
   /* 185 0xb9 '¹' */
1868
   0x36, /* 00110110 */
1869
   0x36, /* 00110110 */
1870
   0xf6, /* 11110110 */
1871
   0x06, /* 00000110 */
1872
   0xf6, /* 11110110 */
1873
   0x36, /* 00110110 */
1874
   0x36, /* 00110110 */
1875
   0x36, /* 00110110 */
1876

  
1877
   /* 186 0xba 'º' */
1878
   0x36, /* 00110110 */
1879
   0x36, /* 00110110 */
1880
   0x36, /* 00110110 */
1881
   0x36, /* 00110110 */
1882
   0x36, /* 00110110 */
1883
   0x36, /* 00110110 */
1884
   0x36, /* 00110110 */
1885
   0x36, /* 00110110 */
1886

  
1887
   /* 187 0xbb '»' */
1888
   0x00, /* 00000000 */
1889
   0x00, /* 00000000 */
1890
   0xfe, /* 11111110 */
1891
   0x06, /* 00000110 */
1892
   0xf6, /* 11110110 */
1893
   0x36, /* 00110110 */
1894
   0x36, /* 00110110 */
1895
   0x36, /* 00110110 */
1896

  
1897
   /* 188 0xbc '¼' */
1898
   0x36, /* 00110110 */
1899
   0x36, /* 00110110 */
1900
   0xf6, /* 11110110 */
1901
   0x06, /* 00000110 */
1902
   0xfe, /* 11111110 */
1903
   0x00, /* 00000000 */
1904
   0x00, /* 00000000 */
1905
   0x00, /* 00000000 */
1906

  
1907
   /* 189 0xbd '½' */
1908
   0x36, /* 00110110 */
1909
   0x36, /* 00110110 */
1910
   0x36, /* 00110110 */
1911
   0x36, /* 00110110 */
1912
   0xfe, /* 11111110 */
1913
   0x00, /* 00000000 */
1914
   0x00, /* 00000000 */
1915
   0x00, /* 00000000 */
1916

  
1917
   /* 190 0xbe '¾' */
1918
   0x18, /* 00011000 */
1919
   0x18, /* 00011000 */
1920
   0xf8, /* 11111000 */
1921
   0x18, /* 00011000 */
1922
   0xf8, /* 11111000 */
1923
   0x00, /* 00000000 */
1924
   0x00, /* 00000000 */
1925
   0x00, /* 00000000 */
1926

  
1927
   /* 191 0xbf '¿' */
1928
   0x00, /* 00000000 */
1929
   0x00, /* 00000000 */
1930
   0x00, /* 00000000 */
1931
   0x00, /* 00000000 */
1932
   0xf8, /* 11111000 */
1933
   0x18, /* 00011000 */
1934
   0x18, /* 00011000 */
1935
   0x18, /* 00011000 */
1936

  
1937
   /* 192 0xc0 'À' */
1938
   0x18, /* 00011000 */
1939
   0x18, /* 00011000 */
1940
   0x18, /* 00011000 */
1941
   0x18, /* 00011000 */
1942
   0x1f, /* 00011111 */
1943
   0x00, /* 00000000 */
1944
   0x00, /* 00000000 */
1945
   0x00, /* 00000000 */
1946

  
1947
   /* 193 0xc1 'Á' */
1948
   0x18, /* 00011000 */
1949
   0x18, /* 00011000 */
1950
   0x18, /* 00011000 */
1951
   0x18, /* 00011000 */
1952
   0xff, /* 11111111 */
1953
   0x00, /* 00000000 */
1954
   0x00, /* 00000000 */
1955
   0x00, /* 00000000 */
1956

  
1957
   /* 194 0xc2 'Â' */
1958
   0x00, /* 00000000 */
1959
   0x00, /* 00000000 */
1960
   0x00, /* 00000000 */
1961
   0x00, /* 00000000 */
1962
   0xff, /* 11111111 */
1963
   0x18, /* 00011000 */
1964
   0x18, /* 00011000 */
1965
   0x18, /* 00011000 */
1966

  
1967
   /* 195 0xc3 'Ã' */
1968
   0x18, /* 00011000 */
1969
   0x18, /* 00011000 */
1970
   0x18, /* 00011000 */
1971
   0x18, /* 00011000 */
1972
   0x1f, /* 00011111 */
1973
   0x18, /* 00011000 */
1974
   0x18, /* 00011000 */
1975
   0x18, /* 00011000 */
1976

  
1977
   /* 196 0xc4 'Ä' */
1978
   0x00, /* 00000000 */
1979
   0x00, /* 00000000 */
1980
   0x00, /* 00000000 */
1981
   0x00, /* 00000000 */
1982
   0xff, /* 11111111 */
1983
   0x00, /* 00000000 */
1984
   0x00, /* 00000000 */
1985
   0x00, /* 00000000 */
1986

  
1987
   /* 197 0xc5 'Å' */
1988
   0x18, /* 00011000 */
1989
   0x18, /* 00011000 */
1990
   0x18, /* 00011000 */
1991
   0x18, /* 00011000 */
1992
   0xff, /* 11111111 */
1993
   0x18, /* 00011000 */
1994
   0x18, /* 00011000 */
1995
   0x18, /* 00011000 */
1996

  
1997
   /* 198 0xc6 'Æ' */
1998
   0x18, /* 00011000 */
1999
   0x18, /* 00011000 */
2000
   0x1f, /* 00011111 */
2001
   0x18, /* 00011000 */
2002
   0x1f, /* 00011111 */
2003
   0x18, /* 00011000 */
2004
   0x18, /* 00011000 */
2005
   0x18, /* 00011000 */
2006

  
2007
   /* 199 0xc7 'Ç' */
2008
   0x36, /* 00110110 */
2009
   0x36, /* 00110110 */
2010
   0x36, /* 00110110 */
2011
   0x36, /* 00110110 */
2012
   0x37, /* 00110111 */
2013
   0x36, /* 00110110 */
2014
   0x36, /* 00110110 */
2015
   0x36, /* 00110110 */
2016

  
2017
   /* 200 0xc8 'È' */
2018
   0x36, /* 00110110 */
2019
   0x36, /* 00110110 */
2020
   0x37, /* 00110111 */
2021
   0x30, /* 00110000 */
2022
   0x3f, /* 00111111 */
2023
   0x00, /* 00000000 */
2024
   0x00, /* 00000000 */
2025
   0x00, /* 00000000 */
2026

  
2027
   /* 201 0xc9 'É' */
2028
   0x00, /* 00000000 */
2029
   0x00, /* 00000000 */
2030
   0x3f, /* 00111111 */
2031
   0x30, /* 00110000 */
2032
   0x37, /* 00110111 */
2033
   0x36, /* 00110110 */
2034
   0x36, /* 00110110 */
2035
   0x36, /* 00110110 */
2036

  
2037
   /* 202 0xca 'Ê' */
2038
   0x36, /* 00110110 */
2039
   0x36, /* 00110110 */
2040
   0xf7, /* 11110111 */
2041
   0x00, /* 00000000 */
2042
   0xff, /* 11111111 */
2043
   0x00, /* 00000000 */
2044
   0x00, /* 00000000 */
2045
   0x00, /* 00000000 */
2046

  
2047
   /* 203 0xcb 'Ë' */
2048
   0x00, /* 00000000 */
2049
   0x00, /* 00000000 */
2050
   0xff, /* 11111111 */
2051
   0x00, /* 00000000 */
2052
   0xf7, /* 11110111 */
2053
   0x36, /* 00110110 */
2054
   0x36, /* 00110110 */
2055
   0x36, /* 00110110 */
2056

  
2057
   /* 204 0xcc 'Ì' */
2058
   0x36, /* 00110110 */
2059
   0x36, /* 00110110 */
2060
   0x37, /* 00110111 */
2061
   0x30, /* 00110000 */
2062
   0x37, /* 00110111 */
2063
   0x36, /* 00110110 */
2064
   0x36, /* 00110110 */
2065
   0x36, /* 00110110 */
2066

  
2067
   /* 205 0xcd 'Í' */
2068
   0x00, /* 00000000 */
2069
   0x00, /* 00000000 */
2070
   0xff, /* 11111111 */
2071
   0x00, /* 00000000 */
2072
   0xff, /* 11111111 */
2073
   0x00, /* 00000000 */
2074
   0x00, /* 00000000 */
2075
   0x00, /* 00000000 */
2076

  
2077
   /* 206 0xce 'Î' */
2078
   0x36, /* 00110110 */
2079
   0x36, /* 00110110 */
2080
   0xf7, /* 11110111 */
2081
   0x00, /* 00000000 */
2082
   0xf7, /* 11110111 */
2083
   0x36, /* 00110110 */
2084
   0x36, /* 00110110 */
2085
   0x36, /* 00110110 */
2086

  
2087
   /* 207 0xcf 'Ï' */
2088
   0x18, /* 00011000 */
2089
   0x18, /* 00011000 */
2090
   0xff, /* 11111111 */
2091
   0x00, /* 00000000 */
2092
   0xff, /* 11111111 */
2093
   0x00, /* 00000000 */
2094
   0x00, /* 00000000 */
2095
   0x00, /* 00000000 */
2096

  
2097
   /* 208 0xd0 'Ð' */
2098
   0x36, /* 00110110 */
2099
   0x36, /* 00110110 */
2100
   0x36, /* 00110110 */
2101
   0x36, /* 00110110 */
2102
   0xff, /* 11111111 */
2103
   0x00, /* 00000000 */
2104
   0x00, /* 00000000 */
2105
   0x00, /* 00000000 */
2106

  
2107
   /* 209 0xd1 'Ñ' */
2108
   0x00, /* 00000000 */
2109
   0x00, /* 00000000 */
2110
   0xff, /* 11111111 */
2111
   0x00, /* 00000000 */
2112
   0xff, /* 11111111 */
2113
   0x18, /* 00011000 */
2114
   0x18, /* 00011000 */
2115
   0x18, /* 00011000 */
2116

  
2117
   /* 210 0xd2 'Ò' */
2118
   0x00, /* 00000000 */
2119
   0x00, /* 00000000 */
2120
   0x00, /* 00000000 */
2121
   0x00, /* 00000000 */
2122
   0xff, /* 11111111 */
2123
   0x36, /* 00110110 */
2124
   0x36, /* 00110110 */
2125
   0x36, /* 00110110 */
2126

  
2127
   /* 211 0xd3 'Ó' */
2128
   0x36, /* 00110110 */
2129
   0x36, /* 00110110 */
2130
   0x36, /* 00110110 */
2131
   0x36, /* 00110110 */
2132
   0x3f, /* 00111111 */
2133
   0x00, /* 00000000 */
2134
   0x00, /* 00000000 */
2135
   0x00, /* 00000000 */
2136

  
2137
   /* 212 0xd4 'Ô' */
2138
   0x18, /* 00011000 */
2139
   0x18, /* 00011000 */
2140
   0x1f, /* 00011111 */
2141
   0x18, /* 00011000 */
2142
   0x1f, /* 00011111 */
2143
   0x00, /* 00000000 */
2144
   0x00, /* 00000000 */
2145
   0x00, /* 00000000 */
2146

  
2147
   /* 213 0xd5 'Õ' */
2148
   0x00, /* 00000000 */
2149
   0x00, /* 00000000 */
2150
   0x1f, /* 00011111 */
2151
   0x18, /* 00011000 */
2152
   0x1f, /* 00011111 */
2153
   0x18, /* 00011000 */
2154
   0x18, /* 00011000 */
2155
   0x18, /* 00011000 */
2156

  
2157
   /* 214 0xd6 'Ö' */
2158
   0x00, /* 00000000 */
2159
   0x00, /* 00000000 */
2160
   0x00, /* 00000000 */
2161
   0x00, /* 00000000 */
2162
   0x3f, /* 00111111 */
2163
   0x36, /* 00110110 */
2164
   0x36, /* 00110110 */
2165
   0x36, /* 00110110 */
2166

  
2167
   /* 215 0xd7 '×' */
2168
   0x36, /* 00110110 */
2169
   0x36, /* 00110110 */
2170
   0x36, /* 00110110 */
2171
   0x36, /* 00110110 */
2172
   0xff, /* 11111111 */
2173
   0x36, /* 00110110 */
2174
   0x36, /* 00110110 */
2175
   0x36, /* 00110110 */
2176

  
2177
   /* 216 0xd8 'Ø' */
2178
   0x18, /* 00011000 */
2179
   0x18, /* 00011000 */
2180
   0xff, /* 11111111 */
2181
   0x18, /* 00011000 */
2182
   0xff, /* 11111111 */
2183
   0x18, /* 00011000 */
2184
   0x18, /* 00011000 */
2185
   0x18, /* 00011000 */
2186

  
2187
   /* 217 0xd9 'Ù' */
2188
   0x18, /* 00011000 */
2189
   0x18, /* 00011000 */
2190
   0x18, /* 00011000 */
2191
   0x18, /* 00011000 */
2192
   0xf8, /* 11111000 */
2193
   0x00, /* 00000000 */
2194
   0x00, /* 00000000 */
2195
   0x00, /* 00000000 */
2196

  
2197
   /* 218 0xda 'Ú' */
2198
   0x00, /* 00000000 */
2199
   0x00, /* 00000000 */
2200
   0x00, /* 00000000 */
2201
   0x00, /* 00000000 */
2202
   0x1f, /* 00011111 */
2203
   0x18, /* 00011000 */
2204
   0x18, /* 00011000 */
2205
   0x18, /* 00011000 */
2206

  
2207
   /* 219 0xdb 'Û' */
2208
   0xff, /* 11111111 */
2209
   0xff, /* 11111111 */
2210
   0xff, /* 11111111 */
2211
   0xff, /* 11111111 */
2212
   0xff, /* 11111111 */
2213
   0xff, /* 11111111 */
2214
   0xff, /* 11111111 */
2215
   0xff, /* 11111111 */
2216

  
2217
   /* 220 0xdc 'Ü' */
2218
   0x00, /* 00000000 */
2219
   0x00, /* 00000000 */
2220
   0x00, /* 00000000 */
2221
   0x00, /* 00000000 */
2222
   0xff, /* 11111111 */
2223
   0xff, /* 11111111 */
2224
   0xff, /* 11111111 */
2225
   0xff, /* 11111111 */
2226

  
2227
   /* 221 0xdd 'Ý' */
2228
   0xf0, /* 11110000 */
2229
   0xf0, /* 11110000 */
2230
   0xf0, /* 11110000 */
2231
   0xf0, /* 11110000 */
2232
   0xf0, /* 11110000 */
2233
   0xf0, /* 11110000 */
2234
   0xf0, /* 11110000 */
2235
   0xf0, /* 11110000 */
2236

  
2237
   /* 222 0xde 'Þ' */
2238
   0x0f, /* 00001111 */
2239
   0x0f, /* 00001111 */
2240
   0x0f, /* 00001111 */
2241
   0x0f, /* 00001111 */
2242
   0x0f, /* 00001111 */
2243
   0x0f, /* 00001111 */
2244
   0x0f, /* 00001111 */
2245
   0x0f, /* 00001111 */
2246

  
2247
   /* 223 0xdf 'ß' */
2248
   0xff, /* 11111111 */
2249
   0xff, /* 11111111 */
2250
   0xff, /* 11111111 */
2251
   0xff, /* 11111111 */
2252
   0x00, /* 00000000 */
2253
   0x00, /* 00000000 */
2254
   0x00, /* 00000000 */
2255
   0x00, /* 00000000 */
2256

  
2257
   /* 224 0xe0 'à' */
2258
   0x00, /* 00000000 */
2259
   0x00, /* 00000000 */
2260
   0x76, /* 01110110 */
2261
   0xdc, /* 11011100 */
2262
   0xc8, /* 11001000 */
2263
   0xdc, /* 11011100 */
2264
   0x76, /* 01110110 */
2265
   0x00, /* 00000000 */
2266

  
2267
   /* 225 0xe1 'á' */
2268
   0x78, /* 01111000 */
2269
   0xcc, /* 11001100 */
2270
   0xcc, /* 11001100 */
2271
   0xd8, /* 11011000 */
2272
   0xcc, /* 11001100 */
2273
   0xc6, /* 11000110 */
2274
   0xcc, /* 11001100 */
2275
   0x00, /* 00000000 */
2276

  
2277
   /* 226 0xe2 'â' */
2278
   0xfe, /* 11111110 */
2279
   0xc6, /* 11000110 */
2280
   0xc0, /* 11000000 */
2281
   0xc0, /* 11000000 */
2282
   0xc0, /* 11000000 */
2283
   0xc0, /* 11000000 */
2284
   0xc0, /* 11000000 */
2285
   0x00, /* 00000000 */
2286

  
2287
   /* 227 0xe3 'ã' */
2288
   0x00, /* 00000000 */
2289
   0x00, /* 00000000 */
2290
   0xfe, /* 11111110 */
2291
   0x6c, /* 01101100 */
2292
   0x6c, /* 01101100 */
2293
   0x6c, /* 01101100 */
2294
   0x6c, /* 01101100 */
2295
   0x00, /* 00000000 */
2296

  
2297
   /* 228 0xe4 'ä' */
2298
   0xfe, /* 11111110 */
2299
   0xc6, /* 11000110 */
2300
   0x60, /* 01100000 */
2301
   0x30, /* 00110000 */
2302
   0x60, /* 01100000 */
2303
   0xc6, /* 11000110 */
2304
   0xfe, /* 11111110 */
2305
   0x00, /* 00000000 */
2306

  
2307
   /* 229 0xe5 'å' */
2308
   0x00, /* 00000000 */
2309
   0x00, /* 00000000 */
2310
   0x7e, /* 01111110 */
2311
   0xd8, /* 11011000 */
2312
   0xd8, /* 11011000 */
2313
   0xd8, /* 11011000 */
2314
   0x70, /* 01110000 */
2315
   0x00, /* 00000000 */
2316

  
2317
   /* 230 0xe6 'æ' */
2318
   0x00, /* 00000000 */
2319
   0x00, /* 00000000 */
2320
   0x66, /* 01100110 */
2321
   0x66, /* 01100110 */
2322
   0x66, /* 01100110 */
2323
   0x66, /* 01100110 */
2324
   0x7c, /* 01111100 */
2325
   0xc0, /* 11000000 */
2326

  
2327
   /* 231 0xe7 'ç' */
2328
   0x00, /* 00000000 */
2329
   0x76, /* 01110110 */
2330
   0xdc, /* 11011100 */
2331
   0x18, /* 00011000 */
2332
   0x18, /* 00011000 */
2333
   0x18, /* 00011000 */
2334
   0x18, /* 00011000 */
2335
   0x00, /* 00000000 */
2336

  
2337
   /* 232 0xe8 'è' */
2338
   0x7e, /* 01111110 */
2339
   0x18, /* 00011000 */
2340
   0x3c, /* 00111100 */
2341
   0x66, /* 01100110 */
2342
   0x66, /* 01100110 */
2343
   0x3c, /* 00111100 */
2344
   0x18, /* 00011000 */
2345
   0x7e, /* 01111110 */
2346

  
2347
   /* 233 0xe9 'é' */
2348
   0x38, /* 00111000 */
2349
   0x6c, /* 01101100 */
2350
   0xc6, /* 11000110 */
2351
   0xfe, /* 11111110 */
2352
   0xc6, /* 11000110 */
2353
   0x6c, /* 01101100 */
2354
   0x38, /* 00111000 */
2355
   0x00, /* 00000000 */
2356

  
2357
   /* 234 0xea 'ê' */
2358
   0x38, /* 00111000 */
2359
   0x6c, /* 01101100 */
2360
   0xc6, /* 11000110 */
2361
   0xc6, /* 11000110 */
2362
   0x6c, /* 01101100 */
2363
   0x6c, /* 01101100 */
2364
   0xee, /* 11101110 */
2365
   0x00, /* 00000000 */
2366

  
2367
   /* 235 0xeb 'ë' */
2368
   0x0e, /* 00001110 */
2369
   0x18, /* 00011000 */
2370
   0x0c, /* 00001100 */
2371
   0x3e, /* 00111110 */
2372
   0x66, /* 01100110 */
2373
   0x66, /* 01100110 */
2374
   0x3c, /* 00111100 */
2375
   0x00, /* 00000000 */
2376

  
2377
   /* 236 0xec 'ì' */
2378
   0x00, /* 00000000 */
2379
   0x00, /* 00000000 */
2380
   0x7e, /* 01111110 */
2381
   0xdb, /* 11011011 */
2382
   0xdb, /* 11011011 */
2383
   0x7e, /* 01111110 */
2384
   0x00, /* 00000000 */
2385
   0x00, /* 00000000 */
2386

  
2387
   /* 237 0xed 'í' */
2388
   0x06, /* 00000110 */
2389
   0x0c, /* 00001100 */
2390
   0x7e, /* 01111110 */
2391
   0xdb, /* 11011011 */
2392
   0xdb, /* 11011011 */
2393
   0x7e, /* 01111110 */
2394
   0x60, /* 01100000 */
2395
   0xc0, /* 11000000 */
2396

  
2397
   /* 238 0xee 'î' */
2398
   0x1e, /* 00011110 */
2399
   0x30, /* 00110000 */
2400
   0x60, /* 01100000 */
2401
   0x7e, /* 01111110 */
2402
   0x60, /* 01100000 */
2403
   0x30, /* 00110000 */
2404
   0x1e, /* 00011110 */
2405
   0x00, /* 00000000 */
2406

  
2407
   /* 239 0xef 'ï' */
2408
   0x00, /* 00000000 */
2409
   0x7c, /* 01111100 */
2410
   0xc6, /* 11000110 */
2411
   0xc6, /* 11000110 */
2412
   0xc6, /* 11000110 */
2413
   0xc6, /* 11000110 */
2414
   0xc6, /* 11000110 */
2415
   0x00, /* 00000000 */
2416

  
2417
   /* 240 0xf0 'ð' */
2418
   0x00, /* 00000000 */
2419
   0xfe, /* 11111110 */
2420
   0x00, /* 00000000 */
2421
   0xfe, /* 11111110 */
2422
   0x00, /* 00000000 */
2423
   0xfe, /* 11111110 */
2424
   0x00, /* 00000000 */
2425
   0x00, /* 00000000 */
2426

  
2427
   /* 241 0xf1 'ñ' */
2428
   0x18, /* 00011000 */
2429
   0x18, /* 00011000 */
2430
   0x7e, /* 01111110 */
2431
   0x18, /* 00011000 */
2432
   0x18, /* 00011000 */
2433
   0x00, /* 00000000 */
2434
   0x7e, /* 01111110 */
2435
   0x00, /* 00000000 */
2436

  
2437
   /* 242 0xf2 'ò' */
2438
   0x30, /* 00110000 */
2439
   0x18, /* 00011000 */
2440
   0x0c, /* 00001100 */
2441
   0x18, /* 00011000 */
2442
   0x30, /* 00110000 */
2443
   0x00, /* 00000000 */
2444
   0x7e, /* 01111110 */
2445
   0x00, /* 00000000 */
2446

  
2447
   /* 243 0xf3 'ó' */
2448
   0x0c, /* 00001100 */
2449
   0x18, /* 00011000 */
2450
   0x30, /* 00110000 */
2451
   0x18, /* 00011000 */
2452
   0x0c, /* 00001100 */
2453
   0x00, /* 00000000 */
2454
   0x7e, /* 01111110 */
2455
   0x00, /* 00000000 */
2456

  
2457
   /* 244 0xf4 'ô' */
2458
   0x0e, /* 00001110 */
2459
   0x1b, /* 00011011 */
2460
   0x1b, /* 00011011 */
2461
   0x18, /* 00011000 */
2462
   0x18, /* 00011000 */
2463
   0x18, /* 00011000 */
2464
   0x18, /* 00011000 */
2465
   0x18, /* 00011000 */
2466

  
2467
   /* 245 0xf5 'õ' */
2468
   0x18, /* 00011000 */
2469
   0x18, /* 00011000 */
2470
   0x18, /* 00011000 */
2471
   0x18, /* 00011000 */
2472
   0x18, /* 00011000 */
2473
   0xd8, /* 11011000 */
2474
   0xd8, /* 11011000 */
2475
   0x70, /* 01110000 */
2476

  
2477
   /* 246 0xf6 'ö' */
2478
   0x00, /* 00000000 */
2479
   0x18, /* 00011000 */
2480
   0x00, /* 00000000 */
2481
   0x7e, /* 01111110 */
2482
   0x00, /* 00000000 */
2483
   0x18, /* 00011000 */
2484
   0x00, /* 00000000 */
2485
   0x00, /* 00000000 */
2486

  
2487
   /* 247 0xf7 '÷' */
2488
   0x00, /* 00000000 */
2489
   0x76, /* 01110110 */
2490
   0xdc, /* 11011100 */
2491
   0x00, /* 00000000 */
2492
   0x76, /* 01110110 */
2493
   0xdc, /* 11011100 */
2494
   0x00, /* 00000000 */
2495
   0x00, /* 00000000 */
2496

  
2497
   /* 248 0xf8 'ø' */
2498
   0x38, /* 00111000 */
2499
   0x6c, /* 01101100 */
2500
   0x6c, /* 01101100 */
2501
   0x38, /* 00111000 */
2502
   0x00, /* 00000000 */
2503
   0x00, /* 00000000 */
2504
   0x00, /* 00000000 */
2505
   0x00, /* 00000000 */
2506

  
2507
   /* 249 0xf9 'ù' */
2508
   0x00, /* 00000000 */
2509
   0x00, /* 00000000 */
2510
   0x00, /* 00000000 */
2511
   0x18, /* 00011000 */
2512
   0x18, /* 00011000 */
2513
   0x00, /* 00000000 */
2514
   0x00, /* 00000000 */
2515
   0x00, /* 00000000 */
2516

  
2517
   /* 250 0xfa 'ú' */
2518
   0x00, /* 00000000 */
2519
   0x00, /* 00000000 */
2520
   0x00, /* 00000000 */
2521
   0x18, /* 00011000 */
2522
   0x00, /* 00000000 */
2523
   0x00, /* 00000000 */
2524
   0x00, /* 00000000 */
2525
   0x00, /* 00000000 */
2526

  
2527
   /* 251 0xfb 'û' */
2528
   0x0f, /* 00001111 */
2529
   0x0c, /* 00001100 */
2530
   0x0c, /* 00001100 */
2531
   0x0c, /* 00001100 */
2532
   0xec, /* 11101100 */
2533
   0x6c, /* 01101100 */
2534
   0x3c, /* 00111100 */
2535
   0x1c, /* 00011100 */
2536

  
2537
   /* 252 0xfc 'ü' */
2538
   0x6c, /* 01101100 */
2539
   0x36, /* 00110110 */
2540
   0x36, /* 00110110 */
2541
   0x36, /* 00110110 */
2542
   0x36, /* 00110110 */
2543
   0x00, /* 00000000 */
2544
   0x00, /* 00000000 */
2545
   0x00, /* 00000000 */
2546

  
2547
   /* 253 0xfd 'ý' */
2548
   0x78, /* 01111000 */
2549
   0x0c, /* 00001100 */
2550
   0x18, /* 00011000 */
2551
   0x30, /* 00110000 */
2552
   0x7c, /* 01111100 */
2553
   0x00, /* 00000000 */
2554
   0x00, /* 00000000 */
2555
   0x00, /* 00000000 */
2556

  
2557
   /* 254 0xfe 'þ' */
2558
   0x00, /* 00000000 */
2559
   0x00, /* 00000000 */
2560
   0x3c, /* 00111100 */
2561
   0x3c, /* 00111100 */
2562
   0x3c, /* 00111100 */
2563
   0x3c, /* 00111100 */
2564
   0x00, /* 00000000 */
2565
   0x00, /* 00000000 */
2566

  
2567
   /* 255 0xff 'ÿ' */
2568
   0x00, /* 00000000 */
2569
   0x00, /* 00000000 */
2570
   0x00, /* 00000000 */
2571
   0x00, /* 00000000 */
2572
   0x00, /* 00000000 */
2573
   0x00, /* 00000000 */
2574
   0x00, /* 00000000 */
2575
   0x00, /* 00000000 */
2576

  
2577
};
fw/wiringPi/devLib/gertboard.c
1
/*
2
 * gertboard.c:
3
 *	Access routines for the SPI devices on the Gertboard
4
 *	Copyright (c) 2012 Gordon Henderson
5
 *
6
 *	The Gertboard has:
7
 *
8
 *		An MCP3002 dual-channel A to D convertor connected
9
 *		to the SPI bus, selected by chip-select A, and:
10
 *
11
 *		An MCP4802 dual-channel D to A convertor connected
12
 *		to the SPI bus, selected via chip-select B.
13
 *
14
 ***********************************************************************
15
 * This file is part of wiringPi:
16
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
17
 *
18
 *    wiringPi is free software: you can redistribute it and/or modify
19
 *    it under the terms of the GNU Lesser General Public License as
20
 *    published by the Free Software Foundation, either version 3 of the
21
 *    License, or (at your option) any later version.
22
 *
23
 *    wiringPi is distributed in the hope that it will be useful,
24
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 *    GNU Lesser General Public License for more details.
27
 *
28
 *    You should have received a copy of the GNU Lesser General Public
29
 *    License along with wiringPi.
30
 *    If not, see <http://www.gnu.org/licenses/>.
31
 ***********************************************************************
32
 */
33

  
34

  
35
#include <stdio.h>
36
#include <stdint.h>
37
#include <fcntl.h>
38
#include <sys/ioctl.h>
39
#include <linux/spi/spidev.h>
40

  
41
#include <wiringPi.h>
42
#include <wiringPiSPI.h>
43

  
44
#include "gertboard.h"
45

  
46
// The A-D convertor won't run at more than 1MHz @ 3.3v
47

  
48
#define	SPI_ADC_SPEED	1000000
49
#define	SPI_DAC_SPEED	1000000
50
#define	SPI_A2D		      0
51
#define	SPI_D2A		      1
52

  
53

  
54
/*
55
 * gertboardAnalogWrite:
56
 *	Write an 8-bit data value to the MCP4802 Analog to digital
57
 *	convertor on the Gertboard.
58
 *********************************************************************************
59
 */
60

  
61
void gertboardAnalogWrite (const int chan, const int value)
62
{
63
  uint8_t spiData [2] ;
64
  uint8_t chanBits, dataBits ;
65

  
66
  if (chan == 0)
67
    chanBits = 0x30 ;
68
  else
69
    chanBits = 0xB0 ;
70

  
71
  chanBits |= ((value >> 4) & 0x0F) ;
72
  dataBits  = ((value << 4) & 0xF0) ;
73

  
74
  spiData [0] = chanBits ;
75
  spiData [1] = dataBits ;
76

  
77
  wiringPiSPIDataRW (SPI_D2A, spiData, 2) ;
78
}
79

  
80

  
81
/*
82
 * gertboardAnalogRead:
83
 *	Return the analog value of the given channel (0/1).
84
 *	The A/D is a 10-bit device
85
 *********************************************************************************
86
 */
87

  
88
int gertboardAnalogRead (const int chan)
89
{
90
  uint8_t spiData [2] ;
91

  
92
  uint8_t chanBits ;
93

  
94
  if (chan == 0)
95
    chanBits = 0b11010000 ;
96
  else
97
    chanBits = 0b11110000 ;
98

  
99
  spiData [0] = chanBits ;
100
  spiData [1] = 0 ;
101

  
102
  wiringPiSPIDataRW (SPI_A2D, spiData, 2) ;
103

  
104
  return ((spiData [0] << 8) | (spiData [1] >> 1)) & 0x3FF ;
105
}
106

  
107

  
108
/*
109
 * gertboardSPISetup:
110
 *	Initialise the SPI bus, etc.
111
 *********************************************************************************
112
 */
113

  
114
int gertboardSPISetup (void)
115
{
116
  if (wiringPiSPISetup (SPI_A2D, SPI_ADC_SPEED) < 0)
117
    return -1 ;
118

  
119
  if (wiringPiSPISetup (SPI_D2A, SPI_DAC_SPEED) < 0)
120
    return -1 ;
121

  
122
  return 0 ;
123
}
124

  
125

  
126
/*
127
 * New wiringPi node extension methods.
128
 *********************************************************************************
129
 */
130

  
131
static int myAnalogRead (struct wiringPiNodeStruct *node, const int chan)
132
{
133
  return gertboardAnalogRead (chan - node->pinBase) ;
134
}
135

  
136
static void myAnalogWrite (struct wiringPiNodeStruct *node, const int chan, const int value)
137
{
138
  gertboardAnalogWrite (chan - node->pinBase, value) ;
139
}
140

  
141

  
142
/*
143
 * gertboardAnalogSetup:
144
 *	Create a new wiringPi device node for the analog devices on the
145
 *	Gertboard. We create one node with 2 pins - each pin being read
146
 *	and write - although the operations actually go to different
147
 *	hardware devices.
148
 *********************************************************************************
149
 */
150

  
151
int gertboardAnalogSetup (const int pinBase)
152
{
153
  struct wiringPiNodeStruct *node ;
154
  int    x ;
155

  
156
  if (( x = gertboardSPISetup ()) != 0)
157
    return  x;
158

  
159
  node = wiringPiNewNode (pinBase, 2) ;
160
  node->analogRead  = myAnalogRead ;
161
  node->analogWrite = myAnalogWrite ;
162

  
163
  return 0 ;
164
}
fw/wiringPi/devLib/gertboard.h
1
/*
2
 * gertboard.h:
3
 *	Access routines for the SPI devices on the Gertboard
4
 *	Copyright (c) 2012 Gordon Henderson
5
 *
6
 *	The Gertboard has an MCP4802 dual-channel D to A convertor
7
 *	connected to the SPI bus, selected via chip-select B.
8
 *
9
 ***********************************************************************
10
 * This file is part of wiringPi:
11
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
12
 *
13
 *    wiringPi is free software: you can redistribute it and/or modify
14
 *    it under the terms of the GNU Lesser General Public License as
15
 *    published by the Free Software Foundation, either version 3 of the
16
 *    License, or (at your option) any later version.
17
 *
18
 *    wiringPi is distributed in the hope that it will be useful,
19
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 *    GNU Lesser General Public License for more details.
22
 *
23
 *    You should have received a copy of the GNU Lesser General Public
24
 *    License along with wiringPi.
25
 *    If not, see <http://www.gnu.org/licenses/>.
26
 ***********************************************************************
27
 */
28

  
29
#ifdef __cplusplus
30
extern "C" {
31
#endif
32

  
33
// Old routines
34

  
35
extern void gertboardAnalogWrite (const int chan, const int value) ;
36
extern int  gertboardAnalogRead  (const int chan) ;
37
extern int  gertboardSPISetup    (void) ;
38

  
39
// New
40

  
41
extern int  gertboardAnalogSetup (const int pinBase) ;
42

  
43
#ifdef __cplusplus
44
}
45
#endif
fw/wiringPi/devLib/lcd.c
1
/*
2
 * lcd.c:
3
 *	Text-based LCD driver.
4
 *	This is designed to drive the parallel interface LCD drivers
5
 *	based in the Hitachi HD44780U controller and compatables.
6
 *
7
 * Copyright (c) 2012 Gordon Henderson.
8
 ***********************************************************************
9
 * This file is part of wiringPi:
10
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
11
 *
12
 *    wiringPi is free software: you can redistribute it and/or modify
13
 *    it under the terms of the GNU Lesser General Public License as published by
14
 *    the Free Software Foundation, either version 3 of the License, or
15
 *    (at your option) any later version.
16
 *
17
 *    wiringPi is distributed in the hope that it will be useful,
18
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 *    GNU Lesser General Public License for more details.
21
 *
22
 *    You should have received a copy of the GNU Lesser General Public License
23
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
24
 ***********************************************************************
25
 */
26

  
27
#include <stdio.h>
28
#include <stdlib.h>
29
#include <stdarg.h>
30

  
31
#include <wiringPi.h>
32

  
33
#include "lcd.h"
34

  
35
#ifndef	TRUE
36
#  define	TRUE	(1==1)
37
#  define	FALSE	(1==2)
38
#endif
39

  
40
// HD44780U Commands
41

  
42
#define	LCD_CLEAR	0x01
43
#define	LCD_HOME	0x02
44
#define	LCD_ENTRY	0x04
45
#define	LCD_CTRL	0x08
46
#define	LCD_CDSHIFT	0x10
47
#define	LCD_FUNC	0x20
48
#define	LCD_CGRAM	0x40
49
#define	LCD_DGRAM	0x80
50

  
51
// Bits in the entry register
52

  
53
#define	LCD_ENTRY_SH		0x01
54
#define	LCD_ENTRY_ID		0x02
55

  
56
// Bits in the control register
57

  
58
#define	LCD_BLINK_CTRL		0x01
59
#define	LCD_CURSOR_CTRL		0x02
60
#define	LCD_DISPLAY_CTRL	0x04
61

  
62
// Bits in the function register
63

  
64
#define	LCD_FUNC_F	0x04
65
#define	LCD_FUNC_N	0x08
66
#define	LCD_FUNC_DL	0x10
67

  
68
#define	LCD_CDSHIFT_RL	0x04
69

  
70
struct lcdDataStruct
71
{
72
  int bits, rows, cols ;
73
  int rsPin, strbPin ;
74
  int dataPins [8] ;
75
  int cx, cy ;
76
} ;
77

  
78
struct lcdDataStruct *lcds [MAX_LCDS] ;
79

  
80
static int lcdControl ;
81

  
82
// Row offsets
83

  
84
static const int rowOff [4] = { 0x00, 0x40, 0x14, 0x54 } ;
85

  
86

  
87
/*
88
 * strobe:
89
 *	Toggle the strobe (Really the "E") pin to the device.
90
 *	According to the docs, data is latched on the falling edge.
91
 *********************************************************************************
92
 */
93

  
94
static void strobe (const struct lcdDataStruct *lcd)
95
{
96

  
97
// Note timing changes for new version of delayMicroseconds ()
98

  
99
  digitalWrite (lcd->strbPin, 1) ; delayMicroseconds (50) ;
100
  digitalWrite (lcd->strbPin, 0) ; delayMicroseconds (50) ;
101
}
102

  
103

  
104
/*
105
 * sentDataCmd:
106
 *	Send an data or command byte to the display.
107
 *********************************************************************************
108
 */
109

  
110
static void sendDataCmd (const struct lcdDataStruct *lcd, unsigned char data)
111
{
112
  register unsigned char myData = data ;
113
  unsigned char          i, d4 ;
114

  
115
  if (lcd->bits == 4)
116
  {
117
    d4 = (myData >> 4) & 0x0F;
118
    for (i = 0 ; i < 4 ; ++i)
119
    {
120
      digitalWrite (lcd->dataPins [i], (d4 & 1)) ;
121
      d4 >>= 1 ;
122
    }
123
    strobe (lcd) ;
124

  
125
    d4 = myData & 0x0F ;
126
    for (i = 0 ; i < 4 ; ++i)
127
    {
128
      digitalWrite (lcd->dataPins [i], (d4 & 1)) ;
129
      d4 >>= 1 ;
130
    }
131
  }
132
  else
133
  {
134
    for (i = 0 ; i < 8 ; ++i)
135
    {
136
      digitalWrite (lcd->dataPins [i], (myData & 1)) ;
137
      myData >>= 1 ;
138
    }
139
  }
140
  strobe (lcd) ;
141
}
142

  
143

  
144
/*
145
 * putCommand:
146
 *	Send a command byte to the display
147
 *********************************************************************************
148
 */
149

  
150
static void putCommand (const struct lcdDataStruct *lcd, unsigned char command)
151
{
152
  digitalWrite (lcd->rsPin,   0) ;
153
  sendDataCmd  (lcd, command) ;
154
  delay (2) ;
155
}
156

  
157
static void put4Command (const struct lcdDataStruct *lcd, unsigned char command)
158
{
159
  register unsigned char myCommand = command ;
160
  register unsigned char i ;
161

  
162
  digitalWrite (lcd->rsPin,   0) ;
163

  
164
  for (i = 0 ; i < 4 ; ++i)
165
  {
166
    digitalWrite (lcd->dataPins [i], (myCommand & 1)) ;
167
    myCommand >>= 1 ;
168
  }
169
  strobe (lcd) ;
170
}
171

  
172

  
173
/*
174
 *********************************************************************************
175
 * User Callable code below here
176
 *********************************************************************************
177
 */
178

  
179
/*
180
 * lcdHome: lcdClear:
181
 *	Home the cursor or clear the screen.
182
 *********************************************************************************
183
 */
184

  
185
void lcdHome (const int fd)
186
{
187
  struct lcdDataStruct *lcd = lcds [fd] ;
188

  
189
  putCommand (lcd, LCD_HOME) ;
190
  lcd->cx = lcd->cy = 0 ;
191
  delay (5) ;
192
}
193

  
194
void lcdClear (const int fd)
195
{
196
  struct lcdDataStruct *lcd = lcds [fd] ;
197

  
198
  putCommand (lcd, LCD_CLEAR) ;
199
  putCommand (lcd, LCD_HOME) ;
200
  lcd->cx = lcd->cy = 0 ;
201
  delay (5) ;
202
}
203

  
204

  
205
/*
206
 * lcdDisplay: lcdCursor: lcdCursorBlink:
207
 *	Turn the display, cursor, cursor blinking on/off
208
 *********************************************************************************
209
 */
210

  
211
void lcdDisplay (const int fd, int state)
212
{
213
  struct lcdDataStruct *lcd = lcds [fd] ;
214

  
215
  if (state)
216
    lcdControl |=  LCD_DISPLAY_CTRL ;
217
  else
218
    lcdControl &= ~LCD_DISPLAY_CTRL ;
219

  
220
  putCommand (lcd, LCD_CTRL | lcdControl) ; 
221
}
222

  
223
void lcdCursor (const int fd, int state)
224
{
225
  struct lcdDataStruct *lcd = lcds [fd] ;
226

  
227
  if (state)
228
    lcdControl |=  LCD_CURSOR_CTRL ;
229
  else
230
    lcdControl &= ~LCD_CURSOR_CTRL ;
231

  
232
  putCommand (lcd, LCD_CTRL | lcdControl) ; 
233
}
234

  
235
void lcdCursorBlink (const int fd, int state)
236
{
237
  struct lcdDataStruct *lcd = lcds [fd] ;
238

  
239
  if (state)
240
    lcdControl |=  LCD_BLINK_CTRL ;
241
  else
242
    lcdControl &= ~LCD_BLINK_CTRL ;
243

  
244
  putCommand (lcd, LCD_CTRL | lcdControl) ; 
245
}
246

  
247

  
248
/*
249
 * lcdSendCommand:
250
 *	Send any arbitary command to the display
251
 *********************************************************************************
252
 */
253

  
254
void lcdSendCommand (const int fd, unsigned char command)
255
{
256
  struct lcdDataStruct *lcd = lcds [fd] ;
257
  putCommand (lcd, command) ;
258
}
259

  
260

  
261
/*
262
 * lcdPosition:
263
 *	Update the position of the cursor on the display.
264
 *	Ignore invalid locations.
265
 *********************************************************************************
266
 */
267

  
268
void lcdPosition (const int fd, int x, int y)
269
{
270
  struct lcdDataStruct *lcd = lcds [fd] ;
271

  
272
  if ((x > lcd->cols) || (x < 0))
273
    return ;
274
  if ((y > lcd->rows) || (y < 0))
275
    return ;
276

  
277
  putCommand (lcd, x + (LCD_DGRAM | rowOff [y])) ;
278

  
279
  lcd->cx = x ;
280
  lcd->cy = y ;
281
}
282

  
283

  
284
/*
285
 * lcdCharDef:
286
 *	Defines a new character in the CGRAM
287
 *********************************************************************************
288
 */
289

  
290
void lcdCharDef (const int fd, int index, unsigned char data [8])
291
{
292
  struct lcdDataStruct *lcd = lcds [fd] ;
293
  int i ;
294

  
295
  putCommand (lcd, LCD_CGRAM | ((index & 7) << 3)) ;
296

  
297
  digitalWrite (lcd->rsPin, 1) ;
298
  for (i = 0 ; i < 8 ; ++i)
299
    sendDataCmd (lcd, data [i]) ;
300
}
301

  
302

  
303
/*
304
 * lcdPutchar:
305
 *	Send a data byte to be displayed on the display. We implement a very
306
 *	simple terminal here - with line wrapping, but no scrolling. Yet.
307
 *********************************************************************************
308
 */
309

  
310
void lcdPutchar (const int fd, unsigned char data)
311
{
312
  struct lcdDataStruct *lcd = lcds [fd] ;
313

  
314
  digitalWrite (lcd->rsPin, 1) ;
315
  sendDataCmd  (lcd, data) ;
316

  
317
  if (++lcd->cx == lcd->cols)
318
  {
319
    lcd->cx = 0 ;
320
    if (++lcd->cy == lcd->rows)
321
      lcd->cy = 0 ;
322
    
323
    putCommand (lcd, lcd->cx + (LCD_DGRAM | rowOff [lcd->cy])) ;
324
  }
325
}
326

  
327

  
328
/*
329
 * lcdPuts:
330
 *	Send a string to be displayed on the display
331
 *********************************************************************************
332
 */
333

  
334
void lcdPuts (const int fd, const char *string)
335
{
336
  while (*string)
337
    lcdPutchar (fd, *string++) ;
338
}
339

  
340

  
341
/*
342
 * lcdPrintf:
343
 *	Printf to an LCD display
344
 *********************************************************************************
345
 */
346

  
347
void lcdPrintf (const int fd, const char *message, ...)
348
{
349
  va_list argp ;
350
  char buffer [1024] ;
351

  
352
  va_start (argp, message) ;
353
    vsnprintf (buffer, 1023, message, argp) ;
354
  va_end (argp) ;
355

  
356
  lcdPuts (fd, buffer) ;
357
}
358

  
359

  
360
/*
361
 * lcdInit:
362
 *	Take a lot of parameters and initialise the LCD, and return a handle to
363
 *	that LCD, or -1 if any error.
364
 *********************************************************************************
365
 */
366

  
367
int lcdInit (const int rows, const int cols, const int bits,
368
	const int rs, const int strb,
369
	const int d0, const int d1, const int d2, const int d3, const int d4,
370
	const int d5, const int d6, const int d7)
371
{
372
  static int initialised = 0 ;
373

  
374
  unsigned char func ;
375
  int i ;
376
  int lcdFd = -1 ;
377
  struct lcdDataStruct *lcd ;
378

  
379
  if (initialised == 0)
380
  {
381
    initialised = 1 ;
382
    for (i = 0 ; i < MAX_LCDS ; ++i)
383
      lcds [i] = NULL ;
384
  }
385

  
386
// Simple sanity checks
387

  
388
  if (! ((bits == 4) || (bits == 8)))
389
    return -1 ;
390

  
391
  if ((rows < 0) || (rows > 20))
392
    return -1 ;
393

  
394
  if ((cols < 0) || (cols > 20))
395
    return -1 ;
396

  
397
// Create a new LCD:
398

  
399
  for (i = 0 ; i < MAX_LCDS ; ++i)
400
  {
401
    if (lcds [i] == NULL)
402
    {
403
      lcdFd = i ;
404
      break ;
405
    }
406
  }
407

  
408
  if (lcdFd == -1)
409
    return -1 ;
410

  
411
  lcd = (struct lcdDataStruct *)malloc (sizeof (struct lcdDataStruct)) ;
412
  if (lcd == NULL)
413
    return -1 ;
414

  
415
  lcd->rsPin   = rs ;
416
  lcd->strbPin = strb ;
417
  lcd->bits    = 8 ;		// For now - we'll set it properly later.
418
  lcd->rows    = rows ;
419
  lcd->cols    = cols ;
420
  lcd->cx      = 0 ;
421
  lcd->cy      = 0 ;
422

  
423
  lcd->dataPins [0] = d0 ;
424
  lcd->dataPins [1] = d1 ;
425
  lcd->dataPins [2] = d2 ;
426
  lcd->dataPins [3] = d3 ;
427
  lcd->dataPins [4] = d4 ;
428
  lcd->dataPins [5] = d5 ;
429
  lcd->dataPins [6] = d6 ;
430
  lcd->dataPins [7] = d7 ;
431

  
432
  lcds [lcdFd] = lcd ;
433

  
434
  digitalWrite (lcd->rsPin,   0) ; pinMode (lcd->rsPin,   OUTPUT) ;
435
  digitalWrite (lcd->strbPin, 0) ; pinMode (lcd->strbPin, OUTPUT) ;
436

  
437
  for (i = 0 ; i < bits ; ++i)
438
  {
439
    digitalWrite (lcd->dataPins [i], 0) ;
440
    pinMode      (lcd->dataPins [i], OUTPUT) ;
441
  }
442
  delay (35) ; // mS
443

  
444

  
445
// 4-bit mode?
446
//	OK. This is a PIG and it's not at all obvious from the documentation I had,
447
//	so I guess some others have worked through either with better documentation
448
//	or more trial and error... Anyway here goes:
449
//
450
//	It seems that the controller needs to see the FUNC command at least 3 times
451
//	consecutively - in 8-bit mode. If you're only using 8-bit mode, then it appears
452
//	that you can get away with one func-set, however I'd not rely on it...
453
//
454
//	So to set 4-bit mode, you need to send the commands one nibble at a time,
455
//	the same three times, but send the command to set it into 8-bit mode those
456
//	three times, then send a final 4th command to set it into 4-bit mode, and only
457
//	then can you flip the switch for the rest of the library to work in 4-bit
458
//	mode which sends the commands as 2 x 4-bit values.
459

  
460
  if (bits == 4)
461
  {
462
    func = LCD_FUNC | LCD_FUNC_DL ;			// Set 8-bit mode 3 times
463
    put4Command (lcd, func >> 4) ; delay (35) ;
464
    put4Command (lcd, func >> 4) ; delay (35) ;
465
    put4Command (lcd, func >> 4) ; delay (35) ;
466
    func = LCD_FUNC ;					// 4th set: 4-bit mode
467
    put4Command (lcd, func >> 4) ; delay (35) ;
468
    lcd->bits = 4 ;
469
  }
470
  else
471
  {
472
    func = LCD_FUNC | LCD_FUNC_DL ;
473
    putCommand  (lcd, func     ) ; delay (35) ;
474
    putCommand  (lcd, func     ) ; delay (35) ;
475
    putCommand  (lcd, func     ) ; delay (35) ;
476
  }
477

  
478
  if (lcd->rows > 1)
479
  {
480
    func |= LCD_FUNC_N ;
481
    putCommand (lcd, func) ; delay (35) ;
482
  }
483

  
484
// Rest of the initialisation sequence
485

  
486
  lcdDisplay     (lcdFd, TRUE) ;
487
  lcdCursor      (lcdFd, FALSE) ;
488
  lcdCursorBlink (lcdFd, FALSE) ;
489
  lcdClear       (lcdFd) ;
490

  
491
  putCommand (lcd, LCD_ENTRY   | LCD_ENTRY_ID) ;
492
  putCommand (lcd, LCD_CDSHIFT | LCD_CDSHIFT_RL) ;
493

  
494
  return lcdFd ;
495
}
fw/wiringPi/devLib/lcd.h
1
/*
2
 * lcd.h:
3
 *	Text-based LCD driver.
4
 *	This is designed to drive the parallel interface LCD drivers
5
 *	based in the Hitachi HD44780U controller and compatables.
6
 *
7
 * Copyright (c) 2012 Gordon Henderson.
8
 ***********************************************************************
9
 * This file is part of wiringPi:
10
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
11
 *
12
 *    wiringPi is free software: you can redistribute it and/or modify
13
 *    it under the terms of the GNU Lesser General Public License as published by
14
 *    the Free Software Foundation, either version 3 of the License, or
15
 *    (at your option) any later version.
16
 *
17
 *    wiringPi is distributed in the hope that it will be useful,
18
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 *    GNU Lesser General Public License for more details.
21
 *
22
 *    You should have received a copy of the GNU Lesser General Public License
23
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
24
 ***********************************************************************
25
 */
26

  
27
#define	MAX_LCDS	8
28

  
29
#ifdef __cplusplus
30
extern "C" {
31
#endif
32

  
33
extern void lcdHome        (const int fd) ;
34
extern void lcdClear       (const int fd) ;
35
extern void lcdDisplay     (const int fd, int state) ;
36
extern void lcdCursor      (const int fd, int state) ;
37
extern void lcdCursorBlink (const int fd, int state) ;
38
extern void lcdSendCommand (const int fd, unsigned char command) ;
39
extern void lcdPosition    (const int fd, int x, int y) ;
40
extern void lcdCharDef     (const int fd, int index, unsigned char data [8]) ;
41
extern void lcdPutchar     (const int fd, unsigned char data) ;
42
extern void lcdPuts        (const int fd, const char *string) ;
43
extern void lcdPrintf      (const int fd, const char *message, ...) ;
44

  
45
extern int  lcdInit (const int rows, const int cols, const int bits,
46
	const int rs, const int strb,
47
	const int d0, const int d1, const int d2, const int d3, const int d4,
48
	const int d5, const int d6, const int d7) ;
49

  
50
#ifdef __cplusplus
51
}
52
#endif
fw/wiringPi/devLib/lcd128x64.c
1
/*
2
 * lcd128x64.c:
3
 *	Graphics-based LCD driver.
4
 *	This is designed to drive the parallel interface LCD drivers
5
 *	based on the generic 12864H chips
6
 *
7
 *	There are many variations on these chips, however they all mostly
8
 *	seem to be similar.
9
 *	This implementation has the Pins from the Pi hard-wired into it,
10
 *	in particular wiringPi pins 0-7 so that we can use
11
 *	digitalWriteByete() to speed things up somewhat.
12
 *
13
 * Copyright (c) 2013 Gordon Henderson.
14
 ***********************************************************************
15
 * This file is part of wiringPi:
16
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
17
 *
18
 *    wiringPi is free software: you can redistribute it and/or modify
19
 *    it under the terms of the GNU Lesser General Public License as published by
20
 *    the Free Software Foundation, either version 3 of the License, or
21
 *    (at your option) any later version.
22
 *
23
 *    wiringPi is distributed in the hope that it will be useful,
24
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 *    GNU Lesser General Public License for more details.
27
 *
28
 *    You should have received a copy of the GNU Lesser General Public License
29
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
30
 ***********************************************************************
31
 */
32

  
33
#include <stdio.h>
34
#include <stdlib.h>
35

  
36
#include <wiringPi.h>
37

  
38
#include "font.h"
39
#include "lcd128x64.h"
40

  
41
// Size
42

  
43
#define	LCD_WIDTH	128
44
#define	LCD_HEIGHT	 64
45

  
46
// Hardware Pins
47
//	Note pins 0-7 are the 8-bit data port
48

  
49
#define	CS1		10
50
#define	CS2		11
51
#define	STROBE		12
52
#define	RS		13
53

  
54
// Software copy of the framebuffer
55
//	it's 8-bit deep although the display itself is only 1-bit deep.
56

  
57
static unsigned char frameBuffer [LCD_WIDTH * LCD_HEIGHT] ;
58

  
59
static int maxX,    maxY ;
60
static int lastX,   lastY ;
61
static int xOrigin, yOrigin ;
62
static int lcdOrientation = 0 ;
63

  
64
/*
65
 * strobe:
66
 *	Toggle the strobe (Really the "E") pin to the device.
67
 *	According to the docs, data is latched on the falling edge.
68
 *********************************************************************************
69
 */
70

  
71
static void strobe (void)
72
{
73
  digitalWrite (STROBE, 1) ; delayMicroseconds (1) ;
74
  digitalWrite (STROBE, 0) ; delayMicroseconds (5) ;
75
}
76

  
77

  
78
/*
79
 * sentData:
80
 *	Send an data or command byte to the display.
81
 *********************************************************************************
82
 */
83

  
84
static void sendData (const int data, const int chip)
85
{
86
  digitalWrite     (chip, 0) ;
87
  digitalWriteByte (data) ;
88
  strobe           () ;
89
  digitalWrite     (chip, 1) ;
90
}
91

  
92

  
93
/*
94
 * sendCommand:
95
 *	Send a command byte to the display
96
 *********************************************************************************
97
 */
98

  
99
static void sendCommand (const int command, const int chip)
100
{
101
  digitalWrite (RS, 0) ;
102
  sendData     (command, chip) ;
103
  digitalWrite (RS, 1) ;
104
}
105

  
106

  
107
/*
108
 * setCol: SetLine:
109
 *	Set the column and line addresses
110
 *********************************************************************************
111
 */
112

  
113
static void setCol  (int col, const int chip)
114
  { sendCommand (0x40 | (col  & 0x3F), chip) ; }
115

  
116
static void setLine (int line, const int chip)
117
  { sendCommand (0xB8 | (line & 0x07), chip) ; }
118

  
119

  
120
/*
121
 * lcd128x64update:
122
 *	Copy our software version to the real display
123
 *********************************************************************************
124
 */
125

  
126
void lcd128x64update (void)
127
{
128
  int line, x, y, fbLoc ;
129
  unsigned char byte ;
130

  
131
// Left side 
132

  
133
  for (line = 0 ; line < 8 ; ++line)
134
  {
135
    setCol  (0,    CS1) ;
136
    setLine (line, CS1) ;
137

  
138
    for (x = 63 ; x >= 0 ; --x)
139
    {
140
      byte = 0 ;
141
      for (y = 0 ; y < 8 ; ++y)
142
      {
143
	fbLoc = x + (((7 - line) * 8) + (7 - y)) * LCD_WIDTH ;
144
	if (frameBuffer [fbLoc] != 0)
145
	  byte |= (1 << y) ;
146
      }
147
      sendData (byte, CS1) ;
148
    }
149
  }
150

  
151
// Right side 
152

  
153
  for (line = 0 ; line < 8 ; ++line)
154
  {
155
    setCol  (0,    CS2) ;
156
    setLine (line, CS2) ;
157

  
158
    for (x = 127 ; x >= 64 ; --x)
159
    {
160
      byte = 0 ;
161
      for (y = 0 ; y < 8 ; ++y)
162
      {
163
	fbLoc = x + (((7 - line) * 8) + (7 - y)) * LCD_WIDTH ;
164
	if (frameBuffer [fbLoc] != 0)
165
	  byte |= (1 << y) ;
166
      }
167
      sendData (byte, CS2) ;
168
    }
169
  }
170
}
171

  
172

  
173
/*
174
 * lcd128x64setOrigin:
175
 *	Set the display offset origin
176
 *********************************************************************************
177
 */
178

  
179
void lcd128x64setOrigin (int x, int y)
180
{
181
  xOrigin = x ;
182
  yOrigin = y ;
183
}
184

  
185

  
186
/*
187
 * lcd128x64setOrientation:
188
 *	Set the display orientation:
189
 *	0: Normal, the display is portrait mode, 0,0 is top left
190
 *	1: Landscape
191
 *	2: Portrait, flipped
192
 *	3: Landscape, flipped
193
 *********************************************************************************
194
 */
195

  
196
void lcd128x64setOrientation (int orientation)
197
{
198
  lcdOrientation = orientation & 3 ;
199

  
200
  lcd128x64setOrigin (0,0) ;
201

  
202
  switch (lcdOrientation)
203
  {
204
    case 0:
205
      maxX = LCD_WIDTH ;
206
      maxY = LCD_HEIGHT ;
207
      break ;
208

  
209
    case 1:
210
      maxX = LCD_HEIGHT ;
211
      maxY = LCD_WIDTH ;
212
      break ;
213

  
214
    case 2:
215
      maxX = LCD_WIDTH ;
216
      maxY = LCD_HEIGHT ;
217
      break ;
218

  
219
    case 3:
220
      maxX = LCD_HEIGHT ;
221
      maxY = LCD_WIDTH ;
222
      break ;
223
  }
224
}
225

  
226

  
227
/*
228
 * lcd128x64orientCoordinates:
229
 *	Adjust the coordinates given to the display orientation
230
 *********************************************************************************
231
 */
232

  
233
void lcd128x64orientCoordinates (int *x, int *y)
234
{
235
  register int tmp ;
236

  
237
  *x += xOrigin ;
238
  *y += yOrigin ;
239
  *y  = maxY - *y - 1 ;
240

  
241
  switch (lcdOrientation)
242
  {
243
    case 0:
244
      break;
245

  
246
    case 1:
247
      tmp = maxY - *y - 1 ;
248
      *y = *x ;
249
      *x = tmp ;
250
      break;
251

  
252
    case 2:
253
      *x = maxX - *x - 1 ;
254
      *y = maxY - *y - 1 ;
255
      break;
256

  
257
    case 3:
258
      *x = maxX - *x - 1 ;
259
      tmp = *y ;
260
      *y = *x ;
261
      *x = tmp ;
262
      break ;
263
  }
264
}
265

  
266

  
267
/*
268
 * lcd128x64getScreenSize:
269
 *	Return the max X & Y screen sizes. Needs to be called again, if you 
270
 *	change screen orientation.
271
 *********************************************************************************
272
 */
273

  
274
void lcd128x64getScreenSize (int *x, int *y)
275
{
276
  *x = maxX ;
277
  *y = maxY ;
278
}
279

  
280

  
281
/*
282
 *********************************************************************************
283
 * Standard Graphical Functions
284
 *********************************************************************************
285
 */
286

  
287

  
288
/*
289
 * lcd128x64point:
290
 *	Plot a pixel.
291
 *********************************************************************************
292
 */
293

  
294
void lcd128x64point (int x, int y, int colour)
295
{
296
  lastX = x ;
297
  lastY = y ;
298

  
299
  lcd128x64orientCoordinates (&x, &y) ;
300

  
301
  if ((x < 0) || (x >= LCD_WIDTH) || (y < 0) || (y >= LCD_HEIGHT))
302
    return ;
303

  
304
  frameBuffer [x + y * LCD_WIDTH] = colour ;
305
}
306

  
307

  
308
/*
309
 * lcd128x64line: lcd128x64lineTo:
310
 *	Classic Bressenham Line code
311
 *********************************************************************************
312
 */
313

  
314
void lcd128x64line (int x0, int y0, int x1, int y1, int colour)
315
{
316
  int dx, dy ;
317
  int sx, sy ;
318
  int err, e2 ;
319

  
320
  lastX = x1 ;
321
  lastY = y1 ;
322

  
323
  dx = abs (x1 - x0) ;
324
  dy = abs (y1 - y0) ;
325

  
326
  sx = (x0 < x1) ? 1 : -1 ;
327
  sy = (y0 < y1) ? 1 : -1 ;
328

  
329
  err = dx - dy ;
330
 
331
  for (;;)
332
  {
333
    lcd128x64point (x0, y0, colour) ;
334

  
335
    if ((x0 == x1) && (y0 == y1))
336
      break ;
337

  
338
    e2 = 2 * err ;
339

  
340
    if (e2 > -dy)
341
    {
342
      err -= dy ;
343
      x0  += sx ;
344
    }
345

  
346
    if (e2 < dx)
347
    {
348
      err += dx ;
349
      y0  += sy ;
350
    }
351
  }
352

  
353
}
354

  
355
void lcd128x64lineTo (int x, int y, int colour)
356
{
357
  lcd128x64line (lastX, lastY, x, y, colour) ;
358
}
359

  
360

  
361
/*
362
 * lcd128x64rectangle:
363
 *	A rectangle is a spoilt days fishing
364
 *********************************************************************************
365
 */
366

  
367
void lcd128x64rectangle (int x1, int y1, int x2, int y2, int colour, int filled)
368
{
369
  register int x ;
370

  
371
  if (filled)
372
  {
373
    /**/ if (x1 == x2)
374
      lcd128x64line (x1, y1, x2, y2, colour) ;
375
    else if (x1 < x2)
376
      for (x = x1 ; x <= x2 ; ++x)
377
	lcd128x64line (x, y1, x, y2, colour) ;
378
    else
379
      for (x = x2 ; x <= x1 ; ++x)
380
	lcd128x64line (x, y1, x, y2, colour) ;
381
  }
382
  else
383
  {
384
    lcd128x64line   (x1, y1, x2, y1, colour) ;
385
    lcd128x64lineTo (x2, y2, colour) ;
386
    lcd128x64lineTo (x1, y2, colour) ;
387
    lcd128x64lineTo (x1, y1, colour) ;
388
  }
389
}
390

  
391

  
392
/*
393
 * lcd128x64circle:
394
 *      This is the midpoint circle algorithm.
395
 *********************************************************************************
396
 */
397

  
398
void lcd128x64circle (int x, int y, int r, int colour, int filled)
399
{
400
  int ddF_x = 1 ;
401
  int ddF_y = -2 * r ;
402

  
403
  int f = 1 - r ;
404
  int x1 = 0 ;
405
  int y1 = r ;
406

  
407
  if (filled)
408
  {
409
    lcd128x64line (x, y + r, x, y - r, colour) ;
410
    lcd128x64line (x + r, y, x - r, y, colour) ;
411
  }
412
  else
413
  {
414
    lcd128x64point (x, y + r, colour) ;
415
    lcd128x64point (x, y - r, colour) ;
416
    lcd128x64point (x + r, y, colour) ;
417
    lcd128x64point (x - r, y, colour) ;
418
  }
419

  
420
  while (x1 < y1)
421
  {
422
    if (f >= 0)
423
    {
424
      y1-- ;
425
      ddF_y += 2 ;
426
      f += ddF_y ;
427
    }
428
    x1++ ;
429
    ddF_x += 2 ;
430
    f += ddF_x ;
431
    if (filled)
432
    {
433
      lcd128x64line (x + x1, y + y1, x - x1, y + y1, colour) ;
434
      lcd128x64line (x + x1, y - y1, x - x1, y - y1, colour) ;
435
      lcd128x64line (x + y1, y + x1, x - y1, y + x1, colour) ;
436
      lcd128x64line (x + y1, y - x1, x - y1, y - x1, colour) ;
437
    }
438
    else
439
    {
440
      lcd128x64point (x + x1, y + y1, colour) ; lcd128x64point (x - x1, y + y1, colour) ;
441
      lcd128x64point (x + x1, y - y1, colour) ; lcd128x64point (x - x1, y - y1, colour) ;
442
      lcd128x64point (x + y1, y + x1, colour) ; lcd128x64point (x - y1, y + x1, colour) ;
443
      lcd128x64point (x + y1, y - x1, colour) ; lcd128x64point (x - y1, y - x1, colour) ;
444
    }
445
  }
446
}
447

  
448

  
449
/*
450
 * lcd128x64ellipse:
451
 *	Fast ellipse drawing algorithm by 
452
 *      John Kennedy
453
 *	Mathematics Department
454
 *	Santa Monica College
455
 *	1900 Pico Blvd.
456
 *	Santa Monica, CA 90405
457
 *	jrkennedy6@gmail.com
458
 *	-Confirned in email this algorithm is in the public domain -GH-
459
 *********************************************************************************
460
 */
461

  
462
static void plot4ellipsePoints (int cx, int cy, int x, int y, int colour, int filled)
463
{
464
  if (filled)
465
  {
466
    lcd128x64line (cx + x, cy + y, cx - x, cy + y, colour) ;
467
    lcd128x64line (cx - x, cy - y, cx + x, cy - y, colour) ;
468
  }
469
  else
470
  {
471
    lcd128x64point (cx + x, cy + y, colour) ;
472
    lcd128x64point (cx - x, cy + y, colour) ;
473
    lcd128x64point (cx - x, cy - y, colour) ;
474
    lcd128x64point (cx + x, cy - y, colour) ;
475
  }
476
}
477

  
478
void lcd128x64ellipse (int cx, int cy, int xRadius, int yRadius, int colour, int filled)
479
{
480
  int x, y ;
481
  int xChange, yChange, ellipseError ;
482
  int twoAsquare, twoBsquare ;
483
  int stoppingX, stoppingY ;
484

  
485
  twoAsquare = 2 * xRadius * xRadius ;
486
  twoBsquare = 2 * yRadius * yRadius ;
487

  
488
  x = xRadius ;
489
  y = 0 ;
490

  
491
  xChange = yRadius * yRadius * (1 - 2 * xRadius) ;
492
  yChange = xRadius * xRadius ;
493

  
494
  ellipseError = 0 ;
495
  stoppingX    = twoBsquare * xRadius ;
496
  stoppingY    = 0 ;
497

  
498
  while (stoppingX >= stoppingY)	// 1st set of points
499
  {
500
    plot4ellipsePoints (cx, cy, x, y, colour, filled) ;
501
    ++y ;
502
    stoppingY    += twoAsquare ;
503
    ellipseError += yChange ;
504
    yChange      += twoAsquare ;
505

  
506
    if ((2 * ellipseError + xChange) > 0 )
507
    {
508
      --x ;
509
      stoppingX    -= twoBsquare ;
510
      ellipseError += xChange ;
511
      xChange      += twoBsquare ;
512
    }
513
  }
514

  
515
  x = 0 ;
516
  y = yRadius ;
517

  
518
  xChange = yRadius * yRadius ;
519
  yChange = xRadius * xRadius * (1 - 2 * yRadius) ;
520

  
521
  ellipseError = 0 ;
522
  stoppingX    = 0 ;
523
  stoppingY    = twoAsquare * yRadius ;
524

  
525
  while (stoppingX <= stoppingY)	//2nd set of points
526
  {
527
    plot4ellipsePoints (cx, cy, x, y, colour, filled) ;
528
    ++x ;
529
    stoppingX    += twoBsquare ;
530
    ellipseError += xChange ;
531
    xChange      += twoBsquare ;
532

  
533
    if ((2 * ellipseError + yChange) > 0 )
534
    {
535
      --y ;
536
      stoppingY -= twoAsquare ;
537
      ellipseError += yChange ;
538
      yChange += twoAsquare ;
539
    }
540
  }
541
}
542

  
543

  
544
/*
545
 * lcd128x64putchar:
546
 *	Print a single character to the screen
547
 *********************************************************************************
548
 */
549

  
550
void lcd128x64putchar (int x, int y, int c, int bgCol, int fgCol)
551
{
552
  int y1, y2 ;
553

  
554
  unsigned char line ;
555
  unsigned char *fontPtr ;
556

  
557
// Can't print if we're offscreen
558

  
559
//if ((x < 0) || (x >= (maxX - fontWidth)) || (y < 0) || (y >= (maxY - fontHeight)))
560
//  return ;
561

  
562
  fontPtr = font + c * fontHeight ;
563

  
564
  for (y1 = fontHeight - 1 ; y1 >= 0 ; --y1)
565
  {
566
    y2 = y + y1 ;
567
    line = *fontPtr++ ;
568
    lcd128x64point (x + 0, y2, (line & 0x80) == 0 ? bgCol : fgCol) ;
569
    lcd128x64point (x + 1, y2, (line & 0x40) == 0 ? bgCol : fgCol) ;
570
    lcd128x64point (x + 2, y2, (line & 0x20) == 0 ? bgCol : fgCol) ;
571
    lcd128x64point (x + 3, y2, (line & 0x10) == 0 ? bgCol : fgCol) ;
572
    lcd128x64point (x + 4, y2, (line & 0x08) == 0 ? bgCol : fgCol) ;
573
    lcd128x64point (x + 5, y2, (line & 0x04) == 0 ? bgCol : fgCol) ;
574
    lcd128x64point (x + 6, y2, (line & 0x02) == 0 ? bgCol : fgCol) ;
575
    lcd128x64point (x + 7, y2, (line & 0x01) == 0 ? bgCol : fgCol) ;
576
  }
577
}
578

  
579

  
580
/*
581
 * lcd128x64puts:
582
 *	Send a string to the display. Obeys \n and \r formatting
583
 *********************************************************************************
584
 */
585

  
586
void lcd128x64puts (int x, int y, const char *str, int bgCol, int fgCol)
587
{
588
  int c, mx, my ;
589

  
590
  mx = x ; my = y ;
591

  
592
  while (*str)
593
  {
594
    c = *str++ ;
595

  
596
    if (c == '\r')
597
    {
598
      mx = x ;
599
      continue ;
600
    }
601

  
602
    if (c == '\n')
603
    {
604
      mx  = x ;
605
      my -= fontHeight ;
606
      continue ;
607
    }
608

  
609
    lcd128x64putchar (mx, my, c, bgCol, fgCol) ;
610

  
611
    mx += fontWidth ;
612
    if (mx >= (maxX - fontWidth))
613
    {
614
      mx  = 0 ;
615
      my -= fontHeight ;
616
    }
617
  }
618
}
619

  
620

  
621
/*
622
 * lcd128x64clear:
623
 *	Clear the display to the given colour.
624
 *********************************************************************************
625
 */
626

  
627
void lcd128x64clear (int colour)
628
{
629
  register int i ;
630
  register unsigned char *ptr = frameBuffer ;
631

  
632
  for (i = 0 ; i < (maxX * maxY) ; ++i)
633
    *ptr++ = colour ;
634
}
635

  
636

  
637

  
638

  
639
/*
640
 * lcd128x64setup:
641
 *	Initialise the display and GPIO.
642
 *********************************************************************************
643
 */
644

  
645
int lcd128x64setup (void)
646
{
647
  int i ;
648

  
649
  for (i = 0 ; i < 8 ; ++i)
650
    pinMode (i, OUTPUT) ;
651

  
652
  digitalWrite (CS1,    1) ;
653
  digitalWrite (CS2,    1) ;
654
  digitalWrite (STROBE, 0) ;
655
  digitalWrite (RS,     1) ;
656

  
657
  pinMode (CS1,    OUTPUT) ;
658
  pinMode (CS2,    OUTPUT) ;
659
  pinMode (STROBE, OUTPUT) ;
660
  pinMode (RS,     OUTPUT) ;
661

  
662
  sendCommand (0x3F, CS1) ;	// Display ON
663
  sendCommand (0xC0, CS1) ;	// Set display start line to 0
664

  
665
  sendCommand (0x3F, CS2) ;	// Display ON
666
  sendCommand (0xC0, CS2) ;	// Set display start line to 0
667

  
668
  lcd128x64clear          (0) ;
669
  lcd128x64setOrientation (0) ;
670
  lcd128x64update         () ;
671

  
672
  return 0 ;
673
}
fw/wiringPi/devLib/lcd128x64.h
1
/*
2
 * lcd128x64.h:
3
 *
4
 * Copyright (c) 2013 Gordon Henderson.
5
 ***********************************************************************
6
 * This file is part of wiringPi:
7
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
8
 *
9
 *    wiringPi is free software: you can redistribute it and/or modify
10
 *    it under the terms of the GNU Lesser General Public License as published by
11
 *    the Free Software Foundation, either version 3 of the License, or
12
 *    (at your option) any later version.
13
 *
14
 *    wiringPi is distributed in the hope that it will be useful,
15
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *    GNU Lesser General Public License for more details.
18
 *
19
 *    You should have received a copy of the GNU Lesser General Public License
20
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
21
 ***********************************************************************
22
 */
23

  
24
extern void lcd128x64setOrigin         (int x, int y) ;
25
extern void lcd128x64setOrientation    (int orientation) ;
26
extern void lcd128x64orientCoordinates (int *x, int *y) ;
27
extern void lcd128x64getScreenSize     (int *x, int *y) ;
28
extern void lcd128x64point             (int  x, int  y, int colour) ;
29
extern void lcd128x64line              (int x0, int y0, int x1, int y1, int colour) ;
30
extern void lcd128x64lineTo            (int  x, int  y, int colour) ;
31
extern void lcd128x64rectangle         (int x1, int y1, int x2, int y2, int colour, int filled) ;
32
extern void lcd128x64circle            (int  x, int  y, int  r, int colour, int filled) ;
33
extern void lcd128x64ellipse           (int cx, int cy, int xRadius, int yRadius, int colour, int filled) ;
34
extern void lcd128x64putchar           (int  x, int  y, int c, int bgCol, int fgCol) ;
35
extern void lcd128x64puts              (int  x, int  y, const char *str, int bgCol, int fgCol) ;
36
extern void lcd128x64update            (void) ;
37
extern void lcd128x64clear             (int colour) ;
38

  
39
extern int  lcd128x64setup             (void) ;
fw/wiringPi/devLib/maxdetect.c
1
/*
2
 * maxdetect.c:
3
 *	Driver for the MaxDetect series sensors
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#include <sys/time.h>
26
#include <stdio.h>
27
//#include <stdlib.h>
28
//#include <unistd.h>
29

  
30
#include <wiringPi.h>
31

  
32
#include "maxdetect.h"
33

  
34
#ifndef	TRUE
35
#  define	TRUE	(1==1)
36
#  define	FALSE	(1==2)
37
#endif
38

  
39

  
40
/*
41
 * maxDetectLowHighWait:
42
 *	Wait for a transition from low to high on the bus
43
 *********************************************************************************
44
 */
45

  
46
static int maxDetectLowHighWait (const int pin)
47
{
48
  struct timeval now, timeOut, timeUp ;
49

  
50
// If already high then wait for pin to go low
51

  
52
  gettimeofday (&now, NULL) ;
53
  timerclear   (&timeOut) ;
54
  timeOut.tv_usec = 1000 ;
55
  timeradd     (&now, &timeOut, &timeUp) ;
56

  
57
  while (digitalRead (pin) == HIGH)
58
  {
59
    gettimeofday (&now, NULL) ;
60
    if (timercmp (&now, &timeUp, >))
61
      return FALSE ;
62
  }
63

  
64
// Wait for it to go HIGH
65

  
66
  gettimeofday (&now, NULL) ;
67
  timerclear (&timeOut) ;
68
  timeOut.tv_usec = 1000 ;
69
  timeradd (&now, &timeOut, &timeUp) ;
70

  
71
  while (digitalRead (pin) == LOW)
72
  {
73
    gettimeofday (&now, NULL) ;
74
    if (timercmp (&now, &timeUp, >))
75
      return FALSE ;
76
  }
77

  
78
  return TRUE ;
79
}
80

  
81

  
82
/*
83
 * maxDetectClockByte:
84
 *	Read in a single byte from the MaxDetect bus
85
 *********************************************************************************
86
 */
87

  
88
static unsigned int maxDetectClockByte (const int pin)
89
{
90
  unsigned int byte = 0 ;
91
  int bit ;
92

  
93
  for (bit = 0 ; bit < 8 ; ++bit)
94
  {
95
    if (!maxDetectLowHighWait (pin))
96
      return 0 ;
97

  
98
// bit starting now - we need to time it.
99

  
100
    delayMicroseconds (30) ;
101
    byte <<= 1 ;
102
    if (digitalRead (pin) == HIGH)	// It's a 1
103
      byte |= 1 ;
104
  }
105

  
106
  return byte ;
107
}
108

  
109

  
110
/*
111
 * maxDetectRead:
112
 *	Read in and return the 4 data bytes from the MaxDetect sensor.
113
 *	Return TRUE/FALSE depending on the checksum validity
114
 *********************************************************************************
115
 */
116

  
117
int maxDetectRead (const int pin, unsigned char buffer [4])
118
{
119
  int i ;
120
  unsigned int checksum ;
121
  unsigned char localBuf [5] ;
122
  struct timeval now, then, took ;
123

  
124
// See how long we took
125

  
126
  gettimeofday (&then, NULL) ;
127

  
128
// Wake up the RHT03 by pulling the data line low, then high
129
//	Low for 10mS, high for 40uS.
130

  
131
  pinMode      (pin, OUTPUT) ;
132
  digitalWrite (pin, 0) ; delay             (10) ;
133
  digitalWrite (pin, 1) ; delayMicroseconds (40) ;
134
  pinMode      (pin, INPUT) ;
135

  
136
// Now wait for sensor to pull pin low
137

  
138
  if (!maxDetectLowHighWait (pin))
139
    return FALSE ;
140

  
141
// and read in 5 bytes (40 bits)
142

  
143
  for (i = 0 ; i < 5 ; ++i)
144
    localBuf [i] = maxDetectClockByte (pin) ;
145

  
146
  checksum = 0 ;
147
  for (i = 0 ; i < 4 ; ++i)
148
  {
149
    buffer [i] = localBuf [i] ;
150
    checksum += localBuf [i] ;
151
  }
152
  checksum &= 0xFF ;
153

  
154
// See how long we took
155
  
156
  gettimeofday (&now, NULL) ;
157
  timersub (&now, &then, &took) ;
158

  
159
// Total time to do this should be:
160
//	10mS + 40µS - reset
161
//	+ 80µS + 80µS - sensor doing its low -> high thing
162
//	+ 40 * (50µS + 27µS (0) or 70µS (1) )
163
//	= 15010µS
164
// so if we take more than that, we've had a scheduling interruption and the
165
// reading is probably bogus.
166

  
167
  if ((took.tv_sec != 0) || (took.tv_usec > 16000))
168
    return FALSE ;
169

  
170
  return checksum == localBuf [4] ;
171
}
172

  
173

  
174
/*
175
 * readRHT03:
176
 *	Read the Temperature & Humidity from an RHT03 sensor
177
 *	Values returned are *10, so 123 is 12.3.
178
 *********************************************************************************
179
 */
180

  
181
int readRHT03 (const int pin, int *temp, int *rh)
182
{
183
  static struct timeval then ;	// will initialise to zero
184
  static        int     lastTemp = 0 ;
185
  static        int     lastRh   = 0 ;
186

  
187
  int result ;
188
  struct timeval now, timeOut ;
189
  unsigned char buffer [4] ;
190

  
191
// The data sheets say to not read more than once every 2 seconds, so you
192
//	get the last good reading
193

  
194
  gettimeofday (&now, NULL) ;
195
  if (timercmp (&now, &then, <))
196
  {
197
    *rh   = lastRh ;
198
    *temp = lastTemp ;
199
    return TRUE ;
200
  }
201

  
202
// Set timeout for next read
203

  
204
  gettimeofday (&now, NULL) ;
205
  timerclear   (&timeOut) ;
206
  timeOut.tv_sec = 2 ;
207
  timeradd (&now, &timeOut, &then) ;
208

  
209
// Read ...
210
  
211
  result = maxDetectRead (pin, buffer) ;
212

  
213
  if (!result) // Try again, but just once
214
    result = maxDetectRead (pin, buffer) ;
215

  
216
  if (!result)
217
    return FALSE ;
218

  
219
  *rh   = (buffer [0] * 256 + buffer [1]) ;
220
  *temp = (buffer [2] * 256 + buffer [3]) ;
221

  
222
  if ((*temp & 0x8000) != 0)	// Negative
223
  {
224
    *temp &= 0x7FFF ;
225
    *temp = -*temp ;
226
  }
227

  
228
// Discard obviously bogus readings - the checksum can't detect a 2-bit error
229
//	(which does seem to happen - no realtime here)
230

  
231
  if ((*rh > 999) || (*temp > 800) || (*temp < -400))
232
    return FALSE ;
233

  
234
  lastRh   = *rh ;
235
  lastTemp = *temp ;
236

  
237
  return TRUE ;
238
}
fw/wiringPi/devLib/maxdetect.h
1
/*
2
 * maxdetect.h:
3
 *	Driver for the MaxDetect series sensors
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25

  
26
#ifdef __cplusplus
27
extern "C" {
28
#endif
29

  
30
// Main generic function
31

  
32
int maxDetectRead (const int pin, unsigned char buffer [4]) ;
33

  
34
// Individual sensors
35

  
36
int readRHT03 (const int pin, int *temp, int *rh) ;
37

  
38
#ifdef __cplusplus
39
}
40
#endif
fw/wiringPi/devLib/piFace.c
1
/*
2
 * piFace.:
3
 *	This file to interface with the PiFace peripheral device which
4
 *	has an MCP23S17 GPIO device connected via the SPI bus.
5
 *
6
 *	Copyright (c) 2012-2013 Gordon Henderson
7
 ***********************************************************************
8
 * This file is part of wiringPi:
9
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
10
 *
11
 *    wiringPi is free software: you can redistribute it and/or modify
12
 *    it under the terms of the GNU Lesser General Public License as
13
 *    published by the Free Software Foundation, either version 3 of the
14
 *    License, or (at your option) any later version.
15
 *
16
 *    wiringPi is distributed in the hope that it will be useful,
17
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *    GNU Lesser General Public License for more details.
20
 *
21
 *    You should have received a copy of the GNU Lesser General Public
22
 *    License along with wiringPi.
23
 *    If not, see <http://www.gnu.org/licenses/>.
24
 ***********************************************************************
25
 */
26

  
27

  
28
#include <stdio.h>
29
#include <stdint.h>
30

  
31
#include <wiringPi.h>
32
#include <mcp23s17.h>
33

  
34
#include "piFace.h"
35

  
36

  
37
/*
38
 * myDigitalWrite:
39
 *	Perform the digitalWrite function on the PiFace board
40
 *********************************************************************************
41
 */
42

  
43
void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value)
44
{
45
  digitalWrite (pin + 16, value) ;
46
}
47

  
48

  
49
/*
50
 * myDigitalRead:
51
 *	Perform the digitalRead function on the PiFace board
52
 *	With a slight twist - if we read from base + 8, then we
53
 *	read from the output latch...
54
 *********************************************************************************
55
 */
56

  
57
int myDigitalRead (struct wiringPiNodeStruct *node, int pin)
58
{
59
  if ((pin - node->pinBase) >= 8)
60
    return digitalRead (pin + 8) ;
61
  else
62
    return digitalRead (pin + 16 + 8) ;
63
}
64

  
65

  
66
/*
67
 * myPullUpDnControl:
68
 *	Perform the pullUpDnControl function on the PiFace board
69
 *********************************************************************************
70
 */
71

  
72
void myPullUpDnControl (struct wiringPiNodeStruct *node, int pin, int pud)
73
{
74
  pullUpDnControl (pin + 16 + 8, pud) ;
75
}
76

  
77

  
78
/*
79
 * piFaceSetup
80
 *	We're going to create an instance of the mcp23s17 here, then
81
 *	provide our own read/write routines on-top of it...
82
 *	The supplied PiFace code (in Pithon) treats it as an 8-bit device
83
 *	where you write the output ports and read the input port using the
84
 *	same pin numbers, however I have had a request to be able to read
85
 *	the output port, so reading 8..15 will read the output latch.
86
 *********************************************************************************
87
 */
88

  
89
int piFaceSetup (const int pinBase)
90
{
91
  int    i ;
92
  struct wiringPiNodeStruct *node ;
93

  
94
// Create an mcp23s17 instance:
95

  
96
   mcp23s17Setup (pinBase + 16, 0, 0) ;
97

  
98
// Set the direction bits
99

  
100
  for (i = 0 ; i < 8 ; ++i)
101
  {
102
    pinMode (pinBase + 16 +     i, OUTPUT) ;	// Port A is the outputs
103
    pinMode (pinBase + 16 + 8 + i, INPUT) ;	// Port B inputs.
104
  }
105

  
106
  node = wiringPiNewNode (pinBase, 16) ;
107
  node->digitalRead     = myDigitalRead ;
108
  node->digitalWrite    = myDigitalWrite ;
109
  node->pullUpDnControl = myPullUpDnControl ;
110

  
111
  return 0 ;
112
}
fw/wiringPi/devLib/piFace.h
1
/*
2
 * piFace.h:
3
 *	Control the PiFace Interface board for the Raspberry Pi
4
 *	Copyright (c) 2012-2013 Gordon Henderson
5
 ***********************************************************************
6
 * This file is part of wiringPi:
7
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
8
 *
9
 *    wiringPi is free software: you can redistribute it and/or modify
10
 *    it under the terms of the GNU Lesser General Public License as published by
11
 *    the Free Software Foundation, either version 3 of the License, or
12
 *    (at your option) any later version.
13
 *
14
 *    wiringPi is distributed in the hope that it will be useful,
15
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *    GNU Lesser General Public License for more details.
18
 *
19
 *    You should have received a copy of the GNU Lesser General Public License
20
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
21
 ***********************************************************************
22
 */
23

  
24
#ifdef __cplusplus
25
extern "C" {
26
#endif
27

  
28
extern int  piFaceSetup (const int pinBase) ;
29

  
30
#ifdef __cplusplus
31
}
32
#endif
fw/wiringPi/devLib/piFaceOld.c
1
/*
2
 * piFace.:
3
 *	Copyright (c) 2012-2016 Gordon Henderson
4
 *
5
 *	This file to interface with the PiFace peripheral device which
6
 *	has an MCP23S17 GPIO device connected via the SPI bus.
7
 ***********************************************************************
8
 * This file is part of wiringPi:
9
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
10
 *
11
 *    wiringPi is free software: you can redistribute it and/or modify
12
 *    it under the terms of the GNU Lesser General Public License as
13
 *    published by the Free Software Foundation, either version 3 of the
14
 *    License, or (at your option) any later version.
15
 *
16
 *    wiringPi is distributed in the hope that it will be useful,
17
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *    GNU Lesser General Public License for more details.
20
 *
21
 *    You should have received a copy of the GNU Lesser General Public
22
 *    License along with wiringPi.
23
 *    If not, see <http://www.gnu.org/licenses/>.
24
 ***********************************************************************
25
 */
26

  
27

  
28
#include <stdio.h>
29
#include <stdint.h>
30

  
31
#include <wiringPi.h>
32
#include <wiringPiSPI.h>
33

  
34
#include "../wiringPi/mcp23x0817.h"
35

  
36
#include "piFace.h"
37

  
38
#define	PIFACE_SPEED	4000000
39
#define	PIFACE_DEVNO	0
40

  
41

  
42

  
43
/*
44
 * writeByte:
45
 *	Write a byte to a register on the MCP23S17 on the SPI bus.
46
 *********************************************************************************
47
 */
48

  
49
static void writeByte (uint8_t reg, uint8_t data)
50
{
51
  uint8_t spiData [4] ;
52

  
53
  spiData [0] = CMD_WRITE ;
54
  spiData [1] = reg ;
55
  spiData [2] = data ;
56

  
57
  wiringPiSPIDataRW (PIFACE_DEVNO, spiData, 3) ;
58
}
59

  
60
/*
61
 * readByte:
62
 *	Read a byte from a register on the MCP23S17 on the SPI bus.
63
 *********************************************************************************
64
 */
65

  
66
static uint8_t readByte (uint8_t reg)
67
{
68
  uint8_t spiData [4] ;
69

  
70
  spiData [0] = CMD_READ ;
71
  spiData [1] = reg ;
72

  
73
  wiringPiSPIDataRW (PIFACE_DEVNO, spiData, 3) ;
74

  
75
  return spiData [2] ;
76
}
77

  
78

  
79
/*
80
 * myDigitalWrite:
81
 *	Perform the digitalWrite function on the PiFace board
82
 *********************************************************************************
83
 */
84

  
85
void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value)
86
{
87
  uint8_t mask, old ;
88

  
89
  pin -= node->pinBase ;
90
  mask = 1 << pin ;
91
  old  = readByte (MCP23x17_GPIOA) ;
92

  
93
  if (value == 0)
94
    old &= (~mask) ;
95
  else
96
    old |=   mask ;
97

  
98
  writeByte (MCP23x17_GPIOA, old) ;
99
}
100

  
101

  
102
/*
103
 * myDigitalRead:
104
 *	Perform the digitalRead function on the PiFace board
105
 *********************************************************************************
106
 */
107

  
108
int myDigitalRead (struct wiringPiNodeStruct *node, int pin)
109
{
110
  uint8_t mask, reg ;
111

  
112
  mask = 1 << ((pin - node->pinBase) & 7) ;
113

  
114
  if (pin < 8)
115
    reg = MCP23x17_GPIOB ;	// Input regsiter
116
  else
117
    reg = MCP23x17_OLATA ;	// Output latch regsiter
118

  
119
  if ((readByte (reg) & mask) != 0)
120
    return HIGH ;
121
  else
122
    return LOW ;
123
}
124

  
125

  
126
/*
127
 * myPullUpDnControl:
128
 *	Perform the pullUpDnControl function on the PiFace board
129
 *********************************************************************************
130
 */
131

  
132
void myPullUpDnControl (struct wiringPiNodeStruct *node, int pin, int pud)
133
{
134
  uint8_t mask, old ;
135

  
136
  mask = 1 << (pin - node->pinBase) ;
137
  old  = readByte (MCP23x17_GPPUB) ;
138

  
139
  if (pud == 0)
140
    old &= (~mask) ;
141
  else
142
    old |=   mask ;
143

  
144
  writeByte (MCP23x17_GPPUB, old) ;
145
}
146

  
147

  
148
/*
149
 * piFaceSetup
150
 *	Setup the SPI interface and initialise the MCP23S17 chip
151
 *	We create one node with 16 pins - each if the first 8 pins being read
152
 *	and write - although the operations actually go to different
153
 *	hardware ports. The top 8 let you read the state of the output register.
154
 *********************************************************************************
155
 */
156

  
157
int piFaceSetup (const int pinBase)
158
{
159
  int    x ;
160
  struct wiringPiNodeStruct *node ;
161

  
162
  if ((x = wiringPiSPISetup (PIFACE_DEVNO, PIFACE_SPEED)) < 0)
163
    return x ;
164

  
165
// Setup the MCP23S17
166

  
167
  writeByte (MCP23x17_IOCON,  IOCON_INIT) ;
168
  writeByte (MCP23x17_IODIRA, 0x00) ;		// Port A -> Outputs
169
  writeByte (MCP23x17_IODIRB, 0xFF) ;		// Port B -> Inputs
170

  
171
  node = wiringPiNewNode (pinBase, 16) ;
172
  node->digitalRead     = myDigitalRead ;
173
  node->digitalWrite    = myDigitalWrite ;
174
  node->pullUpDnControl = myPullUpDnControl ;
175

  
176
  return 0 ;
177
}
fw/wiringPi/devLib/piGlow.c
1
/*
2
 * piGlow.c:
3
 *	Easy access to the Pimoroni PiGlow board.
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#include <wiringPi.h>
26
#include <sn3218.h>
27

  
28
#include "piGlow.h"
29

  
30
#define	PIGLOW_BASE	577
31

  
32
static int leg0 [6] = {  6,  7,  8,  5,  4,  9 } ;
33
static int leg1 [6] = { 17, 16, 15, 13, 11, 10 } ;
34
static int leg2 [6] = {  0,  1,  2,  3, 14, 12 } ;
35

  
36

  
37
/*
38
 * piGlow1:
39
 *	Light up an individual LED
40
 *********************************************************************************
41
 */
42

  
43
void piGlow1 (const int leg, const int ring, const int intensity)
44
{
45
  int *legLeds ;
46

  
47
  if ((leg  < 0) || (leg  > 2)) return ;
48
  if ((ring < 0) || (ring > 5)) return ;
49

  
50
  /**/ if (leg == 0)
51
    legLeds = leg0 ;
52
  else if (leg == 1)
53
    legLeds = leg1 ;
54
  else
55
    legLeds = leg2 ;
56

  
57
  analogWrite (PIGLOW_BASE + legLeds [ring], intensity) ;
58
}
59

  
60
/*
61
 * piGlowLeg:
62
 *	Light up all 6 LEDs on a leg
63
 *********************************************************************************
64
 */
65

  
66
void piGlowLeg (const int leg, const int intensity)
67
{
68
  int  i ;
69
  int *legLeds ;
70

  
71
  if ((leg < 0) || (leg > 2))
72
    return ;
73

  
74
  /**/ if (leg == 0)
75
    legLeds = leg0 ;
76
  else if (leg == 1)
77
    legLeds = leg1 ;
78
  else
79
    legLeds = leg2 ;
80

  
81
  for (i = 0 ; i < 6 ; ++i)
82
    analogWrite (PIGLOW_BASE + legLeds [i], intensity) ;
83
}
84

  
85

  
86
/*
87
 * piGlowRing:
88
 *	Light up 3 LEDs in a ring. Ring 0 is the outermost, 5 the innermost
89
 *********************************************************************************
90
 */
91

  
92
void piGlowRing (const int ring, const int intensity)
93
{
94
  if ((ring < 0) || (ring > 5))
95
    return ;
96

  
97
  analogWrite (PIGLOW_BASE + leg0 [ring], intensity) ;
98
  analogWrite (PIGLOW_BASE + leg1 [ring], intensity) ;
99
  analogWrite (PIGLOW_BASE + leg2 [ring], intensity) ;
100
}
101

  
102
/*
103
 * piGlowSetup:
104
 *	Initialise the board & remember the pins we're using
105
 *********************************************************************************
106
 */
107

  
108
void piGlowSetup (int clear)
109
{
110
  sn3218Setup (PIGLOW_BASE) ;
111

  
112
  if (clear)
113
  {
114
    piGlowLeg (0, 0) ;
115
    piGlowLeg (1, 0) ;
116
    piGlowLeg (2, 0) ;
117
  }
118
}
fw/wiringPi/devLib/piGlow.h
1
/*
2
 * piglow.h:
3
 *	Easy access to the Pimoroni PiGlow board.
4
 *
5
 * Copyright (c) 2013 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25

  
26
#define	PIGLOW_RED	0
27
#define	PIGLOW_ORANGE	1
28
#define	PIGLOW_YELLOW	2
29
#define	PIGLOW_GREEN	3
30
#define	PIGLOW_BLUE	4
31
#define	PIGLOW_WHITE	5
32

  
33

  
34
#ifdef __cplusplus
35
extern "C" {
36
#endif
37

  
38
extern void piGlow1     (const int leg,  const int ring, const int intensity) ;
39
extern void piGlowLeg   (const int leg,  const int intensity) ;
40
extern void piGlowRing  (const int ring, const int intensity) ;
41
extern void piGlowSetup (int clear) ;
42

  
43
#ifdef __cplusplus
44
}
45
#endif
fw/wiringPi/devLib/piNes.c
1
/*
2
 * piNes.c:
3
 *	Driver for the NES Joystick controller on the Raspberry Pi
4
 *	Copyright (c) 2012 Gordon Henderson
5
 ***********************************************************************
6
 * This file is part of wiringPi:
7
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
8
 *
9
 *    wiringPi is free software: you can redistribute it and/or modify
10
 *    it under the terms of the GNU Lesser General Public License as
11
 *    published by the Free Software Foundation, either version 3 of the
12
 *    License, or (at your option) any later version.
13
 *
14
 *    wiringPi is distributed in the hope that it will be useful,
15
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *    GNU Lesser General Public License for more details.
18
 *
19
 *    You should have received a copy of the GNU Lesser General Public
20
 *    License along with wiringPi.
21
 *    If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#include <wiringPi.h>
26

  
27
#include "piNes.h"
28

  
29
#define	MAX_NES_JOYSTICKS	8
30

  
31
#define	NES_RIGHT	0x01
32
#define	NES_LEFT	0x02
33
#define	NES_DOWN	0x04
34
#define	NES_UP		0x08
35
#define	NES_START	0x10
36
#define	NES_SELECT	0x20
37
#define	NES_B		0x40
38
#define	NES_A		0x80
39

  
40

  
41
#define	PULSE_TIME	25
42

  
43
// Data to store the pins for each controller
44

  
45
struct nesPinsStruct
46
{
47
  unsigned int cPin, dPin, lPin ;
48
} ;
49

  
50
static struct nesPinsStruct nesPins [MAX_NES_JOYSTICKS] ;
51

  
52
static int joysticks = 0 ;
53

  
54

  
55
/*
56
 * setupNesJoystick:
57
 *	Create a new NES joystick interface, program the pins, etc.
58
 *********************************************************************************
59
 */
60

  
61
int setupNesJoystick (int dPin, int cPin, int lPin)
62
{
63
  if (joysticks == MAX_NES_JOYSTICKS)
64
    return -1 ;
65

  
66
  nesPins [joysticks].dPin = dPin ;
67
  nesPins [joysticks].cPin = cPin ;
68
  nesPins [joysticks].lPin = lPin ;
69

  
70
  digitalWrite (lPin, LOW) ;
71
  digitalWrite (cPin, LOW) ;
72

  
73
  pinMode (lPin, OUTPUT) ;
74
  pinMode (cPin, OUTPUT) ;
75
  pinMode (dPin, INPUT) ;
76

  
77
  return joysticks++ ;
78
}
79

  
80

  
81
/*
82
 * readNesJoystick:
83
 *	Do a single scan of the NES Joystick.
84
 *********************************************************************************
85
 */
86

  
87
unsigned int readNesJoystick (int joystick)
88
{
89
  unsigned int value = 0 ;
90
  int  i ;
91

  
92
  struct nesPinsStruct *pins = &nesPins [joystick] ;
93
 
94
// Toggle Latch - which presents the first bit
95

  
96
  digitalWrite (pins->lPin, HIGH) ; delayMicroseconds (PULSE_TIME) ;
97
  digitalWrite (pins->lPin, LOW)  ; delayMicroseconds (PULSE_TIME) ;
98

  
99
// Read first bit
100

  
101
  value = digitalRead (pins->dPin) ;
102

  
103
// Now get the next 7 bits with the clock
104

  
105
  for (i = 0 ; i < 7 ; ++i)
106
  {
107
    digitalWrite (pins->cPin, HIGH) ; delayMicroseconds (PULSE_TIME) ;
108
    digitalWrite (pins->cPin, LOW)  ; delayMicroseconds (PULSE_TIME) ;
109
    value = (value << 1) | digitalRead (pins->dPin) ;
110
  }
111

  
112
  return value ^ 0xFF ;
113
}
fw/wiringPi/devLib/piNes.h
1
/*
2
 * piNes.h:
3
 *	Driver for the NES Joystick controller on the Raspberry Pi
4
 *	Copyright (c) 2012 Gordon Henderson
5
 ***********************************************************************
6
 * This file is part of wiringPi:
7
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
8
 *
9
 *    wiringPi is free software: you can redistribute it and/or modify
10
 *    it under the terms of the GNU Lesser General Public License as
11
 *    published by the Free Software Foundation, either version 3 of the
12
 *    License, or (at your option) any later version.
13
 *
14
 *    wiringPi is distributed in the hope that it will be useful,
15
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *    GNU Lesser General Public License for more details.
18
 *
19
 *    You should have received a copy of the GNU Lesser General Public
20
 *    License along with wiringPi.
21
 *    If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#define	MAX_NES_JOYSTICKS	8
26

  
27
#define	NES_RIGHT	0x01
28
#define	NES_LEFT	0x02
29
#define	NES_DOWN	0x04
30
#define	NES_UP		0x08
31
#define	NES_START	0x10
32
#define	NES_SELECT	0x20
33
#define	NES_B		0x40
34
#define	NES_A		0x80
35

  
36
#ifdef __cplusplus
37
extern "C" {
38
#endif
39

  
40
extern int          setupNesJoystick (int dPin, int cPin, int lPin) ;
41
extern unsigned int  readNesJoystick (int joystick) ;
42

  
43
#ifdef __cplusplus
44
}
45
#endif
fw/wiringPi/devLib/scrollPhat.c
1
/*
2
 * scrollPhat.c:
3
 *	Simple driver for the Pimoroni Scroll Phat device
4
 *
5
 * Copyright (c) 2015 Gordon Henderson.
6
 ***********************************************************************
7
 * This file is part of wiringPi:
8
 *	https://projects.drogon.net/raspberry-pi/wiringpi/
9
 *
10
 *    wiringPi is free software: you can redistribute it and/or modify
11
 *    it under the terms of the GNU Lesser General Public License as published by
12
 *    the Free Software Foundation, either version 3 of the License, or
13
 *    (at your option) any later version.
14
 *
15
 *    wiringPi is distributed in the hope that it will be useful,
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *    GNU Lesser General Public License for more details.
19
 *
20
 *    You should have received a copy of the GNU Lesser General Public License
21
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
22
 ***********************************************************************
23
 */
24

  
25
#include <stdio.h>
26
#include <stdlib.h>
27
#include <stdarg.h>
28
#include <string.h>
29
#include <time.h>
30

  
31
#include <wiringPiI2C.h>
32

  
33
#include "scrollPhatFont.h"
34
#include "scrollPhat.h"
35

  
36
// Size
37

  
38
#define	SP_WIDTH	11
39
#define	SP_HEIGHT	 5
40

  
41
// I2C
42

  
43
#define	PHAT_I2C_ADDR	0x60
44

  
45
// Software copy of the framebuffer
46
//	it's 8-bit deep although the display itself is only 1-bit deep.
47

  
48
static unsigned char frameBuffer [SP_WIDTH * SP_HEIGHT] ;
49

  
50
static int lastX,   lastY ;
51
static int printDelayFactor  ;
52
static int scrollPhatFd ;
53

  
54
static int putcharX ;
55

  
56
#undef	DEBUG
57

  
58

  
59
/*
60
 * delay:
61
 *	Wait for some number of milliseconds.
62
 *	This taken from wiringPi as there is no-need to include the whole of
63
 *	wiringPi just for the delay function.
64
 *********************************************************************************
65
 */
66

  
67
static void delay (unsigned int howLong)
68
{
69
  struct timespec sleeper, dummy ;
70

  
71
  sleeper.tv_sec  = (time_t)(howLong / 1000) ;
72
  sleeper.tv_nsec = (long)(howLong % 1000) * 1000000 ;
73

  
74
  nanosleep (&sleeper, &dummy) ;
75
}
76

  
77

  
78

  
79
/*
80
 * scrollPhatUpdate:
81
 *	Copy our software version to the real display
82
 *********************************************************************************
83
 */
84

  
85
void scrollPhatUpdate (void)
86
{
87
  register int x, y ;
88
  register unsigned char data, pixel ;
89
  unsigned char pixels [SP_WIDTH] ;
90

  
91
#ifdef	DEBUG
92
  printf ("+-----------+\n") ;
93
  for (y = 0 ; y < SP_HEIGHT ; ++y)
94
  {
95
    putchar ('|') ;
96
    for (x = 0 ; x < SP_WIDTH ; ++x)
97
    {
98
      pixel = frameBuffer [x + y * SP_WIDTH] ;
99
      putchar (pixel == 0 ? ' ' : '*') ;
100
    }
101
    printf ("|\n") ;
102
  }
103
  printf ("+-----------+\n") ;
104
#endif 
105

  
106