first commit
This commit is contained in:
commit
fadb39dba4
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
25
README
Normal file
25
README
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Описание : Это драйвер для графического LCD от Nokia 3310, а также его китайских клонов.
|
||||||
|
* Базируется на коде библиотек написанных Sylvain Bissonnette и Fandi Gunawan:
|
||||||
|
* http://www.microsyl.com/index.php/2010/03/24/nokia-lcd-library/
|
||||||
|
* http://fandigunawan.wordpress.com/2008/06/18/lcd-nokia-3310-pcd8544-driver-in-winavravr-gcc/
|
||||||
|
* Основные отличия между оригиналом и клоном хорошо описаны в статье от Aheir:
|
||||||
|
* http://radiokot.ru/articles/29/
|
||||||
|
*
|
||||||
|
* Автор : Xander Gresolio <xugres@gmail.com>
|
||||||
|
* Веб-страница : http://we.easyelectronics.ru/profile/XANDER/
|
||||||
|
*
|
||||||
|
* Лицензия : GPL v3.0
|
||||||
|
*
|
||||||
|
* Компилятор : WinAVR, GCC for AVR platform
|
||||||
|
*
|
||||||
|
* История :
|
||||||
|
* Версия 1.0 (06.08.2011)
|
||||||
|
* + Первая версия
|
||||||
|
* + Добавлена поддержка китайских клонов LCD Nokia 3310
|
||||||
|
* + Полный перевод комментариев к исходному коду драйвера
|
||||||
|
* + Таблица символов драйвера дополнена кириллицей (упрощенная Windows-1251)
|
||||||
|
* + Добавлена функция рисования окружностей LcdCircle
|
||||||
|
* - Исправлены ошибки в проверке корректности координат при вызове функций рисования
|
||||||
|
* - Исправлена ошибка в функции LcdSingleBar (неверная отрисовка по y)
|
||||||
|
*/
|
75
main.c
Normal file
75
main.c
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
//  íàñòðîéêàõ ïðîåêòà îáÿçàòåëüíî ïðàâèëüíî óêàæèòå ñâîþ òàêòîâóþ ÷àñòîòó
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
#include "n3310.h"
|
||||||
|
#include "picture.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
|
||||||
|
LcdInit();
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
LcdClear();
|
||||||
|
LcdImage(Picture);
|
||||||
|
LcdUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
_delay_ms(5000);
|
||||||
|
|
||||||
|
|
||||||
|
LcdClear();
|
||||||
|
LcdSingleBar(0, 3, 4, 5, PIXEL_ON);
|
||||||
|
LcdSingleBar(79, 3, 4, 5, PIXEL_ON);
|
||||||
|
LcdSingleBar(0, 47, 4, 5, PIXEL_ON);
|
||||||
|
LcdSingleBar(79, 47, 4, 5, PIXEL_ON);
|
||||||
|
|
||||||
|
LcdGotoXYFont(0,2);
|
||||||
|
LcdFStr(FONT_2X,(unsigned char*)PSTR("3310LCD"));
|
||||||
|
|
||||||
|
LcdGotoXYFont(0,3);
|
||||||
|
LcdFStr(FONT_1X,(unsigned char*)PSTR("Hello World :)"));
|
||||||
|
|
||||||
|
byte bars[5] = {1, 2, 3, 4, 5};
|
||||||
|
LcdBars(bars, 5, 3, 2);
|
||||||
|
LcdUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
_delay_ms(5000);
|
||||||
|
|
||||||
|
|
||||||
|
LcdClear();
|
||||||
|
LcdGotoXYFont(0,2);
|
||||||
|
LcdFStr(FONT_2X,(unsigned char*)PSTR("ÌÎÃÓ×ÈÉ"));
|
||||||
|
|
||||||
|
LcdGotoXYFont(0,3);
|
||||||
|
LcdFStr(FONT_1X,(unsigned char*)PSTR("ÿçûê ïîëíîñòüþïîääåðæèâàåòñÿ:) :) :) :)"));
|
||||||
|
LcdUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
_delay_ms(5000);
|
||||||
|
|
||||||
|
|
||||||
|
LcdClear();
|
||||||
|
LcdRect(0,0,83,47,PIXEL_ON);
|
||||||
|
|
||||||
|
LcdCircle(41,23,20,PIXEL_ON);
|
||||||
|
LcdCircle(33,18,3,PIXEL_ON);
|
||||||
|
LcdCircle(49,18,3,PIXEL_ON);
|
||||||
|
LcdPixel(33,18,PIXEL_ON);
|
||||||
|
LcdPixel(49,18,PIXEL_ON);
|
||||||
|
|
||||||
|
LcdLine(35,34,46,34,PIXEL_ON);
|
||||||
|
LcdLine(30,31,35,34,PIXEL_ON);
|
||||||
|
LcdLine(51,31,46,34,PIXEL_ON);
|
||||||
|
LcdUpdate();
|
||||||
|
|
||||||
|
|
||||||
|
_delay_ms(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
misc/FastLCD.exe
Normal file
BIN
misc/FastLCD.exe
Normal file
Binary file not shown.
BIN
misc/commands.gif
Normal file
BIN
misc/commands.gif
Normal file
Binary file not shown.
After ![]() (image error) Size: 35 KiB |
BIN
misc/pcd8544.pdf
Normal file
BIN
misc/pcd8544.pdf
Normal file
Binary file not shown.
BIN
misc/pinout.jpg
Normal file
BIN
misc/pinout.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 73 KiB |
795
n3310.c
Normal file
795
n3310.c
Normal file
@ -0,0 +1,795 @@
|
|||||||
|
/*
|
||||||
|
* Имя : n3310.c
|
||||||
|
*
|
||||||
|
* Описание : Это драйвер для графического LCD от Nokia 3310, а также его китайских клонов.
|
||||||
|
* Базируется на коде библиотек написанных Sylvain Bissonnette и Fandi Gunawan:
|
||||||
|
* http://www.microsyl.com/index.php/2010/03/24/nokia-lcd-library/
|
||||||
|
* http://fandigunawan.wordpress.com/2008/06/18/lcd-nokia-3310-pcd8544-driver-in-winavravr-gcc/
|
||||||
|
* Основные отличия между оригиналом и клоном хорошо описаны в статье от Aheir:
|
||||||
|
* http://radiokot.ru/articles/29/
|
||||||
|
*
|
||||||
|
* Автор : Xander Gresolio <xugres@gmail.com>
|
||||||
|
* Веб-страница : http://we.easyelectronics.ru/profile/XANDER/
|
||||||
|
*
|
||||||
|
* Лицензия : GPL v3.0
|
||||||
|
*
|
||||||
|
* Компилятор : WinAVR, GCC for AVR platform
|
||||||
|
*
|
||||||
|
* История :
|
||||||
|
* Версия 1.0 (06.08.2011)
|
||||||
|
* + Первая версия
|
||||||
|
* + Добавлена поддержка китайских клонов LCD Nokia 3310
|
||||||
|
* + Полный перевод комментариев к исходному коду драйвера
|
||||||
|
* + Таблица символов драйвера дополнена кириллицей (упрощенная Windows-1251)
|
||||||
|
* + Добавлена функция рисования окружностей LcdCircle
|
||||||
|
* - Исправлены ошибки в проверке корректности координат при вызове функций рисования
|
||||||
|
* - Исправлена ошибка в функции LcdSingleBar (неверная отрисовка по y)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include "n3310.h"
|
||||||
|
|
||||||
|
// Прототипы приватных функций драйвера
|
||||||
|
|
||||||
|
static void LcdSend ( byte data, LcdCmdData cd );
|
||||||
|
static void Delay ( void );
|
||||||
|
|
||||||
|
// Глобальные переменные
|
||||||
|
|
||||||
|
// Кэш в ОЗУ 84*48 бит или 504 байта
|
||||||
|
static byte LcdCache [ LCD_CACHE_SIZE ];
|
||||||
|
|
||||||
|
// Чтобы не обновлять весь дисплей, а лишь ту часть что изменилась,
|
||||||
|
// будем отмечать две границы кэша где произошли изменения. Затем
|
||||||
|
// можно копировать эту часть кэша между границами в ОЗУ дисплея.
|
||||||
|
static int LoWaterMark; // нижняя граница
|
||||||
|
static int HiWaterMark; // верхняя граница
|
||||||
|
|
||||||
|
// Указатель для работы с LcdCache[]
|
||||||
|
static int LcdCacheIdx;
|
||||||
|
|
||||||
|
// Флаг изменений кэша
|
||||||
|
static byte UpdateLcd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdInit
|
||||||
|
* Описание : Производит инициализацию порта и SPI МК, контроллера LCD
|
||||||
|
* Аргумент(ы) : Нет
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
void LcdInit ( void )
|
||||||
|
{
|
||||||
|
// Pull-up на вывод подключенный к reset дисплея
|
||||||
|
LCD_PORT |= _BV ( LCD_RST_PIN );
|
||||||
|
|
||||||
|
// Устанавливаем нужные биты порта на выход
|
||||||
|
LCD_DDR |= _BV( LCD_RST_PIN ) | _BV( LCD_DC_PIN ) | _BV( LCD_CE_PIN ) | _BV( SPI_MOSI_PIN ) | _BV( SPI_CLK_PIN );
|
||||||
|
|
||||||
|
// Некалиброванная задержка
|
||||||
|
Delay();
|
||||||
|
|
||||||
|
// Дергаем reset
|
||||||
|
LCD_PORT &= ~( _BV( LCD_RST_PIN ) );
|
||||||
|
Delay();
|
||||||
|
LCD_PORT |= _BV ( LCD_RST_PIN );
|
||||||
|
|
||||||
|
// Активируем SPI:
|
||||||
|
// без прерываний, старший бит первый, режим мастера, CPOL->0, CPHA->0, Clk/4
|
||||||
|
SPCR = 0x50;
|
||||||
|
|
||||||
|
// Отключаем LCD контроллер - высокий уровень на SCE
|
||||||
|
LCD_PORT |= _BV( LCD_CE_PIN );
|
||||||
|
|
||||||
|
// Отправляем команды дисплею
|
||||||
|
LcdSend( 0x21, LCD_CMD ); // Включаем расширенный набор команд (LCD Extended Commands)
|
||||||
|
LcdSend( 0xC8, LCD_CMD ); // Установка контрастности (LCD Vop)
|
||||||
|
LcdSend( 0x06, LCD_CMD ); // Установка температурного коэффициента (Temp coefficent)
|
||||||
|
LcdSend( 0x13, LCD_CMD ); // Настройка питания (LCD bias mode 1:48)
|
||||||
|
LcdSend( 0x20, LCD_CMD ); // Включаем стандартный набор команд и горизонтальную адресацию (LCD Standard Commands,Horizontal addressing mode)
|
||||||
|
LcdSend( 0x0C, LCD_CMD ); // Нормальный режим (LCD in normal mode)
|
||||||
|
|
||||||
|
// Первичная очистка дисплея
|
||||||
|
LcdClear();
|
||||||
|
LcdUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdClear
|
||||||
|
* Описание : Очищает дисплей. Далее необходимо выполнить LcdUpdate
|
||||||
|
* Аргумент(ы) : Нет
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
void LcdClear ( void )
|
||||||
|
{
|
||||||
|
// // Очистка кэша дисплея
|
||||||
|
// int i;
|
||||||
|
// for ( i = 0; i < LCD_CACHE_SIZE; i++ )
|
||||||
|
// {
|
||||||
|
// LcdCache[i] = 0x00;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Оптимизация от Jakub Lasinski (March 14 2009)
|
||||||
|
memset( LcdCache, 0x00, LCD_CACHE_SIZE );
|
||||||
|
|
||||||
|
// Сброс указателей границ в максимальное значение
|
||||||
|
LoWaterMark = 0;
|
||||||
|
HiWaterMark = LCD_CACHE_SIZE - 1;
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdUpdate
|
||||||
|
* Описание : Копирует кэш в ОЗУ дисплея
|
||||||
|
* Аргумент(ы) : Нет
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
void LcdUpdate (void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if ( LoWaterMark < 0 )
|
||||||
|
LoWaterMark = 0;
|
||||||
|
else if ( LoWaterMark >= LCD_CACHE_SIZE )
|
||||||
|
LoWaterMark = LCD_CACHE_SIZE - 1;
|
||||||
|
|
||||||
|
if ( HiWaterMark < 0 )
|
||||||
|
HiWaterMark = 0;
|
||||||
|
else if ( HiWaterMark >= LCD_CACHE_SIZE )
|
||||||
|
HiWaterMark = LCD_CACHE_SIZE - 1;
|
||||||
|
|
||||||
|
#ifdef CHINA_LCD // Алгоритм для китайского ЖК из нестандартным контроллером
|
||||||
|
|
||||||
|
byte x,y;
|
||||||
|
|
||||||
|
// 102 x 64 - таково предполагаемое разрешение буфера китайского ЖК, при чем
|
||||||
|
// память буфера отображается на дисплей со сдвигом вверх на 3 пикселя.
|
||||||
|
// Поэтому выводим картинку ниже - начиная с второй строки y+1, а потом
|
||||||
|
// сдвинем вверх (опять таки фича китайца, полезная в данном случае)
|
||||||
|
|
||||||
|
x = LoWaterMark % LCD_X_RES; // Устанавливаем начальный адрес x
|
||||||
|
LcdSend( 0x80 | x, LCD_CMD ); // относительно нижней границы LoWaterMark
|
||||||
|
|
||||||
|
y = LoWaterMark / LCD_X_RES + 1; // Устанавливаем начальный адрес y+1
|
||||||
|
LcdSend( 0x40 | y, LCD_CMD ); // относительно нижней границы LoWaterMark
|
||||||
|
|
||||||
|
for ( i = LoWaterMark; i <= HiWaterMark; i++ )
|
||||||
|
{
|
||||||
|
// передаем данные в буфер дисплея
|
||||||
|
LcdSend( LcdCache[i], LCD_DATA );
|
||||||
|
|
||||||
|
x++; // заодно подсчитываем координату x, чтобы вовремя перейти на новую строку
|
||||||
|
if (x >= LCD_X_RES) // если вышли за предел, то переходим на следующую строку (x=0; y++)
|
||||||
|
{
|
||||||
|
// проще говоря, чтобы верно заполнить нужную часть нестандартного буфера,
|
||||||
|
// придется явно указывать требуемый адрес, иначе все поплывет :)
|
||||||
|
x=0;
|
||||||
|
LcdSend( 0x80, LCD_CMD );
|
||||||
|
y++;
|
||||||
|
LcdSend( 0x40 | y, LCD_CMD );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LcdSend( 0x21, LCD_CMD ); // Включаем расширенный набор команд
|
||||||
|
LcdSend( 0x45, LCD_CMD ); // Сдвигаем картинку на 5 пикселей вверх (нестандартная команда китайца, оригинал её игнорирует)
|
||||||
|
LcdSend( 0x20, LCD_CMD ); // Включаем стандартный набор команд и горизонтальную адресацию
|
||||||
|
|
||||||
|
#else // Алгоритм для оригинального дисплея
|
||||||
|
|
||||||
|
// Устанавливаем начальный адрес в соответствии к LoWaterMark
|
||||||
|
LcdSend( 0x80 | ( LoWaterMark % LCD_X_RES ), LCD_CMD );
|
||||||
|
LcdSend( 0x40 | ( LoWaterMark / LCD_X_RES ), LCD_CMD );
|
||||||
|
|
||||||
|
// Обновляем необходимую часть буфера дисплея
|
||||||
|
for ( i = LoWaterMark; i <= HiWaterMark; i++ )
|
||||||
|
{
|
||||||
|
// Для оригинального дисплея не нужно следить за адресом в буфере,
|
||||||
|
// можно просто последовательно выводить данные
|
||||||
|
LcdSend( LcdCache[i], LCD_DATA );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Сброс указателей границ в пустоту
|
||||||
|
LoWaterMark = LCD_CACHE_SIZE - 1;
|
||||||
|
HiWaterMark = 0;
|
||||||
|
|
||||||
|
// Сброс флага изменений кэша
|
||||||
|
UpdateLcd = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdSend
|
||||||
|
* Описание : Отправляет данные в контроллер дисплея
|
||||||
|
* Аргумент(ы) : data -> данные для отправки
|
||||||
|
* cd -> команда или данные (смотри enum в n3310.h)
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
static void LcdSend ( byte data, LcdCmdData cd )
|
||||||
|
{
|
||||||
|
// Включаем контроллер дисплея (низкий уровень активный)
|
||||||
|
LCD_PORT &= ~( _BV( LCD_CE_PIN ) );
|
||||||
|
|
||||||
|
if ( cd == LCD_DATA )
|
||||||
|
{
|
||||||
|
LCD_PORT |= _BV( LCD_DC_PIN );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LCD_PORT &= ~( _BV( LCD_DC_PIN ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Отправка данных в контроллер дисплея
|
||||||
|
SPDR = data;
|
||||||
|
|
||||||
|
// Ждем окончания передачи
|
||||||
|
while ( (SPSR & 0x80) != 0x80 );
|
||||||
|
|
||||||
|
// Отключаем контроллер дисплея
|
||||||
|
LCD_PORT |= _BV( LCD_CE_PIN );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdContrast
|
||||||
|
* Описание : Устанавливает контрастность дисплея
|
||||||
|
* Аргумент(ы) : контраст -> значение от 0x00 к 0x7F
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
void LcdContrast ( byte contrast )
|
||||||
|
{
|
||||||
|
LcdSend( 0x21, LCD_CMD ); // Расширенный набор команд
|
||||||
|
LcdSend( 0x80 | contrast, LCD_CMD ); // Установка уровня контрастности
|
||||||
|
LcdSend( 0x20, LCD_CMD ); // Стандартный набор команд, горизонтальная адресация
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : Delay
|
||||||
|
* Описание : Некалиброванная задержка для процедуры инициализации LCD
|
||||||
|
* Аргумент(ы) : Нет
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
static void Delay ( void )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for ( i = -32000; i < 32000; i++ );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdGotoXYFont
|
||||||
|
* Описание : Устанавливает курсор в позицию x,y относительно стандартного размера шрифта
|
||||||
|
* Аргумент(ы) : x,y -> координаты новой позиции курсора. Значения: 0,0 .. 13,5
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310.h
|
||||||
|
*/
|
||||||
|
byte LcdGotoXYFont ( byte x, byte y )
|
||||||
|
{
|
||||||
|
// Проверка границ
|
||||||
|
if( x > 13 || y > 5 ) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
// Вычисление указателя. Определен как адрес в пределах 504 байт
|
||||||
|
LcdCacheIdx = x * 6 + y * 84;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdChr
|
||||||
|
* Описание : Выводит символ в текущей позиции курсора, затем инкрементирует положение курсора
|
||||||
|
* Аргумент(ы) : size -> размер шрифта. Смотри enum в n3310.h
|
||||||
|
* ch -> символ для вывода
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdChr ( LcdFontSize size, byte ch )
|
||||||
|
{
|
||||||
|
byte i, c;
|
||||||
|
byte b1, b2;
|
||||||
|
int tmpIdx;
|
||||||
|
|
||||||
|
if ( LcdCacheIdx < LoWaterMark )
|
||||||
|
{
|
||||||
|
// Обновляем нижнюю границу
|
||||||
|
LoWaterMark = LcdCacheIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (ch >= 0x20) && (ch <= 0x7F) )
|
||||||
|
{
|
||||||
|
// Смещение в таблице для символов ASCII[0x20-0x7F]
|
||||||
|
ch -= 32;
|
||||||
|
}
|
||||||
|
else if ( ch >= 0xC0 )
|
||||||
|
{
|
||||||
|
// Смещение в таблице для символов CP1251[0xC0-0xFF]
|
||||||
|
ch -= 96;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Остальные игнорируем (их просто нет в таблице для экономии памяти)
|
||||||
|
ch = 95;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( size == FONT_1X )
|
||||||
|
{
|
||||||
|
for ( i = 0; i < 5; i++ )
|
||||||
|
{
|
||||||
|
// Копируем вид символа из таблицы в кэш
|
||||||
|
LcdCache[LcdCacheIdx++] = pgm_read_byte( &(FontLookup[ch][i]) ) << 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( size == FONT_2X )
|
||||||
|
{
|
||||||
|
tmpIdx = LcdCacheIdx - 84;
|
||||||
|
|
||||||
|
if ( tmpIdx < LoWaterMark )
|
||||||
|
{
|
||||||
|
LoWaterMark = tmpIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( tmpIdx < 0 ) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
for ( i = 0; i < 5; i++ )
|
||||||
|
{
|
||||||
|
// Копируем вид символа из таблицы у временную переменную
|
||||||
|
c = pgm_read_byte(&(FontLookup[ch][i])) << 1;
|
||||||
|
// Увеличиваем картинку
|
||||||
|
// Первую часть
|
||||||
|
b1 = (c & 0x01) * 3;
|
||||||
|
b1 |= (c & 0x02) * 6;
|
||||||
|
b1 |= (c & 0x04) * 12;
|
||||||
|
b1 |= (c & 0x08) * 24;
|
||||||
|
|
||||||
|
c >>= 4;
|
||||||
|
// Вторую часть
|
||||||
|
b2 = (c & 0x01) * 3;
|
||||||
|
b2 |= (c & 0x02) * 6;
|
||||||
|
b2 |= (c & 0x04) * 12;
|
||||||
|
b2 |= (c & 0x08) * 24;
|
||||||
|
|
||||||
|
// Копируем две части в кэш
|
||||||
|
LcdCache[tmpIdx++] = b1;
|
||||||
|
LcdCache[tmpIdx++] = b1;
|
||||||
|
LcdCache[tmpIdx + 82] = b2;
|
||||||
|
LcdCache[tmpIdx + 83] = b2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновляем x координату курсора
|
||||||
|
LcdCacheIdx = (LcdCacheIdx + 11) % LCD_CACHE_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( LcdCacheIdx > HiWaterMark )
|
||||||
|
{
|
||||||
|
// Обновляем верхнюю границу
|
||||||
|
HiWaterMark = LcdCacheIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Горизонтальный разрыв между символами
|
||||||
|
LcdCache[LcdCacheIdx] = 0x00;
|
||||||
|
// Если достигли позицию указателя LCD_CACHE_SIZE - 1, переходим в начало
|
||||||
|
if(LcdCacheIdx == (LCD_CACHE_SIZE - 1) )
|
||||||
|
{
|
||||||
|
LcdCacheIdx = 0;
|
||||||
|
return OK_WITH_WRAP;
|
||||||
|
}
|
||||||
|
// Иначе просто инкрементируем указатель
|
||||||
|
LcdCacheIdx++;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdStr
|
||||||
|
* Описание : Эта функция предназначена для печати строки которая хранится в RAM
|
||||||
|
* Аргумент(ы) : size -> размер шрифта. Смотри enum в n3310.h
|
||||||
|
* dataArray -> массив содержащий строку которую нужно напечатать
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdStr ( LcdFontSize size, byte dataArray[] )
|
||||||
|
{
|
||||||
|
byte tmpIdx=0;
|
||||||
|
byte response;
|
||||||
|
while( dataArray[ tmpIdx ] != '\0' )
|
||||||
|
{
|
||||||
|
// Выводим символ
|
||||||
|
response = LcdChr( size, dataArray[ tmpIdx ] );
|
||||||
|
// Не стоит волноваться если произойдет OUT_OF_BORDER,
|
||||||
|
// строка будет печататься дальше из начала дисплея
|
||||||
|
if( response == OUT_OF_BORDER)
|
||||||
|
return OUT_OF_BORDER;
|
||||||
|
// Увеличиваем указатель
|
||||||
|
tmpIdx++;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdFStr
|
||||||
|
* Описание : Эта функция предназначена для печати строки которая хранится в Flash ROM
|
||||||
|
* Аргумент(ы) : size -> размер шрифта. Смотри enum в n3310.h
|
||||||
|
* dataPtr -> указатель на строку которую нужно напечатать
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
* Пример : LcdFStr(FONT_1X, PSTR("Hello World"));
|
||||||
|
* LcdFStr(FONT_1X, &name_of_string_as_array);
|
||||||
|
*/
|
||||||
|
byte LcdFStr ( LcdFontSize size, const byte *dataPtr )
|
||||||
|
{
|
||||||
|
byte c;
|
||||||
|
byte response;
|
||||||
|
for ( c = pgm_read_byte( dataPtr ); c; ++dataPtr, c = pgm_read_byte( dataPtr ) )
|
||||||
|
{
|
||||||
|
// Выводим символ
|
||||||
|
response = LcdChr( size, c );
|
||||||
|
if(response == OUT_OF_BORDER)
|
||||||
|
return OUT_OF_BORDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdPixel
|
||||||
|
* Описание : Отображает пиксель по абсолютным координатам (x,y)
|
||||||
|
* Аргумент(ы) : x,y -> абсолютные координаты пикселя
|
||||||
|
* mode -> Off, On или Xor. Смотри enum в n3310.h
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdPixel ( byte x, byte y, LcdPixelMode mode )
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
byte offset;
|
||||||
|
byte data;
|
||||||
|
|
||||||
|
// Защита от выхода за пределы
|
||||||
|
if ( x >= LCD_X_RES || y >= LCD_Y_RES) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
// Пересчет индекса и смещения
|
||||||
|
index = ( ( y / 8 ) * 84 ) + x;
|
||||||
|
offset = y - ( ( y / 8 ) * 8 );
|
||||||
|
|
||||||
|
data = LcdCache[ index ];
|
||||||
|
|
||||||
|
// Обработка битов
|
||||||
|
|
||||||
|
// Режим PIXEL_OFF
|
||||||
|
if ( mode == PIXEL_OFF )
|
||||||
|
{
|
||||||
|
data &= ( ~( 0x01 << offset ) );
|
||||||
|
}
|
||||||
|
// Режим PIXEL_ON
|
||||||
|
else if ( mode == PIXEL_ON )
|
||||||
|
{
|
||||||
|
data |= ( 0x01 << offset );
|
||||||
|
}
|
||||||
|
// Режим PIXEL_XOR
|
||||||
|
else if ( mode == PIXEL_XOR )
|
||||||
|
{
|
||||||
|
data ^= ( 0x01 << offset );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Окончательный результат копируем в кэш
|
||||||
|
LcdCache[ index ] = data;
|
||||||
|
|
||||||
|
if ( index < LoWaterMark )
|
||||||
|
{
|
||||||
|
// Обновляем нижнюю границу
|
||||||
|
LoWaterMark = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( index > HiWaterMark )
|
||||||
|
{
|
||||||
|
// Обновляем верхнюю границу
|
||||||
|
HiWaterMark = index;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdLine
|
||||||
|
* Описание : Рисует линию между двумя точками на дисплее (алгоритм Брезенхэма)
|
||||||
|
* Аргумент(ы) : x1, y1 -> абсолютные координаты начала линии
|
||||||
|
* x2, y2 -> абсолютные координаты конца линии
|
||||||
|
* mode -> Off, On или Xor. Смотри enum в n3310.h
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdLine ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode )
|
||||||
|
{
|
||||||
|
int dx, dy, stepx, stepy, fraction;
|
||||||
|
byte response;
|
||||||
|
|
||||||
|
// dy y2 - y1
|
||||||
|
// -- = -------
|
||||||
|
// dx x2 - x1
|
||||||
|
|
||||||
|
dy = y2 - y1;
|
||||||
|
dx = x2 - x1;
|
||||||
|
|
||||||
|
// dy отрицательное
|
||||||
|
if ( dy < 0 )
|
||||||
|
{
|
||||||
|
dy = -dy;
|
||||||
|
stepy = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stepy = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dx отрицательное
|
||||||
|
if ( dx < 0 )
|
||||||
|
{
|
||||||
|
dx = -dx;
|
||||||
|
stepx = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stepx = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
dx <<= 1;
|
||||||
|
dy <<= 1;
|
||||||
|
|
||||||
|
// Рисуем начальную точку
|
||||||
|
response = LcdPixel( x1, y1, mode );
|
||||||
|
if(response)
|
||||||
|
return response;
|
||||||
|
|
||||||
|
// Рисуем следующие точки до конца
|
||||||
|
if ( dx > dy )
|
||||||
|
{
|
||||||
|
fraction = dy - ( dx >> 1);
|
||||||
|
while ( x1 != x2 )
|
||||||
|
{
|
||||||
|
if ( fraction >= 0 )
|
||||||
|
{
|
||||||
|
y1 += stepy;
|
||||||
|
fraction -= dx;
|
||||||
|
}
|
||||||
|
x1 += stepx;
|
||||||
|
fraction += dy;
|
||||||
|
|
||||||
|
response = LcdPixel( x1, y1, mode );
|
||||||
|
if(response)
|
||||||
|
return response;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fraction = dx - ( dy >> 1);
|
||||||
|
while ( y1 != y2 )
|
||||||
|
{
|
||||||
|
if ( fraction >= 0 )
|
||||||
|
{
|
||||||
|
x1 += stepx;
|
||||||
|
fraction -= dy;
|
||||||
|
}
|
||||||
|
y1 += stepy;
|
||||||
|
fraction += dx;
|
||||||
|
|
||||||
|
response = LcdPixel( x1, y1, mode );
|
||||||
|
if(response)
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdCircle
|
||||||
|
* Описание : Рисует окружность (алгоритм Брезенхэма)
|
||||||
|
* Аргумент(ы) : x, y -> абсолютные координаты центра
|
||||||
|
* radius -> радиус окружности
|
||||||
|
* mode -> Off, On или Xor. Смотри enum в n3310.h
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdCircle(byte x, byte y, byte radius, LcdPixelMode mode)
|
||||||
|
{
|
||||||
|
signed char xc = 0;
|
||||||
|
signed char yc = 0;
|
||||||
|
signed char p = 0;
|
||||||
|
|
||||||
|
if ( x >= LCD_X_RES || y >= LCD_Y_RES) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
yc = radius;
|
||||||
|
p = 3 - (radius<<1);
|
||||||
|
while (xc <= yc)
|
||||||
|
{
|
||||||
|
LcdPixel(x + xc, y + yc, mode);
|
||||||
|
LcdPixel(x + xc, y - yc, mode);
|
||||||
|
LcdPixel(x - xc, y + yc, mode);
|
||||||
|
LcdPixel(x - xc, y - yc, mode);
|
||||||
|
LcdPixel(x + yc, y + xc, mode);
|
||||||
|
LcdPixel(x + yc, y - xc, mode);
|
||||||
|
LcdPixel(x - yc, y + xc, mode);
|
||||||
|
LcdPixel(x - yc, y - xc, mode);
|
||||||
|
if (p < 0) p += (xc++ << 2) + 6;
|
||||||
|
else p += ((xc++ - yc--)<<2) + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdSingleBar
|
||||||
|
* Описание : Рисует один закрашенный прямоугольник
|
||||||
|
* Аргумент(ы) : baseX -> абсолютная координата x (нижний левый угол)
|
||||||
|
* baseY -> абсолютная координата y (нижний левый угол)
|
||||||
|
* height -> высота (в пикселях)
|
||||||
|
* width -> ширина (в пикселях)
|
||||||
|
* mode -> Off, On или Xor. Смотри enum в n3310.h
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdSingleBar ( byte baseX, byte baseY, byte height, byte width, LcdPixelMode mode )
|
||||||
|
{
|
||||||
|
byte tmpIdxX,tmpIdxY,tmp;
|
||||||
|
|
||||||
|
byte response;
|
||||||
|
|
||||||
|
// Проверка границ
|
||||||
|
if ( ( baseX >= LCD_X_RES) || ( baseY >= LCD_Y_RES) ) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
if ( height > baseY )
|
||||||
|
tmp = 0;
|
||||||
|
else
|
||||||
|
tmp = baseY - height + 1;
|
||||||
|
|
||||||
|
// Рисование линий
|
||||||
|
for ( tmpIdxY = tmp; tmpIdxY <= baseY; tmpIdxY++ )
|
||||||
|
{
|
||||||
|
for ( tmpIdxX = baseX; tmpIdxX < (baseX + width); tmpIdxX++ )
|
||||||
|
{
|
||||||
|
response = LcdPixel( tmpIdxX, tmpIdxY, mode );
|
||||||
|
if(response)
|
||||||
|
return response;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdBars
|
||||||
|
* Описание : Рисует группу закрашенных прямоугольников (в режиме PIXEL_ON)
|
||||||
|
* Аргумент(ы) : data[] -> данные которые нужно отобразить
|
||||||
|
* numbBars -> количество прямоугольников
|
||||||
|
* width -> ширина (в пикселях)
|
||||||
|
* multiplier -> множитель для высоты
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
* Примечание : Пожалуйста проверьте значения EMPTY_SPACE_BARS, BAR_X, BAR_Y в n3310.h
|
||||||
|
* Пример : byte example[5] = {1, 2, 3, 4, 5};
|
||||||
|
* LcdBars(example, 5, 3, 2);
|
||||||
|
*/
|
||||||
|
byte LcdBars ( byte data[], byte numbBars, byte width, byte multiplier )
|
||||||
|
{
|
||||||
|
byte b;
|
||||||
|
byte tmpIdx = 0;
|
||||||
|
byte response;
|
||||||
|
|
||||||
|
for ( b = 0; b < numbBars ; b++ )
|
||||||
|
{
|
||||||
|
// Защита от выхода за пределы
|
||||||
|
if ( tmpIdx > LCD_X_RES - 1 ) return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
// Расчет значения x
|
||||||
|
tmpIdx = ((width + EMPTY_SPACE_BARS) * b) + BAR_X;
|
||||||
|
|
||||||
|
// Рисуем один прямоугольник
|
||||||
|
response = LcdSingleBar( tmpIdx, BAR_Y, data[b] * multiplier, width, PIXEL_ON);
|
||||||
|
if(response == OUT_OF_BORDER)
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
return OK;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdRect
|
||||||
|
* Описание : Рисует незакрашенный прямоугольник
|
||||||
|
* Аргумент(ы) : x1 -> абсолютная координата x левого верхнего угла
|
||||||
|
* y1 -> абсолютная координата y левого верхнего угла
|
||||||
|
* x2 -> абсолютная координата x правого нижнего угла
|
||||||
|
* y2 -> абсолютная координата y правого нижнего угла
|
||||||
|
* mode -> Off, On или Xor. Смотри enum в n3310.h
|
||||||
|
* Возвращаемое значение : смотри возвращаемое значение в n3310lcd.h
|
||||||
|
*/
|
||||||
|
byte LcdRect ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode )
|
||||||
|
{
|
||||||
|
byte tmpIdx;
|
||||||
|
|
||||||
|
// Проверка границ
|
||||||
|
if ( ( x1 >= LCD_X_RES) || ( x2 >= LCD_X_RES) || ( y1 >= LCD_Y_RES) || ( y2 >= LCD_Y_RES) )
|
||||||
|
return OUT_OF_BORDER;
|
||||||
|
|
||||||
|
if ( ( x2 > x1 ) && ( y2 > y1 ) )
|
||||||
|
{
|
||||||
|
// Рисуем горизонтальные линии
|
||||||
|
for ( tmpIdx = x1; tmpIdx <= x2; tmpIdx++ )
|
||||||
|
{
|
||||||
|
LcdPixel( tmpIdx, y1, mode );
|
||||||
|
LcdPixel( tmpIdx, y2, mode );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Рисуем вертикальные линии
|
||||||
|
for ( tmpIdx = y1; tmpIdx <= y2; tmpIdx++ )
|
||||||
|
{
|
||||||
|
LcdPixel( x1, tmpIdx, mode );
|
||||||
|
LcdPixel( x2, tmpIdx, mode );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Имя : LcdImage
|
||||||
|
* Описание : Рисует картинку из массива сохраненного в Flash ROM
|
||||||
|
* Аргумент(ы) : Указатель на массив картинки
|
||||||
|
* Возвращаемое значение : Нет
|
||||||
|
*/
|
||||||
|
void LcdImage ( const byte *imageData )
|
||||||
|
{
|
||||||
|
// // Инициализация указателя кэша
|
||||||
|
// LcdCacheIdx = 0;
|
||||||
|
// // В пределах кэша
|
||||||
|
// for ( LcdCacheIdx = 0; LcdCacheIdx < LCD_CACHE_SIZE; LcdCacheIdx++ )
|
||||||
|
// {
|
||||||
|
// // Копируем данные из массива в кэш
|
||||||
|
// LcdCache[LcdCacheIdx] = pgm_read_byte( imageData++ );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Оптимизация от Jakub Lasinski (March 14 2009)
|
||||||
|
memcpy_P( LcdCache, imageData, LCD_CACHE_SIZE ); // Тоже самое что и выше, но занимает меньше памяти и быстрее выполняется
|
||||||
|
|
||||||
|
// Сброс указателей границ в максимальное значение
|
||||||
|
LoWaterMark = 0;
|
||||||
|
HiWaterMark = LCD_CACHE_SIZE - 1;
|
||||||
|
|
||||||
|
// Установка флага изменений кэша
|
||||||
|
UpdateLcd = TRUE;
|
||||||
|
}
|
269
n3310.h
Normal file
269
n3310.h
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/*
|
||||||
|
* Èìÿ : n3310.h
|
||||||
|
*
|
||||||
|
* Îïèñàíèå : Ýòî çàãîëîâî÷íûé ôàéë äëÿ äðàéâåðà ãðàôè÷åñêîãî LCD îò Nokia 3310, à òàêæå åãî êèòàéñêèõ êëîíîâ.
|
||||||
|
* Áàçèðóåòñÿ íà êîäå áèáëèîòåê íàïèñàííûõ Sylvain Bissonnette è Fandi Gunawan:
|
||||||
|
* http://www.microsyl.com/index.php/2010/03/24/nokia-lcd-library/
|
||||||
|
* http://fandigunawan.wordpress.com/2008/06/18/lcd-nokia-3310-pcd8544-driver-in-winavravr-gcc/
|
||||||
|
* Îñíîâíûå îòëè÷èÿ ìåæäó îðèãèíàëîì è êëîíîì õîðîøî îïèñàíû â ñòàòüå îò Aheir:
|
||||||
|
* http://radiokot.ru/articles/29/
|
||||||
|
*
|
||||||
|
* Àâòîð : Xander Gresolio <xugres@gmail.com>
|
||||||
|
* Âåá-ñòðàíèöà : http://we.easyelectronics.ru/profile/XANDER/
|
||||||
|
*
|
||||||
|
* Ëèöåíçèÿ : GPL v3.0
|
||||||
|
*
|
||||||
|
* Êîìïèëÿòîð : WinAVR, GCC for AVR platform
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _N3310_H_
|
||||||
|
#define _N3310_H_
|
||||||
|
|
||||||
|
// çàêîììåíòèðóéòå ýòó äèðåêòèâó, åñëè âàø äèñïëåé îðèãèíàëüíûé
|
||||||
|
#define CHINA_LCD
|
||||||
|
|
||||||
|
// Ïîðò ê êîòîðîìó ïîäêëþ÷åí LCD (çäåñü ïðèìåð ðàñïèíîâêè äëÿ ATmega8)
|
||||||
|
// Áèáëèîòåêà èñïîëüçóåò àïïàðàòíûé SPI, ïîýòîìó åñëè õîòèòå èíîé ïîðò - ïðèäåòñÿ ðåàëèçîâàòü SPI ïðîãðàììíî)
|
||||||
|
#define LCD_PORT PORTB
|
||||||
|
#define LCD_DDR DDRB
|
||||||
|
|
||||||
|
// Ðàñïèíîâêà ïîðòà
|
||||||
|
#define LCD_DC_PIN PB1
|
||||||
|
#define LCD_CE_PIN PB2
|
||||||
|
#define SPI_MOSI_PIN PB3 // SDIN äèñïëåÿ îáÿçàòåëüíî ïîäêëþ÷àåì ê MOSI àïïàðàòíîãî SPI
|
||||||
|
#define LCD_RST_PIN PB4
|
||||||
|
#define SPI_CLK_PIN PB5 // SCLK äèñïëåÿ îáÿçàòåëüíî ïîäêëþ÷àåì ê SCK àïïàðàòíîãî SPI
|
||||||
|
|
||||||
|
// Ðàçðåøåíèå äèñïëåÿ â ïèêñåëÿõ
|
||||||
|
#define LCD_X_RES 84 // ðàçðåøåíèå ïî ãîðèçîíòàëè
|
||||||
|
#define LCD_Y_RES 48 // ðàçðåøåíèå ïî âåðòèêàëè
|
||||||
|
|
||||||
|
// Íàñòðîéêè äëÿ ðèñîâàíèÿ ãðóïïû ïðÿìîóãîëüíèêîâ ôóíêöèåé LcdBars ( byte data[], byte numbBars, byte width, byte multiplier )
|
||||||
|
#define EMPTY_SPACE_BARS 2 // ðàññòîÿíèå ìåæäó ïðÿìîóãîëüíèêàìè
|
||||||
|
#define BAR_X 30 // êîîðäèíàòà x
|
||||||
|
#define BAR_Y 47 // êîîðäèíàòà y
|
||||||
|
|
||||||
|
// Ðàçìåð êýøà ( 84 * 48 ) / 8 = 504 áàéòà
|
||||||
|
#define LCD_CACHE_SIZE ( ( LCD_X_RES * LCD_Y_RES ) / 8 )
|
||||||
|
|
||||||
|
#define FALSE 0
|
||||||
|
#define TRUE 1
|
||||||
|
|
||||||
|
// Äëÿ âîçâðàùàåìûõ çíà÷åíèé
|
||||||
|
#define OK 0 // Áåçîøèáî÷íàÿ îòðèñîâêà
|
||||||
|
#define OUT_OF_BORDER 1 // Âûõîä çà ãðàíèöû äèñïëåÿ
|
||||||
|
#define OK_WITH_WRAP 2 // Ïåðåõîä íà íà÷àëî (ñèòóàöèÿ àâòîèíêðåìåíòà óêàçàòåëÿ êóðñîðà ïðè âûâîäå äëèííîãî òåêñòà)
|
||||||
|
|
||||||
|
typedef unsigned char byte;
|
||||||
|
|
||||||
|
// Ïåðå÷èñëåíèÿ
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
LCD_CMD = 0, // Êîìàíäà
|
||||||
|
LCD_DATA = 1 // Äàííûå
|
||||||
|
|
||||||
|
} LcdCmdData;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
PIXEL_OFF = 0, // Ïîãàñèòü ïèêñåëè äèñïëåÿ
|
||||||
|
PIXEL_ON = 1, // Âêëþ÷èòü ïèêñåëè äèñïëåÿ
|
||||||
|
PIXEL_XOR = 2 // Èíâåðòèðîâàòü ïèêñåëè
|
||||||
|
|
||||||
|
} LcdPixelMode;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
FONT_1X = 1, // Îáû÷íûé ðàçìåð øðèôòà 5x7
|
||||||
|
FONT_2X = 2 // Óâåëè÷åííûé ðàçìåð øðèôòà
|
||||||
|
|
||||||
|
} LcdFontSize;
|
||||||
|
|
||||||
|
// Ïðîòîòèïû ôóíêöèé, äåòàëüíóþ èíôîðìàöèþ ñìîòðèì âíóòðè n3310lcd.c
|
||||||
|
void LcdInit ( void ); // Èíèöèàëèçàöèÿ
|
||||||
|
void LcdClear ( void ); // Î÷èñòêà áóôåðà
|
||||||
|
void LcdUpdate ( void ); // Êîïèðîâàíèå áóôåðà â ÎÇÓ äèñïëåÿ
|
||||||
|
void LcdImage ( const byte *imageData ); // Ðèñîâàíèå êàðòèíêè èç ìàññèâà â Flash ROM
|
||||||
|
void LcdContrast ( byte contrast ); // Óñòàíîâêà êîíòðàñòíîñòè äèñïëåÿ
|
||||||
|
byte LcdGotoXYFont ( byte x, byte y ); // Óñòàíîâêà êóðñîðà â ïîçèöèþ x,y
|
||||||
|
byte LcdChr ( LcdFontSize size, byte ch ); // Âûâîä ñèìâîëà â òåêóùåé ïîçèöèè
|
||||||
|
byte LcdStr ( LcdFontSize size, byte dataArray[] ); // Âûâîä ñòðîêè ñîõðàíåííîé â RAM
|
||||||
|
byte LcdFStr ( LcdFontSize size, const byte *dataPtr ); // Âûâîä ñòðîêè ñîõðàíåííîé â Flash ROM
|
||||||
|
byte LcdPixel ( byte x, byte y, LcdPixelMode mode ); // Òî÷êà
|
||||||
|
byte LcdLine ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode ); // Ëèíèÿ
|
||||||
|
byte LcdCircle ( byte x, byte y, byte radius, LcdPixelMode mode); // Îêðóæíîñòü
|
||||||
|
byte LcdRect ( byte x1, byte y1, byte x2, byte y2, LcdPixelMode mode ); // Ïðÿìîóãîëüíèê
|
||||||
|
byte LcdSingleBar ( byte baseX, byte baseY, byte height, byte width, LcdPixelMode mode ); // Îäèí
|
||||||
|
byte LcdBars ( byte data[], byte numbBars, byte width, byte multiplier ); // Íåñêîëüêî
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Òàáëèöà äëÿ îòîáðàæåíèÿ ñèìâîëîâ (ASCII[0x20-0x7F] + CP1251[0xC0-0xFF] = âñåãî 160 ñèìâîëîâ)
|
||||||
|
*/
|
||||||
|
static const byte FontLookup [][5] PROGMEM=
|
||||||
|
{
|
||||||
|
{ 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0x20 32
|
||||||
|
{ 0x00, 0x00, 0x5F, 0x00, 0x00 }, // ! 0x21 33
|
||||||
|
{ 0x00, 0x07, 0x00, 0x07, 0x00 }, // " 0x22 34
|
||||||
|
{ 0x14, 0x7F, 0x14, 0x7F, 0x14 }, // # 0x23 35
|
||||||
|
{ 0x24, 0x2A, 0x7F, 0x2A, 0x12 }, // $ 0x24 36
|
||||||
|
{ 0x4C, 0x2C, 0x10, 0x68, 0x64 }, // % 0x25 37
|
||||||
|
{ 0x36, 0x49, 0x55, 0x22, 0x50 }, // & 0x26 38
|
||||||
|
{ 0x00, 0x05, 0x03, 0x00, 0x00 }, // ' 0x27 39
|
||||||
|
{ 0x00, 0x1C, 0x22, 0x41, 0x00 }, // ( 0x28 40
|
||||||
|
{ 0x00, 0x41, 0x22, 0x1C, 0x00 }, // ) 0x29 41
|
||||||
|
{ 0x14, 0x08, 0x3E, 0x08, 0x14 }, // * 0x2A 42
|
||||||
|
{ 0x08, 0x08, 0x3E, 0x08, 0x08 }, // + 0x2B 43
|
||||||
|
{ 0x00, 0x00, 0x50, 0x30, 0x00 }, // , 0x2C 44
|
||||||
|
{ 0x10, 0x10, 0x10, 0x10, 0x10 }, // - 0x2D 45
|
||||||
|
{ 0x00, 0x60, 0x60, 0x00, 0x00 }, // . 0x2E 46
|
||||||
|
{ 0x20, 0x10, 0x08, 0x04, 0x02 }, // / 0x2F 47
|
||||||
|
{ 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 0x30 48
|
||||||
|
{ 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1 0x31 49
|
||||||
|
{ 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2 0x32 50
|
||||||
|
{ 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3 0x33 51
|
||||||
|
{ 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4 0x34 52
|
||||||
|
{ 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5 0x35 53
|
||||||
|
{ 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6 0x36 54
|
||||||
|
{ 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7 0x37 55
|
||||||
|
{ 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8 0x38 56
|
||||||
|
{ 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9 0x39 57
|
||||||
|
{ 0x00, 0x36, 0x36, 0x00, 0x00 }, // : 0x3A 58
|
||||||
|
{ 0x00, 0x56, 0x36, 0x00, 0x00 }, // ; 0x3B 59
|
||||||
|
{ 0x08, 0x14, 0x22, 0x41, 0x00 }, // < 0x3C 60
|
||||||
|
{ 0x14, 0x14, 0x14, 0x14, 0x14 }, // = 0x3D 61
|
||||||
|
{ 0x00, 0x41, 0x22, 0x14, 0x08 }, // > 0x3E 62
|
||||||
|
{ 0x02, 0x01, 0x51, 0x09, 0x06 }, // ? 0x3F 63
|
||||||
|
{ 0x32, 0x49, 0x79, 0x41, 0x3E }, // @ 0x40 64
|
||||||
|
{ 0x7E, 0x11, 0x11, 0x11, 0x7E }, // A 0x41 65
|
||||||
|
{ 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B 0x42 66
|
||||||
|
{ 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C 0x43 67
|
||||||
|
{ 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D 0x44 68
|
||||||
|
{ 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E 0x45 69
|
||||||
|
{ 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F 0x46 70
|
||||||
|
{ 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G 0x47 71
|
||||||
|
{ 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H 0x48 72
|
||||||
|
{ 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I 0x49 73
|
||||||
|
{ 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J 0x4A 74
|
||||||
|
{ 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K 0x4B 75
|
||||||
|
{ 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L 0x4C 76
|
||||||
|
{ 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M 0x4D 77
|
||||||
|
{ 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N 0x4E 78
|
||||||
|
{ 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O 0x4F 79
|
||||||
|
{ 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P 0x50 80
|
||||||
|
{ 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q 0x51 81
|
||||||
|
{ 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R 0x52 82
|
||||||
|
{ 0x46, 0x49, 0x49, 0x49, 0x31 }, // S 0x53 83
|
||||||
|
{ 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T 0x54 84
|
||||||
|
{ 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U 0x55 85
|
||||||
|
{ 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V 0x56 86
|
||||||
|
{ 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W 0x57 87
|
||||||
|
{ 0x63, 0x14, 0x08, 0x14, 0x63 }, // X 0x58 88
|
||||||
|
{ 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y 0x59 89
|
||||||
|
{ 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z 0x5A 90
|
||||||
|
{ 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [ 0x5B 91
|
||||||
|
{ 0x02, 0x04, 0x08, 0x10, 0x20 }, // \ 0x5C 92
|
||||||
|
{ 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ] 0x5D 93
|
||||||
|
{ 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^ 0x5E 94
|
||||||
|
{ 0x40, 0x40, 0x40, 0x40, 0x40 }, // _ 0x5F 95
|
||||||
|
{ 0x00, 0x01, 0x02, 0x04, 0x00 }, // ` 0x60 96
|
||||||
|
{ 0x20, 0x54, 0x54, 0x54, 0x78 }, // a 0x61 97
|
||||||
|
{ 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b 0x62 98
|
||||||
|
{ 0x38, 0x44, 0x44, 0x44, 0x20 }, // c 0x63 99
|
||||||
|
{ 0x38, 0x44, 0x44, 0x48, 0x7F }, // d 0x64 100
|
||||||
|
{ 0x38, 0x54, 0x54, 0x54, 0x18 }, // e 0x65 101
|
||||||
|
{ 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f 0x66 102
|
||||||
|
{ 0x0C, 0x52, 0x52, 0x52, 0x3E }, // g 0x67 103
|
||||||
|
{ 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h 0x68 104
|
||||||
|
{ 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i 0x69 105
|
||||||
|
{ 0x20, 0x40, 0x44, 0x3D, 0x00 }, // j 0x6A 106
|
||||||
|
{ 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k 0x6B 107
|
||||||
|
{ 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l 0x6C 108
|
||||||
|
{ 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m 0x6D 109
|
||||||
|
{ 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n 0x6E 110
|
||||||
|
{ 0x38, 0x44, 0x44, 0x44, 0x38 }, // o 0x6F 111
|
||||||
|
{ 0x7C, 0x14, 0x14, 0x14, 0x08 }, // p 0x70 112
|
||||||
|
{ 0x08, 0x14, 0x14, 0x18, 0x7C }, // q 0x71 113
|
||||||
|
{ 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r 0x72 114
|
||||||
|
{ 0x48, 0x54, 0x54, 0x54, 0x20 }, // s 0x73 115
|
||||||
|
{ 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t 0x74 116
|
||||||
|
{ 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u 0x75 117
|
||||||
|
{ 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v 0x76 118
|
||||||
|
{ 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w 0x77 119
|
||||||
|
{ 0x44, 0x28, 0x10, 0x28, 0x44 }, // x 0x78 120
|
||||||
|
{ 0x0C, 0x50, 0x50, 0x50, 0x3C }, // y 0x79 121
|
||||||
|
{ 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z 0x7A 122
|
||||||
|
{ 0x00, 0x08, 0x36, 0x41, 0x00 }, // { 0x7B 123
|
||||||
|
{ 0x00, 0x00, 0x7F, 0x00, 0x00 }, // | 0x7C 124
|
||||||
|
{ 0x00, 0x41, 0x36, 0x08, 0x00 }, // } 0x7D 125
|
||||||
|
{ 0x08, 0x04, 0x08, 0x10, 0x08 }, // ~ 0x7E 126
|
||||||
|
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, // 0x7F 127
|
||||||
|
|
||||||
|
{ 0x7C, 0x12, 0x11, 0x12, 0x7C }, // À 0xC0 192
|
||||||
|
{ 0x7F, 0x49, 0x49, 0x49, 0x31 }, // Á 0xC1 193
|
||||||
|
{ 0x7F, 0x49, 0x49, 0x49, 0x36 }, // Â 0xC2 194
|
||||||
|
{ 0x7F, 0x01, 0x01, 0x01, 0x01 }, // Ã 0xC3 195
|
||||||
|
{ 0x60, 0x3F, 0x21, 0x3F, 0x60 }, // Ä 0xC4 196
|
||||||
|
{ 0x7F, 0x49, 0x49, 0x49, 0x41 }, // Å 0xC5 197
|
||||||
|
{ 0x77, 0x08, 0x7F, 0x08, 0x77 }, // Æ 0xC6 198
|
||||||
|
{ 0x22, 0x41, 0x49, 0x49, 0x36 }, // Ç 0xC7 199
|
||||||
|
{ 0x7F, 0x10, 0x08, 0x04, 0x7F }, // È 0xC8 200
|
||||||
|
{ 0x7E, 0x10, 0x09, 0x04, 0x7E }, // É 0xC9 201
|
||||||
|
{ 0x7F, 0x08, 0x14, 0x22, 0x41 }, // Ê 0xCA 202
|
||||||
|
{ 0x40, 0x3E, 0x01, 0x01, 0x7F }, // Ë 0xCB 203
|
||||||
|
{ 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // Ì 0xCC 204
|
||||||
|
{ 0x7F, 0x08, 0x08, 0x08, 0x7F }, // Í 0xCD 205
|
||||||
|
{ 0x3E, 0x41, 0x41, 0x41, 0x3E }, // Î 0xCE 206
|
||||||
|
{ 0x7F, 0x01, 0x01, 0x01, 0x7F }, // Ï 0xCF 207
|
||||||
|
{ 0x7F, 0x09, 0x09, 0x09, 0x06 }, // Ð 0xD0 208
|
||||||
|
{ 0x3E, 0x41, 0x41, 0x41, 0x22 }, // Ñ 0xD1 209
|
||||||
|
{ 0x01, 0x01, 0x7F, 0x01, 0x01 }, // Ò 0xD2 210
|
||||||
|
{ 0x07, 0x48, 0x48, 0x48, 0x3F }, // Ó 0xD3 211
|
||||||
|
{ 0x0E, 0x11, 0x7F, 0x11, 0x0E }, // Ô 0xD4 212
|
||||||
|
{ 0x63, 0x14, 0x08, 0x14, 0x63 }, // Õ 0xD5 213
|
||||||
|
{ 0x3F, 0x20, 0x20, 0x3F, 0x60 }, // Ö 0xD6 214
|
||||||
|
{ 0x07, 0x08, 0x08, 0x08, 0x7F }, // × 0xD7 215
|
||||||
|
{ 0x7F, 0x40, 0x7E, 0x40, 0x7F }, // Ø 0xD8 216
|
||||||
|
{ 0x3F, 0x20, 0x3F, 0x20, 0x7F }, // Ù 0xD9 217
|
||||||
|
{ 0x01, 0x7F, 0x48, 0x48, 0x30 }, // Ú 0xDA 218
|
||||||
|
{ 0x7F, 0x48, 0x30, 0x00, 0x7F }, // Û 0xDB 219
|
||||||
|
{ 0x00, 0x7F, 0x48, 0x48, 0x30 }, // Ü 0xDC 220
|
||||||
|
{ 0x22, 0x41, 0x49, 0x49, 0x3E }, // Ý 0xDD 221
|
||||||
|
{ 0x7F, 0x08, 0x3E, 0x41, 0x3E }, // Þ 0xDE 222
|
||||||
|
{ 0x46, 0x29, 0x19, 0x09, 0x7F }, // ß 0xDF 223
|
||||||
|
{ 0x20, 0x54, 0x54, 0x54, 0x78 }, // à 0xE0 224
|
||||||
|
{ 0x3C, 0x4A, 0x4A, 0x4A, 0x31 }, // á 0xE1 225
|
||||||
|
{ 0x7C, 0x54, 0x54, 0x28, 0x00 }, // â 0xE2 226
|
||||||
|
{ 0x7C, 0x04, 0x04, 0x0C, 0x00 }, // ã 0xE3 227
|
||||||
|
{ 0x60, 0x3C, 0x24, 0x3C, 0x60 }, // ä 0xE4 228
|
||||||
|
{ 0x38, 0x54, 0x54, 0x54, 0x18 }, // å 0xE5 229
|
||||||
|
{ 0x6C, 0x10, 0x7C, 0x10, 0x6C }, // æ 0xE6 230
|
||||||
|
{ 0x00, 0x44, 0x54, 0x54, 0x28 }, // ç 0xE7 231
|
||||||
|
{ 0x7C, 0x20, 0x10, 0x08, 0x7C }, // è 0xE8 232
|
||||||
|
{ 0x7C, 0x21, 0x12, 0x09, 0x7C }, // é 0xE9 233
|
||||||
|
{ 0x7C, 0x10, 0x28, 0x44, 0x00 }, // ê 0xEA 234
|
||||||
|
{ 0x40, 0x38, 0x04, 0x04, 0x7C }, // ë 0xEB 235
|
||||||
|
{ 0x7C, 0x08, 0x10, 0x08, 0x7C }, // ì 0xEC 236
|
||||||
|
{ 0x7C, 0x10, 0x10, 0x10, 0x7C }, // í 0xED 237
|
||||||
|
{ 0x38, 0x44, 0x44, 0x44, 0x38 }, // î 0xEE 238
|
||||||
|
{ 0x7C, 0x04, 0x04, 0x04, 0x7C }, // ï 0xEF 239
|
||||||
|
{ 0x7C, 0x14, 0x14, 0x14, 0x08 }, // ð 0xF0 240
|
||||||
|
{ 0x38, 0x44, 0x44, 0x44, 0x00 }, // ñ 0xF1 241
|
||||||
|
{ 0x04, 0x04, 0x7C, 0x04, 0x04 }, // ò 0xF2 242
|
||||||
|
{ 0x0C, 0x50, 0x50, 0x50, 0x3C }, // ó 0xF3 243
|
||||||
|
{ 0x08, 0x14, 0x7C, 0x14, 0x08 }, // ô 0xF4 244
|
||||||
|
{ 0x44, 0x28, 0x10, 0x28, 0x44 }, // õ 0xF5 245
|
||||||
|
{ 0x3C, 0x20, 0x20, 0x3C, 0x60 }, // ö 0xF6 246
|
||||||
|
{ 0x0C, 0x10, 0x10, 0x10, 0x7C }, // ÷ 0xF7 247
|
||||||
|
{ 0x7C, 0x40, 0x7C, 0x40, 0x7C }, // ø 0xF8 248
|
||||||
|
{ 0x3C, 0x20, 0x3C, 0x20, 0x7C }, // ù 0xF9 249
|
||||||
|
{ 0x04, 0x7C, 0x50, 0x50, 0x20 }, // ú 0xFA 250
|
||||||
|
{ 0x7C, 0x50, 0x20, 0x00, 0x7C }, // û 0xFB 251
|
||||||
|
{ 0x00, 0x7C, 0x50, 0x50, 0x20 }, // ü 0xFC 252
|
||||||
|
{ 0x28, 0x44, 0x54, 0x54, 0x38 }, // ý 0xFD 253
|
||||||
|
{ 0x7C, 0x10, 0x38, 0x44, 0x38 }, // þ 0xFE 254
|
||||||
|
{ 0x48, 0x54, 0x34, 0x14, 0x7C } // ÿ 0xFF 255
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _N3310_H_ */
|
37
picture.h
Normal file
37
picture.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Êàðòèíêà çãåíåðèðîâàíà ïðîãðàìîé FastLCD Designer 1.2.0 by Bojan I. MICRODESIGN
|
||||||
|
* Generate Bas table -> çàìåíèòü âñå "&h" íà "0x"
|
||||||
|
*/
|
||||||
|
static const unsigned char Picture[] PROGMEM = {
|
||||||
|
0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x80,
|
||||||
|
0x00,0x00,0x80,0x80,0x40,0x40,0x40,0x80,0x80,0xC0,0xC0,0x40,0xC0,0xA0,0xE0,0xC0,
|
||||||
|
0xE0,0xE0,0xF0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC,0xFE,0xEE,0xF4,0xF0,0xF0,0x70,0x30,
|
||||||
|
0x00,0x80,0x00,0x00,0x80,0x00,0x0C,0x9C,0x1C,0x38,0xB8,0x38,0x38,0xB8,0xF8,0xF0,
|
||||||
|
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
|
||||||
|
0xF8,0xF8,0xF8,0xF8,0x88,0x20,0x8A,0x20,0x08,0x22,0x08,0x00,0x0A,0x00,0x00,0x02,
|
||||||
|
0x80,0x71,0xBA,0xDA,0xFD,0xDD,0xED,0xDE,0xEE,0xF7,0xFF,0xFB,0xFD,0xFD,0xFE,0xFF,
|
||||||
|
0x7F,0x3F,0x1F,0x9F,0x3F,0x7F,0x6F,0x0F,0xAF,0x1F,0xBF,0x3E,0x3C,0x7A,0x78,0x70,
|
||||||
|
0x22,0x88,0xA0,0x2A,0x80,0x08,0x62,0xE0,0xE0,0xF2,0xF0,0x58,0xDA,0xF8,0xFC,0x92,
|
||||||
|
0xFE,0xFF,0xFF,0xD3,0xFF,0xFD,0xF3,0xE1,0xF0,0xF9,0x7F,0xBF,0x3F,0x8F,0x2F,0x4F,
|
||||||
|
0xAF,0x0F,0x4F,0xA7,0x0F,0xAF,0x87,0x2F,0x82,0x80,0x20,0xC0,0x80,0x80,0x50,0x40,
|
||||||
|
0xC4,0xD0,0xA0,0xE8,0xE4,0xEA,0xFF,0xFB,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0x4F,
|
||||||
|
0x27,0x53,0xA8,0x54,0x29,0x4A,0xB5,0x82,0xAC,0xA1,0x8A,0xB6,0x50,0x4D,0x32,0xA4,
|
||||||
|
0x4A,0xB4,0xA9,0x4A,0x52,0xB4,0xAA,0x45,0xA8,0xDA,0x22,0xAC,0xD2,0x2A,0x52,0xA8,
|
||||||
|
0x52,0x4C,0xB0,0xAD,0x43,0x5B,0xB3,0x45,0xA8,0x5B,0xA3,0xAB,0x55,0xA8,0x52,0x54,
|
||||||
|
0xA9,0x56,0xA8,0x45,0xBA,0xA4,0x49,0x5A,0xA2,0x54,0xAA,0x52,0xFE,0xFF,0xFF,0xFE,
|
||||||
|
0xFD,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||||
|
0xFF,0x7F,0xFF,0xFE,0xBF,0x7F,0xBF,0xBF,0xFF,0xDF,0xBF,0x5F,0xDF,0x7F,0xDF,0x7F,
|
||||||
|
0xDF,0xAF,0x7F,0xEE,0x8E,0xF1,0x6E,0x99,0xF7,0x6A,0xDD,0xB2,0x6E,0xD5,0x7A,0xD7,
|
||||||
|
0xAC,0x75,0xDB,0x6D,0xD5,0x7A,0xD7,0xAC,0x7B,0xE5,0xDE,0xA9,0x77,0xDA,0xB5,0xEE,
|
||||||
|
0x59,0xB6,0xEB,0xDD,0xB6,0x69,0xD6,0xBF,0xE8,0x55,0xEF,0xB9,0xD6,0xED,0xB5,0x5B,
|
||||||
|
0xAB,0xFF,0xFD,0xF7,0xFF,0x01,0x01,0x01,0x01,0xE1,0xC1,0x81,0x03,0x05,0x0F,0x1D,
|
||||||
|
0x2F,0x7E,0x01,0x00,0x01,0x01,0xFF,0xFE,0x03,0x01,0x01,0x00,0xF1,0xF0,0xF1,0x71,
|
||||||
|
0xF1,0xF1,0xB1,0xF1,0x01,0x01,0x01,0x03,0xFE,0xFF,0x01,0x01,0x01,0x01,0x9E,0x1B,
|
||||||
|
0x0D,0x07,0x03,0x41,0xE1,0xF1,0xF9,0x6D,0xFF,0xFF,0x00,0x01,0x01,0x01,0xFF,0xFF,
|
||||||
|
0xEB,0x3E,0x0D,0x03,0x01,0x41,0x71,0x70,0x41,0x01,0x03,0x0E,0x3B,0xEF,0xFE,0xFB,
|
||||||
|
0xEE,0x7D,0xF7,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,
|
||||||
|
0xFF,0xFE,0xFC,0xF8,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xF8,0xF0,0xF0,0xF0,
|
||||||
|
0xF1,0xF1,0xF1,0xF1,0xF1,0xF1,0xF1,0xF1,0xF0,0xF0,0xF0,0xF8,0xFF,0xFF,0xF0,0xF0,
|
||||||
|
0xF0,0xF0,0xFF,0xFF,0xFE,0xFC,0xF8,0xF0,0xF0,0xF1,0xF3,0xF7,0xFF,0xFF,0xF0,0xF0,
|
||||||
|
0xF0,0xF0,0xFF,0xF3,0xF0,0xF0,0xF0,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xF0,
|
||||||
|
0xF0,0xF0,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF};
|
BIN
sch/N3310Lib.png
Normal file
BIN
sch/N3310Lib.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 39 KiB |
BIN
sch/N3310Lib.sch
Normal file
BIN
sch/N3310Lib.sch
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user