├── .gitattributes
├── .gitignore
├── .gitlab-ci.yml
├── LICENSE
├── Makefile
├── README.md
├── bb-connect-ap
├── beagle-tester-close.sh
├── beagle-tester-host-setup.sh
├── beagle-tester-open.sh
├── beagle-tester.rules
├── beagle-tester.service
├── cape_header_test_board.md
├── cape_interface_spec.md
├── debian
├── changelog
├── compat
├── config
├── control
├── files
├── format
└── rules
├── gamepup-buzz-on-buttons.out
├── gamepup-buzz-on-buttons.pru0c
├── images
├── BURN-IN.png
├── Makefile
├── beagleboard-xm-pass.png
├── itu-r-bt1729-colorbar-1024x768-32.raw.xz
├── itu-r-bt1729-colorbar-1024x768.raw.xz
├── itu-r-bt1729-colorbar-1088x1920.raw.xz
├── itu-r-bt1729-colorbar-1280x1024-32.raw.xz
├── itu-r-bt1729-colorbar-1280x720.raw.xz
├── itu-r-bt1729-colorbar-128x160.raw.xz
├── itu-r-bt1729-colorbar-1360x768.raw.xz
├── itu-r-bt1729-colorbar-1920x1080.raw.xz
├── itu-r-bt1729-colorbar-2048x1080-32.raw.xz
├── itu-r-bt1729-colorbar-3200x1800.png
├── itu-r-bt1729-colorbar-320x240.raw.xz
├── itu-r-bt1729-colorbar-480x272.raw.xz
├── itu-r-bt1729-colorbar-800x600.raw.xz
└── png2fb.py
├── include
├── common.h
└── red.h
├── src
├── beagle-tester.c
├── common.c
├── fb-test.c
├── font_8x8.c
└── red.c
├── techlab-buzz.out
└── techlab-buzz.pru0c
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.c ident
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore binaries
2 | beagle-tester
3 |
4 | # ignore logs
5 | debian/*.log
6 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | build:
2 | stage: build
3 | parallel:
4 | matrix:
5 | - IMAGE: bookworm
6 | TAG: [docker-amd64, docker-aarch64-ci, docker-armhf]
7 | - IMAGE: noble
8 | TAG: [docker-aarch64-ci, docker-riscv64-ci]
9 | image: registry.git.beagleboard.org/jkridner/debian-build:${IMAGE}
10 | tags:
11 | - ${TAG}
12 | script:
13 | - debuild -us -uc
14 | - mkdir -p public/pkg/${IMAGE}
15 | - cp ../beagle-tester_*.deb public/pkg/${IMAGE}
16 | artifacts:
17 | paths:
18 | - public
19 |
20 | pages:
21 | image: registry.git.beagleboard.org/jkridner/debian-build:latest
22 | stage: deploy
23 | dependencies:
24 | - "build: [bookworm, docker-amd64]"
25 | - "build: [bookworm, docker-aarch64-ci]"
26 | - "build: [bookworm, docker-armhf]"
27 | - "build: [noble, docker-aarch64-ci]"
28 | - "build: [noble, docker-riscv64-ci]"
29 | script:
30 | - apindex public
31 | artifacts:
32 | paths:
33 | - public
34 |
35 |
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | prefix := /usr
2 | CC := gcc
3 | MAKE := make
4 | RM := rm
5 | INSTALL := install
6 | GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags)
7 | SRC := $(wildcard src/*.c)
8 | INC := $(wildcard include/*.h)
9 | OBJS := ${patsubst %.c,%.o,${SRC}}
10 | CFLAGS := $(CFLAGS_FOR_BUILD) -O3 -W -Wall -Wwrite-strings -I./include
11 |
12 | all: beagle-tester
13 |
14 | beagle-tester: $(SRC) $(INC)
15 | $(CC) -DVERSION=\"${GIT_VERSION}\" $(CFLAGS) $(SRC) -o beagle-tester
16 |
17 | images:
18 | $(MAKE) -C images
19 |
20 | clean:
21 | $(RM) -f beagle-tester
22 |
23 | install:
24 | $(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/sbin
25 | $(INSTALL) -m 700 beagle-tester $(DESTDIR)$(prefix)/sbin
26 | $(INSTALL) -m 744 bb-connect-ap $(DESTDIR)$(prefix)/sbin
27 | $(INSTALL) -m 744 beagle-tester-open.sh $(DESTDIR)$(prefix)/sbin
28 | $(INSTALL) -m 744 beagle-tester-close.sh $(DESTDIR)$(prefix)/sbin
29 | $(INSTALL) -m 755 -d $(DESTDIR)/lib/systemd/system
30 | $(INSTALL) -m 644 beagle-tester.service $(DESTDIR)/lib/systemd/system
31 | $(INSTALL) -m 755 -d $(DESTDIR)/etc/udev/rules.d
32 | $(INSTALL) -m 644 beagle-tester.rules $(DESTDIR)/etc/udev/rules.d
33 | $(INSTALL) -m 755 -d $(DESTDIR)/lib/firmware
34 | $(INSTALL) -m 644 techlab-buzz.out $(DESTDIR)/lib/firmware
35 | $(INSTALL) -m 644 gamepup-buzz-on-buttons.out $(DESTDIR)/lib/firmware
36 | $(MAKE) -C images -s install
37 | #systemctl stop beagle-tester.service || true
38 | #systemctl daemon-reload || true
39 | #systemctl enable beagle-tester.service || true
40 |
41 | start: install
42 | systemctl restart beagle-tester.service
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # beagle-tester
2 |
3 | ## Buildroot images
4 |
5 | Download the latest releases bundled in Buildroot at https://github.com/beagleboard/buildroot/releases
6 |
7 | ## Supported boards
8 |
9 | * [BeagleBone Black](#beaglebone-black)
10 | * [BeagleBone Black Industrial](#beaglebone-black)
11 | * [BeagleBone Black Wireless](#beaglebone-black-wireless)
12 | * [BeagleBone Blue](#beaglebone-blue)
13 | * [BeagleBoard-xM](#beagleboard-xm)
14 | * [PocketBeagle GamePup Cape](#gamepup)
15 | * [PocketBeagle TechLab Cape](#techlab)
16 |
17 | ## Supported scanners
18 |
19 | * [Datalogic QuickScan L](http://www.datalogic.com/eng/products/automatic-data-capture/general-duty-handheld-scanners/quickscan-l-qd2300-pd-166.html) - VID:05f9 "PSC Scanning, Inc." PID:2204
20 | * [Intermec SG20 General Duty 1D/2D Handheld Scanner](http://www.intermec.com/products/scansg20t/) - VID:067E PID: 0801
21 |
22 | ## _DUT_ software setup
23 |
24 | For production, the boards should be flashed with an approved production image ahead of beginning this test. No additional software setup steps should be performed. For non-capes, the first 12 characters of the EEPROM should also be valid ahead of running this test, though the additional serial number characters need not and should not be programmed until this test is run.
25 |
26 | If not already setup, on a recent [BeagleBoard.org Debian image](https://beagleboard.org/latest-images), perform:
27 |
28 | apt-get update
29 | DEBIAN_FRONTEND=noninteractive apt-get install -y roboticscape
30 | cd /opt/source
31 | git clone https://github.com/beagleboard/beagle-tester
32 | cd beagle-tester
33 | make && make install
34 |
35 | ## _Host_ software setup
36 |
37 | If you are running Windows as the _host_, make sure you [disable the Windows Firewall for ICMPv4 packets](https://kb.iu.edu/d/aopy).
38 |
39 | ## Serial number barcode format
40 |
41 | Each board that has an on-board EEPROM should have an associated 16 digit serial number placed onto a barcode on the board.
42 |
43 | ### The first 4 ASCII characters indicate the board type:
44 |
45 | * BeagleBone Black - 00C0
46 | * BeagleBone Black Industrial - EIA0
47 | * BeagleBone Black Wireless - BWA5
48 | * BeagleBone Blue - BLA2
49 | * PocketBeagle GamePup Cape - PC00
50 | * PocketBeagle TechLab Cape - PC01
51 |
52 | ### The second 4 characters should:
53 | * For non-capes, indicate the manufacturing week in the format YYWW, where YY is currently 19 and WW is currently 03.
54 | * For capes, indicate the revision level, such as 00A3.
55 |
56 | ### The next 4 characters should:
57 | * For capes, indicate the manufacturing week in the format YYWW, where YY is currently 19 and WW is currently 03. Capes have exclusive manufacturers, so the manufaturer-specific product code can be left off.
58 | * For non-capes, be a manufacturer-specific product code. If you are a new manufacturer, please choose something unique you can use to identify your boards.
59 |
60 | Manuracturer-specific allocations include, but are not limited to:
61 |
62 | * BBGW for GHI manufactured BeagleBone Black Wireless
63 | * ELnn for Embest manufactured BeagleBone Blue
64 | * SBB for Seeed manufactured BeagleBone Black
65 | * SBI for Seeed manufactured BeagleBone Black Industrial
66 | * GPB for GHI manufactured PocketBeagle
67 | * SPB for Seeed manufactured PocketBeagle
68 |
69 | ### The final 4 characters should:
70 | * Be a sequential decimal number. If more than 10,000 boards are manufactured that week, roll over the top digit to an ASCII hex character.
71 |
72 | # BeagleBone Black
73 |
74 | ## Required equipment
75 |
76 | * _TV_: HDMI TV capable of 1280x720p60 (720p) (HDMI monitor if no audio testing) with HDMI-to-microHDMI cable
77 | * _Router_: Ethernet router (configured to answer DHCP requests and answer pings on the provided gateway) with Ethernet cable
78 | * _Host_: BeagleBone Black or other computer (configured to make DHCP requests over USB RNDIS interface and answer pings)
79 | * _Scanner_: A supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
80 | * _Power_: Approved 5V power brick
81 | * _DUT_: BeagleBone Black (device) under test
82 |
83 | ## Test steps
84 |
85 | 1. Connect microHDMI on _DUT_ to _TV_
86 | 2. Connect Ethernet on _DUT_ to _router_
87 | 3. Connect a wire from TP4 to ground to enable EEPROM writing of board revision and serial number
88 | 4. Connect _DUT_ to _power_
89 | 5. Wait for the BeagleBoard.org desktop to show (should be under 2 minutes)
90 | 6. Connect _scanner_
91 | 7. Wait for the CISPR test animation and audio playback (should be under 15 seconds) ![CISPR image][cispr]
92 | 8. Connect USB client port on _DUT_ to _host_
93 | 9. Scan the 16 character barcode
94 | 10. Pass or fail will be indicated by a respectively green or red box on the _TV_
95 | 11. Disconnect _scanner_
96 | 12. Disconnect _host_
97 | 13. Disconnect _power_
98 | 14. Disconnect remaining devices
99 |
100 | # BeagleBone Black Wireless
101 |
102 | ## Required equipment
103 |
104 | * _TV_: HDMI TV capable of 1280x720p60 (720p) (HDMI monitor if no audio testing) with HDMI to microHDMI cable
105 | * _AP_: BeagleBone Black Wireless acting as a WiFi access point (should be default on production image) (SSID: BeagleBone-XXXX, PSK: BeagleBone)
106 | * _Host_: BeagleBone Black Wireless or other computer (configured to make DHCP requests over USB RNDIS interface and answer pings)
107 | * _Scanner_: Supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
108 | * _Power_: Approved 5V power brick
109 | * _DUT_: BeagleBone Black Wireless (device) under test
110 |
111 | ## Test steps
112 |
113 | 1. Ensure _AP_ is functioning nearby
114 | 2. Connect microHDMI on _DUT_ to _TV_
115 | 3. Connect a wire from TP1 to ground to enable EEPROM writing of board revision and serial number
116 | 4. Connect _DUT_ to _power_
117 | 5. Wait for the BeagleBoard.org desktop to show (should be under 2 minutes)
118 | 6. Connect USB host on _DUT_ to _scanner_
119 | 7. Wait for the CISPR test animation and audio playback (should be under 15 seconds) ![CISPR image][cispr]
120 | 8. Connect USB client on _DUT_ to _host_
121 | 9. Scan the 16 character barcode
122 | 10. Pass or fail will be indicated by a respectively green or red box on the _TV_
123 | 11. Disconnect _scanner_
124 | 12. Disconnect _host_
125 | 13. Disconnect _power_
126 | 14. Disconnect remaining devices
127 |
128 | # BeagleBone Blue
129 |
130 | ## Required equipment
131 |
132 | * _AP_: BeagleBone Blue acting as a WiFi access point (use beagle-tester-host-setup.sh script) (SSID: BeagleBone-XXXX, PSK: BeagleBone)
133 | * _Host_: BeagleBone Blue or other computer (configured to make DHCP requests over USB RNDIS interface and answer pings, use beagle-tester-host-setup.sh script)
134 | * _Scanner_: Supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
135 | * _Power_: Approved 12V power brick
136 | * _DUT_: BeagleBone Blue (device) under test
137 |
138 | ## Test steps
139 |
140 | 1. Ensure _AP_ is functioning nearby
141 | 2. Connect a wire from WP to GND to enable EEPROM writing of board revision and serial number
142 | 3. Connect _DUT_ to _power_
143 | 4. Connect USB host on _DUT_ to _scanner_
144 | 5. Wait for the G and R LEDs to be lit
145 | 6. Connect USB client on _DUT_ to _host_
146 | 7. Scan the 16 character barcode
147 | 8. Pass or fail will be indicated by respectively G or R led flashing exclusively (blue LEDs 0-3 will flash indicating the test number executing and if blue LEDs 0-3 stop flashing before G or R begin flashing, then the board hung and failed)
148 | 9. Disconnect _scanner_
149 | 10. Disconnect _host_
150 | 11. Disconnect _power_
151 |
152 | # BeagleBoard-xM
153 |
154 | ## Required equipment
155 |
156 | * _TV_: DVI-D/HDMI TV capable of 1280x1024 with HDMI cable
157 | * _Router_: Ethernet router (configured to answer DHCP requests and answer pings on the provided gateway)
158 | * _Host_: BeagleBone Black or other computer (configured to make DHCP requests over USB RNDIS interface and answer pings)
159 | * _Scanner_: Supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
160 | * _Flashdrives_: Three (3) USB 2.0 HS capable flash drives
161 | * _Speaker_: Speaker with 1/8" audio patch cable
162 | * _Power_: Approved 5V power brick
163 | * _DUT_: BeagleBoard-xM (device) under test
164 |
165 | ## Test steps
166 |
167 | 1. Connect HDMI on _DUT_ to _TV_
168 | 2. Connect Ethernet on _DUT_ to _router_
169 | 3. Connect 3x USB host on _DUT_ to _flashdrives_
170 | 4. Connect audio output on _DUT_ to _speaker_
171 | 5. Connect _DUT_ to _power_
172 | 6. Wait for the BeagleBoard.org desktop to show (should be under 2 minutes)
173 | 7. Connect USB host on _DUT_ to _scanner_
174 | 8. Wait for the CISPR test animation and audio playback (should be under 15 seconds) ![CISPR image][cispr]
175 | 9. Connect USB client on _DUT_ to _host_
176 | 10. Scan a barcode to begin the test
177 | 11. Pass or fail will be indicated by a respectively green or red box on the _TV_ ![xM pass image][xm-pass]
178 | 12. Disconnect _scanner_
179 | 13. Disconnect _host_
180 | 14. Disconnect _power_
181 | 15. Disconnect remaining devices
182 |
183 | [cispr]: https://raw.githubusercontent.com/beagleboard/beagle-tester/main/images/itu-r-bt1729-colorbar-3200x1800.png
184 | [xm-pass]: https://farm1.staticflickr.com/531/31402272653_86721d4fa5_o_d.png
185 |
186 | # GamePup
187 |
188 | ## Required equipment
189 |
190 | * _Host_: PocketBeagle used to execute the test with programmed microSD inserted
191 | * _Scanner_: A supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
192 | * _Power_: Approved 5V power brick with microUSB cable
193 | * _DUT_: GapePup Cape (device) under test
194 |
195 | ## Test steps
196 |
197 | 1. Connect _host_ and _DUT_
198 | 2. Connect a wire across the EEPROM jumper to enable EEPROM writing of board revision and serial number
199 | 3. Connect _power_ to _host_
200 | 4. Wait for the LCD on _DUT_ to turn on (should be under 30 seconds)
201 | 5. Connect _scanner_ to _DUT_
202 | 6. Wait for the CISPR test animation and audio playback (should be under 5 seconds) ![CISPR image][cispr]
203 | 7. Scan barcode to begin the test
204 | 8. Observe tone played from _DUT_
205 | 9. Pass or fail will be indicated by a respectively green or red box on the LCD on _DUT_
206 | 10. Observe 2 red LEDs on _DUT_ lit steadily
207 | 11. Disconnect _scanner_
208 | 12. Press buttons to observe key presses sent to the console and different tone played per key
209 | 13. Disconnect _power_
210 | 14. Disconnect remaining devices
211 |
212 | ## Buttons
213 |
214 | * Select: 5
215 | * Start: 1
216 | * Left-Up: up arrow, ^\[\[A
217 | * Left-Down: down arrow, ^\[\[B
218 | * Left-Right: right arrow, ^\[\[C
219 | * Left-Left: left arrow, ^\[\[D
220 | * Right-Up: ESC
221 | * Right-Right: TAB
222 | * Right-Left: p
223 | * Right-Down: ENTER
224 |
225 | # TechLab
226 |
227 | ## Required equipment
228 |
229 | * _Host_: PocketBeagle used to execute the test with programmed microSD inserted
230 | * _Scanner_: A supported barcode scanner (listed above) (along with a suitable 16 character barcode on the device under test)
231 | * _Power_: Approved 5V power brick with microUSB cable
232 | * _DUT_: TechLab Cape (device) under test
233 |
234 | ## Test steps
235 |
236 | 1. Connect _host_ and _DUT_
237 | 2. Connect a wire across the EEPROM jumper to enable EEPROM writing of board revision and serial number
238 | 3. Connect _power_ to _host_
239 | 4. Wait for "heartbeat" on _host_ LED USR0
240 | 5. Connect _scanner_ to _DUT_
241 | 6. Wait for all _host_ USRx LEDs to be on solid
242 | 7. Scan barcode to begin the test
243 | 8. Observe all 14 seven segment LEDs to turn on
244 | 9. Observe tone played from _DUT_
245 | 10. Observe RGB LED cycle through red-green-blue
246 | 11. Observe all _host_ USRx LEDs to be on solid again
247 | 12. Observe RGB LED to be flashing green (not red)
248 | 13. Press the L button to observe the left seven segment display to turn off
249 | 14. Press the R button to observe the right seven segment display to turn off
250 | 15. Disconnect _scanner_
251 | 16. Disconnect _power_
252 | 17. Disconnect remaining devices
253 |
--------------------------------------------------------------------------------
/bb-connect-ap:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #connmanctl tether wifi off > /dev/null
3 | #sleep 1
4 | connmanctl enable wifi > /dev/null
5 | connmanctl scan wifi > /dev/null
6 | sleep 3
7 | SERVICE=`connmanctl services | grep BeagleBone | head -1 | sed 's/\s\+/,/g'`
8 | if [ "$SERVICE" == "" ] ; then
9 | echo "No BeagleBone tether found!"
10 | exit 1 ;
11 | fi
12 | SSID=`echo $SERVICE | cut -d, -f2`
13 | HASH=`echo $SERVICE | cut -d, -f3`
14 | cat << EOF > /var/lib/connman/$SSID-psk.config
15 | [service_$HASH]
16 | Type = wifi
17 | Name = $SSID
18 | Passphrase = BeagleBone
19 | EOF
20 | connmanctl connect $HASH > /dev/null
21 | sleep 5
22 | echo $SSID
23 |
--------------------------------------------------------------------------------
/beagle-tester-close.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | board=$(cat /proc/device-tree/model | sed "s/ /_/g")
3 | case "${board}" in
4 | TI_AM335x_BeagleBone_Blue)
5 | # disable TFT LCD driver
6 | rmmod fb_ili9341
7 | rmmod fbtft_device
8 | rmmod fbtft
9 | # restore battery LEDs
10 | echo 0 > /sys/class/leds/bat0/brightness
11 | echo 0 > /sys/class/leds/bat1/brightness
12 | echo 0 > /sys/class/leds/bat2/brightness
13 | echo 0 > /sys/class/leds/bat3/brightness
14 | systemctl start battery_monitor.service
15 | ;;
16 | *)
17 | systemctl restart getty@tty1.service
18 | systemctl restart lightdm.service
19 | ;;
20 | esac
21 |
22 | echo Cleaned up console. Exiting.
23 |
--------------------------------------------------------------------------------
/beagle-tester-host-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | if ! [ $(id -u) = 0 ] ; then
4 | echo "$0 must be run as sudo user or root"
5 | exit 1
6 | fi
7 |
8 | #We need to work around these default ip ranges, to make sure the tests pass
9 | #192.168.7.x = default usb0
10 | #192.168.8.x = default SoftAP0
11 | #192.168.9.x = (bbxm, work around 192.168.7.x usb0)
12 |
13 | #usb0 192.168.7.x -> 192.168.10.x
14 |
15 | # Used by: /opt/scripts/boot/autoconfigure_usb0.sh
16 | #iface usb0 inet static
17 | # address 192.168.7.2
18 | # netmask 255.255.255.252
19 | # network 192.168.7.0
20 | # gateway 192.168.7.1
21 |
22 | unset deb_iface_range_regex
23 | unset deb_usb_address
24 | unset deb_usb_network
25 | unset deb_usb_gateway
26 |
27 | deb_iface_range_regex="/^[[:space:]]*iface[[:space:]]+usb0/,/iface/"
28 |
29 | deb_usb_address=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
30 | sed -nr "s/^[[:space:]]*address[[:space:]]+([0-9.]+)/\1/p")
31 |
32 | deb_usb_network=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
33 | sed -nr "s/^[[:space:]]*network[[:space:]]+([0-9.]+)/\1/p")
34 |
35 | deb_usb_gateway=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
36 | sed -nr "s/^[[:space:]]*gateway[[:space:]]+([0-9.]+)/\1/p")
37 |
38 | sed -i -e 's:'$deb_usb_address':192.168.10.2:g' /etc/network/interfaces
39 | sed -i -e 's:'$deb_usb_network':192.168.10.0:g' /etc/network/interfaces
40 | sed -i -e 's:'$deb_usb_gateway':192.168.10.1:g' /etc/network/interfaces
41 |
42 | deb_usb_address=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
43 | sed -nr "s/^[[:space:]]*address[[:space:]]+([0-9.]+)/\1/p")
44 |
45 | deb_usb_network=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
46 | sed -nr "s/^[[:space:]]*network[[:space:]]+([0-9.]+)/\1/p")
47 |
48 | deb_usb_gateway=$(sed -nr "${deb_iface_range_regex} p" /etc/network/interfaces |\
49 | sed -nr "s/^[[:space:]]*gateway[[:space:]]+([0-9.]+)/\1/p")
50 |
51 | echo "usb0, updated: [${deb_usb_address}],[${deb_usb_network}],[${deb_usb_gateway}]"
52 |
53 | #SoftAP0 192.168.8.x -> 192.168.11.x
54 | . /etc/default/bb-wl18xx
55 | sed -i -e 's:'$USE_WL18XX_IP_PREFIX':192.168.11:g' /etc/default/bb-wl18xx
56 |
57 | sed -i -e 's:#USE_PERSONAL_SSID=:USE_PERSONAL_SSID=BeagleBone-TESTER:g' /etc/default/bb-wl18xx
58 |
59 | . /etc/default/bb-wl18xx
60 |
61 | echo "wlan0, updated: [${USE_WL18XX_IP_PREFIX}],[${USE_PERSONAL_SSID}]"
62 |
63 | #/var/local/bb_usb_mass_storage.img is a symlink to:
64 | #/var/cache/doc-beaglebone-getting-started//beaglebone-getting-started-2016-11-07.img
65 | #(or newer)
66 | wfile="test.file"
67 | ln -s /var/local/bb_usb_mass_storage.img /var/www/html/${wfile}
68 | sha256sum /var/www/html/${wfile} > /var/www/html/${wfile}.sha256sum
69 |
70 | echo "wlan0, dl file: [${wfile}] setup on port 8080"
71 |
72 | echo "Please Reboot"
73 |
74 |
--------------------------------------------------------------------------------
/beagle-tester-open.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | board=$(cat /proc/device-tree/model | sed "s/ /_/g")
3 | case "${board}" in
4 | TI_AM335x_BeagleBone_Blue)
5 | # configure battery LEDs
6 | systemctl stop battery_monitor.service
7 | echo 1 > /sys/class/leds/bat0/brightness
8 | echo 1 > /sys/class/leds/bat1/brightness
9 | echo 1 > /sys/class/leds/bat2/brightness
10 | echo 1 > /sys/class/leds/bat3/brightness
11 | # enable TFT LCD driver
12 | # see https://gist.github.com/jadonk/0e4a190fc01dc5723d1f183737af1d83
13 | echo 49 > /sys/class/gpio/unexport # RESET - V14 - GP0_PIN4
14 | echo 57 > /sys/class/gpio/unexport # D/C - U16 - GP0_PIN3
15 | echo 29 > /sys/class/gpio/unexport # CS - H18
16 | echo gpio > /sys/devices/platform/ocp/ocp\:P9_23_pinmux/state # RESET - V14 - GP0_4
17 | echo gpio > /sys/devices/platform/ocp/ocp\:U16_pinmux/state # D/C - U16 - GP0_3
18 | echo spi > /sys/devices/platform/ocp/ocp\:P9_31_pinmux/state # SCLK - A13 - S1.1_5
19 | echo spi > /sys/devices/platform/ocp/ocp\:P9_29_pinmux/state # MISO - B13 - S1.1_4
20 | echo spi > /sys/devices/platform/ocp/ocp\:P9_30_pinmux/state # MOSI - D12 - S1.1_3
21 | echo spi > /sys/devices/platform/ocp/ocp\:H18_pinmux/state # CS - H18 - S1.1_6
22 | modprobe fbtft_device name=adafruit28 busnum=1 rotate=90 gpios=reset:49,dc:57
23 | sleep 2
24 | ;;
25 | TI_OMAP3_BeagleBoard_xM)
26 | amixer -c0 sset 'DAC1 Digital Fine' 40
27 | amixer -c0 sset 'Headset' 2
28 | amixer -c0 sset 'HeadsetL Mixer AudioL1' on
29 | amixer -c0 sset 'HeadsetR Mixer AudioR1' on
30 | sed -i -e 's:192.168.7.1:192.168.9.1:g' /etc/udhcpd.conf
31 | ifconfig usb0 192.168.9.2 netmask 255.255.255.252
32 | systemctl restart udhcpd.service
33 | ;;
34 | *)
35 | ;;
36 | esac
37 |
38 | systemctl stop getty@tty1.service
39 | systemctl stop lightdm.service
40 | export XAUTHORITY=~debian/.Xauthority
41 | #xrandr --newmode 1280720t 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync
42 | #xrandr --display :0.0 --newmode 1280720 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
43 | #xrandr --display :0.0 --addmode default 1280720
44 | #xrandr --display :0.0 --output default --mode 1280720
45 | aplay /usr/share/sounds/alsa/Front_Center.wav
46 | /sbin/bb-connect-ap
47 | GW=$(ip route show default | awk '/dev wlan0 scope link/ {print $1}')
48 | ping -s 8184 -i 0.2 -q $GW &
49 |
50 |
--------------------------------------------------------------------------------
/beagle-tester.rules:
--------------------------------------------------------------------------------
1 | KERNEL=="event*", ATTRS{idVendor}=="05fe", ATTRS{idProduct}=="1010",\
2 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
3 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
4 | KERNEL=="event*", ATTRS{idVendor}=="05f9", ATTRS{idProduct}=="2204",\
5 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
6 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
7 | KERNEL=="event*", ATTRS{idVendor}=="067e", ATTRS{idProduct}=="0801",\
8 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
9 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
10 | KERNEL=="event*", ATTRS{idVendor}=="0c2e", ATTRS{idProduct}=="0901",\
11 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
12 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
13 | KERNEL=="event*", ATTRS{idVendor}=="05f9", ATTRS{idProduct}=="2206",\
14 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
15 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
16 | KERNEL=="event*", ATTRS{idVendor}=="24ea", ATTRS{idProduct}=="0197",\
17 | SYMLINK+="input/beagle-barcode", TAG+="systemd",\
18 | ENV{SYSTEMD_WANTS}="beagle-tester.service"
19 |
--------------------------------------------------------------------------------
/beagle-tester.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Beagle Self-test
3 | Requires=dev-input-beagle\x2dbarcode.device
4 | BindsTo=dev-input-beagle\x2dbarcode.device
5 |
6 | [Service]
7 | ExecStart=/usr/sbin/beagle-tester
8 |
--------------------------------------------------------------------------------
/cape_header_test_board.md:
--------------------------------------------------------------------------------
1 | # Cape Header Test Board
2 |
3 | ## EEPROM-triggered overlay considerations
4 |
5 | * Overlay should set a default pinmux that can be useful for a subset of tests on BeagleBone AI (AM5729).
6 | * On boards with dynamic pin muxing, all modes should be tested.
7 |
--------------------------------------------------------------------------------
/cape_interface_spec.md:
--------------------------------------------------------------------------------
1 | # Cape Interface Spec
2 |
3 | ## I2C
4 |
5 | Suggested Click: [Amient 2](https://www.mikroe.com/ambient-2-click)
6 |
7 | | Links | DT symbol | SCL | SDA | microBUS |
8 | | --------------- | ------------ | ----- | ------ | -------- |
9 | | /dev/bone/i2c/0 | bone_i2c_0 | N/A | N/A | N/A |
10 | | /dev/bone/i2c/1 | bone_i2c_1 | P9.17 | P9.18 | |
11 | | /dev/bone/i2c/2 | bone_i2c_2 | P9.19 | P9.20 | 1,2,3,4 |
12 | | /dev/bone/i2c/3 | bone_i2c_3 | P9.24 | P9.26 | |
13 | | /dev/bone/i2c/4 | bone_i2c_4 | P9.21 | P9.22 | |
14 | | /dev/bone/i2c/5 | bone_i2c_5 | P8.23 | P8.24 | 6 |
15 |
16 | ## SPI
17 |
18 | Suggested Click: [microSD](https://www.mikroe.com/microsd-click)
19 |
20 | | Bone bus | DT symbol | COPI | CIPO | CLK | CS |
21 | | ------------------ | ---------- | ----- | ----- | ----- | ----- |
22 | | /dev/bone/spi/0.0 | bone_spi_0 | P9.18 | P9.21 | P9.22 | P9.17 |
23 | | /dev/bone/spi/0.1 | | P9.18 | P9.21 | P9.22 | P9.23 |
24 | | /dev/bone/spi/1.0 | bone_spi_1 | P9.30 | P9.29 | P9.31 | P9.28 |
25 | | /dev/bone/spi/1.1 | | P9.30 | P9.29 | P9.31 | P9.42 |
26 | | /dev/bone/spi/1.2 | | P9.30 | P9.29 | P9.31 | P8.10 |
27 | | /dev/bone/spi/2.0 | bone_spi_2 | P8.20 | P8.25 | P8.21 | P8.6 |
28 |
29 | ## UART
30 |
31 | Suggested Click: [GNSS 7](https://www.mikroe.com/gnss-7-click)
32 |
33 | | Bone bus | DT symbol | TX | RX |
34 | | ----------------- | ------------ | ------ | ------ |
35 | | /dev/bone/uart/0 | bone_uart_0 | N/A | N/A |
36 | | /dev/bone/uart/1 | bone_uart_1 | P9.24 | P9.26 |
37 | | /dev/bone/uart/2 | bone_uart_2 | P9.21 | P9.22 |
38 | | /dev/bone/uart/3 | bone_uart_3 | P9.42 | *n/a* |
39 | | /dev/bone/uart/4 | bone_uart_4 | P9.13 | P9.11 |
40 | | /dev/bone/uart/5 | bone_uart_5 | P8.37 | P8.38 |
41 | | /dev/bone/uart/6 | bone_uart_6 | P8.29 | P8.28 |
42 | | /dev/bone/uart/7 | bone_uart_7 | P8.34 | P8.22 |
43 | | /dev/bone/uart/8 | bone_uart_8 | P8.24 | P8.23 |
44 |
45 | ## CAN
46 |
47 | Because CAN isn't a native interface on mikroBUS, we should just make our on mikroBUS add-on for this.
48 |
49 | Because we cannot support UART on all of these pins, it may be necessary to do a software UART implementation to support in some cases or simply not support UART on those mikroBUS sockets.
50 |
51 | | Link | TX | RX |
52 | | ------------------------ | ----- | ----- |
53 | | /dev/play/mikrobus/can/0 | RX | TX |
54 | | /dev/bone/can/0 | P9.20 | P9.19 |
55 | | /dev/bone/can/1 | P9.26 | P9.24 |
56 | | /dev/bone/can/2 | P8.08 | P8.07 |
57 | | /dev/bone/can/3 | P8.10 | P8.09 |
58 | | /dev/bone/can/4 | P8.05 | P8.06 |
59 |
60 | ## ADC
61 |
62 | Suggested Click: [PIR 2](https://www.mikroe.com/pir-2-click)
63 |
64 | | Index | Header pin |
65 | | ------ | ----------- |
66 | | 0 | P9.39 |
67 | | 1 | P9.40 |
68 | | 2 | P9.37 |
69 | | 3 | P9.38 |
70 | | 4 | P9.33 |
71 | | 5 | P9.36 |
72 | | 6 | P9.35 |
73 | | 7 | N/A |
74 |
75 | ## PWM
76 |
77 | Suggested Click: [Buzzer](https://www.mikroe.com/buzzer-click)
78 |
79 | | SYSFS link | DT symbol | A | B |
80 | | ---------------- | ---------- | ------ | ------ |
81 | | /dev/bone/pwm/0 | bone_pwm_0 | P9.22 | P9.21 |
82 | | /dev/bone/pwm/1 | bone_pwm_1 | P9.14 | P9.16 |
83 | | /dev/bone/pwm/2 | bone_pwm_2 | P8.19 | P8.13 |
84 |
85 | ## Counter
86 |
87 | We'll need to make our own here.
88 |
89 | Which pins on mikroBUS?
90 |
91 | | SYSFS link | DT symbol | A | B | S | I |
92 | | ---------------------------- | -------------- | ----- | ----- | ----- | ----- |
93 | | /dev/play/mikrobus/counter/0 | play_counter_0 | COPI | CIPO | INT | AN |
94 | | /dev/play/mikrobus/counter/1 | play_counter_1 | PWM | RST | CS | CLK |
95 | | /dev/bone/counter/0 | bone_counter_0 | P9.42 | P9.27 | TBD | TBD |
96 | | /dev/bone/counter/1 | bone_counter_1 | P8.35 | P8.33 | TBD | TBD |
97 | | /dev/bone/counter/2 | bone_counter_2 | P8.12 | P8.11 | TBD | TBD |
98 | | /dev/bone/counter/3 | bone_counter_3 | P8.41 | P8.42 | TBD | TBD |
99 | | /dev/bone/counter/4 | bone_counter_4 | P8.16 | P8.15 | TBD | TBD |
100 |
101 | ## LCD
102 |
103 | ### 0
104 |
105 | | Header pin | RGB565 | mikroBUS |
106 | | ----------- | ------- | -------- |
107 | | P8.27 | VSYNC | |
108 | | P8.28 | PCLK | |
109 | | P8.29 | HSYNC | |
110 | | P8.30 | DE | |
111 | | P8.32 | R4 | |
112 | | P8.31 | R3 | |
113 | | P8.33 | R2 | |
114 | | P8.35 | R1 | |
115 | | P8.34 | R0 | |
116 | | P8.36 | G5 | |
117 | | P8.38 | G4 | |
118 | | P8.37 | G3 | |
119 | | P8.40 | G2 | |
120 | | P8.39 | G1 | |
121 | | P8.42 | G0 | |
122 | | P8.41 | B4 | |
123 | | P8.44 | B3 | |
124 | | P8.43 | B2 | |
125 | | P8.46 | B1 | |
126 | | P8.45 | B0 | |
127 |
128 | ## I2S
129 |
130 | ### /dev/bone/i2s/0
131 |
132 | | I2S | Header pin | mikroBUS |
133 | | ------- | ----------- | -------- |
134 | | HCLK | P9.25 | |
135 | | SCLK | P9.31 | |
136 | | SCLK_IN | P9.12 | |
137 | | WS | P9.29 | |
138 | | WS_IN | P9.27 | |
139 | | SDO0 | P9.28 | |
140 | | SDI0 | P9.30 | |
141 | | SDO1 | P8.31 | |
142 | | SDI1 | P8.33 | |
143 |
144 | ### /dev/play/mikrobus/i2s/0
145 |
146 | | I2S | Header pin | mikroBUS |
147 | | ------- | ----------- | -------- |
148 | | SDO1 | P8.31 | INT |
149 | | SDI1 | P8.33 | CS |
150 | | SCLK_IN | P9.12 | SCK |
151 | | HCLK | P9.25 | |
152 | | WS_IN | P9.27 | |
153 | | SDO0 | P9.28 | |
154 | | WS | P9.29 | |
155 | | SDI0 | P9.30 | |
156 | | SCLK | P9.31 | |
157 |
158 | ## SDIO
159 |
160 | ### 0
161 |
162 | | Header pin | Description |
163 | | ----------- | ------------ |
164 | | P8.20 | CMD |
165 | | P8.21 | CLK |
166 | | P8.25 | DAT0 |
167 | | P8.24 | DAT1 |
168 | | P8.5 | DAT2 |
169 | | P8.6 | DAT3 |
170 | | P8.23 | DAT4 |
171 | | P8.22 | DAT5 |
172 | | P8.3 | DAT6 |
173 | | P8.4 | DAT7 |
174 |
175 | ## mikroBUS
176 |
177 | 0 is on-board, others on on the Cape, PocketCape or HAT
178 |
179 | ### By bus
180 |
181 | | n | AN | SPI | PWM | UART | I2C | RST | INT | CAN | I2S | SDIO | LCD | Notes |
182 | | - | --- | --- | --- | ---- | --- | ----- | ----- | ----- | --- | ---- | --- | ------------------------- |
183 | | 0 | 7 | TBD | TBD | TBD | TBD | N/A | N/A | TBD | 1 | N/A | N/A | On-board, not cape header |
184 | | 1 | 3 | 1.0 | 1A | 2 | 2 | P9.12 | P9.15 | N/A | N/A | N/A | N/A | mikroE cape |
185 | | 2 | 2 | 1.1 | 1B | 1 | 2 | P9.23 | TBD | N/A | N/A | N/A | N/A | mikroE cape |
186 | | 3 | 1 | 0.0 | 2A | 1 | 2 | P8.14 | P8.18 | N/A | N/A | N/A | N/A | mikroE cape |
187 | | 4 | 0 | 1.2 | 2B | 4 | 2 | P8.16 | P8.17 | N/A | N/A | N/A | N/A | mikroE cape |
188 | | 5 | 4 | TBD | TBD | TBD | TBD | TBD | TBD | TBD | 0 | N/A | N/A | I2S capable |
189 | | 6 | 5 | 2.0 | TBD | 8 | 5 | TBD | TBD | N/A | N/A | 0 | N/A | SDIO capable |
190 |
191 | ### By pin
192 |
193 | | n | AN | RST | CS | SCK | CIPO | COPI | PWM | INT | RX | TX | SCL | SDA |
194 | | - | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
195 | | 0 | AXR0 | AFSX | AFSR | ACLKR | AXR2 | AXR3 | ACLKX | AXR1 | RX | TX | SCL | SDA |
196 | | 1 | P9.39 | P9.12 | P9.28 | P9.31 | P9.29 | P9.30 | P9.14 | P9.15 | P9.22 | P9.21 | P9.19 | P9.20 |
197 | | 2 | P9.37 | P9.23 | P9.42 | P9.31 | P9.29 | P9.30 | P9.16 | P9.41 | P9.26 | P9.24 | P9.19 | P9.20 |
198 | | 3 | P9.40 | P8.14 | P9.17 | N/A | N/A | N/A | P8.19 | P8.18 | P9.26 | P9.24 | P9.19 | P9.20 |
199 | | 4 | P9.39 | P8.16 | P8.10 | P9.31 | P9.29 | P9.30 | P8.13 | P8.17 | P9.11 | P9.13 | P9.19 | P9.20 |
200 | | 5 | P9.33 | | | | | | | | | | | |
201 | | 6 | P9.36 | P8.3 | P8.6 | P8.21 | P8.25 | P8.20 | P8.4 | P8.22 | P8.23 | P8.24 | TBD | P8.5 |
202 |
203 | ### Reverse by pin
204 |
205 | | Pin | mikroBUS usage |
206 | | ----- | ------------------------------------------------ |
207 | | P8.3 | 6 (RST) |
208 | | P8.4 | 6 (PWM) |
209 | | P8.5 | 6 (SDA) |
210 | | P8.6 | 6 (CS) |
211 | | P8.7 | TBD |
212 | | P8.8 | TBD |
213 | | P8.9 | TBD |
214 | | P8.10 | 4 (CS) |
215 | | P8.11 | TBD |
216 | | P8.12 | TBD |
217 | | P8.13 | 4 (PWM) |
218 | | P8.14 | 3 (RST) |
219 | | P8.15 | TBD |
220 | | P8.16 | 4 (RST) |
221 | | P8.17 | 4 (INT) |
222 | | P8.18 | 3 (INT) |
223 | | P8.19 | 3 (PWM) |
224 | | P8.20 | 6 (COPI) |
225 | | P8.21 | 6 (SCK) |
226 | | P8.22 | 6 (INT) |
227 | | P8.23 | 6 (RX) |
228 | | P8.24 | 6 (TX) |
229 | | P8.25 | 6 (CIPO) |
230 | | P8.46 | TBD |
231 | | P9.11 | 4 (RX) |
232 | | P9.12 | 1 (RST) |
233 | | P9.13 | 4 (TX) |
234 | | P9.14 | 1 (PWM) |
235 | | P9.15 | 1 (INT) |
236 | | P9.16 | 2 (PWM) |
237 | | P9.17 | 3 (CS) |
238 | | P9.18 | 3 (COPI) |
239 | | P9.19 | 1,2,3,4 (SCL) |
240 | | P9.20 | 1,2,3,4 (SDA) |
241 | | P9.21 | 1 (TX) |
242 | | P9.22 | 1 (RX) |
243 | | P9.23 | 2 (RST) |
244 | | P9.24 | 2,3 (TX) |
245 | | P9.25 | TBD |
246 | | P9.26 | 2,3 (RX) |
247 | | P9.27 | TBD |
248 | | P9.28 | 1 (CS) |
249 | | P9.29 | 1,2,4 (CIPO) |
250 | | P9.30 | 1,2,4 (COPI) |
251 | | P9.31 | 1,2,4 (SCK) |
252 | | P9.33 | TBD |
253 | | P9.35 | TBD |
254 | | P9.36 | TBD |
255 | | P9.37 | 2 (AN) |
256 | | P9.38 | 1 (AN) |
257 | | P9.39 | 4 (AN) |
258 | | P9.40 | 3 (AN) |
259 | | P9.41 | 2 (INT) |
260 | | P9.42 | 2 (CS) |
261 |
--------------------------------------------------------------------------------
/debian/changelog:
--------------------------------------------------------------------------------
1 | beagle-tester (0.1.17rc1) UNRELEASED; urgency=medium
2 |
3 | * Add alsa-utils dependency
4 |
5 | -- Jason Kridner Thu, 15 May 2025 13:53:39 -0400
6 |
7 | beagle-tester (0.1.16) bookworm; urgency=low
8 |
9 | * Add debian packaging
10 |
11 | -- Jason Kridner Thu, 15 May 2025 13:04:21 -0400
12 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/debian/config:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | . /usr/share/debconf/confmodule
4 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: beagle-tester
2 | Section: utils
3 | Priority: optional
4 | Build-Depends: debhelper (>= 9), devscripts, debconf (>= 0.2.26)
5 | Standards-Version: 3.9.8
6 | Maintainer: Jason Kridner
7 | Homepage: https://github.com/beagleboard/beagle-tester
8 |
9 | Package: beagle-tester
10 | Architecture: any
11 | Depends: debconf, bb-customizations (>= 1.20200522),
12 | alsa-utils (>= 1.2.8),
13 | ${shlibs:Depends}, ${misc:Depends}
14 | Description: Beagle Tester
15 | Simplify and standardize testing of BeagleBoard.org designs
16 |
17 |
--------------------------------------------------------------------------------
/debian/files:
--------------------------------------------------------------------------------
1 | beagle-tester-dbgsym_0.1.17rc1_amd64.ddeb debug optional automatic=yes
2 | beagle-tester_0.1.17rc1_amd64.buildinfo utils optional
3 | beagle-tester_0.1.17rc1_amd64.deb utils optional
4 |
--------------------------------------------------------------------------------
/debian/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 | %:
3 | dh $@
4 |
5 |
--------------------------------------------------------------------------------
/gamepup-buzz-on-buttons.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/gamepup-buzz-on-buttons.out
--------------------------------------------------------------------------------
/gamepup-buzz-on-buttons.pru0c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | #define GPIO0 0x44E07000
8 | #define GPIO1 0x4804C000
9 | #define GPIO2 0x481AC000
10 | #define GPIO3 0x481AE000
11 | #define DATAIN 0x138
12 | #define CLEARDATAOUT 0x190
13 | #define SETDATAOUT 0x194
14 | unsigned int volatile * const GPIO0IN = (unsigned int *) (GPIO0 + DATAIN);
15 | unsigned int volatile * const GPIO1IN = (unsigned int *) (GPIO1 + DATAIN);
16 | unsigned int volatile * const GPIO2IN = (unsigned int *) (GPIO2 + DATAIN);
17 | unsigned int volatile * const GPIO3IN = (unsigned int *) (GPIO3 + DATAIN);
18 |
19 | #define LP_LT (!(*GPIO1IN & (1<<28)))
20 | #define LP_RT (!(*GPIO1IN & (1<<26)))
21 | #define LP_UP (!(*GPIO1IN & (1<<25)))
22 | #define LP_DN (!(*GPIO1IN & (1<<27)))
23 | #define RP_LT (!(*GPIO1IN & (1<<12)))
24 | #define RP_RT (!(*GPIO2IN & (1<<0)))
25 | #define RP_UP (!(*GPIO1IN & (1<<14)))
26 | #define RP_DN (!(*GPIO1IN & (1<<15)))
27 | #define SELECT (!(*GPIO3IN & (1<<18)))
28 | #define START (!(*GPIO2IN & (1<<24)))
29 |
30 | volatile register unsigned int __R30;
31 | volatile register unsigned int __R31;
32 | #define BUZZER (1<<1)
33 |
34 | #pragma DATA_SECTION(init_pins, ".init_pins")
35 | #pragma RETAIN(init_pins)
36 | const char init_pins[] =
37 | "/sys/devices/platform/ocp/ocp:P1_33_pinmux/state\0pruout\0" \
38 | "\0\0";
39 |
40 | void main(void) {
41 | unsigned i, j;
42 |
43 | /* Clear SYSCFG[STANDBY_INIT] to enable OCP master port */
44 | CT_CFG.SYSCFG_bit.STANDBY_INIT = 0;
45 |
46 | while(1) {
47 | if(LP_LT) j=4545;
48 | else if(LP_UP) j=4049;
49 | else if(LP_RT) j=3822;
50 | else if(LP_DN) j=3405;
51 | else if(SELECT) j=3034;
52 | else if(START) j=2863;
53 | else if(RP_LT) j=2551;
54 | else if(RP_UP) j=2273;
55 | else if(RP_RT) j=2025;
56 | else if(RP_DN) j=1911;
57 | else j=0;
58 |
59 | if(j) {
60 | __R30 &= ~BUZZER;
61 | for(i=0; i, Texas Instruments Incorporated
87 | *
88 | * Source Modified by Zubeen Tolani < ZeekHuge - zeekhuge@gmail.com >
89 | * Based on the examples distributed by TI
90 | *
91 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
92 | *
93 | *
94 | * Redistribution and use in source and binary forms, with or without
95 | * modification, are permitted provided that the following conditions
96 | * are met:
97 | *
98 | * * Redistributions of source code must retain the above copyright
99 | * notice, this list of conditions and the following disclaimer.
100 | *
101 | * * Redistributions in binary form must reproduce the above copyright
102 | * notice, this list of conditions and the following disclaimer in the
103 | * documentation and/or other materials provided with the
104 | * distribution.
105 | *
106 | * * Neither the name of Texas Instruments Incorporated nor the names of
107 | * its contributors may be used to endorse or promote products derived
108 | * from this software without specific prior written permission.
109 | *
110 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
111 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
112 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
113 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
114 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
115 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
116 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
117 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
118 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
119 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
120 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
121 | *
122 | *
123 | * This is designed for the keys and buzzer on the PocketBeagle GampePup Cape.
124 | */
125 |
--------------------------------------------------------------------------------
/images/BURN-IN.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/BURN-IN.png
--------------------------------------------------------------------------------
/images/Makefile:
--------------------------------------------------------------------------------
1 | prefix := /usr
2 |
3 | BASENAME = itu-r-bt1729-colorbar-
4 | BASERES = 3200x1800
5 | BASEFILE = $(BASENAME)$(BASERES).png
6 |
7 | RESOLUTIONS24 = 1920x1080 1360x768 1280x720 1088x1920 1024x768 800x600 480x272 320x240 128x160
8 | RESOLUTIONS32 = 2048x1080 1280x1024 1024x768
9 |
10 | all:
11 | for x in $(RESOLUTIONS24); do \
12 | echo "Creating $(BASENAME)$$x.raw.xz" ; \
13 | convert $(BASEFILE) -resize $$x\! $(BASENAME)$$x.png ; \
14 | ./png2fb.py $(BASENAME)$$x.png $(BASENAME)$$x.raw ; \
15 | rm -f $(BASENAME)$$x.raw.xz ; \
16 | xz $(BASENAME)$$x.raw ; \
17 | done
18 | for x in $(RESOLUTIONS32); do \
19 | echo "Creating $(BASENAME)$$x-32.raw.xz" ; \
20 | convert $(BASEFILE) -resize $$x\! $(BASENAME)$$x-32.png ; \
21 | ./png2fb.py $(BASENAME)$$x-32.png $(BASENAME)$$x-32.raw -32 ; \
22 | rm -f $(BASENAME)$$x-32.raw.xz ; \
23 | xz $(BASENAME)$$x-32.raw ; \
24 | done
25 |
26 | install:
27 | install -m 755 -d $(DESTDIR)$(prefix)/share/beagle-tester
28 | for x in $(RESOLUTIONS24); do \
29 | echo "Installing $(BASENAME)$$x.raw.xz" ; \
30 | install -m 644 $(BASENAME)$$x.raw.xz $(DESTDIR)$(prefix)/share/beagle-tester ; \
31 | done
32 | for x in $(RESOLUTIONS32); do \
33 | echo "Installing $(BASENAME)$$x-32.raw.xz" ; \
34 | install -m 644 $(BASENAME)$$x-32.raw.xz $(DESTDIR)$(prefix)/share/beagle-tester ; \
35 | done
36 |
37 |
--------------------------------------------------------------------------------
/images/beagleboard-xm-pass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/beagleboard-xm-pass.png
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1024x768-32.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1024x768-32.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1024x768.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1024x768.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1088x1920.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1088x1920.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1280x1024-32.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1280x1024-32.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1280x720.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1280x720.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-128x160.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-128x160.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1360x768.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1360x768.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-1920x1080.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-1920x1080.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-2048x1080-32.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-2048x1080-32.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-3200x1800.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-3200x1800.png
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-320x240.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-320x240.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-480x272.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-480x272.raw.xz
--------------------------------------------------------------------------------
/images/itu-r-bt1729-colorbar-800x600.raw.xz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/images/itu-r-bt1729-colorbar-800x600.raw.xz
--------------------------------------------------------------------------------
/images/png2fb.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # http://stackoverflow.com/questions/19131556/how-to-get-rgb888-24-bit-and-rgb565-16-bit-framebuffer-dump-from-a-jpg-ima
4 |
5 | import sys
6 | from PIL import Image
7 |
8 | if len(sys.argv) == 4:
9 | # print "\nReading: " + sys.argv[1]
10 | out = open(sys.argv[2], "wb")
11 | mode = sys.argv[3]
12 | elif len(sys.argv) == 3:
13 | out = open(sys.argv[2], "wb")
14 | mode = "-16"
15 | elif len(sys.argv) == 2:
16 | out = sys.stdout
17 | mode = "-16"
18 | else:
19 | print "Usage: png2fb.py infile [outfile [-32]]"
20 | sys.exit(1)
21 |
22 | im = Image.open(sys.argv[1])
23 |
24 | if im.mode == "RGB":
25 | pixelSize = 3
26 | elif im.mode == "RGBA":
27 | pixelSize = 4
28 | else:
29 | sys.exit('not supported pixel mode: "%s"' % (im.mode))
30 |
31 | pixels = im.tobytes()
32 | pixels2 = ""
33 | if mode == "-32":
34 | print "Writing in 32-bit mode"
35 | for i in range(0, len(pixels) - 1, pixelSize):
36 | pixels2 += chr(ord(pixels[i + 2]))
37 | pixels2 += chr(ord(pixels[i + 1]))
38 | pixels2 += chr(ord(pixels[i]))
39 | pixels2 += chr(0)
40 | elif mode == "-24":
41 | print "Writing in 24-bit mode"
42 | for i in range(0, len(pixels) - 1, pixelSize):
43 | pixels2 += chr(ord(pixels[i + 2]))
44 | pixels2 += chr(ord(pixels[i + 1]))
45 | pixels2 += chr(ord(pixels[i]))
46 | else:
47 | print "Writing in 16-bit mode"
48 | for i in range(0, len(pixels) - 1, pixelSize):
49 | pixels2 += chr(ord(pixels[i + 2]) >> 3 | (ord(pixels[i + 1]) << 3 & 0xe0))
50 | pixels2 += chr(ord(pixels[i]) & 0xf8 | (ord(pixels[i + 1]) >> 5 & 0x07))
51 | out.write(pixels2)
52 | out.close()
53 |
--------------------------------------------------------------------------------
/include/common.h:
--------------------------------------------------------------------------------
1 | /*
2 | * common.h
3 | *
4 | * Author: Tomi Valkeinen
5 | * Copyright (C) 2009-2012 Tomi Valkeinen
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 |
20 | #ifndef __COMMON_H__
21 | #define __COMMON_H__
22 |
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 | #include
41 | #include
42 | #include
43 |
44 | #define STRINGIFY(x) #x
45 | #define TOSTRING(x) STRINGIFY(x)
46 |
47 | #define ASSERT(x) if (!(x)) \
48 | { perror("assert(" __FILE__ ":" TOSTRING(__LINE__) "): "); exit(1); }
49 | #define FBCTL0(ctl) if (ioctl(fd, ctl))\
50 | { perror("fbctl0(" __FILE__ ":" TOSTRING(__LINE__) "): "); exit(1); }
51 | #define FBCTL1(ctl, arg1) if (ioctl(fd, ctl, arg1))\
52 | { perror("fbctl1(" __FILE__ ":" TOSTRING(__LINE__) "): "); exit(1); }
53 |
54 | #define IOCTL0(fd, ctl) if (ioctl(fd, ctl))\
55 | { perror("ioctl0(" __FILE__ ":" TOSTRING(__LINE__) "): "); exit(1); }
56 | #define IOCTL1(fd, ctl, arg1) if (ioctl(fd, ctl, arg1))\
57 | { perror("ioctl1(" __FILE__ ":" TOSTRING(__LINE__) "): "); exit(1); }
58 |
59 | struct fb_info
60 | {
61 | int fd;
62 |
63 | void *ptr;
64 |
65 | struct fb_var_screeninfo var;
66 | struct fb_fix_screeninfo fix;
67 | unsigned bytespp;
68 | };
69 |
70 | extern char fontdata_8x8[];
71 |
72 | void fb_open(int fb_num, struct fb_info *fb_info);
73 | void fb_update_window(int fd, short x, short y, short w, short h);
74 | void fb_sync_gfx(int fd);
75 | int fb_put_string(struct fb_info *fb_info, int x, int y, const char *s, int maxlen,
76 | unsigned color, int clear, int clearlen);
77 |
78 | void beagle_notice(const char *test, const char *status);
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/include/red.h:
--------------------------------------------------------------------------------
1 | /*
2 | * red.h
3 | *
4 | * Author: Neeraj Dantu
5 | * Copyright (C) 2018 Octavo Systems
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 | #define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
20 | __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
21 |
22 | #define MAP_SIZE 4096UL
23 | #define MAP_MASK (MAP_SIZE - 1)
24 |
25 | unsigned long read_write_mem(int argc, unsigned int address, char type, unsigned long writeval);
26 |
27 |
28 | #define TEMP_I2C_ADD 0x48
29 | #define TEMP_MFG_ID 0xfe
30 | #define TEMP_I2C_BUS 0
31 | #define TEMP_ID 1128
32 |
33 |
34 | int test_tmp480();
35 |
36 | #define TPM_I2C_ADD 0x29
37 | #define TPM_REV_ID 0x4c
38 | #define TPM_I2C_BUS 0
39 |
40 | int test_tpm();
41 |
42 | #define CONTROL_BASE_ADDR (0x44E10000)
43 | #define BOOTMODE (CONTROL_BASE_ADDR + 0x40)
44 | #define BOOTMODE_SD (0x00400318)
45 |
46 | int check_boot_mode();
47 | int test_imu();
48 | int test_bmp();
49 |
50 |
51 | #define NOR_READ_ID 0x9e
52 | struct spi_ioc_transfer xfer[2];
53 |
54 | int test_nor();
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/beagle-tester.c:
--------------------------------------------------------------------------------
1 | /*
2 | * beagle-tester.c
3 | *
4 | * based on evtest and fb-test
5 | *
6 | * Author: Jason Kridner
7 | * Copyright (c) 1999-2000 Vojtech Pavlik
8 | * Copyright (c) 2009-2011 Red Hat, Inc
9 | * Copyright (C) 2009-2012 Tomi Valkeinen
10 | * Copyright (C) 2016-2018 Texas Instruments
11 | *
12 | * This program is free software; you can redistribute it and/or modify it
13 | * under the terms of the GNU General Public License version 2 as published by
14 | * the Free Software Foundation.
15 | *
16 | * This program is distributed in the hope that it will be useful, but WITHOUT
17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 | * more details.
20 | *
21 | * You should have received a copy of the GNU General Public License along with
22 | * this program. If not, see .
23 | */
24 |
25 | #ifdef ENABLE_BLUE
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #endif
32 |
33 | #include "common.h"
34 | void do_fill_screen(struct fb_info *fb_info, int pattern);
35 | void draw_pixel(struct fb_info *fb_info, int x, int y, unsigned color);
36 |
37 | #define MODEL_BOARD "TI OMAP3 BeagleBoard"
38 | #define MODEL_XM "TI OMAP3 BeagleBoard xM"
39 | #define MODEL_X15 "TI AM5728 BeagleBoard-X15"
40 | #define MODEL_BONE "TI AM335x BeagleBone"
41 | #define MODEL_BLACK "TI AM335x BeagleBone Black"
42 | #define MODEL_WIFI "TI AM335x BeagleBone Black Wireless"
43 | #define MODEL_AI "TI AM5729 BeagleBone AI"
44 | #define MODEL_BLUE "TI AM335x BeagleBone Blue"
45 | #define MODEL_OSD3358_BSM_REF "Octavo Systems OSD3358-SM-RED"
46 | #define COLOR_TEXT 0xffffffu
47 | #define COLOR_PASS 0x00ff00u
48 | #define COLOR_FAIL 0xff0000u
49 | #define SCAN_VALUE_REPEAT "BURN-IN"
50 | #define SCAN_VALUE_COLORBAR "COLORBAR"
51 | #define SCAN_VALUE_STOP "STOP"
52 | int fail = 0;
53 | int notice_line = 0;
54 | int display = 1;
55 | struct fb_info fb_info;
56 |
57 | void beagle_test(const char *scan_value);
58 | void do_colorbar();
59 | #ifdef ENABLE_BLUE
60 | int blue_specific_tests();
61 | #endif
62 | int osd3358_sm_ref_design_tests();
63 | void set_led_trigger(const char * led, const char * mode);
64 | void set_user_leds(int code);
65 | int gpio_out_test(const char *name, unsigned pin);
66 |
67 | struct cape
68 | {
69 | const char prefix[5];
70 | const char id_str[21];
71 | int eeprom_addr;
72 | const char name[33];
73 | int (*test)(const char *scan_value, unsigned id);
74 | };
75 |
76 | int test_comms_cape(const char *scan_value, unsigned id);
77 | int test_display18_cape(const char *scan_value, unsigned id);
78 | int test_display50_cape(const char *scan_value, unsigned id);
79 | int test_display70_cape(const char *scan_value, unsigned id);
80 | int test_load_cape(const char *scan_value, unsigned id);
81 | int test_motor_cape(const char *scan_value, unsigned id);
82 | int test_power_cape(const char *scan_value, unsigned id);
83 | int test_proto_cape(const char *scan_value, unsigned id);
84 | int test_relay_cape(const char *scan_value, unsigned id);
85 | int test_robotics_cape(const char *scan_value, unsigned id);
86 | int test_servo_cape(const char *scan_value, unsigned id);
87 | int test_gamepup_cape(const char *scan_value, unsigned id);
88 | int test_techlab_cape(const char *scan_value, unsigned id);
89 | int test_ppilot_cape(const char *scan_value, unsigned id);
90 | void install_overlay(const char *scan_value, const char *id_str);
91 |
92 | /********************************************/
93 | /** This structure matches the barcode **/
94 | /** header with the test function and info **/
95 | /** needed to program the cape EEPROM **/
96 | /********************************************/
97 | /* Per https://github.com/beagleboard/capes/blob/master/README.mediawiki */
98 | static struct cape capes[] = {
99 | { "BC00", "BBORG_COMMS", 0x56, "Industrial Comms Cape", test_comms_cape },
100 | { "BC01", "BBORG_DISPLAY18", 0x57, "1.8\" Display Cape", test_display18_cape },
101 | { "BC02", "BBORG_DISPLAY50", 0x57, "5\" Display Cape", test_display50_cape },
102 | { "BC03", "BBORG_DISPLAY70", 0x57, "7\" Display Cape", test_display70_cape },
103 | { "BC04", "BBORG_LOAD", 0x54, "Load Driver Cape", test_load_cape },
104 | { "BC05", "BBORG_MOTOR", 0x55, "Motor Driver Cape", test_motor_cape },
105 | { "BC06", "BBORG_POWER", 0, "Power Supply Cape", test_power_cape },
106 | { "BC07", "BBORG_PROTO", 0x57, "Prototyping Cape", test_proto_cape },
107 | { "BC08", "BBORG_RELAY", 0x54, "Relay Cape", test_relay_cape },
108 | { "BC09", "BBORG_ROBOTICS", 0, "Robotics Cape", test_robotics_cape },
109 | { "BC0A", "BBORG_SERVO", 0x54, "Servo Cape", test_servo_cape },
110 | { "PC00", "BBORG_GAMEPUP", 0x57, "GamePup Cape", test_gamepup_cape },
111 | { "PC01", "BBORG_TECHLAB", 0x57, "TechLab Cape", test_techlab_cape },
112 | { "PC02", "BBORG_PPILOT", 0x57, "PocketPilot Cape", test_ppilot_cape },
113 | };
114 |
115 | /* Per https://github.com/beagleboard/beaglebone-black/wiki/System-Reference-Manual#824-eeprom-data-format */
116 | const char cape_eeprom[88] = {
117 | 0xAA, 0x55, 0x33, 0xEE, /* header (4) */
118 | 0x41, 0x31, /* format version (2) */
119 | 0, 0, 0, 0, 0, 0, 0, 0, /* board name (32)@6 */
120 | 0, 0, 0, 0, 0, 0, 0, 0,
121 | 0, 0, 0, 0, 0, 0, 0, 0,
122 | 0, 0, 0, 0, 0, 0, 0, 0,
123 | 0x30, 0x30, 0x30, 0x30, /* board version (4)@38 */
124 | 'B', 'e', 'a', 'g', 'l', 'e', /* manufacturer (16)@42 */
125 | 'B', 'o', 'a', 'r', 'd', '.',
126 | 'o', 'r', 'g', 0,
127 | 0, 0, 0, 0, 0, 0, 0, 0, /* part number (16)@58 */
128 | 0, 0, 0, 0, 0, 0, 0, 0,
129 | 0, 0, /* number of pins (2)@60 */
130 | 0, 0, 0, 0, 0, 0, 0, 0, /* serial number (12)@76 */
131 | 0, 0, 0, 0
132 | };
133 |
134 | #ifndef ENABLE_BLUE
135 | volatile int exiting = 0;
136 | #endif
137 |
138 | static void do_stop()
139 | {
140 | #ifdef ENABLE_BLUE
141 | rc_set_state(EXITING);
142 | #else
143 | exiting = 1;
144 | #endif
145 | }
146 |
147 | int main(int argc, char** argv)
148 | {
149 | unsigned short barcode_id[4];
150 | int barcode = open("/dev/input/beagle-barcode", O_RDONLY);
151 | fd_set rdfs;
152 | struct input_event ev[256];
153 | int i, n, rd = 0, run = 0;
154 | struct timeval timeout;
155 | char scan_value[32];
156 | int scan_i = 0;
157 |
158 | fprintf(stderr, "Starting beagle-tester.\n");
159 | fflush(stderr);
160 |
161 | if (!barcode) {
162 | fprintf(stderr, "ERROR: valid barcode scanner not found.\n");
163 | fflush(stderr);
164 | }
165 |
166 | //FILE *errlog = fopen("/var/log/beagle-tester.log", "w");
167 | ioctl(barcode, EVIOCGID, barcode_id);
168 | fprintf(stderr, "Found input device ID: bus 0x%x vendor 0x%x product 0x%x version 0x%x\n",
169 | barcode_id[ID_BUS], barcode_id[ID_VENDOR], barcode_id[ID_PRODUCT], barcode_id[ID_VERSION]);
170 | fflush(stderr);
171 |
172 | system("/usr/sbin/beagle-tester-open.sh");
173 | set_led_trigger("red", "default-on");
174 | set_led_trigger("green", "default-on");
175 | set_led_trigger("beaglebone:green:usr0", "default-on");
176 | set_led_trigger("beaglebone:green:usr1", "default-on");
177 | set_led_trigger("beaglebone:green:usr2", "default-on");
178 | set_led_trigger("beaglebone:green:usr3", "default-on");
179 | set_led_trigger("beaglebone:green:usr4", "default-on");
180 |
181 | if (access("/dev/fb0", W_OK)) {
182 | fprintf(stderr, "Unable to write to /dev/fb0\n");
183 | fflush(stderr);
184 | display = 0;
185 | } else {
186 | fb_open(0, &fb_info);
187 | do_colorbar();
188 | }
189 |
190 | signal(SIGINT, do_stop);
191 | signal(SIGTERM, do_stop);
192 |
193 | /********************************************/
194 | /** This is the main execution loop **/
195 | /********************************************/
196 | #ifdef ENABLE_BLUE
197 | while (rc_get_state()!=EXITING) {
198 | #else
199 | while (!exiting) {
200 | #endif
201 | FD_ZERO(&rdfs);
202 | FD_SET(barcode, &rdfs);
203 | timeout.tv_sec = 0;
204 | timeout.tv_usec = 4000;
205 | rd = select(barcode + 1, &rdfs, NULL, NULL, &timeout);
206 | #ifdef ENABLE_BLUE
207 | if (rc_get_state()==EXITING)
208 | #else
209 | if (exiting)
210 | #endif
211 | break;
212 | if (rd > 0) {
213 | rd = read(barcode, ev, sizeof(ev));
214 | }
215 |
216 | /********************************************/
217 | /** Handle barcode scanner raw input **/
218 | /********************************************/
219 | for (i = 0; i < rd; i += (int)sizeof(struct input_event)) {
220 | unsigned int type, code, value;
221 |
222 | if ((rd % (int) sizeof(struct input_event)) != 0) {
223 | //fprintf(stderr, "Data too small: %d\n", rd); fflush(stderr);
224 | break;
225 | }
226 |
227 | n = i / (int) sizeof(struct input_event);
228 |
229 | type = ev[n].type;
230 | code = ev[n].code;
231 | value = ev[n].value;
232 |
233 | //fprintf(stderr, "Event: %02x %02x %06x\n", type, code, value); fflush(stderr);
234 |
235 | if ((type == 1) && (value == 1)) {
236 | switch (code) {
237 | default:
238 | break;
239 | case KEY_ENTER:
240 | scan_value[scan_i] = 0;
241 | fprintf(stderr, "Got scanned value: %s\n", scan_value);
242 | fflush(stderr);
243 | run = 1;
244 | scan_i = 0;
245 | fail = 0;
246 | break;
247 | case KEY_MINUS:
248 | scan_value[scan_i] = '-';
249 | scan_i++;
250 | break;
251 | case KEY_0:
252 | scan_value[scan_i] = '0';
253 | scan_i++;
254 | break;
255 | case KEY_1:
256 | scan_value[scan_i] = '1';
257 | scan_i++;
258 | break;
259 | case KEY_2:
260 | scan_value[scan_i] = '2';
261 | scan_i++;
262 | break;
263 | case KEY_3:
264 | scan_value[scan_i] = '3';
265 | scan_i++;
266 | break;
267 | case KEY_4:
268 | scan_value[scan_i] = '4';
269 | scan_i++;
270 | break;
271 | case KEY_5:
272 | scan_value[scan_i] = '5';
273 | scan_i++;
274 | break;
275 | case KEY_6:
276 | scan_value[scan_i] = '6';
277 | scan_i++;
278 | break;
279 | case KEY_7:
280 | scan_value[scan_i] = '7';
281 | scan_i++;
282 | break;
283 | case KEY_8:
284 | scan_value[scan_i] = '8';
285 | scan_i++;
286 | break;
287 | case KEY_9:
288 | scan_value[scan_i] = '9';
289 | scan_i++;
290 | break;
291 | case KEY_A:
292 | scan_value[scan_i] = 'A';
293 | scan_i++;
294 | break;
295 | case KEY_B:
296 | scan_value[scan_i] = 'B';
297 | scan_i++;
298 | break;
299 | case KEY_C:
300 | scan_value[scan_i] = 'C';
301 | scan_i++;
302 | break;
303 | case KEY_D:
304 | scan_value[scan_i] = 'D';
305 | scan_i++;
306 | break;
307 | case KEY_E:
308 | scan_value[scan_i] = 'E';
309 | scan_i++;
310 | break;
311 | case KEY_F:
312 | scan_value[scan_i] = 'F';
313 | scan_i++;
314 | break;
315 | case KEY_G:
316 | scan_value[scan_i] = 'G';
317 | scan_i++;
318 | break;
319 | case KEY_H:
320 | scan_value[scan_i] = 'H';
321 | scan_i++;
322 | break;
323 | case KEY_I:
324 | scan_value[scan_i] = 'I';
325 | scan_i++;
326 | break;
327 | case KEY_J:
328 | scan_value[scan_i] = 'J';
329 | scan_i++;
330 | break;
331 | case KEY_K:
332 | scan_value[scan_i] = 'K';
333 | scan_i++;
334 | break;
335 | case KEY_L:
336 | scan_value[scan_i] = 'L';
337 | scan_i++;
338 | break;
339 | case KEY_M:
340 | scan_value[scan_i] = 'M';
341 | scan_i++;
342 | break;
343 | case KEY_N:
344 | scan_value[scan_i] = 'N';
345 | scan_i++;
346 | break;
347 | case KEY_O:
348 | scan_value[scan_i] = 'O';
349 | scan_i++;
350 | break;
351 | case KEY_P:
352 | scan_value[scan_i] = 'P';
353 | scan_i++;
354 | break;
355 | case KEY_Q:
356 | scan_value[scan_i] = 'Q';
357 | scan_i++;
358 | break;
359 | case KEY_R:
360 | scan_value[scan_i] = 'R';
361 | scan_i++;
362 | break;
363 | case KEY_S:
364 | scan_value[scan_i] = 'S';
365 | scan_i++;
366 | break;
367 | case KEY_T:
368 | scan_value[scan_i] = 'T';
369 | scan_i++;
370 | break;
371 | case KEY_U:
372 | scan_value[scan_i] = 'U';
373 | scan_i++;
374 | break;
375 | case KEY_V:
376 | scan_value[scan_i] = 'V';
377 | scan_i++;
378 | break;
379 | case KEY_W:
380 | scan_value[scan_i] = 'W';
381 | scan_i++;
382 | break;
383 | case KEY_X:
384 | scan_value[scan_i] = 'X';
385 | scan_i++;
386 | break;
387 | case KEY_Y:
388 | scan_value[scan_i] = 'Y';
389 | scan_i++;
390 | break;
391 | case KEY_Z:
392 | scan_value[scan_i] = 'Z';
393 | scan_i++;
394 | break;
395 | }
396 | }
397 | //fprintf(stderr, "*"); fflush(stderr);
398 | }
399 |
400 | /********************************************/
401 | /** Process command-line inputs **/
402 | /********************************************/
403 | if(scan_i == 0 && argc > 1) {
404 | strcpy(scan_value, argv[argc-1]);
405 | run = 1;
406 | argc--;
407 | }
408 |
409 | /********************************************/
410 | /** Display CISPR colorbar while idle **/
411 | /********************************************/
412 | if (run == 0) {
413 | if (display) do_colorbar();
414 | }
415 | /********************************************/
416 | /** Handle case where STOP is requested **/
417 | /********************************************/
418 | if (!strcmp(scan_value, SCAN_VALUE_STOP)) {
419 | #ifdef ENABLE_BLUE
420 | rc_set_state(EXITING);
421 | #else
422 | exiting = 1;
423 | #endif
424 | break;
425 | }
426 | /********************************************/
427 | /** Handle a request to run a test **/
428 | /********************************************/
429 | else if (run == 1) {
430 | if (display) do_fill_screen(&fb_info, 0);
431 | beagle_test(scan_value);
432 | fprintf(stderr, "Test fails: %d\n", fail);
433 | fflush(stderr);
434 | if (fail > 0) {
435 | printf("RESULT: \033[41;30;5m FAIL \033[0m\n");
436 | } else {
437 | printf("RESULT: PASS \n");
438 | }
439 | #ifdef ENABLE_BLUE
440 | if (rc_get_state()==EXITING) {
441 | #else
442 | if (exiting) {
443 | #endif
444 | run = 0;
445 | break;
446 | } else if (!strcmp(scan_value, SCAN_VALUE_REPEAT)) {
447 | // pause 4 seconds and run again
448 | sleep(4);
449 | } else {
450 | memset(scan_value, 0, sizeof(scan_value));
451 | run = 2;
452 | }
453 | }
454 | }
455 |
456 | if (display) do_fill_screen(&fb_info, 4);
457 | set_user_leds(-1);
458 | system("/usr/sbin/beagle-tester-close.sh");
459 | set_led_trigger("red", "none");
460 | set_led_trigger("green", "none");
461 |
462 | return 0;
463 | }
464 |
465 | void beagle_test(const char *scan_value)
466 | {
467 | int r;
468 | int fd_sn;
469 | char str[120];
470 | char str2[50];
471 | char wlan0_ap[50];
472 | char wlan0_host[50];
473 | int len, off;
474 | char model[70];
475 | FILE *fp;
476 | unsigned x, y;
477 | unsigned color;
478 |
479 | notice_line = 0;
480 | beagle_notice("scan", scan_value);
481 |
482 | #ifdef VERSION
483 | beagle_notice("tester", VERSION);
484 | #else
485 | beagle_notice("tester", "$Id: 8ddd6e59dc8b799edbbee9f669bdd3d6ad83a7ea $");
486 | #endif
487 |
488 | /********************************************/
489 | /** Handle case test is on a cape **/
490 | /** Use the ID and cape array to call test **/
491 | /********************************************/
492 | if(!strncmp(scan_value, "BC", 2) || !strncmp(scan_value, "PC", 2)) {
493 | for(x = 0; x < sizeof(capes) / sizeof(capes[0]); x++) {
494 | if(!strncmp(scan_value, capes[x].prefix, 4)) {
495 | beagle_notice("model", capes[x].name);
496 | fail = capes[x].test(scan_value, x);
497 | goto done;
498 | }
499 | }
500 | }
501 |
502 | fp = fopen("/proc/device-tree/model", "r");
503 | fgets(str, sizeof(str), fp);
504 | fclose(fp);
505 | strcpy(model, str);
506 | len = strlen(str);
507 | len--; str[len] = 0; // remove trailing character
508 | off = (len > 25) ? len-25 : 0;
509 | beagle_notice("model", &str[off]);
510 | if(!strcmp(model, MODEL_BLACK)) {
511 | if(strncmp(scan_value, "00", 2)) {
512 | beagle_notice("model", "fail");
513 | fail = 1;
514 | goto done;
515 | }
516 | }
517 | else if(!strcmp(model, MODEL_WIFI)) {
518 | if(strncmp(scan_value, "BW", 2)) {
519 | beagle_notice("model", "fail");
520 | fail = 1;
521 | goto done;
522 | }
523 | }
524 | else if(!strcmp(model, MODEL_BLUE)) {
525 | if(strncmp(scan_value, "BL", 2)) {
526 | beagle_notice("model", "fail");
527 | fail = 1;
528 | goto done;
529 | }
530 | }
531 |
532 | fd_sn = open("/sys/bus/i2c/devices/i2c-0/0-0050/0-00500/nvmem", O_RDWR);
533 | lseek(fd_sn, 0, SEEK_SET);
534 | r = read(fd_sn, str, 28);
535 | str[28] = 0;
536 | beagle_notice("eeprom", str);
537 |
538 | fp = fopen("/etc/dogtag", "r");
539 | fgets(str, sizeof(str), fp);
540 | fclose(fp);
541 | len = strlen(str);
542 | len--; str[len] = 0; // remove trailing character
543 | off = (len > 25) ? len-25 : 0;
544 | beagle_notice("dogtag", &str[off]);
545 |
546 | strcpy(str, "memtester 1M 1 > /dev/null");
547 | fprintf(stderr, str);
548 | fprintf(stderr, "\n");
549 | fflush(stderr);
550 | r = system(str);
551 | beagle_notice("memory", r ? "fail" : "pass");
552 |
553 | // if we have WiFi
554 | if(!strcmp(model, MODEL_WIFI) || !strcmp(model, MODEL_BLUE)) {
555 | // connect to ap
556 | system("bb-connect-ap > /tmp/beagle-tester-ap");
557 | fp = fopen("/tmp/beagle-tester-ap", "r");
558 | if (fp != NULL) {
559 | fgets(str2, sizeof(str2)-1, fp);
560 | str2[25] = 0;
561 | fclose(fp);
562 | } else {
563 | str2[0] = 0;
564 | }
565 | beagle_notice("ap", str2);
566 |
567 | // fetch wlan0 address
568 | system("ip -4 addr show wlan0 | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d '\n' | tr -d '\r' > /tmp/beagle-tester-wlan0-host");
569 | fp = fopen("/tmp/beagle-tester-wlan0-host", "r");
570 | if (fp != NULL) {
571 | fgets(wlan0_host, sizeof(wlan0_host)-1, fp);
572 | fclose(fp);
573 | } else {
574 | wlan0_host[0] = 0;
575 | }
576 |
577 | // fetch wlan0 gateway
578 | system("ip route | grep -E 'wlan0|link' | grep -Ev 'src|default' | awk '{print $1}' > /tmp/beagle-tester-wlan0-gw");
579 | fp = fopen("/tmp/beagle-tester-wlan0-gw", "r");
580 | if (fp != NULL) {
581 | fgets(wlan0_ap, sizeof(wlan0_ap)-1, fp);
582 | fclose(fp);
583 | } else {
584 | wlan0_ap[0] = 0;
585 | }
586 |
587 | sprintf(str, "ping -c 4 -w 10 -I %s %s",
588 | wlan0_host, wlan0_ap);
589 | fprintf(stderr, str);
590 | fprintf(stderr, "\n");
591 | fflush(stderr);
592 | r = system(str);
593 | fprintf(stderr, "ping returned: %d\n", r);
594 | beagle_notice("wifi", r ? "fail" : "pass");
595 | } else { // Ethernet
596 | fp = popen("ip route get 1.1.1.1 | perl -n -e 'print $1 if /via (.*) dev/'",
597 | "r"); // fetch gateway
598 | if (fp != NULL) {
599 | fgets(str2, sizeof(str2)-1, fp);
600 | pclose(fp);
601 | } else {
602 | str2[0] = 0;
603 | }
604 | sprintf(str, "ping -s 8184 -i 0.01 -q -c 150 -w 2 -I eth0 %s",
605 | str2);
606 | fprintf(stderr, str);
607 | fprintf(stderr, "\n");
608 | fflush(stderr);
609 | r = system(str);
610 | beagle_notice("ethernet", r ? "fail" : "pass");
611 | }
612 |
613 | // if BeagleBoard-xM
614 | if(!strcmp(model, MODEL_XM)) {
615 | sprintf(str, "ping -s 8184 -i 0.01 -q -c 90 -w 2 -I 192.168.9.2 192.168.9.1");
616 | } else {
617 | sprintf(str, "ping -s 8184 -i 0.01 -q -c 150 -w 2 -I 192.168.7.2 192.168.7.1");
618 | }
619 | fprintf(stderr, str);
620 | fprintf(stderr, "\n");
621 | fflush(stderr);
622 | r = system(str);
623 | beagle_notice("usb dev", r ? "fail" : "pass");
624 |
625 | // if BeagleBoard-xM
626 | if(!strcmp(model, MODEL_XM)) {
627 | sprintf(str, "timeout 8 hdparm -q -t --direct /dev/sda");
628 | fprintf(stderr, str);
629 | fprintf(stderr, "\n");
630 | fflush(stderr);
631 | r = system(str);
632 | beagle_notice("usb 1", r ? "fail" : "pass");
633 |
634 | sprintf(str, "timeout 8 hdparm -q -t --direct /dev/sdb");
635 | fprintf(stderr, str);
636 | fprintf(stderr, "\n");
637 | fflush(stderr);
638 | r = system(str);
639 | beagle_notice("usb 2", r ? "fail" : "pass");
640 |
641 | sprintf(str, "timeout 8 hdparm -q -t --direct /dev/sdc");
642 | fprintf(stderr, str);
643 | fprintf(stderr, "\n");
644 | fflush(stderr);
645 | r = system(str);
646 | beagle_notice("usb 3", r ? "fail" : "pass");
647 | }
648 |
649 | #ifdef ENABLE_BLUE
650 | // if BeagleBone Blue
651 | if(!strcmp(model, MODEL_BLUE)) {
652 | r = blue_specific_tests();
653 | beagle_notice("sensors", r ? "fail" : "pass");
654 | }
655 | #endif
656 |
657 | // If OSD3358-SM-RED
658 | if(!strcmp(model, MODEL_OSD3358_BSM_REF)){
659 | r = osd3358_sm_ref_design_tests();
660 | beagle_notice("OSD3358-SM Reference Design board components", r ? "fail" : "pass");
661 | }
662 |
663 | // if not xM nor X15, didn't fail and we aren't in repeat mode
664 | if(strcmp(model, MODEL_XM) && strcmp(model, MODEL_X15) &&
665 | !fail && strcmp(scan_value, SCAN_VALUE_REPEAT)) {
666 | lseek(fd_sn, 0, SEEK_SET);
667 | r = read(fd_sn, str, 12);
668 |
669 | /* TODO: How do we properly decide how to assign the EEPROM? */
670 | /* DANGEROUS!!!: This will make everything a BeagleBone
671 | * Black derivative. This will break PocketBeagles and X15s */
672 | memcpy(&str[0], "\xaa\x55\x33\xee\x41\x33\x33\x35\x42\x4e\x4c\x54", 12);
673 |
674 | memcpy(&str[12], scan_value, 16);
675 | str[28] = 0;
676 | lseek(fd_sn, 0, SEEK_SET);
677 | r = write(fd_sn, str, 28);
678 | lseek(fd_sn, 0, SEEK_SET);
679 | r = read(fd_sn, str2, 28);
680 | str2[28] = 0;
681 | beagle_notice("eeprom", str2);
682 | fail = strcmp(str, str2) ? 1 : 0;
683 | beagle_notice("eeprom", fail ? "fail" : "pass");
684 | }
685 |
686 | close(fd_sn);
687 |
688 | done:
689 | color = fail ? COLOR_FAIL : COLOR_PASS;
690 | if (display) {
691 | for (y = fb_info.var.yres/2; y < fb_info.var.yres; y++) {
692 | for (x = fb_info.var.xres/2; x < fb_info.var.xres; x++)
693 | draw_pixel(&fb_info, x, y, color);
694 | }
695 | }
696 |
697 | if (fail) {
698 | set_led_trigger("red", "timer");
699 | set_led_trigger("green", "none");
700 | } else {
701 | set_led_trigger("beaglebone:green:usr0", "default-on");
702 | set_led_trigger("beaglebone:green:usr1", "default-on");
703 | set_led_trigger("beaglebone:green:usr2", "default-on");
704 | set_led_trigger("beaglebone:green:usr3", "default-on");
705 | set_led_trigger("beaglebone:green:usr4", "default-on");
706 | set_led_trigger("red", "none");
707 | set_led_trigger("green", "timer");
708 | }
709 | }
710 |
711 | void beagle_notice(const char *test, const char *status)
712 | {
713 | const char *fmt = "%8.8s: %-25.25s";
714 | unsigned color = COLOR_TEXT;
715 | char str[70];
716 |
717 | set_user_leds(notice_line);
718 |
719 | if(!strcmp(status, "fail")) {
720 | fail++;
721 | color = COLOR_FAIL;
722 | }
723 | sprintf(str, fmt, test, status);
724 | fprintf(stderr, str);
725 | fprintf(stderr, "\n");
726 | fflush(stderr);
727 | if (display)
728 | fb_put_string(&fb_info, 20, 50+notice_line*10, str, 70, color, 1, 70);
729 | notice_line++;
730 | }
731 |
732 | void do_colorbar()
733 | {
734 | static int init = 0;
735 | static int cur_x = 0, cur_dir = 0;
736 | int x, y;
737 |
738 | if (!init) {
739 | if (fb_info.var.xres == 1920 && fb_info.var.bits_per_pixel == 32)
740 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-2048x1080-32.raw.xz > /dev/fb0");
741 | else if (fb_info.var.xres == 1280 && fb_info.var.bits_per_pixel == 32)
742 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1280x1024-32.raw.xz > /dev/fb0");
743 | else if (fb_info.var.xres == 1024 && fb_info.var.bits_per_pixel == 32)
744 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1024x768-32.raw.xz > /dev/fb0");
745 | else if (fb_info.var.xres == 320)
746 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-320x240.raw.xz > /dev/fb0");
747 | else if (fb_info.var.xres == 480)
748 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-480x272.raw.xz > /dev/fb0");
749 | else if (fb_info.var.xres == 800)
750 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-800x600.raw.xz > /dev/fb0");
751 | else if (fb_info.var.xres == 1024)
752 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1024x768.raw.xz > /dev/fb0");
753 | else if (fb_info.var.xres == 1088)
754 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1088x1920.raw.xz > /dev/fb0");
755 | else if (fb_info.var.xres == 1280)
756 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1280x720.raw.xz > /dev/fb0");
757 | else if (fb_info.var.xres == 1360)
758 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1360x768.raw.xz > /dev/fb0");
759 | else if (fb_info.var.xres == 1920)
760 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-1920x1080.raw.xz > /dev/fb0");
761 | else if (fb_info.var.xres == 128)
762 | system("xzcat /usr/share/beagle-tester/itu-r-bt1729-colorbar-128x160.raw.xz > /dev/fb0");
763 | else
764 | system("cat /dev/zero > /dev/fb0");
765 | init = 1;
766 | }
767 |
768 | for (x = cur_x; x < cur_x+4; x++)
769 | for (y = (388*(int)fb_info.var.yres)/480; y < (405*(int)fb_info.var.yres)/480; y++)
770 | draw_pixel(&fb_info, x+(int)fb_info.var.xres/2, y, 0x000000);
771 |
772 | if (cur_dir == 0) {
773 | cur_x++;
774 | if (cur_x >= 56*(int)fb_info.var.xres/400) cur_dir = 1;
775 | } else {
776 | cur_x--;
777 | if (cur_x <= -58*(int)fb_info.var.xres/400) cur_dir = 0;
778 | }
779 |
780 | for (x = cur_x; x < cur_x+4; x++)
781 | for (y = (388*(int)fb_info.var.yres)/480; y < (405*(int)fb_info.var.yres)/480; y++)
782 | draw_pixel(&fb_info, x+(int)fb_info.var.xres/2, y, 0xffffff);
783 |
784 | //usleep(4444);
785 | }
786 |
787 | #ifdef ENABLE_BLUE
788 | int blue_specific_tests() {
789 | int ret;
790 |
791 | // use defaults for now, except also enable magnetometer.
792 | float v;
793 | rc_mpu_data_t data;
794 | rc_mpu_config_t conf = rc_mpu_default_config();
795 | conf.i2c_bus = 2;
796 | conf.gpio_interrupt_pin = 117;
797 | conf.enable_magnetometer = 1;
798 |
799 | if(rc_adc_init()){
800 | fprintf(stderr, "ERROR: rc_adc_init() failed to initialize adc\n");
801 | return -1;
802 | }
803 |
804 | // check charger by checking for the right voltage on the batt line
805 | v = rc_adc_batt();
806 | fprintf(stderr, "battery input/charger voltage: %.2fV\n", v);
807 | if(v>10.0 || v<6.0) {
808 | fprintf(stderr, "ERROR: battery input voltage out of spec\n");
809 | rc_adc_cleanup();
810 | return -1;
811 | }
812 |
813 | // make sure 12V DC supply is connected
814 | v = rc_adc_dc_jack();
815 | fprintf(stderr, "dc jack input voltage: %.2fV\n", v);
816 | if(v<10.0) {
817 | fprintf(stderr, "ERROR: dc jack voltage too low\n");
818 | rc_adc_cleanup();
819 | return -2;
820 | }
821 |
822 | rc_adc_cleanup();
823 |
824 | // test imu
825 | ret = rc_mpu_initialize_dmp(&data, conf);
826 | rc_mpu_power_off();
827 | if(ret<0) {
828 | fprintf(stderr, "failed: mpu9250 imu\n");
829 | return -3;
830 | }
831 |
832 | // test barometer
833 | ret = rc_bmp_init(BMP_OVERSAMPLE_16,BMP_FILTER_OFF);
834 | rc_bmp_power_off();
835 | if(ret<0) {
836 | fprintf(stderr, "failed: bmp280 barometer\n");
837 | rc_mpu_power_off();
838 | return -4;
839 | }
840 |
841 | //cleanup_cape();
842 | return 0;
843 | }
844 | #endif
845 |
846 | void set_led_trigger(const char * led, const char * mode)
847 | {
848 | int fd;
849 | char path[100];
850 | int mode_len;
851 |
852 | sprintf(path, "/sys/class/leds/%s/trigger", led);
853 | mode_len = strlen(mode);
854 | fd = open(path, O_WRONLY);
855 | if(!fd) return;
856 | write(fd, mode, mode_len);
857 | close(fd);
858 | }
859 |
860 | void set_user_leds(int code)
861 | {
862 | if (code < 0) {
863 | set_led_trigger("beaglebone:green:usr0", "heartbeat");
864 | set_led_trigger("beaglebone:green:usr1", "mmc0");
865 | set_led_trigger("beaglebone:green:usr2", "cpu");
866 | set_led_trigger("beaglebone:green:usr3", "mmc1");
867 | set_led_trigger("beaglebone:green:usr4", "phy0assoc");
868 | } else {
869 | set_led_trigger("beaglebone:green:usr0", (code & 1) ? "timer" : "none");
870 | set_led_trigger("beaglebone:green:usr1", (code & 2) ? "timer" : "none");
871 | set_led_trigger("beaglebone:green:usr2", (code & 4) ? "timer" : "none");
872 | set_led_trigger("beaglebone:green:usr3", (code & 8) ? "timer" : "none");
873 | set_led_trigger("beaglebone:green:usr4", (code & 16) ? "timer" : "none");
874 | }
875 | }
876 |
877 | /********************************************/
878 | /** Cape tests start here **/
879 | /********************************************/
880 |
881 | /* BC0000A2yywwnnnnnnnn */
882 | int test_comms_cape(const char *scan_value, unsigned id)
883 | {
884 | int r;
885 | int fd_sn;
886 | char str[120];
887 | char str2[120];
888 |
889 | install_overlay(scan_value, capes[id].id_str);
890 |
891 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0056/2-00560/nvmem", O_RDWR);
892 | lseek(fd_sn, 0, SEEK_SET);
893 | r = read(fd_sn, str, 88);
894 | if(r < 0)
895 | printf("EEPROM read failure in test_comms_cape()\n");
896 | str[89] = 0;
897 | beagle_notice("name", &str[6]);
898 |
899 | gpio_out_test("sinkA", 49);
900 | gpio_out_test("sinkB", 48);
901 |
902 | memcpy(str, cape_eeprom, 88);
903 | strcpy(&str[6], capes[id].name); /* board name */
904 | memcpy(&str[38], &scan_value[4], 4); /* board version */
905 | strcpy(&str[58], capes[id].id_str); /* part number */
906 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
907 | str[89] = 0;
908 | lseek(fd_sn, 0, SEEK_SET);
909 | r = write(fd_sn, str, 88);
910 | lseek(fd_sn, 0, SEEK_SET);
911 | r = read(fd_sn, str2, 88);
912 | str2[89] = 0;
913 | beagle_notice("name", &str2[6]);
914 | beagle_notice("ver/mfr", &str2[38]);
915 | beagle_notice("partno", &str2[58]);
916 | beagle_notice("serial", &str2[76]);
917 | fail = memcmp(str, str2, 88) ? 1 : 0;
918 | beagle_notice("eeprom", fail ? "fail" : "pass");
919 |
920 | close(fd_sn);
921 | return(fail);
922 | }
923 |
924 | int test_display18_cape(const char *scan_value, unsigned id)
925 | {
926 | printf("%s %d - not supported\n", scan_value, id);
927 | fail++;
928 | return(fail);
929 | }
930 |
931 | int test_display50_cape(const char *scan_value, unsigned id)
932 | {
933 | printf("%s %d - not supported\n", scan_value, id);
934 | fail++;
935 | return(fail);
936 | }
937 |
938 | int test_display70_cape(const char *scan_value, unsigned id)
939 | {
940 | printf("%s %d - not supported\n", scan_value, id);
941 | fail++;
942 | return(fail);
943 | }
944 |
945 | /* BC0400A2yywwnnnnnnnn */
946 | int test_load_cape(const char *scan_value, unsigned id)
947 | {
948 | int r;
949 | int fd_sn;
950 | char str[120];
951 | char str2[120];
952 |
953 | install_overlay(scan_value, capes[id].id_str);
954 |
955 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0054/2-00540/nvmem", O_RDWR);
956 | lseek(fd_sn, 0, SEEK_SET);
957 | r = read(fd_sn, str, 88);
958 | if(r < 0)
959 | printf("EEPROM read failure in test_load_cape()\n");
960 | str[89] = 0;
961 | beagle_notice("name", &str[6]);
962 |
963 | gpio_out_test("sink1", 7);
964 | gpio_out_test("sink2", 20);
965 | gpio_out_test("sink3", 112);
966 | gpio_out_test("sink4", 115);
967 | gpio_out_test("sink5", 44);
968 | gpio_out_test("sink6", 45);
969 | gpio_out_test("sink7", 47);
970 | gpio_out_test("sink8", 27);
971 |
972 | memcpy(str, cape_eeprom, 88);
973 | strcpy(&str[6], capes[id].name); /* board name */
974 | memcpy(&str[38], &scan_value[4], 4); /* board version */
975 | strcpy(&str[58], capes[id].id_str); /* part number */
976 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
977 | str[89] = 0;
978 | lseek(fd_sn, 0, SEEK_SET);
979 | r = write(fd_sn, str, 88);
980 | lseek(fd_sn, 0, SEEK_SET);
981 | r = read(fd_sn, str2, 88);
982 | str2[89] = 0;
983 | beagle_notice("name", &str2[6]);
984 | beagle_notice("ver/mfr", &str2[38]);
985 | beagle_notice("partno", &str2[58]);
986 | beagle_notice("serial", &str2[76]);
987 | fail = memcmp(str, str2, 88) ? 1 : 0;
988 | beagle_notice("eeprom", fail ? "fail" : "pass");
989 |
990 | close(fd_sn);
991 |
992 | return(fail);
993 | }
994 |
995 | /* BC0500A2yywwnnnnnnnn */
996 | int test_motor_cape(const char *scan_value, unsigned id)
997 | {
998 | int r;
999 | int fd_sn;
1000 | char str[120];
1001 | char str2[120];
1002 | const char *sleep = "sleep 1";
1003 |
1004 | install_overlay(scan_value, capes[id].id_str);
1005 |
1006 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0055/2-00550/nvmem", O_RDWR);
1007 | lseek(fd_sn, 0, SEEK_SET);
1008 | r = read(fd_sn, str, 88);
1009 | if(r < 0)
1010 | printf("EEPROM read failure in test_motor_cape()\n");
1011 | str[89] = 0;
1012 | beagle_notice("name", &str[6]);
1013 |
1014 | /* Export PWMs */
1015 | /* Motor 1 */
1016 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip*/export'");
1017 | /* Motor 2 */
1018 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip*/export'");
1019 | /* Motor 3 */
1020 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip*/export'");
1021 | /* Motor 4 */
1022 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip*/export'");
1023 | system(sleep);
1024 |
1025 | /* Test Motor 1 */
1026 | beagle_notice("M1", "low");
1027 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*1/period'");
1028 | system("bash -c 'echo 50000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*1/duty_cycle'");
1029 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*1/enable'");
1030 | system("echo pwm > /sys/devices/platform/ocp/ocp:P9_16_pinmux/state");
1031 | system(sleep);
1032 | beagle_notice("M1", "high");
1033 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*1/duty_cycle'");
1034 | system(sleep);
1035 | system("echo gpio > /sys/devices/platform/ocp/ocp:P9_16_pinmux/state");
1036 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*1/enable'");
1037 |
1038 | /* Test Motor 2 */
1039 | beagle_notice("M2", "low");
1040 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*0/period'");
1041 | system("bash -c 'echo 50000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*0/duty_cycle'");
1042 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*0/enable'");
1043 | system("echo pwm > /sys/devices/platform/ocp/ocp:P9_14_pinmux/state");
1044 | system(sleep);
1045 | beagle_notice("M2", "high");
1046 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*0/duty_cycle'");
1047 | system(sleep);
1048 | system("echo gpio > /sys/devices/platform/ocp/ocp:P9_14_pinmux/state");
1049 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48302000.*/48302200.*/pwm/pwmchip*/pwm*0/enable'");
1050 |
1051 | /* Test Motor 3 */
1052 | beagle_notice("M3", "low");
1053 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*1/period'");
1054 | system("bash -c 'echo 50000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*1/duty_cycle'");
1055 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*1/enable'");
1056 | system("echo pwm > /sys/devices/platform/ocp/ocp:P8_13_pinmux/state");
1057 | system(sleep);
1058 | beagle_notice("M3", "high");
1059 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*1/duty_cycle'");
1060 | system(sleep);
1061 | system("echo gpio > /sys/devices/platform/ocp/ocp:P8_13_pinmux/state");
1062 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*1/enable'");
1063 |
1064 | /* Test Motor 4 */
1065 | beagle_notice("M4", "low");
1066 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*0/period'");
1067 | system("bash -c 'echo 50000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*0/duty_cycle'");
1068 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*0/enable'");
1069 | system("echo pwm > /sys/devices/platform/ocp/ocp:P8_19_pinmux/state");
1070 | system(sleep);
1071 | beagle_notice("M4", "high");
1072 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*0/duty_cycle'");
1073 | system(sleep);
1074 | system("echo gpio > /sys/devices/platform/ocp/ocp:P8_19_pinmux/state");
1075 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48304000.*/48304200.*/pwm/pwmchip*/pwm*0/enable'");
1076 |
1077 | memcpy(str, cape_eeprom, 88);
1078 | strcpy(&str[6], capes[id].name); /* board name */
1079 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1080 | strcpy(&str[58], capes[id].id_str); /* part number */
1081 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1082 | str[89] = 0;
1083 | lseek(fd_sn, 0, SEEK_SET);
1084 | r = write(fd_sn, str, 88);
1085 | lseek(fd_sn, 0, SEEK_SET);
1086 | r = read(fd_sn, str2, 88);
1087 | str2[89] = 0;
1088 | beagle_notice("name", &str2[6]);
1089 | beagle_notice("ver/mfr", &str2[38]);
1090 | beagle_notice("partno", &str2[58]);
1091 | beagle_notice("serial", &str2[76]);
1092 | fail = memcmp(str, str2, 88) ? 1 : 0;
1093 | beagle_notice("eeprom", fail ? "fail" : "pass");
1094 |
1095 | close(fd_sn);
1096 |
1097 | return(fail);
1098 | }
1099 |
1100 | int test_power_cape(const char *scan_value, unsigned id)
1101 | {
1102 | printf("%s %d - not supported\n", scan_value, id);
1103 | fail++;
1104 | return(fail);
1105 | }
1106 |
1107 | /* BC0700A2yywwnnnnnnnn */
1108 | int test_proto_cape(const char *scan_value, unsigned id)
1109 | {
1110 | int r;
1111 | int fd_sn;
1112 | char str[120];
1113 | char str2[120];
1114 |
1115 | install_overlay(scan_value, capes[id].id_str);
1116 |
1117 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0057/2-00570/nvmem", O_RDWR);
1118 | lseek(fd_sn, 0, SEEK_SET);
1119 | r = read(fd_sn, str, 88);
1120 | if(r < 0)
1121 | printf("EEPROM read failure in test_proto_cape()\n");
1122 | str[89] = 0;
1123 | beagle_notice("name", &str[6]);
1124 |
1125 | gpio_out_test("LED", 68);
1126 | gpio_out_test("Blue", 44);
1127 | gpio_out_test("Red", 26);
1128 | gpio_out_test("Green", 46);
1129 |
1130 | memcpy(str, cape_eeprom, 88);
1131 | strcpy(&str[6], capes[id].name); /* board name */
1132 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1133 | strcpy(&str[58], capes[id].id_str); /* part number */
1134 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1135 | str[89] = 0;
1136 | lseek(fd_sn, 0, SEEK_SET);
1137 | r = write(fd_sn, str, 88);
1138 | lseek(fd_sn, 0, SEEK_SET);
1139 | r = read(fd_sn, str2, 88);
1140 | str2[89] = 0;
1141 | beagle_notice("name", &str2[6]);
1142 | beagle_notice("ver/mfr", &str2[38]);
1143 | beagle_notice("partno", &str2[58]);
1144 | beagle_notice("serial", &str2[76]);
1145 | fail = memcmp(str, str2, 88) ? 1 : 0;
1146 | beagle_notice("eeprom", fail ? "fail" : "pass");
1147 |
1148 | close(fd_sn);
1149 | return(fail);
1150 | }
1151 |
1152 | /* BC0800A2yywwnnnnnnnn */
1153 | int test_relay_cape(const char *scan_value, unsigned id)
1154 | {
1155 | int r;
1156 | int fd_sn;
1157 | char str[120];
1158 | char str2[120];
1159 |
1160 | install_overlay(scan_value, capes[id].id_str);
1161 |
1162 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0054/2-00540/nvmem", O_RDWR);
1163 | lseek(fd_sn, 0, SEEK_SET);
1164 | r = read(fd_sn, str, 88);
1165 | if(r < 0)
1166 | printf("EEPROM read failure in test_relay_cape()\n");
1167 | str[89] = 0;
1168 | beagle_notice("name", &str[6]);
1169 |
1170 | gpio_out_test("relay1", 20);
1171 | gpio_out_test("relay2", 7);
1172 | gpio_out_test("relay3", 112);
1173 | gpio_out_test("relay4", 115);
1174 |
1175 | //for(r = 0; r < 88; r++) printf("%02x", cape_eeprom[r]); printf("\n");
1176 | memcpy(str, cape_eeprom, 88);
1177 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1178 | strcpy(&str[6], capes[id].name); /* board name */
1179 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1180 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1181 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1182 | strcpy(&str[58], capes[id].id_str); /* part number */
1183 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1184 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1185 | str[89] = 0;
1186 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1187 | lseek(fd_sn, 0, SEEK_SET);
1188 | r = write(fd_sn, str, 88);
1189 | lseek(fd_sn, 0, SEEK_SET);
1190 | r = read(fd_sn, str2, 88);
1191 | str2[89] = 0;
1192 | beagle_notice("name", &str2[6]);
1193 | beagle_notice("ver/mfr", &str2[38]);
1194 | beagle_notice("partno", &str2[58]);
1195 | beagle_notice("serial", &str2[76]);
1196 | //for(r = 0; r < 88; r++) printf("%02x", str[r]); printf("\n");
1197 | //for(r = 0; r < 88; r++) printf("%02x", str2[r]); printf("\n");
1198 | fail = memcmp(str, str2, 88) ? 1 : 0;
1199 | beagle_notice("eeprom", fail ? "fail" : "pass");
1200 |
1201 | close(fd_sn);
1202 |
1203 | return(fail);
1204 | }
1205 |
1206 | int test_robotics_cape(const char *scan_value, unsigned id)
1207 | {
1208 | printf("%s %d - not supported\n", scan_value, id);
1209 | fail++;
1210 | return(fail);
1211 | }
1212 |
1213 | /* BC0A00A2yywwnnnnnnnn */
1214 | int test_servo_cape(const char *scan_value, unsigned id)
1215 | {
1216 | int r;
1217 | int fd_sn;
1218 | char str[120];
1219 | char str2[120];
1220 | const char *sleep = "sleep 1";
1221 |
1222 | install_overlay(scan_value, capes[id].id_str);
1223 |
1224 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0054/2-00540/nvmem", O_RDWR);
1225 | lseek(fd_sn, 0, SEEK_SET);
1226 | r = read(fd_sn, str, 88);
1227 | if(r < 0)
1228 | printf("EEPROM read failure in test_servo_cape()\n");
1229 | str[89] = 0;
1230 | beagle_notice("name", &str[6]);
1231 |
1232 | /* Enable pca9685 */
1233 | system("echo pca9685 0x70 > /sys/bus/i2c/devices/i2c-2/new_device");
1234 | system("echo out > /sys/class/gpio/gpio68/direction");
1235 | system("echo 0 > /sys/class/gpio/gpio68/value");
1236 | system(sleep);
1237 |
1238 | /* Export PWMs */
1239 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1240 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1241 | system("bash -c 'echo 2 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1242 | system("bash -c 'echo 3 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1243 | system("bash -c 'echo 4 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1244 | system("bash -c 'echo 5 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1245 | system("bash -c 'echo 6 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1246 | system("bash -c 'echo 7 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1247 | system("bash -c 'echo 8 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1248 | system("bash -c 'echo 9 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1249 | system("bash -c 'echo 10 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1250 | system("bash -c 'echo 11 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1251 | system("bash -c 'echo 12 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1252 | system("bash -c 'echo 13 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1253 | system("bash -c 'echo 14 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1254 | system("bash -c 'echo 15 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/export'");
1255 |
1256 | /* Set periods to 100Hz (10ms) */
1257 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/period'");
1258 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/period'");
1259 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/period'");
1260 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/period'");
1261 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/period'");
1262 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/period'");
1263 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/period'");
1264 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/period'");
1265 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/period'");
1266 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/period'");
1267 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/period'");
1268 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/period'");
1269 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/period'");
1270 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/period'");
1271 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/period'");
1272 | system("bash -c 'echo 10000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/period'");
1273 |
1274 | /* Set duty cycles to 1ms */
1275 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/duty_cycle'");
1276 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/duty_cycle'");
1277 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/duty_cycle'");
1278 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/duty_cycle'");
1279 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/duty_cycle'");
1280 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/duty_cycle'");
1281 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/duty_cycle'");
1282 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/duty_cycle'");
1283 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/duty_cycle'");
1284 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/duty_cycle'");
1285 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/duty_cycle'");
1286 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/duty_cycle'");
1287 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/duty_cycle'");
1288 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/duty_cycle'");
1289 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/duty_cycle'");
1290 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/duty_cycle'");
1291 |
1292 | /* Enable PWM outputs */
1293 | beagle_notice("pwms", "1ms");
1294 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/enable'");
1295 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/enable'");
1296 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/enable'");
1297 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/enable'");
1298 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/enable'");
1299 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/enable'");
1300 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/enable'");
1301 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/enable'");
1302 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/enable'");
1303 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/enable'");
1304 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/enable'");
1305 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/enable'");
1306 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/enable'");
1307 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/enable'");
1308 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/enable'");
1309 | system("bash -c 'echo 1 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/enable'");
1310 |
1311 | /* Set duty cycles to 2ms */
1312 | beagle_notice("pwms", "2ms");
1313 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/duty_cycle'");
1314 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/duty_cycle'");
1315 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/duty_cycle'");
1316 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/duty_cycle'");
1317 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/duty_cycle'");
1318 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/duty_cycle'");
1319 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/duty_cycle'");
1320 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/duty_cycle'");
1321 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/duty_cycle'");
1322 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/duty_cycle'");
1323 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/duty_cycle'");
1324 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/duty_cycle'");
1325 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/duty_cycle'");
1326 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/duty_cycle'");
1327 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/duty_cycle'");
1328 | system("bash -c 'echo 2000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/duty_cycle'");
1329 |
1330 | /* Set duty cycles to 1ms */
1331 | beagle_notice("pwms", "1ms");
1332 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/duty_cycle'");
1333 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/duty_cycle'");
1334 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/duty_cycle'");
1335 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/duty_cycle'");
1336 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/duty_cycle'");
1337 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/duty_cycle'");
1338 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/duty_cycle'");
1339 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/duty_cycle'");
1340 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/duty_cycle'");
1341 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/duty_cycle'");
1342 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/duty_cycle'");
1343 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/duty_cycle'");
1344 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/duty_cycle'");
1345 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/duty_cycle'");
1346 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/duty_cycle'");
1347 | system("bash -c 'echo 1000000 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/duty_cycle'");
1348 |
1349 | /* Enable PWM outputs */
1350 | beagle_notice("pwms", "off");
1351 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:0/enable'");
1352 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:1/enable'");
1353 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:2/enable'");
1354 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:3/enable'");
1355 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:4/enable'");
1356 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:5/enable'");
1357 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:6/enable'");
1358 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:7/enable'");
1359 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:8/enable'");
1360 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:9/enable'");
1361 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:10/enable'");
1362 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:11/enable'");
1363 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:12/enable'");
1364 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:13/enable'");
1365 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:14/enable'");
1366 | system("bash -c 'echo 0 > /sys/bus/i2c/drivers/pca9685-pwm/2-0070/pwm/pwmchip*/pwm*:15/enable'");
1367 |
1368 | memcpy(str, cape_eeprom, 88);
1369 | strcpy(&str[6], capes[id].name); /* board name */
1370 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1371 | strcpy(&str[58], capes[id].id_str); /* part number */
1372 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1373 | str[89] = 0;
1374 | lseek(fd_sn, 0, SEEK_SET);
1375 | r = write(fd_sn, str, 88);
1376 | lseek(fd_sn, 0, SEEK_SET);
1377 | r = read(fd_sn, str2, 88);
1378 | str2[89] = 0;
1379 | beagle_notice("name", &str2[6]);
1380 | beagle_notice("ver/mfr", &str2[38]);
1381 | beagle_notice("partno", &str2[58]);
1382 | beagle_notice("serial", &str2[76]);
1383 | fail = memcmp(str, str2, 88) ? 1 : 0;
1384 | beagle_notice("eeprom", fail ? "fail" : "pass");
1385 |
1386 | close(fd_sn);
1387 |
1388 | return(fail);
1389 | }
1390 |
1391 | /* PC0000Axyywwnnnnnnnn */
1392 | int test_gamepup_cape(const char *scan_value, unsigned id)
1393 | {
1394 | int r;
1395 | int fd_sn;
1396 | char str[120];
1397 | char str2[120];
1398 | const char *sleep = "sleep 1";
1399 |
1400 | install_overlay(scan_value, capes[id].id_str);
1401 |
1402 | /* Enable EEPROM */
1403 | system("echo 24c256 0x57 > /sys/bus/i2c/devices/i2c-2/new_device");
1404 | system(sleep);
1405 |
1406 | /* Read EEPROM */
1407 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0057/2-00570/nvmem", O_RDWR);
1408 | lseek(fd_sn, 0, SEEK_SET);
1409 | r = read(fd_sn, str, 88);
1410 | if(r < 0)
1411 | printf("EEPROM read failure in test_gamepup_cape()\n");
1412 | str[89] = 0;
1413 | beagle_notice("name", &str[6]);
1414 |
1415 | /* Light up LEDs */
1416 | beagle_notice("leds", "on");
1417 | set_led_trigger("gamepup::left", "default-on");
1418 | set_led_trigger("gamepup::right", "default-on");
1419 |
1420 | /* Make tone on buzzer */
1421 | system("echo pwm > /sys/devices/platform/ocp/ocp:P1_33_pinmux/state");
1422 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip*/export'");
1423 | system(sleep);
1424 | beagle_notice("buzzer", "tone");
1425 | system("bash -c 'echo 1000000 > /sys/devices/platform/ocp/48300000.*/48300200.*/pwm/pwmchip*/pwm*1/period'");
1426 | system("bash -c 'echo 500000 > /sys/devices/platform/ocp/48300000.*/48300200.*/pwm/pwmchip*/pwm*1/duty_cycle'");
1427 | system("bash -c 'echo 1 > /sys/devices/platform/ocp/48300000.*/48300200.*/pwm/pwmchip*/pwm*1/enable'");
1428 | system(sleep);
1429 | system("bash -c 'echo 0 > /sys/devices/platform/ocp/48300000.*/48300200.*/pwm/pwmchip*/pwm*1/enable'");
1430 |
1431 | /* Switch buzzer to PRU enabled via buttons */
1432 | system("echo pruout > /sys/devices/platform/ocp/ocp:P1_33_pinmux/state");
1433 | system("echo stop > /sys/class/remoteproc/remoteproc1/state");
1434 | system("echo gamepup-buzz-on-buttons.out > /sys/class/remoteproc/remoteproc1/firmware");
1435 | system("echo start > /sys/class/remoteproc/remoteproc1/state");
1436 |
1437 | /* Write EEPROM */
1438 | memcpy(str, cape_eeprom, 88);
1439 | strcpy(&str[6], capes[id].name); /* board name */
1440 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1441 | strcpy(&str[58], capes[id].id_str); /* part number */
1442 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1443 | str[89] = 0;
1444 | lseek(fd_sn, 0, SEEK_SET);
1445 | r = write(fd_sn, str, 88);
1446 | lseek(fd_sn, 0, SEEK_SET);
1447 | r = read(fd_sn, str2, 88);
1448 | str2[89] = 0;
1449 | beagle_notice("name", &str2[6]);
1450 | beagle_notice("ver/mfr", &str2[38]);
1451 | beagle_notice("partno", &str2[58]);
1452 | beagle_notice("serial", &str2[76]);
1453 | fail = memcmp(str, str2, 88) ? 1 : 0;
1454 | beagle_notice("eeprom", fail ? "fail" : "pass");
1455 |
1456 | if(fail) {
1457 | set_led_trigger("gamepup::left", "timer");
1458 | set_led_trigger("gamepup::right", "timer");
1459 | }
1460 |
1461 | /* Finish */
1462 | close(fd_sn);
1463 | return(fail);
1464 | }
1465 |
1466 | /* PC0100Axyywwnnnnnnnn */
1467 | int test_techlab_cape(const char *scan_value, unsigned id)
1468 | {
1469 | int r;
1470 | int fd_sn;
1471 | int fd_light;
1472 | char str[120];
1473 | char str2[120];
1474 | char *ptr;
1475 | const char *sleep = "sleep 1";
1476 | int fd_accel;
1477 |
1478 | install_overlay(scan_value, capes[id].id_str);
1479 |
1480 | /* Enable EEPROM */
1481 | system("echo 24c256 0x57 > /sys/bus/i2c/devices/i2c-2/new_device");
1482 | system(sleep);
1483 |
1484 | /* Read EEPROM */
1485 | fd_sn = open("/sys/bus/i2c/devices/i2c-2/2-0057/2-00570/nvmem", O_RDWR);
1486 | lseek(fd_sn, 0, SEEK_SET);
1487 | r = read(fd_sn, str, 88);
1488 | if(r < 0)
1489 | printf("EEPROM read failure in test_techlab_cape()\n");
1490 | str[89] = 0;
1491 | beagle_notice("name", &str[6]);
1492 |
1493 | beagle_notice("7seg", "on");
1494 |
1495 | /* Put buttons into GPIO mode */
1496 | system("echo gpio > /sys/devices/platform/ocp/ocp:P2_33_pinmux/state");
1497 | system("echo gpio > /sys/devices/platform/ocp/ocp:P1_29_pinmux/state");
1498 |
1499 | /* Tie left button to left SPI GPIO expander seven segment LED */
1500 | set_led_trigger("techlab::seg0", "gpio");
1501 | set_led_trigger("techlab::seg1", "gpio");
1502 | set_led_trigger("techlab::seg2", "gpio");
1503 | set_led_trigger("techlab::seg3", "gpio");
1504 | set_led_trigger("techlab::seg4", "gpio");
1505 | set_led_trigger("techlab::seg5", "gpio");
1506 | set_led_trigger("techlab::seg6", "gpio");
1507 | system("echo 45 > /sys/class/leds/techlab::seg0/gpio");
1508 | system("echo 255 > /sys/class/leds/techlab::seg0/brightness");
1509 | system("echo 45 > /sys/class/leds/techlab::seg1/gpio");
1510 | system("echo 255 > /sys/class/leds/techlab::seg1/brightness");
1511 | system("echo 45 > /sys/class/leds/techlab::seg2/gpio");
1512 | system("echo 255 > /sys/class/leds/techlab::seg2/brightness");
1513 | system("echo 45 > /sys/class/leds/techlab::seg3/gpio");
1514 | system("echo 255 > /sys/class/leds/techlab::seg3/brightness");
1515 | system("echo 45 > /sys/class/leds/techlab::seg4/gpio");
1516 | system("echo 255 > /sys/class/leds/techlab::seg4/brightness");
1517 | system("echo 45 > /sys/class/leds/techlab::seg5/gpio");
1518 | system("echo 255 > /sys/class/leds/techlab::seg5/brightness");
1519 | system("echo 45 > /sys/class/leds/techlab::seg6/gpio");
1520 | system("echo 255 > /sys/class/leds/techlab::seg6/brightness");
1521 |
1522 | /* Tie right button to left SPI GPIO expander seven segment LED */
1523 | set_led_trigger("techlab::seg8", "gpio");
1524 | set_led_trigger("techlab::seg9", "gpio");
1525 | set_led_trigger("techlab::seg10", "gpio");
1526 | set_led_trigger("techlab::seg11", "gpio");
1527 | set_led_trigger("techlab::seg12", "gpio");
1528 | set_led_trigger("techlab::seg13", "gpio");
1529 | set_led_trigger("techlab::seg14", "gpio");
1530 | system("echo 117 > /sys/class/leds/techlab::seg8/gpio");
1531 | system("echo 255 > /sys/class/leds/techlab::seg8/brightness");
1532 | system("echo 117 > /sys/class/leds/techlab::seg9/gpio");
1533 | system("echo 255 > /sys/class/leds/techlab::seg9/brightness");
1534 | system("echo 117 > /sys/class/leds/techlab::seg10/gpio");
1535 | system("echo 255 > /sys/class/leds/techlab::seg10/brightness");
1536 | system("echo 117 > /sys/class/leds/techlab::seg11/gpio");
1537 | system("echo 255 > /sys/class/leds/techlab::seg11/brightness");
1538 | system("echo 117 > /sys/class/leds/techlab::seg12/gpio");
1539 | system("echo 255 > /sys/class/leds/techlab::seg12/brightness");
1540 | system("echo 117 > /sys/class/leds/techlab::seg13/gpio");
1541 | system("echo 255 > /sys/class/leds/techlab::seg13/brightness");
1542 | system("echo 117 > /sys/class/leds/techlab::seg14/gpio");
1543 | system("echo 255 > /sys/class/leds/techlab::seg14/brightness");
1544 | system("echo 117 > /sys/class/leds/techlab::seg15/gpio");
1545 | system("echo 255 > /sys/class/leds/techlab::seg15/brightness");
1546 |
1547 | /* Make tone on buzzer */
1548 | beagle_notice("buzzer", "tone");
1549 | system("bash -c 'echo pruout > /sys/devices/platform/ocp/ocp:P2_30_pinmux/state'");
1550 | system("bash -c 'echo stop > /sys/class/remoteproc/remoteproc1/state'");
1551 | system("echo techlab-buzz.out > /sys/class/remoteproc/remoteproc1/firmware");
1552 | system("bash -c 'echo start > /sys/class/remoteproc/remoteproc1/state'");
1553 |
1554 | /* Turn on red LED */
1555 | beagle_notice("led", "red");
1556 | system("echo pwm > /sys/devices/platform/ocp/ocp:P1_33_pinmux/state");
1557 | set_led_trigger("techlab::red", "default-on");
1558 | system(sleep);
1559 | set_led_trigger("techlab::red", "none");
1560 |
1561 | /* Turn on green LED */
1562 | beagle_notice("led", "green");
1563 | set_led_trigger("techlab::green", "default-on");
1564 | system(sleep);
1565 | set_led_trigger("techlab::green", "none");
1566 |
1567 | /* Turn on blue LED */
1568 | beagle_notice("led", "blue");
1569 | set_led_trigger("techlab::blue", "default-on");
1570 | system(sleep);
1571 | set_led_trigger("techlab::blue", "none");
1572 |
1573 | /* Just a single light sensor reading */
1574 | fd_light = open("/sys/bus/iio/devices/iio:device0/in_voltage0_raw", O_RDWR);
1575 | lseek(fd_light, 0, SEEK_SET);
1576 | r = read(fd_light, str, 5);
1577 | if(r < 0)
1578 | printf("Light sensor read failure in test_techlab_cape()\n");
1579 | ptr = strtok(str, "\n");
1580 | beagle_notice("light", ptr);
1581 |
1582 | /* Read accelerometer */
1583 | fd_accel = open("/sys/bus/iio/devices/iio:device1/in_accel_x_raw", O_RDWR);
1584 | lseek(fd_accel, 0, SEEK_SET);
1585 | r = read(fd_accel, str, 5);
1586 | if(r < 0) {
1587 | fail++;
1588 | ptr = (char *)"fail";
1589 | } else {
1590 | ptr = strtok(str, "\n");
1591 | }
1592 | beagle_notice("accel", str);
1593 |
1594 | /* Write EEPROM */
1595 | memcpy(str, cape_eeprom, 88);
1596 | strcpy(&str[6], capes[id].name); /* board name */
1597 | memcpy(&str[38], &scan_value[4], 4); /* board version */
1598 | strcpy(&str[58], capes[id].id_str); /* part number */
1599 | strncpy(&str[76], &scan_value[8], 16); /* serial number */
1600 | str[89] = 0;
1601 | lseek(fd_sn, 0, SEEK_SET);
1602 | r = write(fd_sn, str, 88);
1603 | lseek(fd_sn, 0, SEEK_SET);
1604 | r = read(fd_sn, str2, 88);
1605 | str2[89] = 0;
1606 | beagle_notice("name", &str2[6]);
1607 | beagle_notice("ver/mfr", &str2[38]);
1608 | beagle_notice("partno", &str2[58]);
1609 | beagle_notice("serial", &str2[76]);
1610 | fail = memcmp(str, str2, 88) ? (fail+1) : fail;
1611 | beagle_notice("eeprom", fail ? "fail" : "pass");
1612 |
1613 | if(fail)
1614 | set_led_trigger("techlab::red", "timer");
1615 | else
1616 | set_led_trigger("techlab::green", "timer");
1617 |
1618 | /* Finish */
1619 | close(fd_sn);
1620 | return(fail);
1621 | }
1622 |
1623 | /* PC0200Axyywwnnnnnnnn */
1624 | int test_ppilot_cape(const char *scan_value, unsigned id)
1625 | {
1626 | printf("%s %d - not supported\n", scan_value, id);
1627 | fail++;
1628 | return(fail);
1629 | }
1630 |
1631 | void install_overlay(const char *scan_value, const char *id_str)
1632 | {
1633 | printf("Building overlay for %s\n", scan_value);
1634 | /* #dtb_overlay=/lib/firmware/.dtbo */
1635 | const char *cmd = "perl -i.bak -pe 's!^.*dtb_overlay=/lib/firmware/.+\\.dtbo.*!dtb_overlay=/lib/firmware/%s.dtbo!;' /boot/uEnv.txt";
1636 | printf("Optional command to force overlay loading:\n");
1637 | printf(cmd, id_str);
1638 | printf("\n");
1639 | }
1640 |
1641 | int gpio_out_test(const char *name, unsigned pin)
1642 | {
1643 | const char *sleep = "sleep 1";
1644 | const char *pinfile = "/sys/class/gpio/gpio%i";
1645 | const char *export = "echo %i > /sys/class/gpio/export";
1646 | const char *dir_out = "echo out > /sys/class/gpio/gpio%i/direction";
1647 | const char *value_high = "echo 1 > /sys/class/gpio/gpio%i/value";
1648 | const char *value_low = "echo 0 > /sys/class/gpio/gpio%i/value";
1649 | char buffer[50];
1650 | struct stat mystat;
1651 |
1652 | sprintf(buffer, pinfile, pin);
1653 | if(stat(buffer, &mystat) != 0) {
1654 | sprintf(buffer, export, pin);
1655 | system(buffer);
1656 | }
1657 | sprintf(buffer, dir_out, pin);
1658 | system(buffer);
1659 | sprintf(buffer, value_high, pin);
1660 | system(buffer);
1661 | beagle_notice(name, "on");
1662 | system(sleep);
1663 | sprintf(buffer, value_low, pin);
1664 | system(buffer);
1665 | beagle_notice(name, "off");
1666 | system(sleep);
1667 |
1668 | return(0);
1669 | }
1670 |
1671 |
--------------------------------------------------------------------------------
/src/common.c:
--------------------------------------------------------------------------------
1 | /*
2 | * common.c
3 | *
4 | * Author: Tomi Valkeinen
5 | * Copyright (C) 2009-2012 Tomi Valkeinen
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 |
20 | #include "common.h"
21 |
22 | void fb_open(int fb_num, struct fb_info *fb_info)
23 | {
24 | char str[64];
25 | int fd,tty;
26 |
27 | tty = open("/dev/tty1", O_RDWR);
28 |
29 | if(ioctl(tty, KDSETMODE, KD_GRAPHICS) == -1)
30 | fprintf(stderr, "Failed to set graphics mode on tty1\n");
31 |
32 | sprintf(str, "/dev/fb%d", fb_num);
33 | fd = open(str, O_RDWR);
34 |
35 | ASSERT(fd >= 0);
36 |
37 | fb_info->fd = fd;
38 | IOCTL1(fd, FBIOGET_VSCREENINFO, &fb_info->var);
39 | IOCTL1(fd, FBIOGET_FSCREENINFO, &fb_info->fix);
40 |
41 | fprintf(stderr, "fb res %dx%d virtual %dx%d, line_len %d, bpp %d\n",
42 | fb_info->var.xres, fb_info->var.yres,
43 | fb_info->var.xres_virtual, fb_info->var.yres_virtual,
44 | fb_info->fix.line_length, fb_info->var.bits_per_pixel);
45 | fflush(stderr);
46 |
47 | void *ptr = mmap(0,
48 | fb_info->var.yres_virtual * fb_info->fix.line_length,
49 | PROT_WRITE | PROT_READ,
50 | MAP_SHARED, fd, 0);
51 |
52 | ASSERT(ptr != MAP_FAILED);
53 |
54 | fb_info->ptr = ptr;
55 | }
56 |
57 | static void fb_clear_area(struct fb_info *fb_info, int x, int y, int w, int h)
58 | {
59 | int i = 0;
60 | int loc;
61 | char *fbuffer = (char *)fb_info->ptr;
62 | struct fb_var_screeninfo *var = &fb_info->var;
63 | struct fb_fix_screeninfo *fix = &fb_info->fix;
64 |
65 | for (i = 0; i < h; i++) {
66 | loc = (x + var->xoffset) * (var->bits_per_pixel / 8)
67 | + (y + i + var->yoffset) * fix->line_length;
68 | memset(fbuffer + loc, 0, w * var->bits_per_pixel / 8);
69 | }
70 | }
71 |
72 | static void fb_put_char(struct fb_info *fb_info, int x, int y, char c,
73 | unsigned color)
74 | {
75 | int i, j, bits, loc;
76 | unsigned char *p8;
77 | unsigned short *p16;
78 | unsigned int *p32;
79 | struct fb_var_screeninfo *var = &fb_info->var;
80 | struct fb_fix_screeninfo *fix = &fb_info->fix;
81 |
82 | unsigned short c16;
83 | unsigned r = (color >> 16) & 0xff;
84 | unsigned g = (color >> 8) & 0xff;
85 | unsigned b = (color >> 0) & 0xff;
86 |
87 | r = r * 32 / 256;
88 | g = g * 64 / 256;
89 | b = b * 32 / 256;
90 |
91 | c16 = (r << 11) | (g << 5) | (b << 0);
92 |
93 | for (i = 0; i < 8; i++) {
94 | bits = fontdata_8x8[8 * c + i];
95 | for (j = 0; j < 8; j++) {
96 | loc = (x + j + var->xoffset) * (var->bits_per_pixel / 8)
97 | + (y + i + var->yoffset) * fix->line_length;
98 | if (loc >= 0 && loc < (int)(fix->smem_len) &&
99 | ((bits >> (7 - j)) & 1)) {
100 | switch (var->bits_per_pixel) {
101 | case 8:
102 | p8 = fb_info->ptr + loc;
103 | *p8 = color;
104 | break; //???
105 | case 16:
106 | p16 = fb_info->ptr + loc;
107 | *p16 = c16;
108 | break;
109 | case 24:
110 | case 32:
111 | p32 = fb_info->ptr + loc;
112 | *p32 = color;
113 | break;
114 | }
115 | }
116 | }
117 | }
118 | }
119 |
120 | int fb_put_string(struct fb_info *fb_info, int x, int y, const char *s, int maxlen,
121 | unsigned color, int clear, int clearlen)
122 | {
123 | int i;
124 | int w = 0;
125 |
126 | if (clear)
127 | fb_clear_area(fb_info, x, y, clearlen * 8, 8);
128 |
129 | for (i = 0; i < (int)strlen(s) && i < maxlen; i++) {
130 | fb_put_char(fb_info, (x + 8 * i), y, s[i], color);
131 | w += 8;
132 | }
133 |
134 | return w;
135 | }
136 |
--------------------------------------------------------------------------------
/src/fb-test.c:
--------------------------------------------------------------------------------
1 | /*
2 | * fb-test.c
3 | *
4 | * Author: Tomi Valkeinen
5 | * Copyright (C) 2009-2012 Tomi Valkeinen
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 |
20 | #include "common.h"
21 |
22 | void draw_pixel(struct fb_info *fb_info, int x, int y, unsigned color)
23 | {
24 | void *fbmem;
25 |
26 | fbmem = fb_info->ptr;
27 | if (fb_info->var.bits_per_pixel == 8) {
28 | unsigned char *p;
29 |
30 | fbmem += fb_info->fix.line_length * y;
31 |
32 | p = fbmem;
33 |
34 | p += x;
35 |
36 | *p = color;
37 | } else if (fb_info->var.bits_per_pixel == 16) {
38 | unsigned short c;
39 | unsigned r = (color >> 16) & 0xff;
40 | unsigned g = (color >> 8) & 0xff;
41 | unsigned b = (color >> 0) & 0xff;
42 | unsigned short *p;
43 |
44 | r = r * 32 / 256;
45 | g = g * 64 / 256;
46 | b = b * 32 / 256;
47 |
48 | c = (r << 11) | (g << 5) | (b << 0);
49 |
50 | fbmem += fb_info->fix.line_length * y;
51 |
52 | p = fbmem;
53 |
54 | p += x;
55 |
56 | *p = c;
57 | } else if (fb_info->var.bits_per_pixel == 24) {
58 | unsigned char *p;
59 |
60 | p = (unsigned char *)fbmem + fb_info->fix.line_length * y + 3 * x;
61 | *p++ = color;
62 | *p++ = color >> 8;
63 | *p = color >> 16;
64 | } else {
65 | unsigned int *p;
66 |
67 | fbmem += fb_info->fix.line_length * y;
68 |
69 | p = fbmem;
70 |
71 | p += x;
72 |
73 | *p = color;
74 | }
75 | }
76 |
77 | static void fill_screen(struct fb_info *fb_info)
78 | {
79 | unsigned x, y;
80 | unsigned h = fb_info->var.yres;
81 | unsigned w = fb_info->var.xres;
82 |
83 | for (y = 0; y < h; y++) {
84 | for (x = 0; x < w; x++) {
85 | if (x < 20 && y < 20)
86 | draw_pixel(fb_info, x, y, 0xffffff);
87 | else if (x < 20 && (y > 20 && y < h - 20))
88 | draw_pixel(fb_info, x, y, 0xff);
89 | else if (y < 20 && (x > 20 && x < w - 20))
90 | draw_pixel(fb_info, x, y, 0xff00);
91 | else if (x > w - 20 && (y > 20 && y < h - 20))
92 | draw_pixel(fb_info, x, y, 0xff0000);
93 | else if (y > h - 20 && (x > 20 && x < w - 20))
94 | draw_pixel(fb_info, x, y, 0xffff00);
95 | else if (x == 20 || x == w - 20 ||
96 | y == 20 || y == h - 20)
97 | draw_pixel(fb_info, x, y, 0xffffff);
98 | else if (x == y || w - x == h - y)
99 | draw_pixel(fb_info, x, y, 0xff00ff);
100 | else if (w - x == y || x == h - y)
101 | draw_pixel(fb_info, x, y, 0x00ffff);
102 | else if (x > 20 && y > 20 && x < w - 20 && y < h - 20) {
103 | int t = x * 3 / w;
104 | unsigned r = 0, g = 0, b = 0;
105 | unsigned c;
106 | if (fb_info->var.bits_per_pixel == 16) {
107 | if (t == 0)
108 | b = (y % 32) * 256 / 32;
109 | else if (t == 1)
110 | g = (y % 64) * 256 / 64;
111 | else if (t == 2)
112 | r = (y % 32) * 256 / 32;
113 | } else {
114 | if (t == 0)
115 | b = (y % 256);
116 | else if (t == 1)
117 | g = (y % 256);
118 | else if (t == 2)
119 | r = (y % 256);
120 | }
121 | c = (r << 16) | (g << 8) | (b << 0);
122 | draw_pixel(fb_info, x, y, c);
123 | } else {
124 | draw_pixel(fb_info, x, y, 0);
125 | }
126 | }
127 |
128 | }
129 |
130 | fb_put_string(fb_info, w / 3 * 2, 30, "RED", 3, 0xffffff, 1, 3);
131 | fb_put_string(fb_info, w / 3, 30, "GREEN", 5, 0xffffff, 1, 5);
132 | fb_put_string(fb_info, 20, 30, "BLUE", 4, 0xffffff, 1, 4);
133 | }
134 |
135 | void fill_screen_solid(struct fb_info *fb_info, unsigned int color)
136 | {
137 |
138 | unsigned x, y;
139 | unsigned h = fb_info->var.yres;
140 | unsigned w = fb_info->var.xres;
141 |
142 | for (y = 0; y < h; y++) {
143 | for (x = 0; x < w; x++)
144 | draw_pixel(fb_info, x, y, color);
145 | }
146 | }
147 |
148 | void do_fill_screen(struct fb_info *fb_info, int pattern)
149 | {
150 |
151 | switch (pattern) {
152 | case 1:
153 | fill_screen_solid(fb_info, 0xff0000);
154 | break;
155 | case 2:
156 | fill_screen_solid(fb_info, 0x00ff00);
157 | break;
158 | case 3:
159 | fill_screen_solid(fb_info, 0x0000ff);
160 | break;
161 | case 4:
162 | fill_screen_solid(fb_info, 0xffffff);
163 | break;
164 | case 0:
165 | default:
166 | fill_screen(fb_info);
167 | break;
168 | }
169 | }
170 |
171 | /* end of fb-test.c */
172 |
173 |
--------------------------------------------------------------------------------
/src/font_8x8.c:
--------------------------------------------------------------------------------
1 | /*
2 | * font_8x8.c
3 | *
4 | * Author: Tomi Valkeinen
5 | * Copyright (C) 2009-2012 Tomi Valkeinen
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 |
20 | /**********************************************/
21 | /* */
22 | /* Font file generated by cpi2fnt */
23 | /* */
24 | /**********************************************/
25 |
26 | char fontdata_8x8[] = {
27 |
28 | /* 0 0x00 '^@' */
29 | 0x00, /* 00000000 */
30 | 0x00, /* 00000000 */
31 | 0x00, /* 00000000 */
32 | 0x00, /* 00000000 */
33 | 0x00, /* 00000000 */
34 | 0x00, /* 00000000 */
35 | 0x00, /* 00000000 */
36 | 0x00, /* 00000000 */
37 |
38 | /* 1 0x01 '^A' */
39 | 0x7e, /* 01111110 */
40 | 0x81, /* 10000001 */
41 | 0xa5, /* 10100101 */
42 | 0x81, /* 10000001 */
43 | 0xbd, /* 10111101 */
44 | 0x99, /* 10011001 */
45 | 0x81, /* 10000001 */
46 | 0x7e, /* 01111110 */
47 |
48 | /* 2 0x02 '^B' */
49 | 0x7e, /* 01111110 */
50 | 0xff, /* 11111111 */
51 | 0xdb, /* 11011011 */
52 | 0xff, /* 11111111 */
53 | 0xc3, /* 11000011 */
54 | 0xe7, /* 11100111 */
55 | 0xff, /* 11111111 */
56 | 0x7e, /* 01111110 */
57 |
58 | /* 3 0x03 '^C' */
59 | 0x6c, /* 01101100 */
60 | 0xfe, /* 11111110 */
61 | 0xfe, /* 11111110 */
62 | 0xfe, /* 11111110 */
63 | 0x7c, /* 01111100 */
64 | 0x38, /* 00111000 */
65 | 0x10, /* 00010000 */
66 | 0x00, /* 00000000 */
67 |
68 | /* 4 0x04 '^D' */
69 | 0x10, /* 00010000 */
70 | 0x38, /* 00111000 */
71 | 0x7c, /* 01111100 */
72 | 0xfe, /* 11111110 */
73 | 0x7c, /* 01111100 */
74 | 0x38, /* 00111000 */
75 | 0x10, /* 00010000 */
76 | 0x00, /* 00000000 */
77 |
78 | /* 5 0x05 '^E' */
79 | 0x38, /* 00111000 */
80 | 0x7c, /* 01111100 */
81 | 0x38, /* 00111000 */
82 | 0xfe, /* 11111110 */
83 | 0xfe, /* 11111110 */
84 | 0xd6, /* 11010110 */
85 | 0x10, /* 00010000 */
86 | 0x38, /* 00111000 */
87 |
88 | /* 6 0x06 '^F' */
89 | 0x10, /* 00010000 */
90 | 0x38, /* 00111000 */
91 | 0x7c, /* 01111100 */
92 | 0xfe, /* 11111110 */
93 | 0xfe, /* 11111110 */
94 | 0x7c, /* 01111100 */
95 | 0x10, /* 00010000 */
96 | 0x38, /* 00111000 */
97 |
98 | /* 7 0x07 '^G' */
99 | 0x00, /* 00000000 */
100 | 0x00, /* 00000000 */
101 | 0x18, /* 00011000 */
102 | 0x3c, /* 00111100 */
103 | 0x3c, /* 00111100 */
104 | 0x18, /* 00011000 */
105 | 0x00, /* 00000000 */
106 | 0x00, /* 00000000 */
107 |
108 | /* 8 0x08 '^H' */
109 | 0xff, /* 11111111 */
110 | 0xff, /* 11111111 */
111 | 0xe7, /* 11100111 */
112 | 0xc3, /* 11000011 */
113 | 0xc3, /* 11000011 */
114 | 0xe7, /* 11100111 */
115 | 0xff, /* 11111111 */
116 | 0xff, /* 11111111 */
117 |
118 | /* 9 0x09 '^I' */
119 | 0x00, /* 00000000 */
120 | 0x3c, /* 00111100 */
121 | 0x66, /* 01100110 */
122 | 0x42, /* 01000010 */
123 | 0x42, /* 01000010 */
124 | 0x66, /* 01100110 */
125 | 0x3c, /* 00111100 */
126 | 0x00, /* 00000000 */
127 |
128 | /* 10 0x0a '^J' */
129 | 0xff, /* 11111111 */
130 | 0xc3, /* 11000011 */
131 | 0x99, /* 10011001 */
132 | 0xbd, /* 10111101 */
133 | 0xbd, /* 10111101 */
134 | 0x99, /* 10011001 */
135 | 0xc3, /* 11000011 */
136 | 0xff, /* 11111111 */
137 |
138 | /* 11 0x0b '^K' */
139 | 0x0f, /* 00001111 */
140 | 0x07, /* 00000111 */
141 | 0x0f, /* 00001111 */
142 | 0x7d, /* 01111101 */
143 | 0xcc, /* 11001100 */
144 | 0xcc, /* 11001100 */
145 | 0xcc, /* 11001100 */
146 | 0x78, /* 01111000 */
147 |
148 | /* 12 0x0c '^L' */
149 | 0x3c, /* 00111100 */
150 | 0x66, /* 01100110 */
151 | 0x66, /* 01100110 */
152 | 0x66, /* 01100110 */
153 | 0x3c, /* 00111100 */
154 | 0x18, /* 00011000 */
155 | 0x7e, /* 01111110 */
156 | 0x18, /* 00011000 */
157 |
158 | /* 13 0x0d '^M' */
159 | 0x3f, /* 00111111 */
160 | 0x33, /* 00110011 */
161 | 0x3f, /* 00111111 */
162 | 0x30, /* 00110000 */
163 | 0x30, /* 00110000 */
164 | 0x70, /* 01110000 */
165 | 0xf0, /* 11110000 */
166 | 0xe0, /* 11100000 */
167 |
168 | /* 14 0x0e '^N' */
169 | 0x7f, /* 01111111 */
170 | 0x63, /* 01100011 */
171 | 0x7f, /* 01111111 */
172 | 0x63, /* 01100011 */
173 | 0x63, /* 01100011 */
174 | 0x67, /* 01100111 */
175 | 0xe6, /* 11100110 */
176 | 0xc0, /* 11000000 */
177 |
178 | /* 15 0x0f '^O' */
179 | 0x18, /* 00011000 */
180 | 0xdb, /* 11011011 */
181 | 0x3c, /* 00111100 */
182 | 0xe7, /* 11100111 */
183 | 0xe7, /* 11100111 */
184 | 0x3c, /* 00111100 */
185 | 0xdb, /* 11011011 */
186 | 0x18, /* 00011000 */
187 |
188 | /* 16 0x10 '^P' */
189 | 0x80, /* 10000000 */
190 | 0xe0, /* 11100000 */
191 | 0xf8, /* 11111000 */
192 | 0xfe, /* 11111110 */
193 | 0xf8, /* 11111000 */
194 | 0xe0, /* 11100000 */
195 | 0x80, /* 10000000 */
196 | 0x00, /* 00000000 */
197 |
198 | /* 17 0x11 '^Q' */
199 | 0x02, /* 00000010 */
200 | 0x0e, /* 00001110 */
201 | 0x3e, /* 00111110 */
202 | 0xfe, /* 11111110 */
203 | 0x3e, /* 00111110 */
204 | 0x0e, /* 00001110 */
205 | 0x02, /* 00000010 */
206 | 0x00, /* 00000000 */
207 |
208 | /* 18 0x12 '^R' */
209 | 0x18, /* 00011000 */
210 | 0x3c, /* 00111100 */
211 | 0x7e, /* 01111110 */
212 | 0x18, /* 00011000 */
213 | 0x18, /* 00011000 */
214 | 0x7e, /* 01111110 */
215 | 0x3c, /* 00111100 */
216 | 0x18, /* 00011000 */
217 |
218 | /* 19 0x13 '^S' */
219 | 0x66, /* 01100110 */
220 | 0x66, /* 01100110 */
221 | 0x66, /* 01100110 */
222 | 0x66, /* 01100110 */
223 | 0x66, /* 01100110 */
224 | 0x00, /* 00000000 */
225 | 0x66, /* 01100110 */
226 | 0x00, /* 00000000 */
227 |
228 | /* 20 0x14 '^T' */
229 | 0x7f, /* 01111111 */
230 | 0xdb, /* 11011011 */
231 | 0xdb, /* 11011011 */
232 | 0x7b, /* 01111011 */
233 | 0x1b, /* 00011011 */
234 | 0x1b, /* 00011011 */
235 | 0x1b, /* 00011011 */
236 | 0x00, /* 00000000 */
237 |
238 | /* 21 0x15 '^U' */
239 | 0x3e, /* 00111110 */
240 | 0x61, /* 01100001 */
241 | 0x3c, /* 00111100 */
242 | 0x66, /* 01100110 */
243 | 0x66, /* 01100110 */
244 | 0x3c, /* 00111100 */
245 | 0x86, /* 10000110 */
246 | 0x7c, /* 01111100 */
247 |
248 | /* 22 0x16 '^V' */
249 | 0x00, /* 00000000 */
250 | 0x00, /* 00000000 */
251 | 0x00, /* 00000000 */
252 | 0x00, /* 00000000 */
253 | 0x7e, /* 01111110 */
254 | 0x7e, /* 01111110 */
255 | 0x7e, /* 01111110 */
256 | 0x00, /* 00000000 */
257 |
258 | /* 23 0x17 '^W' */
259 | 0x18, /* 00011000 */
260 | 0x3c, /* 00111100 */
261 | 0x7e, /* 01111110 */
262 | 0x18, /* 00011000 */
263 | 0x7e, /* 01111110 */
264 | 0x3c, /* 00111100 */
265 | 0x18, /* 00011000 */
266 | 0xff, /* 11111111 */
267 |
268 | /* 24 0x18 '^X' */
269 | 0x18, /* 00011000 */
270 | 0x3c, /* 00111100 */
271 | 0x7e, /* 01111110 */
272 | 0x18, /* 00011000 */
273 | 0x18, /* 00011000 */
274 | 0x18, /* 00011000 */
275 | 0x18, /* 00011000 */
276 | 0x00, /* 00000000 */
277 |
278 | /* 25 0x19 '^Y' */
279 | 0x18, /* 00011000 */
280 | 0x18, /* 00011000 */
281 | 0x18, /* 00011000 */
282 | 0x18, /* 00011000 */
283 | 0x7e, /* 01111110 */
284 | 0x3c, /* 00111100 */
285 | 0x18, /* 00011000 */
286 | 0x00, /* 00000000 */
287 |
288 | /* 26 0x1a '^Z' */
289 | 0x00, /* 00000000 */
290 | 0x18, /* 00011000 */
291 | 0x0c, /* 00001100 */
292 | 0xfe, /* 11111110 */
293 | 0x0c, /* 00001100 */
294 | 0x18, /* 00011000 */
295 | 0x00, /* 00000000 */
296 | 0x00, /* 00000000 */
297 |
298 | /* 27 0x1b '^[' */
299 | 0x00, /* 00000000 */
300 | 0x30, /* 00110000 */
301 | 0x60, /* 01100000 */
302 | 0xfe, /* 11111110 */
303 | 0x60, /* 01100000 */
304 | 0x30, /* 00110000 */
305 | 0x00, /* 00000000 */
306 | 0x00, /* 00000000 */
307 |
308 | /* 28 0x1c '^\' */
309 | 0x00, /* 00000000 */
310 | 0x00, /* 00000000 */
311 | 0xc0, /* 11000000 */
312 | 0xc0, /* 11000000 */
313 | 0xc0, /* 11000000 */
314 | 0xfe, /* 11111110 */
315 | 0x00, /* 00000000 */
316 | 0x00, /* 00000000 */
317 |
318 | /* 29 0x1d '^]' */
319 | 0x00, /* 00000000 */
320 | 0x24, /* 00100100 */
321 | 0x66, /* 01100110 */
322 | 0xff, /* 11111111 */
323 | 0x66, /* 01100110 */
324 | 0x24, /* 00100100 */
325 | 0x00, /* 00000000 */
326 | 0x00, /* 00000000 */
327 |
328 | /* 30 0x1e '^^' */
329 | 0x00, /* 00000000 */
330 | 0x18, /* 00011000 */
331 | 0x3c, /* 00111100 */
332 | 0x7e, /* 01111110 */
333 | 0xff, /* 11111111 */
334 | 0xff, /* 11111111 */
335 | 0x00, /* 00000000 */
336 | 0x00, /* 00000000 */
337 |
338 | /* 31 0x1f '^_' */
339 | 0x00, /* 00000000 */
340 | 0xff, /* 11111111 */
341 | 0xff, /* 11111111 */
342 | 0x7e, /* 01111110 */
343 | 0x3c, /* 00111100 */
344 | 0x18, /* 00011000 */
345 | 0x00, /* 00000000 */
346 | 0x00, /* 00000000 */
347 |
348 | /* 32 0x20 ' ' */
349 | 0x00, /* 00000000 */
350 | 0x00, /* 00000000 */
351 | 0x00, /* 00000000 */
352 | 0x00, /* 00000000 */
353 | 0x00, /* 00000000 */
354 | 0x00, /* 00000000 */
355 | 0x00, /* 00000000 */
356 | 0x00, /* 00000000 */
357 |
358 | /* 33 0x21 '!' */
359 | 0x18, /* 00011000 */
360 | 0x3c, /* 00111100 */
361 | 0x3c, /* 00111100 */
362 | 0x18, /* 00011000 */
363 | 0x18, /* 00011000 */
364 | 0x00, /* 00000000 */
365 | 0x18, /* 00011000 */
366 | 0x00, /* 00000000 */
367 |
368 | /* 34 0x22 '"' */
369 | 0x66, /* 01100110 */
370 | 0x66, /* 01100110 */
371 | 0x24, /* 00100100 */
372 | 0x00, /* 00000000 */
373 | 0x00, /* 00000000 */
374 | 0x00, /* 00000000 */
375 | 0x00, /* 00000000 */
376 | 0x00, /* 00000000 */
377 |
378 | /* 35 0x23 '#' */
379 | 0x6c, /* 01101100 */
380 | 0x6c, /* 01101100 */
381 | 0xfe, /* 11111110 */
382 | 0x6c, /* 01101100 */
383 | 0xfe, /* 11111110 */
384 | 0x6c, /* 01101100 */
385 | 0x6c, /* 01101100 */
386 | 0x00, /* 00000000 */
387 |
388 | /* 36 0x24 '$' */
389 | 0x18, /* 00011000 */
390 | 0x3e, /* 00111110 */
391 | 0x60, /* 01100000 */
392 | 0x3c, /* 00111100 */
393 | 0x06, /* 00000110 */
394 | 0x7c, /* 01111100 */
395 | 0x18, /* 00011000 */
396 | 0x00, /* 00000000 */
397 |
398 | /* 37 0x25 '%' */
399 | 0x00, /* 00000000 */
400 | 0xc6, /* 11000110 */
401 | 0xcc, /* 11001100 */
402 | 0x18, /* 00011000 */
403 | 0x30, /* 00110000 */
404 | 0x66, /* 01100110 */
405 | 0xc6, /* 11000110 */
406 | 0x00, /* 00000000 */
407 |
408 | /* 38 0x26 '&' */
409 | 0x38, /* 00111000 */
410 | 0x6c, /* 01101100 */
411 | 0x38, /* 00111000 */
412 | 0x76, /* 01110110 */
413 | 0xdc, /* 11011100 */
414 | 0xcc, /* 11001100 */
415 | 0x76, /* 01110110 */
416 | 0x00, /* 00000000 */
417 |
418 | /* 39 0x27 ''' */
419 | 0x18, /* 00011000 */
420 | 0x18, /* 00011000 */
421 | 0x30, /* 00110000 */
422 | 0x00, /* 00000000 */
423 | 0x00, /* 00000000 */
424 | 0x00, /* 00000000 */
425 | 0x00, /* 00000000 */
426 | 0x00, /* 00000000 */
427 |
428 | /* 40 0x28 '(' */
429 | 0x0c, /* 00001100 */
430 | 0x18, /* 00011000 */
431 | 0x30, /* 00110000 */
432 | 0x30, /* 00110000 */
433 | 0x30, /* 00110000 */
434 | 0x18, /* 00011000 */
435 | 0x0c, /* 00001100 */
436 | 0x00, /* 00000000 */
437 |
438 | /* 41 0x29 ')' */
439 | 0x30, /* 00110000 */
440 | 0x18, /* 00011000 */
441 | 0x0c, /* 00001100 */
442 | 0x0c, /* 00001100 */
443 | 0x0c, /* 00001100 */
444 | 0x18, /* 00011000 */
445 | 0x30, /* 00110000 */
446 | 0x00, /* 00000000 */
447 |
448 | /* 42 0x2a '*' */
449 | 0x00, /* 00000000 */
450 | 0x66, /* 01100110 */
451 | 0x3c, /* 00111100 */
452 | 0xff, /* 11111111 */
453 | 0x3c, /* 00111100 */
454 | 0x66, /* 01100110 */
455 | 0x00, /* 00000000 */
456 | 0x00, /* 00000000 */
457 |
458 | /* 43 0x2b '+' */
459 | 0x00, /* 00000000 */
460 | 0x18, /* 00011000 */
461 | 0x18, /* 00011000 */
462 | 0x7e, /* 01111110 */
463 | 0x18, /* 00011000 */
464 | 0x18, /* 00011000 */
465 | 0x00, /* 00000000 */
466 | 0x00, /* 00000000 */
467 |
468 | /* 44 0x2c ',' */
469 | 0x00, /* 00000000 */
470 | 0x00, /* 00000000 */
471 | 0x00, /* 00000000 */
472 | 0x00, /* 00000000 */
473 | 0x00, /* 00000000 */
474 | 0x18, /* 00011000 */
475 | 0x18, /* 00011000 */
476 | 0x30, /* 00110000 */
477 |
478 | /* 45 0x2d '-' */
479 | 0x00, /* 00000000 */
480 | 0x00, /* 00000000 */
481 | 0x00, /* 00000000 */
482 | 0x7e, /* 01111110 */
483 | 0x00, /* 00000000 */
484 | 0x00, /* 00000000 */
485 | 0x00, /* 00000000 */
486 | 0x00, /* 00000000 */
487 |
488 | /* 46 0x2e '.' */
489 | 0x00, /* 00000000 */
490 | 0x00, /* 00000000 */
491 | 0x00, /* 00000000 */
492 | 0x00, /* 00000000 */
493 | 0x00, /* 00000000 */
494 | 0x18, /* 00011000 */
495 | 0x18, /* 00011000 */
496 | 0x00, /* 00000000 */
497 |
498 | /* 47 0x2f '/' */
499 | 0x06, /* 00000110 */
500 | 0x0c, /* 00001100 */
501 | 0x18, /* 00011000 */
502 | 0x30, /* 00110000 */
503 | 0x60, /* 01100000 */
504 | 0xc0, /* 11000000 */
505 | 0x80, /* 10000000 */
506 | 0x00, /* 00000000 */
507 |
508 | /* 48 0x30 '0' */
509 | 0x38, /* 00111000 */
510 | 0x6c, /* 01101100 */
511 | 0xc6, /* 11000110 */
512 | 0xd6, /* 11010110 */
513 | 0xc6, /* 11000110 */
514 | 0x6c, /* 01101100 */
515 | 0x38, /* 00111000 */
516 | 0x00, /* 00000000 */
517 |
518 | /* 49 0x31 '1' */
519 | 0x18, /* 00011000 */
520 | 0x38, /* 00111000 */
521 | 0x18, /* 00011000 */
522 | 0x18, /* 00011000 */
523 | 0x18, /* 00011000 */
524 | 0x18, /* 00011000 */
525 | 0x7e, /* 01111110 */
526 | 0x00, /* 00000000 */
527 |
528 | /* 50 0x32 '2' */
529 | 0x7c, /* 01111100 */
530 | 0xc6, /* 11000110 */
531 | 0x06, /* 00000110 */
532 | 0x1c, /* 00011100 */
533 | 0x30, /* 00110000 */
534 | 0x66, /* 01100110 */
535 | 0xfe, /* 11111110 */
536 | 0x00, /* 00000000 */
537 |
538 | /* 51 0x33 '3' */
539 | 0x7c, /* 01111100 */
540 | 0xc6, /* 11000110 */
541 | 0x06, /* 00000110 */
542 | 0x3c, /* 00111100 */
543 | 0x06, /* 00000110 */
544 | 0xc6, /* 11000110 */
545 | 0x7c, /* 01111100 */
546 | 0x00, /* 00000000 */
547 |
548 | /* 52 0x34 '4' */
549 | 0x1c, /* 00011100 */
550 | 0x3c, /* 00111100 */
551 | 0x6c, /* 01101100 */
552 | 0xcc, /* 11001100 */
553 | 0xfe, /* 11111110 */
554 | 0x0c, /* 00001100 */
555 | 0x1e, /* 00011110 */
556 | 0x00, /* 00000000 */
557 |
558 | /* 53 0x35 '5' */
559 | 0xfe, /* 11111110 */
560 | 0xc0, /* 11000000 */
561 | 0xc0, /* 11000000 */
562 | 0xfc, /* 11111100 */
563 | 0x06, /* 00000110 */
564 | 0xc6, /* 11000110 */
565 | 0x7c, /* 01111100 */
566 | 0x00, /* 00000000 */
567 |
568 | /* 54 0x36 '6' */
569 | 0x38, /* 00111000 */
570 | 0x60, /* 01100000 */
571 | 0xc0, /* 11000000 */
572 | 0xfc, /* 11111100 */
573 | 0xc6, /* 11000110 */
574 | 0xc6, /* 11000110 */
575 | 0x7c, /* 01111100 */
576 | 0x00, /* 00000000 */
577 |
578 | /* 55 0x37 '7' */
579 | 0xfe, /* 11111110 */
580 | 0xc6, /* 11000110 */
581 | 0x0c, /* 00001100 */
582 | 0x18, /* 00011000 */
583 | 0x30, /* 00110000 */
584 | 0x30, /* 00110000 */
585 | 0x30, /* 00110000 */
586 | 0x00, /* 00000000 */
587 |
588 | /* 56 0x38 '8' */
589 | 0x7c, /* 01111100 */
590 | 0xc6, /* 11000110 */
591 | 0xc6, /* 11000110 */
592 | 0x7c, /* 01111100 */
593 | 0xc6, /* 11000110 */
594 | 0xc6, /* 11000110 */
595 | 0x7c, /* 01111100 */
596 | 0x00, /* 00000000 */
597 |
598 | /* 57 0x39 '9' */
599 | 0x7c, /* 01111100 */
600 | 0xc6, /* 11000110 */
601 | 0xc6, /* 11000110 */
602 | 0x7e, /* 01111110 */
603 | 0x06, /* 00000110 */
604 | 0x0c, /* 00001100 */
605 | 0x78, /* 01111000 */
606 | 0x00, /* 00000000 */
607 |
608 | /* 58 0x3a ':' */
609 | 0x00, /* 00000000 */
610 | 0x18, /* 00011000 */
611 | 0x18, /* 00011000 */
612 | 0x00, /* 00000000 */
613 | 0x00, /* 00000000 */
614 | 0x18, /* 00011000 */
615 | 0x18, /* 00011000 */
616 | 0x00, /* 00000000 */
617 |
618 | /* 59 0x3b ';' */
619 | 0x00, /* 00000000 */
620 | 0x18, /* 00011000 */
621 | 0x18, /* 00011000 */
622 | 0x00, /* 00000000 */
623 | 0x00, /* 00000000 */
624 | 0x18, /* 00011000 */
625 | 0x18, /* 00011000 */
626 | 0x30, /* 00110000 */
627 |
628 | /* 60 0x3c '<' */
629 | 0x06, /* 00000110 */
630 | 0x0c, /* 00001100 */
631 | 0x18, /* 00011000 */
632 | 0x30, /* 00110000 */
633 | 0x18, /* 00011000 */
634 | 0x0c, /* 00001100 */
635 | 0x06, /* 00000110 */
636 | 0x00, /* 00000000 */
637 |
638 | /* 61 0x3d '=' */
639 | 0x00, /* 00000000 */
640 | 0x00, /* 00000000 */
641 | 0x7e, /* 01111110 */
642 | 0x00, /* 00000000 */
643 | 0x00, /* 00000000 */
644 | 0x7e, /* 01111110 */
645 | 0x00, /* 00000000 */
646 | 0x00, /* 00000000 */
647 |
648 | /* 62 0x3e '>' */
649 | 0x60, /* 01100000 */
650 | 0x30, /* 00110000 */
651 | 0x18, /* 00011000 */
652 | 0x0c, /* 00001100 */
653 | 0x18, /* 00011000 */
654 | 0x30, /* 00110000 */
655 | 0x60, /* 01100000 */
656 | 0x00, /* 00000000 */
657 |
658 | /* 63 0x3f '?' */
659 | 0x7c, /* 01111100 */
660 | 0xc6, /* 11000110 */
661 | 0x0c, /* 00001100 */
662 | 0x18, /* 00011000 */
663 | 0x18, /* 00011000 */
664 | 0x00, /* 00000000 */
665 | 0x18, /* 00011000 */
666 | 0x00, /* 00000000 */
667 |
668 | /* 64 0x40 '@' */
669 | 0x7c, /* 01111100 */
670 | 0xc6, /* 11000110 */
671 | 0xde, /* 11011110 */
672 | 0xde, /* 11011110 */
673 | 0xde, /* 11011110 */
674 | 0xc0, /* 11000000 */
675 | 0x78, /* 01111000 */
676 | 0x00, /* 00000000 */
677 |
678 | /* 65 0x41 'A' */
679 | 0x38, /* 00111000 */
680 | 0x6c, /* 01101100 */
681 | 0xc6, /* 11000110 */
682 | 0xfe, /* 11111110 */
683 | 0xc6, /* 11000110 */
684 | 0xc6, /* 11000110 */
685 | 0xc6, /* 11000110 */
686 | 0x00, /* 00000000 */
687 |
688 | /* 66 0x42 'B' */
689 | 0xfc, /* 11111100 */
690 | 0x66, /* 01100110 */
691 | 0x66, /* 01100110 */
692 | 0x7c, /* 01111100 */
693 | 0x66, /* 01100110 */
694 | 0x66, /* 01100110 */
695 | 0xfc, /* 11111100 */
696 | 0x00, /* 00000000 */
697 |
698 | /* 67 0x43 'C' */
699 | 0x3c, /* 00111100 */
700 | 0x66, /* 01100110 */
701 | 0xc0, /* 11000000 */
702 | 0xc0, /* 11000000 */
703 | 0xc0, /* 11000000 */
704 | 0x66, /* 01100110 */
705 | 0x3c, /* 00111100 */
706 | 0x00, /* 00000000 */
707 |
708 | /* 68 0x44 'D' */
709 | 0xf8, /* 11111000 */
710 | 0x6c, /* 01101100 */
711 | 0x66, /* 01100110 */
712 | 0x66, /* 01100110 */
713 | 0x66, /* 01100110 */
714 | 0x6c, /* 01101100 */
715 | 0xf8, /* 11111000 */
716 | 0x00, /* 00000000 */
717 |
718 | /* 69 0x45 'E' */
719 | 0xfe, /* 11111110 */
720 | 0x62, /* 01100010 */
721 | 0x68, /* 01101000 */
722 | 0x78, /* 01111000 */
723 | 0x68, /* 01101000 */
724 | 0x62, /* 01100010 */
725 | 0xfe, /* 11111110 */
726 | 0x00, /* 00000000 */
727 |
728 | /* 70 0x46 'F' */
729 | 0xfe, /* 11111110 */
730 | 0x62, /* 01100010 */
731 | 0x68, /* 01101000 */
732 | 0x78, /* 01111000 */
733 | 0x68, /* 01101000 */
734 | 0x60, /* 01100000 */
735 | 0xf0, /* 11110000 */
736 | 0x00, /* 00000000 */
737 |
738 | /* 71 0x47 'G' */
739 | 0x3c, /* 00111100 */
740 | 0x66, /* 01100110 */
741 | 0xc0, /* 11000000 */
742 | 0xc0, /* 11000000 */
743 | 0xce, /* 11001110 */
744 | 0x66, /* 01100110 */
745 | 0x3a, /* 00111010 */
746 | 0x00, /* 00000000 */
747 |
748 | /* 72 0x48 'H' */
749 | 0xc6, /* 11000110 */
750 | 0xc6, /* 11000110 */
751 | 0xc6, /* 11000110 */
752 | 0xfe, /* 11111110 */
753 | 0xc6, /* 11000110 */
754 | 0xc6, /* 11000110 */
755 | 0xc6, /* 11000110 */
756 | 0x00, /* 00000000 */
757 |
758 | /* 73 0x49 'I' */
759 | 0x3c, /* 00111100 */
760 | 0x18, /* 00011000 */
761 | 0x18, /* 00011000 */
762 | 0x18, /* 00011000 */
763 | 0x18, /* 00011000 */
764 | 0x18, /* 00011000 */
765 | 0x3c, /* 00111100 */
766 | 0x00, /* 00000000 */
767 |
768 | /* 74 0x4a 'J' */
769 | 0x1e, /* 00011110 */
770 | 0x0c, /* 00001100 */
771 | 0x0c, /* 00001100 */
772 | 0x0c, /* 00001100 */
773 | 0xcc, /* 11001100 */
774 | 0xcc, /* 11001100 */
775 | 0x78, /* 01111000 */
776 | 0x00, /* 00000000 */
777 |
778 | /* 75 0x4b 'K' */
779 | 0xe6, /* 11100110 */
780 | 0x66, /* 01100110 */
781 | 0x6c, /* 01101100 */
782 | 0x78, /* 01111000 */
783 | 0x6c, /* 01101100 */
784 | 0x66, /* 01100110 */
785 | 0xe6, /* 11100110 */
786 | 0x00, /* 00000000 */
787 |
788 | /* 76 0x4c 'L' */
789 | 0xf0, /* 11110000 */
790 | 0x60, /* 01100000 */
791 | 0x60, /* 01100000 */
792 | 0x60, /* 01100000 */
793 | 0x62, /* 01100010 */
794 | 0x66, /* 01100110 */
795 | 0xfe, /* 11111110 */
796 | 0x00, /* 00000000 */
797 |
798 | /* 77 0x4d 'M' */
799 | 0xc6, /* 11000110 */
800 | 0xee, /* 11101110 */
801 | 0xfe, /* 11111110 */
802 | 0xfe, /* 11111110 */
803 | 0xd6, /* 11010110 */
804 | 0xc6, /* 11000110 */
805 | 0xc6, /* 11000110 */
806 | 0x00, /* 00000000 */
807 |
808 | /* 78 0x4e 'N' */
809 | 0xc6, /* 11000110 */
810 | 0xe6, /* 11100110 */
811 | 0xf6, /* 11110110 */
812 | 0xde, /* 11011110 */
813 | 0xce, /* 11001110 */
814 | 0xc6, /* 11000110 */
815 | 0xc6, /* 11000110 */
816 | 0x00, /* 00000000 */
817 |
818 | /* 79 0x4f 'O' */
819 | 0x7c, /* 01111100 */
820 | 0xc6, /* 11000110 */
821 | 0xc6, /* 11000110 */
822 | 0xc6, /* 11000110 */
823 | 0xc6, /* 11000110 */
824 | 0xc6, /* 11000110 */
825 | 0x7c, /* 01111100 */
826 | 0x00, /* 00000000 */
827 |
828 | /* 80 0x50 'P' */
829 | 0xfc, /* 11111100 */
830 | 0x66, /* 01100110 */
831 | 0x66, /* 01100110 */
832 | 0x7c, /* 01111100 */
833 | 0x60, /* 01100000 */
834 | 0x60, /* 01100000 */
835 | 0xf0, /* 11110000 */
836 | 0x00, /* 00000000 */
837 |
838 | /* 81 0x51 'Q' */
839 | 0x7c, /* 01111100 */
840 | 0xc6, /* 11000110 */
841 | 0xc6, /* 11000110 */
842 | 0xc6, /* 11000110 */
843 | 0xc6, /* 11000110 */
844 | 0xce, /* 11001110 */
845 | 0x7c, /* 01111100 */
846 | 0x0e, /* 00001110 */
847 |
848 | /* 82 0x52 'R' */
849 | 0xfc, /* 11111100 */
850 | 0x66, /* 01100110 */
851 | 0x66, /* 01100110 */
852 | 0x7c, /* 01111100 */
853 | 0x6c, /* 01101100 */
854 | 0x66, /* 01100110 */
855 | 0xe6, /* 11100110 */
856 | 0x00, /* 00000000 */
857 |
858 | /* 83 0x53 'S' */
859 | 0x3c, /* 00111100 */
860 | 0x66, /* 01100110 */
861 | 0x30, /* 00110000 */
862 | 0x18, /* 00011000 */
863 | 0x0c, /* 00001100 */
864 | 0x66, /* 01100110 */
865 | 0x3c, /* 00111100 */
866 | 0x00, /* 00000000 */
867 |
868 | /* 84 0x54 'T' */
869 | 0x7e, /* 01111110 */
870 | 0x7e, /* 01111110 */
871 | 0x5a, /* 01011010 */
872 | 0x18, /* 00011000 */
873 | 0x18, /* 00011000 */
874 | 0x18, /* 00011000 */
875 | 0x3c, /* 00111100 */
876 | 0x00, /* 00000000 */
877 |
878 | /* 85 0x55 'U' */
879 | 0xc6, /* 11000110 */
880 | 0xc6, /* 11000110 */
881 | 0xc6, /* 11000110 */
882 | 0xc6, /* 11000110 */
883 | 0xc6, /* 11000110 */
884 | 0xc6, /* 11000110 */
885 | 0x7c, /* 01111100 */
886 | 0x00, /* 00000000 */
887 |
888 | /* 86 0x56 'V' */
889 | 0xc6, /* 11000110 */
890 | 0xc6, /* 11000110 */
891 | 0xc6, /* 11000110 */
892 | 0xc6, /* 11000110 */
893 | 0xc6, /* 11000110 */
894 | 0x6c, /* 01101100 */
895 | 0x38, /* 00111000 */
896 | 0x00, /* 00000000 */
897 |
898 | /* 87 0x57 'W' */
899 | 0xc6, /* 11000110 */
900 | 0xc6, /* 11000110 */
901 | 0xc6, /* 11000110 */
902 | 0xd6, /* 11010110 */
903 | 0xd6, /* 11010110 */
904 | 0xfe, /* 11111110 */
905 | 0x6c, /* 01101100 */
906 | 0x00, /* 00000000 */
907 |
908 | /* 88 0x58 'X' */
909 | 0xc6, /* 11000110 */
910 | 0xc6, /* 11000110 */
911 | 0x6c, /* 01101100 */
912 | 0x38, /* 00111000 */
913 | 0x6c, /* 01101100 */
914 | 0xc6, /* 11000110 */
915 | 0xc6, /* 11000110 */
916 | 0x00, /* 00000000 */
917 |
918 | /* 89 0x59 'Y' */
919 | 0x66, /* 01100110 */
920 | 0x66, /* 01100110 */
921 | 0x66, /* 01100110 */
922 | 0x3c, /* 00111100 */
923 | 0x18, /* 00011000 */
924 | 0x18, /* 00011000 */
925 | 0x3c, /* 00111100 */
926 | 0x00, /* 00000000 */
927 |
928 | /* 90 0x5a 'Z' */
929 | 0xfe, /* 11111110 */
930 | 0xc6, /* 11000110 */
931 | 0x8c, /* 10001100 */
932 | 0x18, /* 00011000 */
933 | 0x32, /* 00110010 */
934 | 0x66, /* 01100110 */
935 | 0xfe, /* 11111110 */
936 | 0x00, /* 00000000 */
937 |
938 | /* 91 0x5b '[' */
939 | 0x3c, /* 00111100 */
940 | 0x30, /* 00110000 */
941 | 0x30, /* 00110000 */
942 | 0x30, /* 00110000 */
943 | 0x30, /* 00110000 */
944 | 0x30, /* 00110000 */
945 | 0x3c, /* 00111100 */
946 | 0x00, /* 00000000 */
947 |
948 | /* 92 0x5c '\' */
949 | 0xc0, /* 11000000 */
950 | 0x60, /* 01100000 */
951 | 0x30, /* 00110000 */
952 | 0x18, /* 00011000 */
953 | 0x0c, /* 00001100 */
954 | 0x06, /* 00000110 */
955 | 0x02, /* 00000010 */
956 | 0x00, /* 00000000 */
957 |
958 | /* 93 0x5d ']' */
959 | 0x3c, /* 00111100 */
960 | 0x0c, /* 00001100 */
961 | 0x0c, /* 00001100 */
962 | 0x0c, /* 00001100 */
963 | 0x0c, /* 00001100 */
964 | 0x0c, /* 00001100 */
965 | 0x3c, /* 00111100 */
966 | 0x00, /* 00000000 */
967 |
968 | /* 94 0x5e '^' */
969 | 0x10, /* 00010000 */
970 | 0x38, /* 00111000 */
971 | 0x6c, /* 01101100 */
972 | 0xc6, /* 11000110 */
973 | 0x00, /* 00000000 */
974 | 0x00, /* 00000000 */
975 | 0x00, /* 00000000 */
976 | 0x00, /* 00000000 */
977 |
978 | /* 95 0x5f '_' */
979 | 0x00, /* 00000000 */
980 | 0x00, /* 00000000 */
981 | 0x00, /* 00000000 */
982 | 0x00, /* 00000000 */
983 | 0x00, /* 00000000 */
984 | 0x00, /* 00000000 */
985 | 0x00, /* 00000000 */
986 | 0xff, /* 11111111 */
987 |
988 | /* 96 0x60 '`' */
989 | 0x30, /* 00110000 */
990 | 0x18, /* 00011000 */
991 | 0x0c, /* 00001100 */
992 | 0x00, /* 00000000 */
993 | 0x00, /* 00000000 */
994 | 0x00, /* 00000000 */
995 | 0x00, /* 00000000 */
996 | 0x00, /* 00000000 */
997 |
998 | /* 97 0x61 'a' */
999 | 0x00, /* 00000000 */
1000 | 0x00, /* 00000000 */
1001 | 0x78, /* 01111000 */
1002 | 0x0c, /* 00001100 */
1003 | 0x7c, /* 01111100 */
1004 | 0xcc, /* 11001100 */
1005 | 0x76, /* 01110110 */
1006 | 0x00, /* 00000000 */
1007 |
1008 | /* 98 0x62 'b' */
1009 | 0xe0, /* 11100000 */
1010 | 0x60, /* 01100000 */
1011 | 0x7c, /* 01111100 */
1012 | 0x66, /* 01100110 */
1013 | 0x66, /* 01100110 */
1014 | 0x66, /* 01100110 */
1015 | 0xdc, /* 11011100 */
1016 | 0x00, /* 00000000 */
1017 |
1018 | /* 99 0x63 'c' */
1019 | 0x00, /* 00000000 */
1020 | 0x00, /* 00000000 */
1021 | 0x7c, /* 01111100 */
1022 | 0xc6, /* 11000110 */
1023 | 0xc0, /* 11000000 */
1024 | 0xc6, /* 11000110 */
1025 | 0x7c, /* 01111100 */
1026 | 0x00, /* 00000000 */
1027 |
1028 | /* 100 0x64 'd' */
1029 | 0x1c, /* 00011100 */
1030 | 0x0c, /* 00001100 */
1031 | 0x7c, /* 01111100 */
1032 | 0xcc, /* 11001100 */
1033 | 0xcc, /* 11001100 */
1034 | 0xcc, /* 11001100 */
1035 | 0x76, /* 01110110 */
1036 | 0x00, /* 00000000 */
1037 |
1038 | /* 101 0x65 'e' */
1039 | 0x00, /* 00000000 */
1040 | 0x00, /* 00000000 */
1041 | 0x7c, /* 01111100 */
1042 | 0xc6, /* 11000110 */
1043 | 0xfe, /* 11111110 */
1044 | 0xc0, /* 11000000 */
1045 | 0x7c, /* 01111100 */
1046 | 0x00, /* 00000000 */
1047 |
1048 | /* 102 0x66 'f' */
1049 | 0x3c, /* 00111100 */
1050 | 0x66, /* 01100110 */
1051 | 0x60, /* 01100000 */
1052 | 0xf8, /* 11111000 */
1053 | 0x60, /* 01100000 */
1054 | 0x60, /* 01100000 */
1055 | 0xf0, /* 11110000 */
1056 | 0x00, /* 00000000 */
1057 |
1058 | /* 103 0x67 'g' */
1059 | 0x00, /* 00000000 */
1060 | 0x00, /* 00000000 */
1061 | 0x76, /* 01110110 */
1062 | 0xcc, /* 11001100 */
1063 | 0xcc, /* 11001100 */
1064 | 0x7c, /* 01111100 */
1065 | 0x0c, /* 00001100 */
1066 | 0xf8, /* 11111000 */
1067 |
1068 | /* 104 0x68 'h' */
1069 | 0xe0, /* 11100000 */
1070 | 0x60, /* 01100000 */
1071 | 0x6c, /* 01101100 */
1072 | 0x76, /* 01110110 */
1073 | 0x66, /* 01100110 */
1074 | 0x66, /* 01100110 */
1075 | 0xe6, /* 11100110 */
1076 | 0x00, /* 00000000 */
1077 |
1078 | /* 105 0x69 'i' */
1079 | 0x18, /* 00011000 */
1080 | 0x00, /* 00000000 */
1081 | 0x38, /* 00111000 */
1082 | 0x18, /* 00011000 */
1083 | 0x18, /* 00011000 */
1084 | 0x18, /* 00011000 */
1085 | 0x3c, /* 00111100 */
1086 | 0x00, /* 00000000 */
1087 |
1088 | /* 106 0x6a 'j' */
1089 | 0x06, /* 00000110 */
1090 | 0x00, /* 00000000 */
1091 | 0x06, /* 00000110 */
1092 | 0x06, /* 00000110 */
1093 | 0x06, /* 00000110 */
1094 | 0x66, /* 01100110 */
1095 | 0x66, /* 01100110 */
1096 | 0x3c, /* 00111100 */
1097 |
1098 | /* 107 0x6b 'k' */
1099 | 0xe0, /* 11100000 */
1100 | 0x60, /* 01100000 */
1101 | 0x66, /* 01100110 */
1102 | 0x6c, /* 01101100 */
1103 | 0x78, /* 01111000 */
1104 | 0x6c, /* 01101100 */
1105 | 0xe6, /* 11100110 */
1106 | 0x00, /* 00000000 */
1107 |
1108 | /* 108 0x6c 'l' */
1109 | 0x38, /* 00111000 */
1110 | 0x18, /* 00011000 */
1111 | 0x18, /* 00011000 */
1112 | 0x18, /* 00011000 */
1113 | 0x18, /* 00011000 */
1114 | 0x18, /* 00011000 */
1115 | 0x3c, /* 00111100 */
1116 | 0x00, /* 00000000 */
1117 |
1118 | /* 109 0x6d 'm' */
1119 | 0x00, /* 00000000 */
1120 | 0x00, /* 00000000 */
1121 | 0xec, /* 11101100 */
1122 | 0xfe, /* 11111110 */
1123 | 0xd6, /* 11010110 */
1124 | 0xd6, /* 11010110 */
1125 | 0xd6, /* 11010110 */
1126 | 0x00, /* 00000000 */
1127 |
1128 | /* 110 0x6e 'n' */
1129 | 0x00, /* 00000000 */
1130 | 0x00, /* 00000000 */
1131 | 0xdc, /* 11011100 */
1132 | 0x66, /* 01100110 */
1133 | 0x66, /* 01100110 */
1134 | 0x66, /* 01100110 */
1135 | 0x66, /* 01100110 */
1136 | 0x00, /* 00000000 */
1137 |
1138 | /* 111 0x6f 'o' */
1139 | 0x00, /* 00000000 */
1140 | 0x00, /* 00000000 */
1141 | 0x7c, /* 01111100 */
1142 | 0xc6, /* 11000110 */
1143 | 0xc6, /* 11000110 */
1144 | 0xc6, /* 11000110 */
1145 | 0x7c, /* 01111100 */
1146 | 0x00, /* 00000000 */
1147 |
1148 | /* 112 0x70 'p' */
1149 | 0x00, /* 00000000 */
1150 | 0x00, /* 00000000 */
1151 | 0xdc, /* 11011100 */
1152 | 0x66, /* 01100110 */
1153 | 0x66, /* 01100110 */
1154 | 0x7c, /* 01111100 */
1155 | 0x60, /* 01100000 */
1156 | 0xf0, /* 11110000 */
1157 |
1158 | /* 113 0x71 'q' */
1159 | 0x00, /* 00000000 */
1160 | 0x00, /* 00000000 */
1161 | 0x76, /* 01110110 */
1162 | 0xcc, /* 11001100 */
1163 | 0xcc, /* 11001100 */
1164 | 0x7c, /* 01111100 */
1165 | 0x0c, /* 00001100 */
1166 | 0x1e, /* 00011110 */
1167 |
1168 | /* 114 0x72 'r' */
1169 | 0x00, /* 00000000 */
1170 | 0x00, /* 00000000 */
1171 | 0xdc, /* 11011100 */
1172 | 0x76, /* 01110110 */
1173 | 0x60, /* 01100000 */
1174 | 0x60, /* 01100000 */
1175 | 0xf0, /* 11110000 */
1176 | 0x00, /* 00000000 */
1177 |
1178 | /* 115 0x73 's' */
1179 | 0x00, /* 00000000 */
1180 | 0x00, /* 00000000 */
1181 | 0x7e, /* 01111110 */
1182 | 0xc0, /* 11000000 */
1183 | 0x7c, /* 01111100 */
1184 | 0x06, /* 00000110 */
1185 | 0xfc, /* 11111100 */
1186 | 0x00, /* 00000000 */
1187 |
1188 | /* 116 0x74 't' */
1189 | 0x30, /* 00110000 */
1190 | 0x30, /* 00110000 */
1191 | 0xfc, /* 11111100 */
1192 | 0x30, /* 00110000 */
1193 | 0x30, /* 00110000 */
1194 | 0x36, /* 00110110 */
1195 | 0x1c, /* 00011100 */
1196 | 0x00, /* 00000000 */
1197 |
1198 | /* 117 0x75 'u' */
1199 | 0x00, /* 00000000 */
1200 | 0x00, /* 00000000 */
1201 | 0xcc, /* 11001100 */
1202 | 0xcc, /* 11001100 */
1203 | 0xcc, /* 11001100 */
1204 | 0xcc, /* 11001100 */
1205 | 0x76, /* 01110110 */
1206 | 0x00, /* 00000000 */
1207 |
1208 | /* 118 0x76 'v' */
1209 | 0x00, /* 00000000 */
1210 | 0x00, /* 00000000 */
1211 | 0xc6, /* 11000110 */
1212 | 0xc6, /* 11000110 */
1213 | 0xc6, /* 11000110 */
1214 | 0x6c, /* 01101100 */
1215 | 0x38, /* 00111000 */
1216 | 0x00, /* 00000000 */
1217 |
1218 | /* 119 0x77 'w' */
1219 | 0x00, /* 00000000 */
1220 | 0x00, /* 00000000 */
1221 | 0xc6, /* 11000110 */
1222 | 0xd6, /* 11010110 */
1223 | 0xd6, /* 11010110 */
1224 | 0xfe, /* 11111110 */
1225 | 0x6c, /* 01101100 */
1226 | 0x00, /* 00000000 */
1227 |
1228 | /* 120 0x78 'x' */
1229 | 0x00, /* 00000000 */
1230 | 0x00, /* 00000000 */
1231 | 0xc6, /* 11000110 */
1232 | 0x6c, /* 01101100 */
1233 | 0x38, /* 00111000 */
1234 | 0x6c, /* 01101100 */
1235 | 0xc6, /* 11000110 */
1236 | 0x00, /* 00000000 */
1237 |
1238 | /* 121 0x79 'y' */
1239 | 0x00, /* 00000000 */
1240 | 0x00, /* 00000000 */
1241 | 0xc6, /* 11000110 */
1242 | 0xc6, /* 11000110 */
1243 | 0xc6, /* 11000110 */
1244 | 0x7e, /* 01111110 */
1245 | 0x06, /* 00000110 */
1246 | 0xfc, /* 11111100 */
1247 |
1248 | /* 122 0x7a 'z' */
1249 | 0x00, /* 00000000 */
1250 | 0x00, /* 00000000 */
1251 | 0x7e, /* 01111110 */
1252 | 0x4c, /* 01001100 */
1253 | 0x18, /* 00011000 */
1254 | 0x32, /* 00110010 */
1255 | 0x7e, /* 01111110 */
1256 | 0x00, /* 00000000 */
1257 |
1258 | /* 123 0x7b '{' */
1259 | 0x0e, /* 00001110 */
1260 | 0x18, /* 00011000 */
1261 | 0x18, /* 00011000 */
1262 | 0x70, /* 01110000 */
1263 | 0x18, /* 00011000 */
1264 | 0x18, /* 00011000 */
1265 | 0x0e, /* 00001110 */
1266 | 0x00, /* 00000000 */
1267 |
1268 | /* 124 0x7c '|' */
1269 | 0x18, /* 00011000 */
1270 | 0x18, /* 00011000 */
1271 | 0x18, /* 00011000 */
1272 | 0x18, /* 00011000 */
1273 | 0x18, /* 00011000 */
1274 | 0x18, /* 00011000 */
1275 | 0x18, /* 00011000 */
1276 | 0x00, /* 00000000 */
1277 |
1278 | /* 125 0x7d '}' */
1279 | 0x70, /* 01110000 */
1280 | 0x18, /* 00011000 */
1281 | 0x18, /* 00011000 */
1282 | 0x0e, /* 00001110 */
1283 | 0x18, /* 00011000 */
1284 | 0x18, /* 00011000 */
1285 | 0x70, /* 01110000 */
1286 | 0x00, /* 00000000 */
1287 |
1288 | /* 126 0x7e '~' */
1289 | 0x76, /* 01110110 */
1290 | 0xdc, /* 11011100 */
1291 | 0x00, /* 00000000 */
1292 | 0x00, /* 00000000 */
1293 | 0x00, /* 00000000 */
1294 | 0x00, /* 00000000 */
1295 | 0x00, /* 00000000 */
1296 | 0x00, /* 00000000 */
1297 |
1298 | /* 127 0x7f '' */
1299 | 0x00, /* 00000000 */
1300 | 0x10, /* 00010000 */
1301 | 0x38, /* 00111000 */
1302 | 0x6c, /* 01101100 */
1303 | 0xc6, /* 11000110 */
1304 | 0xc6, /* 11000110 */
1305 | 0xfe, /* 11111110 */
1306 | 0x00, /* 00000000 */
1307 |
1308 | /* 128 0x80 '�' */
1309 | 0x7c, /* 01111100 */
1310 | 0xc6, /* 11000110 */
1311 | 0xc0, /* 11000000 */
1312 | 0xc0, /* 11000000 */
1313 | 0xc6, /* 11000110 */
1314 | 0x7c, /* 01111100 */
1315 | 0x0c, /* 00001100 */
1316 | 0x78, /* 01111000 */
1317 |
1318 | /* 129 0x81 '�' */
1319 | 0xcc, /* 11001100 */
1320 | 0x00, /* 00000000 */
1321 | 0xcc, /* 11001100 */
1322 | 0xcc, /* 11001100 */
1323 | 0xcc, /* 11001100 */
1324 | 0xcc, /* 11001100 */
1325 | 0x76, /* 01110110 */
1326 | 0x00, /* 00000000 */
1327 |
1328 | /* 130 0x82 '�' */
1329 | 0x0c, /* 00001100 */
1330 | 0x18, /* 00011000 */
1331 | 0x7c, /* 01111100 */
1332 | 0xc6, /* 11000110 */
1333 | 0xfe, /* 11111110 */
1334 | 0xc0, /* 11000000 */
1335 | 0x7c, /* 01111100 */
1336 | 0x00, /* 00000000 */
1337 |
1338 | /* 131 0x83 '�' */
1339 | 0x7c, /* 01111100 */
1340 | 0x82, /* 10000010 */
1341 | 0x78, /* 01111000 */
1342 | 0x0c, /* 00001100 */
1343 | 0x7c, /* 01111100 */
1344 | 0xcc, /* 11001100 */
1345 | 0x76, /* 01110110 */
1346 | 0x00, /* 00000000 */
1347 |
1348 | /* 132 0x84 '�' */
1349 | 0xc6, /* 11000110 */
1350 | 0x00, /* 00000000 */
1351 | 0x78, /* 01111000 */
1352 | 0x0c, /* 00001100 */
1353 | 0x7c, /* 01111100 */
1354 | 0xcc, /* 11001100 */
1355 | 0x76, /* 01110110 */
1356 | 0x00, /* 00000000 */
1357 |
1358 | /* 133 0x85 '�' */
1359 | 0x30, /* 00110000 */
1360 | 0x18, /* 00011000 */
1361 | 0x78, /* 01111000 */
1362 | 0x0c, /* 00001100 */
1363 | 0x7c, /* 01111100 */
1364 | 0xcc, /* 11001100 */
1365 | 0x76, /* 01110110 */
1366 | 0x00, /* 00000000 */
1367 |
1368 | /* 134 0x86 '�' */
1369 | 0x30, /* 00110000 */
1370 | 0x30, /* 00110000 */
1371 | 0x78, /* 01111000 */
1372 | 0x0c, /* 00001100 */
1373 | 0x7c, /* 01111100 */
1374 | 0xcc, /* 11001100 */
1375 | 0x76, /* 01110110 */
1376 | 0x00, /* 00000000 */
1377 |
1378 | /* 135 0x87 '�' */
1379 | 0x00, /* 00000000 */
1380 | 0x00, /* 00000000 */
1381 | 0x7e, /* 01111110 */
1382 | 0xc0, /* 11000000 */
1383 | 0xc0, /* 11000000 */
1384 | 0x7e, /* 01111110 */
1385 | 0x0c, /* 00001100 */
1386 | 0x38, /* 00111000 */
1387 |
1388 | /* 136 0x88 '�' */
1389 | 0x7c, /* 01111100 */
1390 | 0x82, /* 10000010 */
1391 | 0x7c, /* 01111100 */
1392 | 0xc6, /* 11000110 */
1393 | 0xfe, /* 11111110 */
1394 | 0xc0, /* 11000000 */
1395 | 0x7c, /* 01111100 */
1396 | 0x00, /* 00000000 */
1397 |
1398 | /* 137 0x89 '�' */
1399 | 0xc6, /* 11000110 */
1400 | 0x00, /* 00000000 */
1401 | 0x7c, /* 01111100 */
1402 | 0xc6, /* 11000110 */
1403 | 0xfe, /* 11111110 */
1404 | 0xc0, /* 11000000 */
1405 | 0x7c, /* 01111100 */
1406 | 0x00, /* 00000000 */
1407 |
1408 | /* 138 0x8a '�' */
1409 | 0x30, /* 00110000 */
1410 | 0x18, /* 00011000 */
1411 | 0x7c, /* 01111100 */
1412 | 0xc6, /* 11000110 */
1413 | 0xfe, /* 11111110 */
1414 | 0xc0, /* 11000000 */
1415 | 0x7c, /* 01111100 */
1416 | 0x00, /* 00000000 */
1417 |
1418 | /* 139 0x8b '�' */
1419 | 0x66, /* 01100110 */
1420 | 0x00, /* 00000000 */
1421 | 0x38, /* 00111000 */
1422 | 0x18, /* 00011000 */
1423 | 0x18, /* 00011000 */
1424 | 0x18, /* 00011000 */
1425 | 0x3c, /* 00111100 */
1426 | 0x00, /* 00000000 */
1427 |
1428 | /* 140 0x8c '�' */
1429 | 0x7c, /* 01111100 */
1430 | 0x82, /* 10000010 */
1431 | 0x38, /* 00111000 */
1432 | 0x18, /* 00011000 */
1433 | 0x18, /* 00011000 */
1434 | 0x18, /* 00011000 */
1435 | 0x3c, /* 00111100 */
1436 | 0x00, /* 00000000 */
1437 |
1438 | /* 141 0x8d '�' */
1439 | 0x30, /* 00110000 */
1440 | 0x18, /* 00011000 */
1441 | 0x00, /* 00000000 */
1442 | 0x38, /* 00111000 */
1443 | 0x18, /* 00011000 */
1444 | 0x18, /* 00011000 */
1445 | 0x3c, /* 00111100 */
1446 | 0x00, /* 00000000 */
1447 |
1448 | /* 142 0x8e '�' */
1449 | 0xc6, /* 11000110 */
1450 | 0x38, /* 00111000 */
1451 | 0x6c, /* 01101100 */
1452 | 0xc6, /* 11000110 */
1453 | 0xfe, /* 11111110 */
1454 | 0xc6, /* 11000110 */
1455 | 0xc6, /* 11000110 */
1456 | 0x00, /* 00000000 */
1457 |
1458 | /* 143 0x8f '�' */
1459 | 0x38, /* 00111000 */
1460 | 0x6c, /* 01101100 */
1461 | 0x7c, /* 01111100 */
1462 | 0xc6, /* 11000110 */
1463 | 0xfe, /* 11111110 */
1464 | 0xc6, /* 11000110 */
1465 | 0xc6, /* 11000110 */
1466 | 0x00, /* 00000000 */
1467 |
1468 | /* 144 0x90 '�' */
1469 | 0x18, /* 00011000 */
1470 | 0x30, /* 00110000 */
1471 | 0xfe, /* 11111110 */
1472 | 0xc0, /* 11000000 */
1473 | 0xf8, /* 11111000 */
1474 | 0xc0, /* 11000000 */
1475 | 0xfe, /* 11111110 */
1476 | 0x00, /* 00000000 */
1477 |
1478 | /* 145 0x91 '�' */
1479 | 0x00, /* 00000000 */
1480 | 0x00, /* 00000000 */
1481 | 0x7e, /* 01111110 */
1482 | 0x18, /* 00011000 */
1483 | 0x7e, /* 01111110 */
1484 | 0xd8, /* 11011000 */
1485 | 0x7e, /* 01111110 */
1486 | 0x00, /* 00000000 */
1487 |
1488 | /* 146 0x92 '�' */
1489 | 0x3e, /* 00111110 */
1490 | 0x6c, /* 01101100 */
1491 | 0xcc, /* 11001100 */
1492 | 0xfe, /* 11111110 */
1493 | 0xcc, /* 11001100 */
1494 | 0xcc, /* 11001100 */
1495 | 0xce, /* 11001110 */
1496 | 0x00, /* 00000000 */
1497 |
1498 | /* 147 0x93 '�' */
1499 | 0x7c, /* 01111100 */
1500 | 0x82, /* 10000010 */
1501 | 0x7c, /* 01111100 */
1502 | 0xc6, /* 11000110 */
1503 | 0xc6, /* 11000110 */
1504 | 0xc6, /* 11000110 */
1505 | 0x7c, /* 01111100 */
1506 | 0x00, /* 00000000 */
1507 |
1508 | /* 148 0x94 '�' */
1509 | 0xc6, /* 11000110 */
1510 | 0x00, /* 00000000 */
1511 | 0x7c, /* 01111100 */
1512 | 0xc6, /* 11000110 */
1513 | 0xc6, /* 11000110 */
1514 | 0xc6, /* 11000110 */
1515 | 0x7c, /* 01111100 */
1516 | 0x00, /* 00000000 */
1517 |
1518 | /* 149 0x95 '�' */
1519 | 0x30, /* 00110000 */
1520 | 0x18, /* 00011000 */
1521 | 0x7c, /* 01111100 */
1522 | 0xc6, /* 11000110 */
1523 | 0xc6, /* 11000110 */
1524 | 0xc6, /* 11000110 */
1525 | 0x7c, /* 01111100 */
1526 | 0x00, /* 00000000 */
1527 |
1528 | /* 150 0x96 '�' */
1529 | 0x78, /* 01111000 */
1530 | 0x84, /* 10000100 */
1531 | 0x00, /* 00000000 */
1532 | 0xcc, /* 11001100 */
1533 | 0xcc, /* 11001100 */
1534 | 0xcc, /* 11001100 */
1535 | 0x76, /* 01110110 */
1536 | 0x00, /* 00000000 */
1537 |
1538 | /* 151 0x97 '�' */
1539 | 0x60, /* 01100000 */
1540 | 0x30, /* 00110000 */
1541 | 0xcc, /* 11001100 */
1542 | 0xcc, /* 11001100 */
1543 | 0xcc, /* 11001100 */
1544 | 0xcc, /* 11001100 */
1545 | 0x76, /* 01110110 */
1546 | 0x00, /* 00000000 */
1547 |
1548 | /* 152 0x98 '�' */
1549 | 0xc6, /* 11000110 */
1550 | 0x00, /* 00000000 */
1551 | 0xc6, /* 11000110 */
1552 | 0xc6, /* 11000110 */
1553 | 0xc6, /* 11000110 */
1554 | 0x7e, /* 01111110 */
1555 | 0x06, /* 00000110 */
1556 | 0xfc, /* 11111100 */
1557 |
1558 | /* 153 0x99 '�' */
1559 | 0xc6, /* 11000110 */
1560 | 0x38, /* 00111000 */
1561 | 0x6c, /* 01101100 */
1562 | 0xc6, /* 11000110 */
1563 | 0xc6, /* 11000110 */
1564 | 0x6c, /* 01101100 */
1565 | 0x38, /* 00111000 */
1566 | 0x00, /* 00000000 */
1567 |
1568 | /* 154 0x9a '�' */
1569 | 0xc6, /* 11000110 */
1570 | 0x00, /* 00000000 */
1571 | 0xc6, /* 11000110 */
1572 | 0xc6, /* 11000110 */
1573 | 0xc6, /* 11000110 */
1574 | 0xc6, /* 11000110 */
1575 | 0x7c, /* 01111100 */
1576 | 0x00, /* 00000000 */
1577 |
1578 | /* 155 0x9b '�' */
1579 | 0x18, /* 00011000 */
1580 | 0x18, /* 00011000 */
1581 | 0x7e, /* 01111110 */
1582 | 0xc0, /* 11000000 */
1583 | 0xc0, /* 11000000 */
1584 | 0x7e, /* 01111110 */
1585 | 0x18, /* 00011000 */
1586 | 0x18, /* 00011000 */
1587 |
1588 | /* 156 0x9c '�' */
1589 | 0x38, /* 00111000 */
1590 | 0x6c, /* 01101100 */
1591 | 0x64, /* 01100100 */
1592 | 0xf0, /* 11110000 */
1593 | 0x60, /* 01100000 */
1594 | 0x66, /* 01100110 */
1595 | 0xfc, /* 11111100 */
1596 | 0x00, /* 00000000 */
1597 |
1598 | /* 157 0x9d '�' */
1599 | 0x66, /* 01100110 */
1600 | 0x66, /* 01100110 */
1601 | 0x3c, /* 00111100 */
1602 | 0x7e, /* 01111110 */
1603 | 0x18, /* 00011000 */
1604 | 0x7e, /* 01111110 */
1605 | 0x18, /* 00011000 */
1606 | 0x18, /* 00011000 */
1607 |
1608 | /* 158 0x9e '�' */
1609 | 0xf8, /* 11111000 */
1610 | 0xcc, /* 11001100 */
1611 | 0xcc, /* 11001100 */
1612 | 0xfa, /* 11111010 */
1613 | 0xc6, /* 11000110 */
1614 | 0xcf, /* 11001111 */
1615 | 0xc6, /* 11000110 */
1616 | 0xc7, /* 11000111 */
1617 |
1618 | /* 159 0x9f '�' */
1619 | 0x0e, /* 00001110 */
1620 | 0x1b, /* 00011011 */
1621 | 0x18, /* 00011000 */
1622 | 0x3c, /* 00111100 */
1623 | 0x18, /* 00011000 */
1624 | 0xd8, /* 11011000 */
1625 | 0x70, /* 01110000 */
1626 | 0x00, /* 00000000 */
1627 |
1628 | /* 160 0xa0 '�' */
1629 | 0x18, /* 00011000 */
1630 | 0x30, /* 00110000 */
1631 | 0x78, /* 01111000 */
1632 | 0x0c, /* 00001100 */
1633 | 0x7c, /* 01111100 */
1634 | 0xcc, /* 11001100 */
1635 | 0x76, /* 01110110 */
1636 | 0x00, /* 00000000 */
1637 |
1638 | /* 161 0xa1 '�' */
1639 | 0x0c, /* 00001100 */
1640 | 0x18, /* 00011000 */
1641 | 0x00, /* 00000000 */
1642 | 0x38, /* 00111000 */
1643 | 0x18, /* 00011000 */
1644 | 0x18, /* 00011000 */
1645 | 0x3c, /* 00111100 */
1646 | 0x00, /* 00000000 */
1647 |
1648 | /* 162 0xa2 '�' */
1649 | 0x0c, /* 00001100 */
1650 | 0x18, /* 00011000 */
1651 | 0x7c, /* 01111100 */
1652 | 0xc6, /* 11000110 */
1653 | 0xc6, /* 11000110 */
1654 | 0xc6, /* 11000110 */
1655 | 0x7c, /* 01111100 */
1656 | 0x00, /* 00000000 */
1657 |
1658 | /* 163 0xa3 '�' */
1659 | 0x18, /* 00011000 */
1660 | 0x30, /* 00110000 */
1661 | 0xcc, /* 11001100 */
1662 | 0xcc, /* 11001100 */
1663 | 0xcc, /* 11001100 */
1664 | 0xcc, /* 11001100 */
1665 | 0x76, /* 01110110 */
1666 | 0x00, /* 00000000 */
1667 |
1668 | /* 164 0xa4 '�' */
1669 | 0x76, /* 01110110 */
1670 | 0xdc, /* 11011100 */
1671 | 0x00, /* 00000000 */
1672 | 0xdc, /* 11011100 */
1673 | 0x66, /* 01100110 */
1674 | 0x66, /* 01100110 */
1675 | 0x66, /* 01100110 */
1676 | 0x00, /* 00000000 */
1677 |
1678 | /* 165 0xa5 '�' */
1679 | 0x76, /* 01110110 */
1680 | 0xdc, /* 11011100 */
1681 | 0x00, /* 00000000 */
1682 | 0xe6, /* 11100110 */
1683 | 0xf6, /* 11110110 */
1684 | 0xde, /* 11011110 */
1685 | 0xce, /* 11001110 */
1686 | 0x00, /* 00000000 */
1687 |
1688 | /* 166 0xa6 '�' */
1689 | 0x3c, /* 00111100 */
1690 | 0x6c, /* 01101100 */
1691 | 0x6c, /* 01101100 */
1692 | 0x3e, /* 00111110 */
1693 | 0x00, /* 00000000 */
1694 | 0x7e, /* 01111110 */
1695 | 0x00, /* 00000000 */
1696 | 0x00, /* 00000000 */
1697 |
1698 | /* 167 0xa7 '�' */
1699 | 0x38, /* 00111000 */
1700 | 0x6c, /* 01101100 */
1701 | 0x6c, /* 01101100 */
1702 | 0x38, /* 00111000 */
1703 | 0x00, /* 00000000 */
1704 | 0x7c, /* 01111100 */
1705 | 0x00, /* 00000000 */
1706 | 0x00, /* 00000000 */
1707 |
1708 | /* 168 0xa8 '�' */
1709 | 0x18, /* 00011000 */
1710 | 0x00, /* 00000000 */
1711 | 0x18, /* 00011000 */
1712 | 0x18, /* 00011000 */
1713 | 0x30, /* 00110000 */
1714 | 0x63, /* 01100011 */
1715 | 0x3e, /* 00111110 */
1716 | 0x00, /* 00000000 */
1717 |
1718 | /* 169 0xa9 '�' */
1719 | 0x00, /* 00000000 */
1720 | 0x00, /* 00000000 */
1721 | 0x00, /* 00000000 */
1722 | 0xfe, /* 11111110 */
1723 | 0xc0, /* 11000000 */
1724 | 0xc0, /* 11000000 */
1725 | 0x00, /* 00000000 */
1726 | 0x00, /* 00000000 */
1727 |
1728 | /* 170 0xaa '�' */
1729 | 0x00, /* 00000000 */
1730 | 0x00, /* 00000000 */
1731 | 0x00, /* 00000000 */
1732 | 0xfe, /* 11111110 */
1733 | 0x06, /* 00000110 */
1734 | 0x06, /* 00000110 */
1735 | 0x00, /* 00000000 */
1736 | 0x00, /* 00000000 */
1737 |
1738 | /* 171 0xab '�' */
1739 | 0x63, /* 01100011 */
1740 | 0xe6, /* 11100110 */
1741 | 0x6c, /* 01101100 */
1742 | 0x7e, /* 01111110 */
1743 | 0x33, /* 00110011 */
1744 | 0x66, /* 01100110 */
1745 | 0xcc, /* 11001100 */
1746 | 0x0f, /* 00001111 */
1747 |
1748 | /* 172 0xac '�' */
1749 | 0x63, /* 01100011 */
1750 | 0xe6, /* 11100110 */
1751 | 0x6c, /* 01101100 */
1752 | 0x7a, /* 01111010 */
1753 | 0x36, /* 00110110 */
1754 | 0x6a, /* 01101010 */
1755 | 0xdf, /* 11011111 */
1756 | 0x06, /* 00000110 */
1757 |
1758 | /* 173 0xad '�' */
1759 | 0x18, /* 00011000 */
1760 | 0x00, /* 00000000 */
1761 | 0x18, /* 00011000 */
1762 | 0x18, /* 00011000 */
1763 | 0x3c, /* 00111100 */
1764 | 0x3c, /* 00111100 */
1765 | 0x18, /* 00011000 */
1766 | 0x00, /* 00000000 */
1767 |
1768 | /* 174 0xae '�' */
1769 | 0x00, /* 00000000 */
1770 | 0x33, /* 00110011 */
1771 | 0x66, /* 01100110 */
1772 | 0xcc, /* 11001100 */
1773 | 0x66, /* 01100110 */
1774 | 0x33, /* 00110011 */
1775 | 0x00, /* 00000000 */
1776 | 0x00, /* 00000000 */
1777 |
1778 | /* 175 0xaf '�' */
1779 | 0x00, /* 00000000 */
1780 | 0xcc, /* 11001100 */
1781 | 0x66, /* 01100110 */
1782 | 0x33, /* 00110011 */
1783 | 0x66, /* 01100110 */
1784 | 0xcc, /* 11001100 */
1785 | 0x00, /* 00000000 */
1786 | 0x00, /* 00000000 */
1787 |
1788 | /* 176 0xb0 '�' */
1789 | 0x22, /* 00100010 */
1790 | 0x88, /* 10001000 */
1791 | 0x22, /* 00100010 */
1792 | 0x88, /* 10001000 */
1793 | 0x22, /* 00100010 */
1794 | 0x88, /* 10001000 */
1795 | 0x22, /* 00100010 */
1796 | 0x88, /* 10001000 */
1797 |
1798 | /* 177 0xb1 '�' */
1799 | 0x55, /* 01010101 */
1800 | 0xaa, /* 10101010 */
1801 | 0x55, /* 01010101 */
1802 | 0xaa, /* 10101010 */
1803 | 0x55, /* 01010101 */
1804 | 0xaa, /* 10101010 */
1805 | 0x55, /* 01010101 */
1806 | 0xaa, /* 10101010 */
1807 |
1808 | /* 178 0xb2 '�' */
1809 | 0x77, /* 01110111 */
1810 | 0xdd, /* 11011101 */
1811 | 0x77, /* 01110111 */
1812 | 0xdd, /* 11011101 */
1813 | 0x77, /* 01110111 */
1814 | 0xdd, /* 11011101 */
1815 | 0x77, /* 01110111 */
1816 | 0xdd, /* 11011101 */
1817 |
1818 | /* 179 0xb3 '�' */
1819 | 0x18, /* 00011000 */
1820 | 0x18, /* 00011000 */
1821 | 0x18, /* 00011000 */
1822 | 0x18, /* 00011000 */
1823 | 0x18, /* 00011000 */
1824 | 0x18, /* 00011000 */
1825 | 0x18, /* 00011000 */
1826 | 0x18, /* 00011000 */
1827 |
1828 | /* 180 0xb4 '�' */
1829 | 0x18, /* 00011000 */
1830 | 0x18, /* 00011000 */
1831 | 0x18, /* 00011000 */
1832 | 0x18, /* 00011000 */
1833 | 0xf8, /* 11111000 */
1834 | 0x18, /* 00011000 */
1835 | 0x18, /* 00011000 */
1836 | 0x18, /* 00011000 */
1837 |
1838 | /* 181 0xb5 '�' */
1839 | 0x18, /* 00011000 */
1840 | 0x18, /* 00011000 */
1841 | 0xf8, /* 11111000 */
1842 | 0x18, /* 00011000 */
1843 | 0xf8, /* 11111000 */
1844 | 0x18, /* 00011000 */
1845 | 0x18, /* 00011000 */
1846 | 0x18, /* 00011000 */
1847 |
1848 | /* 182 0xb6 '�' */
1849 | 0x36, /* 00110110 */
1850 | 0x36, /* 00110110 */
1851 | 0x36, /* 00110110 */
1852 | 0x36, /* 00110110 */
1853 | 0xf6, /* 11110110 */
1854 | 0x36, /* 00110110 */
1855 | 0x36, /* 00110110 */
1856 | 0x36, /* 00110110 */
1857 |
1858 | /* 183 0xb7 '�' */
1859 | 0x00, /* 00000000 */
1860 | 0x00, /* 00000000 */
1861 | 0x00, /* 00000000 */
1862 | 0x00, /* 00000000 */
1863 | 0xfe, /* 11111110 */
1864 | 0x36, /* 00110110 */
1865 | 0x36, /* 00110110 */
1866 | 0x36, /* 00110110 */
1867 |
1868 | /* 184 0xb8 '�' */
1869 | 0x00, /* 00000000 */
1870 | 0x00, /* 00000000 */
1871 | 0xf8, /* 11111000 */
1872 | 0x18, /* 00011000 */
1873 | 0xf8, /* 11111000 */
1874 | 0x18, /* 00011000 */
1875 | 0x18, /* 00011000 */
1876 | 0x18, /* 00011000 */
1877 |
1878 | /* 185 0xb9 '�' */
1879 | 0x36, /* 00110110 */
1880 | 0x36, /* 00110110 */
1881 | 0xf6, /* 11110110 */
1882 | 0x06, /* 00000110 */
1883 | 0xf6, /* 11110110 */
1884 | 0x36, /* 00110110 */
1885 | 0x36, /* 00110110 */
1886 | 0x36, /* 00110110 */
1887 |
1888 | /* 186 0xba '�' */
1889 | 0x36, /* 00110110 */
1890 | 0x36, /* 00110110 */
1891 | 0x36, /* 00110110 */
1892 | 0x36, /* 00110110 */
1893 | 0x36, /* 00110110 */
1894 | 0x36, /* 00110110 */
1895 | 0x36, /* 00110110 */
1896 | 0x36, /* 00110110 */
1897 |
1898 | /* 187 0xbb '�' */
1899 | 0x00, /* 00000000 */
1900 | 0x00, /* 00000000 */
1901 | 0xfe, /* 11111110 */
1902 | 0x06, /* 00000110 */
1903 | 0xf6, /* 11110110 */
1904 | 0x36, /* 00110110 */
1905 | 0x36, /* 00110110 */
1906 | 0x36, /* 00110110 */
1907 |
1908 | /* 188 0xbc '�' */
1909 | 0x36, /* 00110110 */
1910 | 0x36, /* 00110110 */
1911 | 0xf6, /* 11110110 */
1912 | 0x06, /* 00000110 */
1913 | 0xfe, /* 11111110 */
1914 | 0x00, /* 00000000 */
1915 | 0x00, /* 00000000 */
1916 | 0x00, /* 00000000 */
1917 |
1918 | /* 189 0xbd '�' */
1919 | 0x36, /* 00110110 */
1920 | 0x36, /* 00110110 */
1921 | 0x36, /* 00110110 */
1922 | 0x36, /* 00110110 */
1923 | 0xfe, /* 11111110 */
1924 | 0x00, /* 00000000 */
1925 | 0x00, /* 00000000 */
1926 | 0x00, /* 00000000 */
1927 |
1928 | /* 190 0xbe '�' */
1929 | 0x18, /* 00011000 */
1930 | 0x18, /* 00011000 */
1931 | 0xf8, /* 11111000 */
1932 | 0x18, /* 00011000 */
1933 | 0xf8, /* 11111000 */
1934 | 0x00, /* 00000000 */
1935 | 0x00, /* 00000000 */
1936 | 0x00, /* 00000000 */
1937 |
1938 | /* 191 0xbf '�' */
1939 | 0x00, /* 00000000 */
1940 | 0x00, /* 00000000 */
1941 | 0x00, /* 00000000 */
1942 | 0x00, /* 00000000 */
1943 | 0xf8, /* 11111000 */
1944 | 0x18, /* 00011000 */
1945 | 0x18, /* 00011000 */
1946 | 0x18, /* 00011000 */
1947 |
1948 | /* 192 0xc0 '�' */
1949 | 0x18, /* 00011000 */
1950 | 0x18, /* 00011000 */
1951 | 0x18, /* 00011000 */
1952 | 0x18, /* 00011000 */
1953 | 0x1f, /* 00011111 */
1954 | 0x00, /* 00000000 */
1955 | 0x00, /* 00000000 */
1956 | 0x00, /* 00000000 */
1957 |
1958 | /* 193 0xc1 '�' */
1959 | 0x18, /* 00011000 */
1960 | 0x18, /* 00011000 */
1961 | 0x18, /* 00011000 */
1962 | 0x18, /* 00011000 */
1963 | 0xff, /* 11111111 */
1964 | 0x00, /* 00000000 */
1965 | 0x00, /* 00000000 */
1966 | 0x00, /* 00000000 */
1967 |
1968 | /* 194 0xc2 '�' */
1969 | 0x00, /* 00000000 */
1970 | 0x00, /* 00000000 */
1971 | 0x00, /* 00000000 */
1972 | 0x00, /* 00000000 */
1973 | 0xff, /* 11111111 */
1974 | 0x18, /* 00011000 */
1975 | 0x18, /* 00011000 */
1976 | 0x18, /* 00011000 */
1977 |
1978 | /* 195 0xc3 '�' */
1979 | 0x18, /* 00011000 */
1980 | 0x18, /* 00011000 */
1981 | 0x18, /* 00011000 */
1982 | 0x18, /* 00011000 */
1983 | 0x1f, /* 00011111 */
1984 | 0x18, /* 00011000 */
1985 | 0x18, /* 00011000 */
1986 | 0x18, /* 00011000 */
1987 |
1988 | /* 196 0xc4 '�' */
1989 | 0x00, /* 00000000 */
1990 | 0x00, /* 00000000 */
1991 | 0x00, /* 00000000 */
1992 | 0x00, /* 00000000 */
1993 | 0xff, /* 11111111 */
1994 | 0x00, /* 00000000 */
1995 | 0x00, /* 00000000 */
1996 | 0x00, /* 00000000 */
1997 |
1998 | /* 197 0xc5 '�' */
1999 | 0x18, /* 00011000 */
2000 | 0x18, /* 00011000 */
2001 | 0x18, /* 00011000 */
2002 | 0x18, /* 00011000 */
2003 | 0xff, /* 11111111 */
2004 | 0x18, /* 00011000 */
2005 | 0x18, /* 00011000 */
2006 | 0x18, /* 00011000 */
2007 |
2008 | /* 198 0xc6 '�' */
2009 | 0x18, /* 00011000 */
2010 | 0x18, /* 00011000 */
2011 | 0x1f, /* 00011111 */
2012 | 0x18, /* 00011000 */
2013 | 0x1f, /* 00011111 */
2014 | 0x18, /* 00011000 */
2015 | 0x18, /* 00011000 */
2016 | 0x18, /* 00011000 */
2017 |
2018 | /* 199 0xc7 '�' */
2019 | 0x36, /* 00110110 */
2020 | 0x36, /* 00110110 */
2021 | 0x36, /* 00110110 */
2022 | 0x36, /* 00110110 */
2023 | 0x37, /* 00110111 */
2024 | 0x36, /* 00110110 */
2025 | 0x36, /* 00110110 */
2026 | 0x36, /* 00110110 */
2027 |
2028 | /* 200 0xc8 '�' */
2029 | 0x36, /* 00110110 */
2030 | 0x36, /* 00110110 */
2031 | 0x37, /* 00110111 */
2032 | 0x30, /* 00110000 */
2033 | 0x3f, /* 00111111 */
2034 | 0x00, /* 00000000 */
2035 | 0x00, /* 00000000 */
2036 | 0x00, /* 00000000 */
2037 |
2038 | /* 201 0xc9 '�' */
2039 | 0x00, /* 00000000 */
2040 | 0x00, /* 00000000 */
2041 | 0x3f, /* 00111111 */
2042 | 0x30, /* 00110000 */
2043 | 0x37, /* 00110111 */
2044 | 0x36, /* 00110110 */
2045 | 0x36, /* 00110110 */
2046 | 0x36, /* 00110110 */
2047 |
2048 | /* 202 0xca '�' */
2049 | 0x36, /* 00110110 */
2050 | 0x36, /* 00110110 */
2051 | 0xf7, /* 11110111 */
2052 | 0x00, /* 00000000 */
2053 | 0xff, /* 11111111 */
2054 | 0x00, /* 00000000 */
2055 | 0x00, /* 00000000 */
2056 | 0x00, /* 00000000 */
2057 |
2058 | /* 203 0xcb '�' */
2059 | 0x00, /* 00000000 */
2060 | 0x00, /* 00000000 */
2061 | 0xff, /* 11111111 */
2062 | 0x00, /* 00000000 */
2063 | 0xf7, /* 11110111 */
2064 | 0x36, /* 00110110 */
2065 | 0x36, /* 00110110 */
2066 | 0x36, /* 00110110 */
2067 |
2068 | /* 204 0xcc '�' */
2069 | 0x36, /* 00110110 */
2070 | 0x36, /* 00110110 */
2071 | 0x37, /* 00110111 */
2072 | 0x30, /* 00110000 */
2073 | 0x37, /* 00110111 */
2074 | 0x36, /* 00110110 */
2075 | 0x36, /* 00110110 */
2076 | 0x36, /* 00110110 */
2077 |
2078 | /* 205 0xcd '�' */
2079 | 0x00, /* 00000000 */
2080 | 0x00, /* 00000000 */
2081 | 0xff, /* 11111111 */
2082 | 0x00, /* 00000000 */
2083 | 0xff, /* 11111111 */
2084 | 0x00, /* 00000000 */
2085 | 0x00, /* 00000000 */
2086 | 0x00, /* 00000000 */
2087 |
2088 | /* 206 0xce '�' */
2089 | 0x36, /* 00110110 */
2090 | 0x36, /* 00110110 */
2091 | 0xf7, /* 11110111 */
2092 | 0x00, /* 00000000 */
2093 | 0xf7, /* 11110111 */
2094 | 0x36, /* 00110110 */
2095 | 0x36, /* 00110110 */
2096 | 0x36, /* 00110110 */
2097 |
2098 | /* 207 0xcf '�' */
2099 | 0x18, /* 00011000 */
2100 | 0x18, /* 00011000 */
2101 | 0xff, /* 11111111 */
2102 | 0x00, /* 00000000 */
2103 | 0xff, /* 11111111 */
2104 | 0x00, /* 00000000 */
2105 | 0x00, /* 00000000 */
2106 | 0x00, /* 00000000 */
2107 |
2108 | /* 208 0xd0 '�' */
2109 | 0x36, /* 00110110 */
2110 | 0x36, /* 00110110 */
2111 | 0x36, /* 00110110 */
2112 | 0x36, /* 00110110 */
2113 | 0xff, /* 11111111 */
2114 | 0x00, /* 00000000 */
2115 | 0x00, /* 00000000 */
2116 | 0x00, /* 00000000 */
2117 |
2118 | /* 209 0xd1 '�' */
2119 | 0x00, /* 00000000 */
2120 | 0x00, /* 00000000 */
2121 | 0xff, /* 11111111 */
2122 | 0x00, /* 00000000 */
2123 | 0xff, /* 11111111 */
2124 | 0x18, /* 00011000 */
2125 | 0x18, /* 00011000 */
2126 | 0x18, /* 00011000 */
2127 |
2128 | /* 210 0xd2 '�' */
2129 | 0x00, /* 00000000 */
2130 | 0x00, /* 00000000 */
2131 | 0x00, /* 00000000 */
2132 | 0x00, /* 00000000 */
2133 | 0xff, /* 11111111 */
2134 | 0x36, /* 00110110 */
2135 | 0x36, /* 00110110 */
2136 | 0x36, /* 00110110 */
2137 |
2138 | /* 211 0xd3 '�' */
2139 | 0x36, /* 00110110 */
2140 | 0x36, /* 00110110 */
2141 | 0x36, /* 00110110 */
2142 | 0x36, /* 00110110 */
2143 | 0x3f, /* 00111111 */
2144 | 0x00, /* 00000000 */
2145 | 0x00, /* 00000000 */
2146 | 0x00, /* 00000000 */
2147 |
2148 | /* 212 0xd4 '�' */
2149 | 0x18, /* 00011000 */
2150 | 0x18, /* 00011000 */
2151 | 0x1f, /* 00011111 */
2152 | 0x18, /* 00011000 */
2153 | 0x1f, /* 00011111 */
2154 | 0x00, /* 00000000 */
2155 | 0x00, /* 00000000 */
2156 | 0x00, /* 00000000 */
2157 |
2158 | /* 213 0xd5 '�' */
2159 | 0x00, /* 00000000 */
2160 | 0x00, /* 00000000 */
2161 | 0x1f, /* 00011111 */
2162 | 0x18, /* 00011000 */
2163 | 0x1f, /* 00011111 */
2164 | 0x18, /* 00011000 */
2165 | 0x18, /* 00011000 */
2166 | 0x18, /* 00011000 */
2167 |
2168 | /* 214 0xd6 '�' */
2169 | 0x00, /* 00000000 */
2170 | 0x00, /* 00000000 */
2171 | 0x00, /* 00000000 */
2172 | 0x00, /* 00000000 */
2173 | 0x3f, /* 00111111 */
2174 | 0x36, /* 00110110 */
2175 | 0x36, /* 00110110 */
2176 | 0x36, /* 00110110 */
2177 |
2178 | /* 215 0xd7 '�' */
2179 | 0x36, /* 00110110 */
2180 | 0x36, /* 00110110 */
2181 | 0x36, /* 00110110 */
2182 | 0x36, /* 00110110 */
2183 | 0xff, /* 11111111 */
2184 | 0x36, /* 00110110 */
2185 | 0x36, /* 00110110 */
2186 | 0x36, /* 00110110 */
2187 |
2188 | /* 216 0xd8 '�' */
2189 | 0x18, /* 00011000 */
2190 | 0x18, /* 00011000 */
2191 | 0xff, /* 11111111 */
2192 | 0x18, /* 00011000 */
2193 | 0xff, /* 11111111 */
2194 | 0x18, /* 00011000 */
2195 | 0x18, /* 00011000 */
2196 | 0x18, /* 00011000 */
2197 |
2198 | /* 217 0xd9 '�' */
2199 | 0x18, /* 00011000 */
2200 | 0x18, /* 00011000 */
2201 | 0x18, /* 00011000 */
2202 | 0x18, /* 00011000 */
2203 | 0xf8, /* 11111000 */
2204 | 0x00, /* 00000000 */
2205 | 0x00, /* 00000000 */
2206 | 0x00, /* 00000000 */
2207 |
2208 | /* 218 0xda '�' */
2209 | 0x00, /* 00000000 */
2210 | 0x00, /* 00000000 */
2211 | 0x00, /* 00000000 */
2212 | 0x00, /* 00000000 */
2213 | 0x1f, /* 00011111 */
2214 | 0x18, /* 00011000 */
2215 | 0x18, /* 00011000 */
2216 | 0x18, /* 00011000 */
2217 |
2218 | /* 219 0xdb '�' */
2219 | 0xff, /* 11111111 */
2220 | 0xff, /* 11111111 */
2221 | 0xff, /* 11111111 */
2222 | 0xff, /* 11111111 */
2223 | 0xff, /* 11111111 */
2224 | 0xff, /* 11111111 */
2225 | 0xff, /* 11111111 */
2226 | 0xff, /* 11111111 */
2227 |
2228 | /* 220 0xdc '�' */
2229 | 0x00, /* 00000000 */
2230 | 0x00, /* 00000000 */
2231 | 0x00, /* 00000000 */
2232 | 0x00, /* 00000000 */
2233 | 0xff, /* 11111111 */
2234 | 0xff, /* 11111111 */
2235 | 0xff, /* 11111111 */
2236 | 0xff, /* 11111111 */
2237 |
2238 | /* 221 0xdd '�' */
2239 | 0xf0, /* 11110000 */
2240 | 0xf0, /* 11110000 */
2241 | 0xf0, /* 11110000 */
2242 | 0xf0, /* 11110000 */
2243 | 0xf0, /* 11110000 */
2244 | 0xf0, /* 11110000 */
2245 | 0xf0, /* 11110000 */
2246 | 0xf0, /* 11110000 */
2247 |
2248 | /* 222 0xde '�' */
2249 | 0x0f, /* 00001111 */
2250 | 0x0f, /* 00001111 */
2251 | 0x0f, /* 00001111 */
2252 | 0x0f, /* 00001111 */
2253 | 0x0f, /* 00001111 */
2254 | 0x0f, /* 00001111 */
2255 | 0x0f, /* 00001111 */
2256 | 0x0f, /* 00001111 */
2257 |
2258 | /* 223 0xdf '�' */
2259 | 0xff, /* 11111111 */
2260 | 0xff, /* 11111111 */
2261 | 0xff, /* 11111111 */
2262 | 0xff, /* 11111111 */
2263 | 0x00, /* 00000000 */
2264 | 0x00, /* 00000000 */
2265 | 0x00, /* 00000000 */
2266 | 0x00, /* 00000000 */
2267 |
2268 | /* 224 0xe0 '�' */
2269 | 0x00, /* 00000000 */
2270 | 0x00, /* 00000000 */
2271 | 0x76, /* 01110110 */
2272 | 0xdc, /* 11011100 */
2273 | 0xc8, /* 11001000 */
2274 | 0xdc, /* 11011100 */
2275 | 0x76, /* 01110110 */
2276 | 0x00, /* 00000000 */
2277 |
2278 | /* 225 0xe1 '�' */
2279 | 0x78, /* 01111000 */
2280 | 0xcc, /* 11001100 */
2281 | 0xcc, /* 11001100 */
2282 | 0xd8, /* 11011000 */
2283 | 0xcc, /* 11001100 */
2284 | 0xc6, /* 11000110 */
2285 | 0xcc, /* 11001100 */
2286 | 0x00, /* 00000000 */
2287 |
2288 | /* 226 0xe2 '�' */
2289 | 0xfe, /* 11111110 */
2290 | 0xc6, /* 11000110 */
2291 | 0xc0, /* 11000000 */
2292 | 0xc0, /* 11000000 */
2293 | 0xc0, /* 11000000 */
2294 | 0xc0, /* 11000000 */
2295 | 0xc0, /* 11000000 */
2296 | 0x00, /* 00000000 */
2297 |
2298 | /* 227 0xe3 '�' */
2299 | 0x00, /* 00000000 */
2300 | 0x00, /* 00000000 */
2301 | 0xfe, /* 11111110 */
2302 | 0x6c, /* 01101100 */
2303 | 0x6c, /* 01101100 */
2304 | 0x6c, /* 01101100 */
2305 | 0x6c, /* 01101100 */
2306 | 0x00, /* 00000000 */
2307 |
2308 | /* 228 0xe4 '�' */
2309 | 0xfe, /* 11111110 */
2310 | 0xc6, /* 11000110 */
2311 | 0x60, /* 01100000 */
2312 | 0x30, /* 00110000 */
2313 | 0x60, /* 01100000 */
2314 | 0xc6, /* 11000110 */
2315 | 0xfe, /* 11111110 */
2316 | 0x00, /* 00000000 */
2317 |
2318 | /* 229 0xe5 '�' */
2319 | 0x00, /* 00000000 */
2320 | 0x00, /* 00000000 */
2321 | 0x7e, /* 01111110 */
2322 | 0xd8, /* 11011000 */
2323 | 0xd8, /* 11011000 */
2324 | 0xd8, /* 11011000 */
2325 | 0x70, /* 01110000 */
2326 | 0x00, /* 00000000 */
2327 |
2328 | /* 230 0xe6 '�' */
2329 | 0x00, /* 00000000 */
2330 | 0x00, /* 00000000 */
2331 | 0x66, /* 01100110 */
2332 | 0x66, /* 01100110 */
2333 | 0x66, /* 01100110 */
2334 | 0x66, /* 01100110 */
2335 | 0x7c, /* 01111100 */
2336 | 0xc0, /* 11000000 */
2337 |
2338 | /* 231 0xe7 '�' */
2339 | 0x00, /* 00000000 */
2340 | 0x76, /* 01110110 */
2341 | 0xdc, /* 11011100 */
2342 | 0x18, /* 00011000 */
2343 | 0x18, /* 00011000 */
2344 | 0x18, /* 00011000 */
2345 | 0x18, /* 00011000 */
2346 | 0x00, /* 00000000 */
2347 |
2348 | /* 232 0xe8 '�' */
2349 | 0x7e, /* 01111110 */
2350 | 0x18, /* 00011000 */
2351 | 0x3c, /* 00111100 */
2352 | 0x66, /* 01100110 */
2353 | 0x66, /* 01100110 */
2354 | 0x3c, /* 00111100 */
2355 | 0x18, /* 00011000 */
2356 | 0x7e, /* 01111110 */
2357 |
2358 | /* 233 0xe9 '�' */
2359 | 0x38, /* 00111000 */
2360 | 0x6c, /* 01101100 */
2361 | 0xc6, /* 11000110 */
2362 | 0xfe, /* 11111110 */
2363 | 0xc6, /* 11000110 */
2364 | 0x6c, /* 01101100 */
2365 | 0x38, /* 00111000 */
2366 | 0x00, /* 00000000 */
2367 |
2368 | /* 234 0xea '�' */
2369 | 0x38, /* 00111000 */
2370 | 0x6c, /* 01101100 */
2371 | 0xc6, /* 11000110 */
2372 | 0xc6, /* 11000110 */
2373 | 0x6c, /* 01101100 */
2374 | 0x6c, /* 01101100 */
2375 | 0xee, /* 11101110 */
2376 | 0x00, /* 00000000 */
2377 |
2378 | /* 235 0xeb '�' */
2379 | 0x0e, /* 00001110 */
2380 | 0x18, /* 00011000 */
2381 | 0x0c, /* 00001100 */
2382 | 0x3e, /* 00111110 */
2383 | 0x66, /* 01100110 */
2384 | 0x66, /* 01100110 */
2385 | 0x3c, /* 00111100 */
2386 | 0x00, /* 00000000 */
2387 |
2388 | /* 236 0xec '�' */
2389 | 0x00, /* 00000000 */
2390 | 0x00, /* 00000000 */
2391 | 0x7e, /* 01111110 */
2392 | 0xdb, /* 11011011 */
2393 | 0xdb, /* 11011011 */
2394 | 0x7e, /* 01111110 */
2395 | 0x00, /* 00000000 */
2396 | 0x00, /* 00000000 */
2397 |
2398 | /* 237 0xed '�' */
2399 | 0x06, /* 00000110 */
2400 | 0x0c, /* 00001100 */
2401 | 0x7e, /* 01111110 */
2402 | 0xdb, /* 11011011 */
2403 | 0xdb, /* 11011011 */
2404 | 0x7e, /* 01111110 */
2405 | 0x60, /* 01100000 */
2406 | 0xc0, /* 11000000 */
2407 |
2408 | /* 238 0xee '�' */
2409 | 0x1e, /* 00011110 */
2410 | 0x30, /* 00110000 */
2411 | 0x60, /* 01100000 */
2412 | 0x7e, /* 01111110 */
2413 | 0x60, /* 01100000 */
2414 | 0x30, /* 00110000 */
2415 | 0x1e, /* 00011110 */
2416 | 0x00, /* 00000000 */
2417 |
2418 | /* 239 0xef '�' */
2419 | 0x00, /* 00000000 */
2420 | 0x7c, /* 01111100 */
2421 | 0xc6, /* 11000110 */
2422 | 0xc6, /* 11000110 */
2423 | 0xc6, /* 11000110 */
2424 | 0xc6, /* 11000110 */
2425 | 0xc6, /* 11000110 */
2426 | 0x00, /* 00000000 */
2427 |
2428 | /* 240 0xf0 '�' */
2429 | 0x00, /* 00000000 */
2430 | 0xfe, /* 11111110 */
2431 | 0x00, /* 00000000 */
2432 | 0xfe, /* 11111110 */
2433 | 0x00, /* 00000000 */
2434 | 0xfe, /* 11111110 */
2435 | 0x00, /* 00000000 */
2436 | 0x00, /* 00000000 */
2437 |
2438 | /* 241 0xf1 '�' */
2439 | 0x18, /* 00011000 */
2440 | 0x18, /* 00011000 */
2441 | 0x7e, /* 01111110 */
2442 | 0x18, /* 00011000 */
2443 | 0x18, /* 00011000 */
2444 | 0x00, /* 00000000 */
2445 | 0x7e, /* 01111110 */
2446 | 0x00, /* 00000000 */
2447 |
2448 | /* 242 0xf2 '�' */
2449 | 0x30, /* 00110000 */
2450 | 0x18, /* 00011000 */
2451 | 0x0c, /* 00001100 */
2452 | 0x18, /* 00011000 */
2453 | 0x30, /* 00110000 */
2454 | 0x00, /* 00000000 */
2455 | 0x7e, /* 01111110 */
2456 | 0x00, /* 00000000 */
2457 |
2458 | /* 243 0xf3 '�' */
2459 | 0x0c, /* 00001100 */
2460 | 0x18, /* 00011000 */
2461 | 0x30, /* 00110000 */
2462 | 0x18, /* 00011000 */
2463 | 0x0c, /* 00001100 */
2464 | 0x00, /* 00000000 */
2465 | 0x7e, /* 01111110 */
2466 | 0x00, /* 00000000 */
2467 |
2468 | /* 244 0xf4 '�' */
2469 | 0x0e, /* 00001110 */
2470 | 0x1b, /* 00011011 */
2471 | 0x1b, /* 00011011 */
2472 | 0x18, /* 00011000 */
2473 | 0x18, /* 00011000 */
2474 | 0x18, /* 00011000 */
2475 | 0x18, /* 00011000 */
2476 | 0x18, /* 00011000 */
2477 |
2478 | /* 245 0xf5 '�' */
2479 | 0x18, /* 00011000 */
2480 | 0x18, /* 00011000 */
2481 | 0x18, /* 00011000 */
2482 | 0x18, /* 00011000 */
2483 | 0x18, /* 00011000 */
2484 | 0xd8, /* 11011000 */
2485 | 0xd8, /* 11011000 */
2486 | 0x70, /* 01110000 */
2487 |
2488 | /* 246 0xf6 '�' */
2489 | 0x00, /* 00000000 */
2490 | 0x18, /* 00011000 */
2491 | 0x00, /* 00000000 */
2492 | 0x7e, /* 01111110 */
2493 | 0x00, /* 00000000 */
2494 | 0x18, /* 00011000 */
2495 | 0x00, /* 00000000 */
2496 | 0x00, /* 00000000 */
2497 |
2498 | /* 247 0xf7 '�' */
2499 | 0x00, /* 00000000 */
2500 | 0x76, /* 01110110 */
2501 | 0xdc, /* 11011100 */
2502 | 0x00, /* 00000000 */
2503 | 0x76, /* 01110110 */
2504 | 0xdc, /* 11011100 */
2505 | 0x00, /* 00000000 */
2506 | 0x00, /* 00000000 */
2507 |
2508 | /* 248 0xf8 '�' */
2509 | 0x38, /* 00111000 */
2510 | 0x6c, /* 01101100 */
2511 | 0x6c, /* 01101100 */
2512 | 0x38, /* 00111000 */
2513 | 0x00, /* 00000000 */
2514 | 0x00, /* 00000000 */
2515 | 0x00, /* 00000000 */
2516 | 0x00, /* 00000000 */
2517 |
2518 | /* 249 0xf9 '�' */
2519 | 0x00, /* 00000000 */
2520 | 0x00, /* 00000000 */
2521 | 0x00, /* 00000000 */
2522 | 0x18, /* 00011000 */
2523 | 0x18, /* 00011000 */
2524 | 0x00, /* 00000000 */
2525 | 0x00, /* 00000000 */
2526 | 0x00, /* 00000000 */
2527 |
2528 | /* 250 0xfa '�' */
2529 | 0x00, /* 00000000 */
2530 | 0x00, /* 00000000 */
2531 | 0x00, /* 00000000 */
2532 | 0x18, /* 00011000 */
2533 | 0x00, /* 00000000 */
2534 | 0x00, /* 00000000 */
2535 | 0x00, /* 00000000 */
2536 | 0x00, /* 00000000 */
2537 |
2538 | /* 251 0xfb '�' */
2539 | 0x0f, /* 00001111 */
2540 | 0x0c, /* 00001100 */
2541 | 0x0c, /* 00001100 */
2542 | 0x0c, /* 00001100 */
2543 | 0xec, /* 11101100 */
2544 | 0x6c, /* 01101100 */
2545 | 0x3c, /* 00111100 */
2546 | 0x1c, /* 00011100 */
2547 |
2548 | /* 252 0xfc '�' */
2549 | 0x6c, /* 01101100 */
2550 | 0x36, /* 00110110 */
2551 | 0x36, /* 00110110 */
2552 | 0x36, /* 00110110 */
2553 | 0x36, /* 00110110 */
2554 | 0x00, /* 00000000 */
2555 | 0x00, /* 00000000 */
2556 | 0x00, /* 00000000 */
2557 |
2558 | /* 253 0xfd '�' */
2559 | 0x78, /* 01111000 */
2560 | 0x0c, /* 00001100 */
2561 | 0x18, /* 00011000 */
2562 | 0x30, /* 00110000 */
2563 | 0x7c, /* 01111100 */
2564 | 0x00, /* 00000000 */
2565 | 0x00, /* 00000000 */
2566 | 0x00, /* 00000000 */
2567 |
2568 | /* 254 0xfe '�' */
2569 | 0x00, /* 00000000 */
2570 | 0x00, /* 00000000 */
2571 | 0x3c, /* 00111100 */
2572 | 0x3c, /* 00111100 */
2573 | 0x3c, /* 00111100 */
2574 | 0x3c, /* 00111100 */
2575 | 0x00, /* 00000000 */
2576 | 0x00, /* 00000000 */
2577 |
2578 | /* 255 0xff '�' */
2579 | 0x00, /* 00000000 */
2580 | 0x00, /* 00000000 */
2581 | 0x00, /* 00000000 */
2582 | 0x00, /* 00000000 */
2583 | 0x00, /* 00000000 */
2584 | 0x00, /* 00000000 */
2585 | 0x00, /* 00000000 */
2586 | 0x00, /* 00000000 */
2587 |
2588 | };
2589 | /* end of font_8x8.c */
--------------------------------------------------------------------------------
/src/red.c:
--------------------------------------------------------------------------------
1 | /*
2 | * red.c
3 | *
4 | * Author: Neeraj Dantu
5 | * Copyright (C) 2018 Octavo Systems
6 |
7 | * This program is free software; you can redistribute it and/or modify it
8 | * under the terms of the GNU General Public License version 2 as published by
9 | * the Free Software Foundation.
10 | *
11 | * This program is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 | * more details.
15 | *
16 | * You should have received a copy of the GNU General Public License along with
17 | * this program. If not, see .
18 | */
19 |
20 | #include "common.h"
21 | #include "red.h"
22 |
23 | int osd3358_sm_ref_design_tests(){
24 |
25 | int ret;
26 | //Test bootmode
27 | ret = check_boot_mode();
28 | if(ret<0) {
29 | fprintf(stderr, "failed: boot mode test\n");
30 | beagle_notice("BOOT MODE", "fail");
31 | return -3;
32 | }
33 | else
34 | {
35 | beagle_notice("BOOT MODE", "pass");
36 | }
37 |
38 |
39 | //Test IMU using driver
40 | ret = test_imu();
41 | if(ret<0) {
42 | fprintf(stderr, "failed: mpu9250 imu\n");
43 | beagle_notice("IMU", "fail");
44 | return -3;
45 | }
46 | else
47 | {
48 | beagle_notice("IMU", "pass");
49 | }
50 |
51 | // test barometer
52 | ret = test_bmp();
53 | if(ret<0)
54 | {
55 | fprintf(stderr, "failed: bmp280 barometer\n");
56 | beagle_notice("BMP", "fail");
57 | return -4;
58 | }
59 | else
60 | {
61 | beagle_notice("BMP", "pass");
62 | }
63 |
64 | //test temp sensor
65 | ret = test_tmp480();
66 | if(ret<0)
67 | {
68 | fprintf(stderr, "failed: tmp480 temp sensor\n");
69 | beagle_notice("TEMP", "fail");
70 | return -5;
71 | }
72 | else
73 | {
74 | beagle_notice("TEMP", "pass");
75 | }
76 |
77 | //test TPM
78 | ret = test_tpm();
79 | if(ret<0) {
80 | fprintf(stderr, "failed: TPM\n");
81 | beagle_notice("TPM", "fail");
82 | return -6;
83 | }
84 | else
85 | {
86 | beagle_notice("TPM", "pass");
87 | }
88 |
89 |
90 | //Test NOR Flash on SPI0
91 | ret = test_nor();
92 | if(ret<0){
93 | fprintf(stderr, "failed: NOR\n");
94 | beagle_notice("NOR", "fail");
95 | return -7;
96 | }
97 | else
98 | {
99 | beagle_notice("NOR", "pass");
100 | }
101 |
102 |
103 | return 0;
104 | }
105 |
106 |
107 | unsigned long read_write_mem(int argc, unsigned int address, char type, unsigned long writeval) {
108 | int fd;
109 | void *map_base, *virt_addr;
110 | unsigned long read_result = 0;
111 | off_t target;
112 | int access_type = 'w';
113 |
114 | if(argc < 1) { exit(1); }
115 |
116 | target = address;
117 |
118 | if(argc > 1)
119 | access_type = tolower(type);
120 |
121 |
122 | if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
123 | fflush(stdout);
124 |
125 | /* Map one page */
126 | map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK);
127 | if(map_base == (void *) -1) FATAL;
128 | if (0) { printf("Memory mapped at address %p.\n", map_base); }
129 | fflush(stdout);
130 |
131 | virt_addr = map_base + (target & MAP_MASK);
132 |
133 | if(argc <= 2) {
134 | switch(access_type) {
135 | case 'b':
136 | read_result = *((unsigned char *) virt_addr);
137 | break;
138 | case 'h':
139 | read_result = *((unsigned short *) virt_addr);
140 | break;
141 | case 'w':
142 | read_result = *((unsigned long *) virt_addr);
143 | break;
144 | default:
145 | fprintf(stderr, "Illegal data type '%c'.\n", access_type);
146 | exit(2);
147 | }
148 |
149 |
150 | } else {
151 | switch(access_type) {
152 | case 'b':
153 | *((unsigned char *) virt_addr) = writeval;
154 | read_result = *((unsigned char *) virt_addr);
155 | break;
156 | case 'h':
157 | *((unsigned short *) virt_addr) = writeval;
158 | read_result = *((unsigned short *) virt_addr);
159 | break;
160 | case 'w':
161 | *((unsigned long *) virt_addr) = writeval;
162 | read_result = *((unsigned long *) virt_addr);
163 | break;
164 | }
165 |
166 | }
167 |
168 | if(munmap(map_base, MAP_SIZE) == -1) FATAL;
169 | close(fd);
170 | return read_result;
171 | }
172 |
173 |
174 | int test_tmp480()
175 | {
176 |
177 | uint8_t c = 0xFF;
178 | int file, ret, i;
179 | char buf[10] = "";
180 | uint16_t *data;
181 |
182 | file = open("/dev/i2c-0", O_RDWR);
183 |
184 |
185 | if(ioctl(file, I2C_SLAVE, TEMP_I2C_ADD) < 0)
186 | {
187 | printf("Address of temp sensor was not set\n");
188 | }
189 |
190 | ret = write(file, &c, 1);
191 | if(ret!=1)
192 | {
193 | printf("write to i2c bus with temp sensor failed\n");
194 | return -1;
195 | }
196 |
197 | ret = read(file, buf, 2);
198 | if(ret!=(2))
199 | {
200 | printf("i2c device returned %d bytes\n",ret);
201 | return -1;
202 | }
203 |
204 | // form words from bytes and put into user's data array
205 | for(i=0;i<1;i++)
206 | {
207 | data[i] = (((uint16_t)buf[0])<<8 | buf[1]);
208 | }
209 |
210 | if(data[0] != TEMP_ID)
211 | {
212 | return -1;
213 | }
214 | else
215 | {
216 | return 0;
217 | }
218 | }
219 |
220 |
221 | int test_tpm()
222 | {
223 | FILE *fp;
224 | char buff[10];
225 | char string[] = "0xc6";
226 |
227 | system("touch /var/tpmtest.txt");
228 | system("i2cget -f -y 0 0x29 0x4c c > /var/tpmtest.txt");
229 | fp = fopen("/var/tpmtest.txt", "r");
230 | fscanf(fp, "%s", buff);
231 | fclose(fp);
232 | system("rm /var/tpmtest.txt");
233 |
234 | if(strcmp(buff,string) == 0)
235 | {
236 | return 1;
237 | }
238 | else
239 | {
240 | return -1;
241 | }
242 | }
243 |
244 | int check_boot_mode() {
245 |
246 | unsigned long temp = 0;
247 | temp = read_write_mem(2, BOOTMODE, 'w', 0x00000000);
248 | if(temp == BOOTMODE_SD)
249 | {
250 | return 1;
251 | }
252 | else
253 | {
254 | return -1;
255 | }
256 | }
257 |
258 | int test_imu()
259 | {
260 | FILE *fp;
261 | char buff[10];
262 | char string[] = "0x71";
263 |
264 | system("touch /var/imutest.txt");
265 | system("i2cget -f -y 0 0x68 0x75 > /var/imutest.txt");
266 | fp = fopen("/var/imutest.txt", "r");
267 | fscanf(fp, "%s", buff);
268 | fclose(fp);
269 | system("rm /var/imutest.txt");
270 |
271 | if(strcmp(buff,string) == 0)
272 | {
273 | return 1;
274 | }
275 | else
276 | {
277 | return -1;
278 | }
279 | }
280 |
281 |
282 | int test_bmp()
283 | {
284 | FILE *fp;
285 | char buff[10];
286 | char string[] = "0x58";
287 |
288 | system("touch /var/bmptest.txt");
289 | system("i2cget -f -y 0 0x76 0xD0 > /var/bmptest.txt");
290 | fp = fopen("/var/bmptest.txt", "r");
291 | fscanf(fp, "%s", buff);
292 | fclose(fp);
293 | system("rm /var/bmptest.txt");
294 |
295 | if(strcmp(buff,string) == 0)
296 | {
297 | return 1;
298 | }
299 | else
300 | {
301 | return -1;
302 | }
303 | }
304 |
305 | int test_nor()
306 | {
307 | /* int spi_speed_hz, slave, ret, fd, tx_bytes, i, mode_proper, bits, rx_bytes;*/
308 | int spi_speed_hz, ret, mode_proper, bits, rx_bytes;
309 | mode_proper = SPI_MODE_0;
310 | bits = 8;
311 | rx_bytes = 8;
312 | spi_speed_hz = 10000;
313 | char command[8];
314 | command[0] = 0x90;
315 | command[1] = 0x00;
316 | command[2] = 0x00;
317 | command[3] = 0x00;
318 | command[4] = 0x00;
319 | command[5] = 0x00;
320 | command[6] = 0x00;
321 | command[7] = 0x00;
322 |
323 | char *rx_id = malloc(8*sizeof(char));
324 | /* slave = 1; */
325 | spi_speed_hz = 10000;
326 | /* tx_bytes = 4; */
327 |
328 | int fdsp;
329 | //Setting spi mode
330 |
331 | system("config-pin P9_17 spi_cs");
332 | system("config-pin P9_18 spi");
333 | system("config-pin P9_21 spi");
334 | system("config-pin P9_22 spi_sclk");
335 |
336 | fdsp = open("/dev/spidev1.0", O_RDWR);
337 | ret = ioctl(fdsp, SPI_IOC_WR_MODE);
338 | if(ioctl(fdsp, SPI_IOC_WR_MODE, &mode_proper)<0){
339 | printf("can't set spi mode");
340 | close(fdsp);
341 | return -1;
342 | }
343 | if(ioctl(fdsp, SPI_IOC_RD_MODE, &mode_proper)<0){
344 | printf("can't get spi mode");
345 | close(fdsp);
346 | return -1;
347 | }
348 | if(ioctl(fdsp, SPI_IOC_WR_BITS_PER_WORD, &bits)<0){
349 | printf("can't set bits per word");
350 | close(fdsp);
351 | return -1;
352 | }
353 | if(ioctl(fdsp, SPI_IOC_RD_BITS_PER_WORD, &bits)<0){
354 | printf("can't get bits per word");
355 | close(fdsp);
356 | return -1;
357 | }
358 | if(ioctl(fdsp, SPI_IOC_WR_MAX_SPEED_HZ, &spi_speed_hz)<0){
359 | printf("can't set max speed hz");
360 | close(fdsp);
361 | return -1;
362 | }
363 | if(ioctl(fdsp, SPI_IOC_RD_MAX_SPEED_HZ, &spi_speed_hz)<0){
364 | printf("can't get max speed hz");
365 | close(fdsp);
366 | return -1;
367 | }
368 |
369 | //Filling in the xfer struct
370 | xfer[0].cs_change = 1;
371 | xfer[0].delay_usecs = 0;
372 | xfer[0].speed_hz = spi_speed_hz;
373 | xfer[0].bits_per_word = bits;
374 | xfer[0].rx_buf = 0;
375 | xfer[0].tx_buf = (unsigned long) command;
376 | xfer[0].len = 8;
377 |
378 | ret = ioctl(fdsp, SPI_IOC_MESSAGE(1), &xfer[0]);
379 | if(ret<0){
380 | printf("ERROR: SPI_IOC_MESSAGE_FAILED %x\n", ret);
381 | }
382 |
383 | xfer[1].cs_change = 1;
384 | xfer[1].delay_usecs = 0;
385 | xfer[1].speed_hz = spi_speed_hz;
386 | xfer[1].bits_per_word = bits;
387 | xfer[1].rx_buf = (unsigned long) rx_id;
388 | xfer[1].tx_buf = 0;
389 | xfer[1].len = rx_bytes;
390 | // receive
391 | ret=ioctl(fdsp, SPI_IOC_MESSAGE(1), &xfer[1]);
392 | if(ret<0){
393 | printf("ERROR: SPI read command failed\n");
394 | return -1;
395 | }
396 |
397 | if (*rx_id == 0x01){
398 | return 1;
399 | }
400 | else{
401 | return -1;
402 | }
403 | }
404 |
405 |
406 |
407 |
--------------------------------------------------------------------------------
/techlab-buzz.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beagleboard/beagle-tester/8ab6e2e58c7ce9364b705433e6aa59e597c8076f/techlab-buzz.out
--------------------------------------------------------------------------------
/techlab-buzz.pru0c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 Jason Kridner , Texas Instruments Incorporated
3 | *
4 | * Source Modified by Zubeen Tolani < ZeekHuge - zeekhuge@gmail.com >
5 | * Based on the examples distributed by TI
6 | *
7 | * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
8 | *
9 | *
10 | * Redistribution and use in source and binary forms, with or without
11 | * modification, are permitted provided that the following conditions
12 | * are met:
13 | *
14 | * * Redistributions of source code must retain the above copyright
15 | * notice, this list of conditions and the following disclaimer.
16 | *
17 | * * Redistributions in binary form must reproduce the above copyright
18 | * notice, this list of conditions and the following disclaimer in the
19 | * documentation and/or other materials provided with the
20 | * distribution.
21 | *
22 | * * Neither the name of Texas Instruments Incorporated nor the names of
23 | * its contributors may be used to endorse or promote products derived
24 | * from this software without specific prior written permission.
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | *
39 | * Build with:
40 | * make -C /var/lib/cloud9/examples/extras/pru PRUN=pru0 TARGET=buzz
41 | *
42 | * Makefile source at:
43 | * https://github.com/beagleboard/bone101/blob/gh-pages/examples/extras/pru/Makefile
44 | *
45 | * Rerun with:
46 | * sudo cp buzz.out /lib/firmware/am335x-pru0-fw
47 | * echo pruout | sudo tee /sys/devices/platform/ocp/ocp\:P2_30_pinmux/state
48 | * echo stop | sudo tee /sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a300000.pruss/4a33*000.pru0/remoteproc/remoteproc*/state
49 | * echo start | sudo tee /sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a300000.pruss/4a33*000.pru0/remoteproc/remoteproc*/state
50 | */
51 |
52 | #include
53 | #include
54 | #include
55 | #include
56 | #include
57 |
58 | #define INS_PER_US 200 // 5ns per instruction
59 | #define INS_PER_DELAY_LOOP 2 // two instructions per delay loop
60 | #define DELAY_CYCLES 1250*(INS_PER_US / INS_PER_DELAY_LOOP) // About 2*400Hz
61 |
62 | volatile register unsigned int __R30;
63 | volatile register unsigned int __R31;
64 | #define PRU0_GPIO (1<<3)
65 |
66 | struct my_resource_table {
67 | struct resource_table base;
68 |
69 | uint32_t offset[1]; /* Should match 'num' in actual definition */
70 | };
71 |
72 | #pragma DATA_SECTION(pru_remoteproc_ResourceTable, ".resource_table")
73 | #pragma RETAIN(pru_remoteproc_ResourceTable)
74 | struct my_resource_table pru_remoteproc_ResourceTable = {
75 | 1, /* we're the first version that implements this */
76 | 0, /* number of entries in the table */
77 | 0, 0, /* reserved, must be zero */
78 | 0, /* offset[0] */
79 | };
80 |
81 | #pragma DATA_SECTION(init_pins, ".init_pins")
82 | #pragma RETAIN(init_pins)
83 | const char init_pins[] =
84 | "/sys/devices/platform/ocp/ocp:P2_30_pinmux/state\0pruout\0" \
85 | "\0\0";
86 |
87 | void main(void) {
88 | int i;
89 |
90 | /* Toggle GPIO at 400Hz for 1s */
91 | for(i = 0; i < 400; i++) {
92 | __R30 |= PRU0_GPIO;
93 | __delay_cycles(DELAY_CYCLES);
94 | __R30 ^= PRU0_GPIO;
95 | __delay_cycles(DELAY_CYCLES);
96 | }
97 |
98 | __halt();
99 | }
100 |
--------------------------------------------------------------------------------