├── .gitignore
├── BBIOConfig.pri
├── BBIOConfig.pro
├── LICENSE
├── README.md
├── deployment.pri
├── doc
├── UI_description.png
└── snapshot.png
├── fileio.cpp
├── fileio.h
├── icon.rc
├── icons
├── bbioconfig.ico
├── bbioconfig.iconset
│ ├── icon_120x120.png
│ ├── icon_120x120@2x.png
│ ├── icon_128x128.png
│ ├── icon_128x128@2x.png
│ ├── icon_152x152.png
│ ├── icon_152x152@2x.png
│ ├── icon_16x16.png
│ ├── icon_16x16@2x.png
│ ├── icon_256x256.png
│ ├── icon_256x256@2x.png
│ ├── icon_32x32.png
│ ├── icon_32x32@2x.png
│ ├── icon_512x512.png
│ ├── icon_512x512@2x.png
│ ├── icon_57x57.png
│ ├── icon_57x57@2x.png
│ ├── icon_72x72.png
│ └── icon_72x72@2x.png
├── bbioconfig.png
├── icon_convert.sh
└── svg
│ ├── bbioconfig.svg
│ └── icon_convert.sh
├── mac_Info.plist
├── main.cpp
├── misc
└── bbioconfig.desktop
├── qml.qrc
└── qml
├── BBB_shape.png
├── BBB_shape.svg
├── BBIOConfig.qml
├── ConfigModeSelector.qml
├── Functions.js
├── Legend.qml
├── OverlaySelector.qml
├── Pin.qml
├── Port.qml
├── ToolTip.qml
├── ToolTipArea.qml
├── colormap.txt
├── colormap1.txt
├── colormap2.txt
├── main.qml
└── pinmux.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | # C++ objects and libs
2 |
3 | *.slo
4 | *.lo
5 | *.o
6 | *.a
7 | *.la
8 | *.lai
9 | *.so
10 | *.dll
11 | *.dylib
12 |
13 | # Qt-es
14 |
15 | /.qmake.cache
16 | /.qmake.stash
17 | *.pro.user
18 | *.pro.user.*
19 | *.moc
20 | moc_*.cpp
21 | qrc_*.cpp
22 | ui_*.h
23 | Makefile*
24 | *-build-*
25 |
26 | # QtCreator
27 |
28 | *.autosave
29 |
--------------------------------------------------------------------------------
/BBIOConfig.pri:
--------------------------------------------------------------------------------
1 | QT += qml quick widgets
2 |
3 | SOURCES += $$PWD/fileio.cpp
4 |
5 | HEADERS += $$PWD/fileio.h
6 |
7 | RESOURCES += $$PWD/qml.qrc
8 |
9 | INCLUDEPATH += $$PWD
10 |
--------------------------------------------------------------------------------
/BBIOConfig.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 | TARGET = bbioconfig
3 |
4 | QT += qml quick widgets
5 | QT -= network
6 |
7 | SOURCES += main.cpp \
8 | fileio.cpp
9 |
10 | HEADERS += \
11 | fileio.h
12 |
13 | RESOURCES += qml.qrc
14 |
15 | # Additional import path used to resolve QML modules in Qt Creator's code model
16 | QML_IMPORT_PATH =
17 |
18 | windows: {
19 | RC_FILE = icon.rc
20 | }
21 |
22 | macx: {
23 | QMAKE_INFO_PLIST = mac_Info.plist
24 | ICON = $$PWD/icons/$${TARGET}.icns
25 | QMAKE_POST_LINK += $$QMAKE_COPY $$PWD/$${QMAKE_INFO_PLIST} $${TARGET}.app/Contents/Info.plist $$escape_expand(\n\t)
26 | QMAKE_POST_LINK += $$QMAKE_COPY $$ICON $${TARGET}.app/Contents/Resources/machinekit.icns
27 | }
28 |
29 | # Default rules for deployment.
30 | include(deployment.pri)
31 |
32 | PREFIX = /usr
33 |
34 | target.path = $$PREFIX/bin
35 |
36 | desktop.path = $$PREFIX/share/applications
37 | desktop.files = $$PWD/misc/$${TARGET}.desktop
38 |
39 | icon.path = $$PREFIX/share/pixmaps
40 | icon.files = $$PWD/icons/$${TARGET}.png
41 |
42 | INSTALLS += target desktop icon
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BBIOConfig
2 |
3 | A GUI for the BB universal IO
4 | https://github.com/cdsteinkuehler/beaglebone-universal-io
5 |
6 | 
7 |
8 | ## Using BBIOConfig
9 | To use BBIOConfig you will need a very recent Debian BB image with the config-pin utility installed. In case you don't have such an image installed on you Beagle Bone please download install the BB universal IO from here: https://github.com/cdsteinkuehler/beaglebone-universal-io
10 |
11 | To find out whether you have the BB universal IO installed on your BeagleBone connect via SSH and try to run config-pin. If you have the BB universal IO installed you will see some application output.
12 |
13 | ### UI Overview
14 | 
15 |
16 | The UI has the following elements:
17 | 1. Device tree overlay selection menu
18 | 2. Config mode selection menu
19 | 3. Display selection menu
20 | 4. Pin description
21 | 5. Port with port name
22 | 6. Configuration title
23 | 7. Color and pin function legend
24 |
25 | ### Creating a IO configuration
26 | To create a new pin configuration start by create a new document using the application menu **Ctrl+N** or **File>New**. Then save the new file using **Ctrl+S** or **File>Save**. Now you can start creating you IO configuration. Make sure that you save you document regularly since BBIOConfig currently does not check for changes and warn when closed.
27 |
28 | Start by selecting a device tree overlay (1). I recommend using only the cape-universal for a start as it does not conflict with eMMC and HDMI pins. To see more clearly which pins can be edited or not you can modify the check in the display config menu (3). When you hover the colored pins in the legend (7) you can see which pins can be configured to which function. When you click on a pin at a port (5) you will get configuration menu showing you all the function that can be selected for one pin.
29 |
30 | If you select **gpio, gpio_pd or gpio_pu** as pin function you can further modify the pin direction and default value by changing the config mode (2).
31 |
32 | For every editable pin you can also add description by clicking the edits next to the pins (4).
33 | **NOTE:** You can use the keyboard (Tab and arrow keys) to navigate between the description fields. Also try out using the Return key to navigate to corresponding pin (press space to open the menu or the arrow keys to change the function).
34 |
35 | You can also change the title displayed on top the of the configuration window by clicking on it (6).
36 |
37 | ### Using a IO configuration
38 | To use a IO configuration created with BBIOConfig deploy it to your BeagleBone you must use the config-pin utility:
39 | `config-pin -f .bbio`
40 |
--------------------------------------------------------------------------------
/deployment.pri:
--------------------------------------------------------------------------------
1 | android-no-sdk {
2 | target.path = /data/user/qt
3 | export(target.path)
4 | INSTALLS += target
5 | } else:android {
6 | x86 {
7 | target.path = /libs/x86
8 | } else: armeabi-v7a {
9 | target.path = /libs/armeabi-v7a
10 | } else {
11 | target.path = /libs/armeabi
12 | }
13 | export(target.path)
14 | INSTALLS += target
15 | } else:unix {
16 | isEmpty(target.path) {
17 | target.path = /opt/$${TARGET}/bin
18 | export(target.path)
19 | }
20 | INSTALLS += target
21 | }
22 |
23 | export(INSTALLS)
24 |
--------------------------------------------------------------------------------
/doc/UI_description.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/doc/UI_description.png
--------------------------------------------------------------------------------
/doc/snapshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/doc/snapshot.png
--------------------------------------------------------------------------------
/fileio.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | #include "fileio.h"
21 |
22 | FileIO::FileIO(QQuickItem *parent) :
23 | QQuickItem(parent)
24 | {
25 | m_url = QStringLiteral("");
26 | m_data = QStringLiteral("");
27 | m_error = false;
28 | }
29 |
30 | void FileIO::save()
31 | {
32 | QUrl url(m_url);
33 | QString fileName = m_url;
34 |
35 | if (url.isLocalFile())
36 | {
37 | fileName = url.toLocalFile();
38 | }
39 |
40 | QFile file(fileName);
41 |
42 | if (file.open(QIODevice::WriteOnly))
43 | {
44 | file.write(m_data.toLocal8Bit());
45 | file.close();
46 | m_error = false;
47 | emit saved();
48 | emit errorChanged(m_error);
49 | }
50 | else
51 | {
52 | m_error = true;
53 | //emit error("Cannot open file to write");
54 | emit errorChanged(m_error);
55 | }
56 | }
57 |
58 | void FileIO::load()
59 | {
60 | QUrl url(m_url);
61 | QString fileName = m_url;
62 |
63 | if (url.isLocalFile())
64 | {
65 | fileName = url.toLocalFile();
66 | }
67 |
68 | QFile file(fileName);
69 |
70 | if (file.open(QIODevice::ReadOnly))
71 | {
72 | m_data = QString::fromLocal8Bit(file.readAll());
73 | emit dataChanged(m_data);
74 | file.close();
75 | m_error = false;
76 | emit loaded();
77 | emit errorChanged(m_error);
78 | }
79 | else
80 | {
81 | m_error = true;
82 | //emit error("Cannot open file to read");
83 | emit errorChanged(m_error);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/fileio.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | #ifndef FILEIO_H
21 | #define FILEIO_H
22 |
23 | #include
24 | #include
25 |
26 | class FileIO : public QQuickItem
27 | {
28 | Q_OBJECT
29 | Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
30 | Q_PROPERTY(QString data READ data WRITE setData NOTIFY dataChanged)
31 | Q_PROPERTY(bool error READ error NOTIFY errorChanged)
32 |
33 | public:
34 | explicit FileIO(QQuickItem *parent = 0);
35 |
36 | QString url() const
37 | {
38 | return m_url;
39 | }
40 |
41 | QString data() const
42 | {
43 | return m_data;
44 | }
45 |
46 | bool error() const
47 | {
48 | return m_error;
49 | }
50 |
51 | signals:
52 | void loaded();
53 | void saved();
54 |
55 | void urlChanged(QString arg);
56 | void dataChanged(QString arg);
57 |
58 | void errorChanged(bool arg);
59 |
60 | public slots:
61 | void save();
62 | void load();
63 |
64 | void setUrl(QString arg)
65 | {
66 | if (m_url != arg) {
67 | m_url = arg;
68 | emit urlChanged(arg);
69 | }
70 | }
71 | void setData(QString arg)
72 | {
73 | if (m_data != arg) {
74 | m_data = arg;
75 | emit dataChanged(arg);
76 | }
77 | }
78 |
79 | private:
80 | QString m_url;
81 | QString m_data;
82 | bool m_error;
83 | };
84 |
85 | #endif // FILEIO_H
86 |
--------------------------------------------------------------------------------
/icon.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "icons/bbioconfig.ico"
--------------------------------------------------------------------------------
/icons/bbioconfig.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.ico
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_120x120.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_120x120@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_120x120@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_128x128.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_128x128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_128x128@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_152x152.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_152x152@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_152x152@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_16x16.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_16x16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_16x16@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_256x256.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_256x256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_256x256@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_32x32.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_32x32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_32x32@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_512x512.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_512x512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_512x512@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_57x57.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_57x57@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_72x72.png
--------------------------------------------------------------------------------
/icons/bbioconfig.iconset/icon_72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.iconset/icon_72x72@2x.png
--------------------------------------------------------------------------------
/icons/bbioconfig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/icons/bbioconfig.png
--------------------------------------------------------------------------------
/icons/icon_convert.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Mac:
3 | iconutil -c icns ./bbioconfig.iconset
4 | # Linux:
5 | #shopt -s extglob
6 | #png2icns bbioconfig.icns bbioconfig.iconset/icon_!(*@2x).png
7 |
--------------------------------------------------------------------------------
/icons/svg/bbioconfig.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
134 |
--------------------------------------------------------------------------------
/icons/svg/icon_convert.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # (Batch) SVG to PNG script.
4 | # Converts an svg file into a number of png files of different sizes.
5 | # The sizes can be specified in the sizes array (line 15).
6 | #
7 | # Potential issues:
8 | # This script will overwrite existing png files
9 | # Parameters:
10 | # at least one path of SVG file to convert
11 | # Requires:
12 | # rsvg (http://librsvg.sourceforge.net/)
13 | # Author:
14 | # Konrad Siek
15 |
16 | # Array of sizes to convert to
17 | sizes=(16 32 57 72 120 128 152 256 512)
18 |
19 | OUTPUT_PATH="../bbioconfig.iconset/"
20 |
21 | # Check if any files were specified
22 | if [ $# -gt 0 ]; then
23 | for svg_file in $@
24 | do
25 | # Check if file exists
26 | if [ -f $svg_file ]
27 | then
28 | # Extract name of file (remove extension)
29 | svg_name=$(echo $svg_file | cut -f 1 -d "." | tr -d " ")
30 |
31 | # Set the output path
32 | OUTPUT_PATH="../"${svg_name}".iconset/"
33 | mkdir -p $OUTPUT_PATH
34 |
35 | # Convert file to png with of the sizes
36 | for s in $(seq 0 $((${#sizes[@]} - 1)))
37 | do
38 | size=${sizes[$s]}
39 | rsvg-convert -w $size -h $size $svg_file -o "$OUTPUT_PATH""icon"_"$size"x"$size"".png"
40 | size_new=`expr ${sizes[$s]} \* 2`
41 | rsvg-convert -w $size_new -h $size_new $svg_file -o "$OUTPUT_PATH""icon"_"$size"x"$size""@2x.png"
42 |
43 | done
44 | else
45 | # Warning message.
46 | echo "$0: File $svg_file does not exist and will be ignored."
47 | fi
48 | done
49 | else
50 | # Usage message.
51 | echo "$0: Provide at least one SVG file to convert, please."
52 | fi
53 |
--------------------------------------------------------------------------------
/mac_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | BBIOConfig
7 | CFBundleExecutable
8 | bbioconfig
9 | CFBundleGetInfoString
10 | Created by Qt/QMake
11 | CFBundleIconFile
12 | machinekit.icns
13 | CFBundleIdentifier
14 | systems.roessler.bbioconfig
15 | NSHumanReadableCopyright
16 | Alexander Rössler 2016
17 |
18 |
19 |
--------------------------------------------------------------------------------
/main.cpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | #include
21 | #include
22 | #include "fileio.h"
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | QApplication app(argc, argv);
27 |
28 | qmlRegisterType("FileIO", 1, 0, "File");
29 |
30 | QQmlApplicationEngine engine;
31 | engine.load(QUrl(QStringLiteral("qrc:///bbioconfig/qml/main.qml")));
32 |
33 | return app.exec();
34 | }
35 |
--------------------------------------------------------------------------------
/misc/bbioconfig.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Categories=Qt;Utility; # TODO
3 | Comment[en_US]=A GUI for the BB universal IO
4 | Comment=A GUI for the BB universal IO
5 | Encoding=UTF-8
6 | Exec=bbioconfig
7 | GenericName[en_US]=BBIOConfig
8 | GenericName=BBIOConfig
9 | Icon=bbioconfig
10 | MimeType=
11 | Name[en_US]=BBIOConfig
12 | Name=BBIOConfig
13 | Path=
14 | StartupNotify=true
15 | Terminal=false
16 | TerminalOptions=
17 | Type=Application
18 | Version=1.0
19 | X-DBUS-ServiceName=
20 | X-DBUS-StartupType=
21 | X-KDE-SubstituteUID=false
22 | X-KDE-Username=
23 |
--------------------------------------------------------------------------------
/qml.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | qml/main.qml
4 | qml/Pin.qml
5 | qml/Port.qml
6 | qml/Legend.qml
7 | qml/pinmux.txt
8 | qml/ToolTip.qml
9 | qml/ToolTipArea.qml
10 | qml/OverlaySelector.qml
11 | qml/colormap.txt
12 | qml/ConfigModeSelector.qml
13 | qml/colormap1.txt
14 | qml/colormap2.txt
15 | qml/Functions.js
16 | qml/BBB_shape.png
17 | qml/BBIOConfig.qml
18 |
19 |
20 |
--------------------------------------------------------------------------------
/qml/BBB_shape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/machinekoder/BBIOConfig/cc1a863b1e13e0504c68af4c4424c6312b84a603/qml/BBB_shape.png
--------------------------------------------------------------------------------
/qml/BBB_shape.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
556 |
--------------------------------------------------------------------------------
/qml/BBIOConfig.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.2
21 | import QtQuick.Controls 1.1
22 | import QtQuick.Window 2.0
23 | import FileIO 1.0
24 | import "Functions.js" as Functions
25 |
26 | Rectangle {
27 | property var portList: [port8, port9]
28 | property string currentFile: ""
29 | property string currentFileName: (currentFile == "") ? "Untitled" : currentFile.substring(currentFile.lastIndexOf("/")+1)
30 | property var functionColorMap: []
31 | property var gpioDirectionColorMap: []
32 | property var gpioValueColorMap: []
33 | property string documentTitle: qsTr("BeagleBone Universal IO Configurator")
34 | property bool modified: false
35 |
36 | signal dataChanged()
37 |
38 | function openDocument(fileUrl) {
39 | currentFile = fileUrl
40 | Functions.loadPinmux()
41 | return Functions.loadConfig(currentFile)
42 | }
43 |
44 | function saveDocument(fileUrl) {
45 | if (fileUrl !== "")
46 | currentFile = fileUrl
47 | return Functions.saveConfig(currentFile)
48 | }
49 |
50 | function newDocument() {
51 | currentFile = ""
52 | Functions.loadPinmux()
53 | }
54 |
55 | onDataChanged: modified = true
56 |
57 | id: main
58 | width: 1000
59 | height: 800
60 | color: "white"
61 |
62 | Component.onCompleted: {
63 | loadTimer.running = true
64 | }
65 |
66 | Timer {
67 | id: loadTimer
68 |
69 | running: false
70 | repeat: true
71 | interval: 10
72 | onTriggered: {
73 | // Wait for the ports to get ready
74 | var ready = true
75 | for (var i = 0; i < portList.length; ++i)
76 | {
77 | if (!portList[i].ready)
78 | {
79 | ready = false
80 | break
81 | }
82 | portList[i].createTabOrder()
83 | }
84 |
85 | if (ready)
86 | {
87 | main.functionColorMap = Functions.loadColorMap(":/bbioconfig/qml/colormap.txt")
88 | main.gpioDirectionColorMap = Functions.loadColorMap(":/bbioconfig/qml/colormap1.txt")
89 | main.gpioValueColorMap = Functions.loadColorMap(":/bbioconfig/qml/colormap2.txt")
90 |
91 | if (main.currentFile !== "") // the file was already loaded
92 | openDocument(main.currentFile)
93 | else
94 | Functions.loadPinmux()
95 |
96 |
97 | loadTimer.running = false
98 | console.log("loaded")
99 | }
100 | }
101 | }
102 |
103 | File {
104 | id: configFile
105 | }
106 |
107 | OverlaySelector {
108 | id: overlaySelector
109 | anchors.left: parent.left
110 | anchors.top: parent.top
111 | anchors.margins: Screen.logicalPixelDensity * 2
112 | width: Screen.logicalPixelDensity * 40
113 | title: qsTr("Overlays")
114 |
115 | onOutputChanged: main.dataChanged()
116 | }
117 |
118 | ConfigModeSelector {
119 | id: configModeSelector
120 | anchors.left: parent.left
121 | anchors.top: overlaySelector.bottom
122 | anchors.margins: overlaySelector.anchors.margins
123 | width: overlaySelector.width
124 | title: qsTr("Config Mode")
125 | input: [qsTr("Pin function"), qsTr("GPIO direction"), qsTr("GPIO value")]
126 | }
127 |
128 | GroupBox {
129 | id: settingsGroup
130 | anchors.left: parent.left
131 | anchors.top: configModeSelector.bottom
132 | anchors.margins: overlaySelector.anchors.margins
133 | width: configModeSelector.width
134 | title: qsTr("Display")
135 |
136 | CheckBox {
137 | id: displayUneditablePinsCheck
138 | text: qsTr("Uneditable Pins")
139 | checked: true
140 | }
141 | }
142 |
143 | Legend {
144 | id: legend
145 | anchors.right: parent.right
146 | anchors.bottom: parent.bottom
147 | anchors.margins: Screen.logicalPixelDensity * 2
148 | width: Screen.pixelDensity * 25
149 | colorMap: selector.currentColorMap
150 | }
151 |
152 | Item {
153 | property var currentColorMap: {
154 | switch (configModeSelector.currentIndex) {
155 | case 0: return functionColorMap
156 | case 1: return gpioDirectionColorMap
157 | case 2: return gpioValueColorMap
158 | default: return functionColorMap
159 | }
160 | }
161 |
162 | id: selector
163 | anchors.horizontalCenter: parent.horizontalCenter
164 | anchors.top: parent.top
165 | anchors.bottom: parent.bottom
166 | anchors.margins: parent.height * 0.05
167 | width: height
168 |
169 | Image {
170 | anchors.fill: parent
171 | source: "BBB_shape.png"
172 | fillMode: Image.PreserveAspectFit
173 | }
174 |
175 | TextInput {
176 | id: titleText
177 | anchors.horizontalCenter: parent.horizontalCenter
178 | anchors.top: parent.top
179 | anchors.topMargin: parent.height * 0.01
180 | width: parent.width
181 | horizontalAlignment: TextInput.AlignHCenter
182 | font.pixelSize: parent.width * 0.03
183 | font.bold: true
184 | text: main.documentTitle
185 | selectByMouse: true
186 |
187 | MouseArea {
188 | anchors.fill: parent
189 | cursorShape: Qt.IBeamCursor
190 | enabled: false
191 | }
192 |
193 | Binding { target: titleText; property: "text"; value: main.documentTitle }
194 | Binding { target: main; property: "documentTitle"; value: titleText.text }
195 |
196 | onTextChanged: main.dataChanged()
197 | }
198 |
199 | Port {
200 | id: port9
201 |
202 | anchors.top: parent.top
203 | anchors.left: parent.left
204 | width: parent.width * 0.054
205 | anchors.topMargin: parent.height * 0.275
206 | anchors.leftMargin: parent.width * 0.245
207 | currentColorMap: selector.currentColorMap
208 | loadedOverlays: overlaySelector.output
209 | previewType: legend.previewType
210 | previewOverlay: overlaySelector.hoveredItem
211 | previewEnabled: (legend.previewType != "") || (overlaySelector.hoveredItem != "")
212 | configMode: configModeSelector.currentIndex
213 | portNumber: 9
214 | displayUneditablePins: displayUneditablePinsCheck.checked
215 |
216 | onDataChanged: main.dataChanged()
217 | }
218 |
219 | Text {
220 | text: "P9"
221 | color: "grey"
222 | anchors.top: port9.bottom
223 | anchors.topMargin: parent.height*0.01
224 | anchors.horizontalCenter: port9.horizontalCenter
225 | anchors.horizontalCenterOffset: parent.width * 0.03
226 | font.pixelSize: parent.width * 0.04
227 | }
228 |
229 | Port {
230 | id: port8
231 |
232 | anchors.top: parent.top
233 | anchors.right: parent.right
234 | width: parent.width * 0.054
235 | anchors.topMargin: parent.height * 0.275
236 | anchors.rightMargin: parent.width * 0.245
237 | currentColorMap: selector.currentColorMap
238 | loadedOverlays: overlaySelector.output
239 | previewType: legend.previewType
240 | previewOverlay: overlaySelector.hoveredItem
241 | previewEnabled: (legend.previewType != "") || (overlaySelector.hoveredItem != "")
242 | configMode: configModeSelector.currentIndex
243 | portNumber: 8
244 | displayUneditablePins: displayUneditablePinsCheck.checked
245 |
246 | onDataChanged: main.dataChanged()
247 | }
248 |
249 | Text {
250 | text: "P8"
251 | color: "grey"
252 | anchors.top: port8.bottom
253 | anchors.topMargin: parent.height*0.01
254 | anchors.horizontalCenter: port8.horizontalCenter
255 | anchors.horizontalCenterOffset: -parent.width * 0.03
256 | font.pixelSize: parent.width * 0.04
257 | }
258 | }
259 | }
260 |
--------------------------------------------------------------------------------
/qml/ConfigModeSelector.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.0
21 | import QtQuick.Controls 1.0
22 | import QtQuick.Layouts 1.0
23 |
24 | GroupBox {
25 | property var input: ["test", "test2", "test3"]
26 | property int currentIndex: 0
27 |
28 | id: main
29 |
30 | ListModel {
31 | id: listModel
32 |
33 | }
34 |
35 | Column {
36 | Repeater {
37 | id: listView
38 | anchors.fill: parent
39 | model: listModel
40 |
41 | RadioButton {
42 | text: name
43 | exclusiveGroup: group
44 | checked: radioChecked
45 | onClicked: selectionChanged(index, checked)
46 | }
47 | }
48 | }
49 |
50 | ExclusiveGroup { id: group }
51 |
52 | onInputChanged: {
53 | currentIndex = 0
54 | listModel.clear()
55 | for (var i = 0; i < input.length; ++i)
56 | {
57 | listModel.append({"name": input[i], "index": i, "radioChecked": (i == 0)})
58 | }
59 | }
60 |
61 | function selectionChanged(index, checked) {
62 | if (checked) {
63 | currentIndex = index
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/qml/Functions.js:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | function loadPinmux()
21 | {
22 | var functions = []
23 | var capes = []
24 |
25 | configFile.url = ":/bbioconfig/qml/pinmux.txt"
26 | configFile.load()
27 |
28 | if (configFile.error == true)
29 | {
30 | console.log("file error")
31 | return
32 | }
33 |
34 | // first set all pins to reserved
35 | for (var j = 0; j < portList.length; ++j)
36 | {
37 | for (var i = 0; i < portList[j].pinList.length; ++i)
38 | {
39 | var pin = portList[j].pinList[i]
40 | pin.functions = ["reserved"]
41 | pin.info = ["reserved"]
42 | pin.type = "reserved"
43 | pin.description = ""
44 | pin.overlay = []
45 | pin.gpioDirection = "unmodified"
46 | pin.gpioValue = "unmodified"
47 | pin.kernelPinNumber = 0
48 | pin.pruPinNumber = 0
49 | pin.visible = false
50 | }
51 | }
52 |
53 | var lines = configFile.data.split("\n") // split it into seperate lines
54 | for (var i = 0; i < lines.length; ++i)
55 | {
56 | var line = lines[i]
57 | if ((line.length === 0) || (line[0] === "#")) // skip empty and comment lines
58 | continue;
59 |
60 | var lineData = line.split("=") // split the line into a left and right side
61 | lineData[1] = lineData[1].replace("\"","") // remove quote marks from the right side
62 | lineData[1] = lineData[1].replace("\"","")
63 | var functionsData = lineData[1].split(" ")
64 | var pinmuxData = lineData[0].split("_") // split the left side into port, pin and type
65 |
66 | var port = parseInt(pinmuxData[0].substr(1),10) // Port, P
67 | var pin = parseInt(pinmuxData[1],10) // Pin
68 | var type = pinmuxData[2] // Type: PINMUX, INFO, CAPE
69 |
70 | for (var j = 0; j < functionsData.length; ++j) // convert the right side into a list of strings
71 | {
72 | var func = functionsData[j]
73 |
74 | switch(type) {
75 | case "PINMUX":
76 | if ((functions.indexOf(func) == -1) && (func !== "")) // this has no use yet
77 | {
78 | functions.push(func)
79 | }
80 | break;
81 | case "CAPE":
82 | if ((capes.indexOf(func) == -1) && (func !== "")) // this has no use yet
83 | {
84 | capes.push(func)
85 | }
86 | break;
87 | default:
88 | }
89 | }
90 |
91 | if ((port === 8) || (port === 9)) // BB has only P8 and P9
92 | {
93 | if (pin <= portList[port-8].pinList.length) // BB has 46 pins per port
94 | {
95 | var targetPin = portList[port-8].pinList[pin-1]
96 | targetPin.visible = true
97 | switch(type) {
98 | case "PINMUX":
99 | targetPin.functions = functionsData
100 | targetPin.type = functionsData[0]
101 | break;
102 | case "PIN":
103 | targetPin.defaultFunction = functionsData[0]
104 | break;
105 | case "INFO":
106 | targetPin.info = functionsData
107 | break;
108 | case "CAPE":
109 | targetPin.overlay = functionsData
110 | break;
111 | case "PRU":
112 | targetPin.pruPinNumber = parseInt(functionsData[0])
113 | break;
114 | case "GPIO":
115 | targetPin.kernelPinNumber = parseInt(functionsData[0])
116 | break;
117 | default:
118 | }
119 |
120 | }
121 | }
122 | }
123 | //console.log(functions)
124 | overlaySelector.input = capes
125 |
126 | //now everthing should be loaded -> reset modified
127 | modified = false
128 | }
129 |
130 | function loadColorMap(fileName) {
131 | configFile.url = fileName
132 | configFile.load()
133 |
134 | if (configFile.error == true)
135 | {
136 | console.log("file error")
137 | return
138 | }
139 |
140 | var lines = configFile.data.split("\n") // split it into seperate lines
141 | var colorMap = []
142 |
143 | for (var i = 0; i < lines.length; ++i)
144 | {
145 | if ((lines[i] === "") || (lines[i][0] === "#"))
146 | continue
147 |
148 | var data = lines[i].replace(/\s+/g, ' ').split(" ")
149 | colorMap.push(data)
150 | }
151 |
152 | return colorMap
153 | }
154 |
155 | function loadConfig(fileName)
156 | {
157 | configFile.url = fileName
158 | configFile.load()
159 |
160 | if (configFile.error == true)
161 | {
162 | console.log("file error")
163 | return false
164 | }
165 |
166 | var lines = configFile.data.split("\n");
167 |
168 | if (lines.length === 0)
169 | return true
170 |
171 | var overlays = []
172 | overlaySelector.clearSelection() // clear selected overlays
173 | documentTitle = ""
174 |
175 | for (var i = 0; i < lines.length; ++i)
176 | {
177 | var line = lines[i]
178 | var titleText = "# title: "
179 |
180 | if (line.indexOf(titleText) === 0) // get the document title
181 | documentTitle = line.substring(titleText.length)
182 |
183 | if ((line.length === 0) || (line[0] === "#")) // skip empty and comment lines
184 | continue;
185 |
186 | var lineDataRaw = line.split(" ")
187 | var lineData = []
188 | for (var j = 0; j < lineDataRaw.length; ++j)
189 | {
190 | var lineDataRawLine = lineDataRaw[j]
191 | if (lineDataRawLine.length > 0)
192 | {
193 | lineData.push(lineDataRawLine.replace("#",""))
194 | }
195 | }
196 |
197 | if (lineData.length === 0)
198 | continue
199 |
200 | var overlayCheckText = lineData[0].toLowerCase()
201 | switch (overlayCheckText) {
202 | case "overlay":
203 | case "ov":
204 | case "cape":
205 | overlays.push(lineData[1])
206 | continue;
207 | default:
208 | }
209 |
210 | var pinmuxData = lineData[0].split("_")
211 |
212 | if (pinmuxData[0][0].toString().toUpperCase() === "P") // remove the leading P
213 | {
214 | pinmuxData[0] = pinmuxData[0].substr(1)
215 | }
216 |
217 | var port = parseInt(pinmuxData[0],10)
218 | var pin = parseInt(pinmuxData[1],10)
219 |
220 | if ((port === 8) || (port === 9))
221 | {
222 | if (pin <= portList[port-8].pinList.length)
223 | {
224 | var targetPin = portList[port-8].pinList[pin-1]
225 |
226 | //right hand value
227 | switch (lineData[1].toLowerCase()) {
228 | case "in":
229 | case "input":
230 | targetPin.type = "gpio"
231 | targetPin.gpioDirection = "in"
232 | break;
233 | case "out":
234 | case "output":
235 | targetPin.type = "gpio"
236 | targetPin.gpioDirection = "out"
237 | break;
238 | case "hi":
239 | case "high":
240 | case "1":
241 | targetPin.type = "gpio"
242 | targetPin.gpioDirection = "out"
243 | targetPin.gpioValue = "high"
244 | break;
245 | case "lo":
246 | case "low":
247 | case "0":
248 | targetPin.type = "gpio"
249 | targetPin.gpioDirection = "out"
250 | targetPin.gpioValue = "low"
251 | break;
252 | case "in+":
253 | case "input+":
254 | targetPin.type = "gpio_pu"
255 | targetPin.gpioDirection = "in"
256 | break;
257 | case "in-":
258 | case "input-":
259 | targetPin.type = "gpio_pd"
260 | targetPin.gpioDirection = "in"
261 | break
262 | case "out+":
263 | case "output+":
264 | targetPin.type = "gpio_pu"
265 | targetPin.gpioDirection = "out"
266 | break;
267 | case "out-":
268 | case "output-":
269 | targetPin.type = "gpio_pd"
270 | targetPin.gpioDirection = "out"
271 | break;
272 | case "hi+":
273 | case "high+":
274 | case "1+":
275 | targetPin.type = "gpio_pu"
276 | targetPin.gpioDirection = "out"
277 | targetPin.gpioValue = "high"
278 | break;
279 | case "hi-":
280 | case "high-":
281 | case "1-":
282 | targetPin.type = "gpio_pd"
283 | targetPin.gpioDirection = "out"
284 | targetPin.gpioValue = "high"
285 | break;
286 | case "lo+":
287 | case "low+":
288 | case "0+":
289 | targetPin.type = "gpio_pu"
290 | targetPin.gpioDirection = "out"
291 | targetPin.gpioValue = "low"
292 | break;
293 | case "lo-":
294 | case "low-":
295 | case "0-":
296 | targetPin.type = "gpio_pd"
297 | targetPin.gpioDirection = "out"
298 | targetPin.gpioValue = "low"
299 | break;
300 | default:
301 | targetPin.type = lineData[1]
302 | }
303 |
304 | if (lineData.length > 2)
305 | {
306 | targetPin.description = lineData[2]
307 | for (var j = 3; j < lineData.length; ++j)
308 | targetPin.description += " " + lineData[j]
309 | }
310 | }
311 | }
312 | }
313 |
314 | //console.log(overlays)
315 | for (var i = 0; i < overlays.length; ++i) {
316 | overlaySelector.selectOverlay(overlays[i])
317 | }
318 |
319 | modified = false
320 |
321 | return true
322 | }
323 |
324 | function saveConfig(fileName) {
325 | var data = ""
326 |
327 | data += "# File generated with BB pin configurator\n"
328 | data += "# title: " + documentTitle + "\n"
329 |
330 | // exporting overlays
331 | for (var i = 0; i < overlaySelector.output.length; ++i)
332 | {
333 | data += "overlay " + overlaySelector.output[i] + "\n"
334 | }
335 |
336 | // exporting pins
337 | for (var i = 0; i < portList.length; ++i)
338 | {
339 | var port = i+8
340 | for (var j = 0; j < portList[i].pinList.length; ++j)
341 | {
342 | var sourcePin = portList[i].pinList[j]
343 | var pin = j+1
344 |
345 | if ((sourcePin.overlay === []) || (sourcePin.type === "reserved")) // this is a reserved pin
346 | continue
347 |
348 | var contained = false
349 | for (var k = 0; k < sourcePin.overlay.length; ++k) {
350 | if (sourcePin.loadedOverlays.indexOf(sourcePin.overlay[k]) !== -1) { // overlay not loaded
351 | contained = true
352 | break
353 | }
354 | }
355 | if (!contained) // overlay not loaded
356 | continue
357 |
358 | var pinName = "P" + port + "_" + pin
359 | var command = pinName + " "
360 |
361 | if (sourcePin.type === "gpio")
362 | {
363 | if ((sourcePin.gpioValue !== "unmodified") && (sourcePin.gpioDirection === "out"))
364 | {
365 | command += sourcePin.gpioValue
366 | }
367 | else if (sourcePin.gpioDirection !== "unmodified")
368 | {
369 | command += sourcePin.gpioDirection
370 | }
371 | else
372 | {
373 | command += "gpio"
374 | }
375 | }
376 | else if (sourcePin.type === "gpio_pu")
377 | {
378 | if ((sourcePin.gpioValue !== "unmodified") && (sourcePin.gpioDirection === "out"))
379 | {
380 | command += sourcePin.gpioValue + "+"
381 | }
382 | else if (sourcePin.gpioDirection !== "unmodified")
383 | {
384 | command += sourcePin.gpioDirection + "+"
385 | }
386 | else
387 | {
388 | command += "gpio_pu"
389 | }
390 | }
391 | else if (sourcePin.type === "gpio_pd")
392 | {
393 | if ((sourcePin.gpioValue !== "unmodified") && (sourcePin.gpioDirection === "out"))
394 | {
395 | command += sourcePin.gpioValue + "-"
396 | }
397 | else if (sourcePin.gpioDirection !== "unmodified")
398 | {
399 | command += sourcePin.gpioDirection + "-"
400 | }
401 | else
402 | {
403 | command += "gpio_pd"
404 | }
405 | }
406 | else
407 | {
408 | command += sourcePin.type
409 | }
410 |
411 | if (sourcePin.description.length > 0)
412 | {
413 | command += " #" + sourcePin.description
414 | }
415 |
416 | data += command + "\n"
417 | }
418 | }
419 |
420 | configFile.url = fileName
421 | configFile.data = data
422 | configFile.save()
423 |
424 | if (configFile.error)
425 | {
426 | console.log("file error")
427 | return false
428 | }
429 |
430 | modified = false
431 |
432 | return true
433 | }
434 |
435 | function rgb2hsv (color) {
436 | var computedH = 0;
437 | var computedS = 0;
438 | var computedV = 0;
439 | var r = color.r;
440 | var g = color.g;
441 | var b = color.b;
442 |
443 | var minRGB = Math.min(r,Math.min(g,b));
444 | var maxRGB = Math.max(r,Math.max(g,b));
445 |
446 | // Black-gray-white
447 | if (minRGB === maxRGB) {
448 | computedV = minRGB;
449 | return {h: 0, s: 0, v: computedV};
450 | }
451 |
452 | // Colors other than black-gray-white:
453 | var d = (r === minRGB) ? g-b : ((b === minRGB) ? r-g : b-r);
454 | var h = (r === minRGB) ? 3 : ((b === minRGB) ? 1 : 5);
455 | computedH = 60*(h - d/(maxRGB - minRGB));
456 | computedS = (maxRGB - minRGB)/maxRGB;
457 | computedV = maxRGB;
458 | return {h: computedH, s: computedS, v: computedV};
459 | }
460 |
--------------------------------------------------------------------------------
/qml/Legend.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.0
21 | import QtQuick.Controls 1.0
22 |
23 | GroupBox {
24 | property var colorMap: [["GPIO", "red"], ["I2C", "blue"], ["UART", "green"]]
25 | property var pinList: []
26 | property string previewType: ""
27 | property int pinSize: main.width*0.125
28 | property int pinSpacing: 2
29 |
30 | id: main
31 | width: 100
32 | title: qsTr("Legend")
33 |
34 | Component.onCompleted: {
35 | refreshPins()
36 | }
37 |
38 | onColorMapChanged: {
39 | if (pinList == undefined)
40 | {
41 | return
42 | }
43 |
44 | refreshPins()
45 | }
46 |
47 | Grid {
48 | id: grid
49 | anchors.top: parent.top
50 | anchors.bottom: parent.bottom
51 | columns: 1
52 | rows: colorMap.length
53 | spacing: main.pinSpacing
54 | }
55 |
56 | function refreshPins() {
57 | for (var i = 0; i < pinList.length; ++i)
58 | {
59 | pinList[i].destroy()
60 | }
61 | pinList = []
62 |
63 | for (var i = 0; i < colorMap.length; ++i)
64 | {
65 | createPin(i)
66 | }
67 |
68 | //main.height = colorMap.length * (main.pinSize + main.pinSpacing) + 30
69 | }
70 |
71 | function createPin(number) {
72 | var component;
73 | var sprite;
74 | var numberVisible;
75 |
76 | numberVisible = false
77 |
78 | component = Qt.createComponent("Pin.qml");
79 | sprite = component.createObject(grid, {"width": Qt.binding(function(){return main.pinSize}),
80 | "height": Qt.binding(function(){return main.pinSize}),
81 | "number": number*2,
82 | "numberVisible": numberVisible,
83 | "description": main.colorMap[number][0],
84 | "colorMap": main.colorMap,
85 | "type": main.colorMap[number][0],
86 | "editable": false,
87 | "previewEnabled": true,
88 | "previewType": ""});
89 | sprite.type = main.colorMap[number][0]
90 | sprite.previewEntered.connect(main.previewEntered)
91 | sprite.previewExited.connect(main.previewExited)
92 |
93 | if (sprite === null) {
94 | // Error Handling
95 | console.log("Error creating object");
96 | }
97 |
98 | main.pinList.push(sprite)
99 | }
100 |
101 | function previewEntered(type) {
102 | main.previewType = type
103 | }
104 |
105 | function previewExited() {
106 | main.previewType = ""
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/qml/OverlaySelector.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.0
21 | import QtQuick.Controls 1.0
22 |
23 | GroupBox {
24 | property var input: ["test", "test2", "test3"]
25 | property var output: []
26 | property string hoveredItem: ""
27 |
28 | id: main
29 |
30 | ListModel {
31 | id: listModel
32 |
33 | }
34 |
35 | Column {
36 | id: container
37 | Repeater {
38 | id: listView
39 | model: listModel
40 | CheckBox {
41 | text: name
42 | checked: itemChecked
43 | onClicked: selectionChanged(index, checked)
44 | onHoveredChanged: hovered ? main.hoveredItem = text : main.hoveredItem = ""
45 | }
46 | }
47 | }
48 |
49 | onInputChanged: {
50 | listModel.clear()
51 | output = []
52 | for (var i = 0; i < input.length; ++i)
53 | {
54 | listModel.append({"name": input[i], "index": i, "itemChecked": false})
55 | }
56 | }
57 |
58 | function selectionChanged(id, value) {
59 | var output = main.output
60 | if (value === true)
61 | {
62 | output.push(input[id])
63 | }
64 | else
65 | {
66 | var foundIndex = output.indexOf(input[id])
67 | if (foundIndex > -1)
68 | {
69 | output.splice(foundIndex, 1)
70 | }
71 | }
72 |
73 | main.output = output
74 | }
75 |
76 | function clearSelection() {
77 | for (var i = 0; i < input.length; ++i) {
78 | listModel.get(i).itemChecked = false
79 | }
80 | main.output = []
81 | }
82 |
83 | function selectOverlay(name) {
84 | var index = input.indexOf(name)
85 |
86 | if (index == -1) {
87 | console.log("unknown overlay")
88 | return
89 | }
90 |
91 | listModel.get(index).itemChecked = true
92 | selectionChanged(index, true)
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/qml/Pin.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.0
21 | import QtQuick.Controls 1.1
22 | import QtQuick.Controls.Styles 1.1
23 | import "Functions.js" as Functions
24 |
25 | Item {
26 | property string defaultFunction: "GPIO" // function when cape is not loded
27 | property var functions: ["GPIO", "I2C", "UART"] // pinmux functions
28 | property var info: ["gpio1_0", "gpio1_0", "i2c1_cs", "uart0_sck"] // info to default function and pinmux functions
29 | property string type: "GPIO" // current selected type
30 | property var overlay: ["cape-test"] // overlay that is necessary for pinmuxing
31 | property var loadedOverlays: ["cape-test", "cape-test2"] // currently loaded overlay
32 | property bool pinmuxActive: getPinmuxActive() // determines wheter the pinmux is active or not
33 | property string previewType: "" // type for preview mode
34 | property string previewOverlay: "" // overlay for preview mode
35 | property bool previewEnabled: false // enabled the preview mdoe
36 | property bool previewActive: getPreviewActive() // holds whether the preview is active or not
37 | property string gpioDirection: "unmodified" // type of the gpio pin (in or out)
38 | property var gpioDirections: ["unmodified", "in", "out"]
39 | property string gpioValue: "unmodified" // startup gpio value
40 | property var gpioValues: ["unmodifed", "low", "high"]
41 | property int pinNumber: 0 // number of the pin
42 | property int portNumber: 0
43 | property int pruPinNumber: 0
44 | property int kernelPinNumber: 0
45 | property var colorMap: [["GPIO", "red"], ["I2C", "blue"], ["UART", "green"]] // current avtive color map
46 | property alias numberVisible: numberText.visible // visibility of the number
47 | property string description: "Test" // descriptive text for the pin
48 | property bool editable: getEditable() // editability of the pin
49 | property alias textInput: descriptionTextInput // currently active text input
50 | property string infoText: getInfoText() // info text for the pin
51 | property int configMode: 0 // active config mode: 0=function, 1=gpio dir, 2=gpio value
52 | property double uneditableOpacitiy: (configMode == 0)?(displayUneditablePins?1.0:0.1):0.2
53 | property bool rightSide: ((main.pinNumber % 2) == 0)
54 |
55 | property bool displayUneditablePins: true
56 |
57 | signal previewEntered(string type)
58 | signal previewExited()
59 | signal dataChangedUnfiltered()
60 | signal dataChanged()
61 |
62 | Component.onCompleted: {
63 | onTypeChanged.connect(dataChangedUnfiltered)
64 | onGpioDirectionChanged.connect(dataChangedUnfiltered)
65 | onGpioValueChanged.connect(dataChangedUnfiltered)
66 | textInput.onTextChanged.connect(dataChangedUnfiltered)
67 | }
68 |
69 | onDataChangedUnfiltered: {
70 | if ((pinNumber != 0) && (portNumber != 0)) // this fixed the wrong behaviour when config mode is switched
71 | dataChanged()
72 | }
73 |
74 | function getPinmuxActive() {
75 | var overlayActive = false
76 | for (var i = 0; i < overlay.length; ++i) {
77 | if (overlay[i] === "") {
78 | continue
79 | }
80 |
81 | if (loadedOverlays.indexOf(overlay[i]) !== -1) {
82 | overlayActive = true
83 | break
84 | }
85 | }
86 |
87 | return (overlayActive) && ((functions.length > 0) && (functions[0] !== "reserved"))
88 | }
89 |
90 | function getEditable() {
91 | switch (configMode) {
92 | case 0: return pinmuxActive
93 | case 1: return ((type === "gpio") || (type === "gpio_pu") || (type === "gpio_pd"))
94 | case 2: return (((type === "gpio") || (type === "gpio_pu") || (type === "gpio_pd")) && (gpioDirection === "out"))
95 | default: return false
96 | }
97 | }
98 |
99 | function getInfoText() {
100 | var functionIndex = functions.indexOf((previewActive?previewType:type))
101 | if (!pinmuxActive && !previewActive)
102 | return info[0]
103 |
104 | if ((previewActive) && previewType == defaultFunction)
105 | return info[0]
106 |
107 | if ((functionIndex != -1) && (info.length > (functionIndex+1))) {
108 | return info[functionIndex+1]
109 | }
110 | else {
111 | return ""
112 | }
113 | }
114 |
115 | function getColor() {
116 | var searchValue
117 |
118 | if (main.configMode == 1) {
119 | searchValue = main.gpioDirection
120 | }
121 | else if (main.configMode == 2) {
122 | searchValue = main.gpioValue
123 | }
124 | else if (main.previewActive) {
125 | if (main.previewType != "")
126 | searchValue = main.previewType
127 | else if (overlayPreviewTimer.x) // previewing an overlay -> blinking
128 | return "white"
129 | else
130 | searchValue = main.defaultFunction
131 | }
132 | else if (main.pinmuxActive) {
133 | searchValue = main.type
134 | }
135 | else {
136 | searchValue = main.defaultFunction
137 | }
138 |
139 | for (var i = 0; i < main.colorMap.length; ++i)
140 | {
141 | if (main.colorMap[i][0] === searchValue)
142 | {
143 | return main.colorMap[i][1]
144 | }
145 | }
146 | return "grey"
147 | }
148 |
149 | function getPreviewActive() {
150 |
151 | if (previewEnabled && (previewType == "") && (overlay.indexOf(previewOverlay) != -1))
152 | return true
153 |
154 | if ((!previewEnabled) || (previewType == ""))
155 | return false
156 |
157 | if (previewType === defaultFunction)
158 | return true
159 |
160 | if (functions.indexOf(previewType) != -1)
161 | return true;
162 |
163 | return false;
164 | }
165 |
166 | id: main
167 | width: 100
168 | height: 62
169 |
170 | Timer {
171 | property color previewColor: "white"
172 | property bool x: true
173 | id: overlayPreviewTimer
174 | interval: 400
175 | running: previewActive && (previewOverlay != "")
176 | repeat: true
177 | onTriggered: x = !x
178 | }
179 |
180 | ToolTip {
181 | anchors.left: rightSide?parent.right:undefined
182 | anchors.leftMargin: parent.width*0.8
183 | anchors.right: !rightSide?parent.left:undefined
184 | anchors.rightMargin: anchors.leftMargin
185 | width: childrenRect.width + main.width
186 | height: childrenRect.height + main.width
187 | color: "white"
188 | border.color: "black"
189 |
190 | visible: (comboBox.hovered || comboBox2.hovered || comboBox3.hovered || mouseArea.containsMouse) && !(previewEnabled && (previewType == ""))
191 | z: 1000
192 |
193 | Text {
194 | x: main.width/2
195 | y: main.width/2
196 | font.pixelSize: 0
197 | text: "P" + portNumber + "_" + pinNumber + " " +
198 | infoText + " (" + (pinmuxActive?type:defaultFunction) + ")" +
199 | ((kernelPinNumber != 0)?" " + qsTr("Kernel Pin: ") + kernelPinNumber:"") +
200 | ((pruPinNumber != 0)?" " + qsTr("PRU Pin: ") + pruPinNumber:"")
201 | }
202 | }
203 |
204 | Rectangle {
205 | id: pinRect
206 | anchors.fill: parent
207 | color: getColor()
208 | opacity: (editable || previewActive || (previewEnabled && previewType == ""))?1.0:uneditableOpacitiy
209 | }
210 |
211 | Text {
212 | id: numberText
213 | anchors.fill: parent
214 | color: ((pinRect.opacity > 0.5) && (pinRect.color.r+pinRect.color.g+pinRect.color.b) < 2.0)?"white":"black"
215 | horizontalAlignment: Text.AlignHCenter
216 | verticalAlignment: Text.AlignVCenter
217 | text: main.pinNumber
218 | font.bold: true
219 | font.pixelSize: parent.width*0.6
220 | }
221 |
222 | ComboBox {
223 | id: comboBox
224 | anchors.fill: parent
225 | model: main.functions
226 | style: ComboBoxStyle {
227 | background: Item {}
228 | label: Item {}
229 | }
230 | visible: (main.editable && (main.configMode == 0))
231 |
232 | Binding { target: main; property: "type"; value: comboBox.currentText}
233 | //Binding { target: comboBox; property: "currentText"; value: main.type} // This binding does not do what it should do
234 | Timer { // and this is the reason for this timer
235 | repeat: true // updating the index of the combo box
236 | interval: 100
237 | running: parent.visible
238 | onTriggered: {
239 | if (parent.currentText !== main.type)
240 | parent.currentIndex = parent.model.indexOf(main.type)
241 | }
242 | }
243 |
244 | Keys.onPressed: {
245 | if ((event.key === Qt.Key_Menu) || (event.key === Qt.Key_Tab) || (event.key === Qt.Key_Return)) {
246 | textInput.forceActiveFocus()
247 | }
248 | }
249 | }
250 |
251 | ComboBox {
252 | id: comboBox2
253 | anchors.fill: parent
254 | model: main.gpioDirections
255 | style: ComboBoxStyle {
256 | background: Item {}
257 | label: Item {}
258 | }
259 | visible: (main.editable && (main.configMode == 1))
260 |
261 | Binding { target: main; property: "gpioDirection"; value: comboBox2.currentText}
262 | //Binding { target: comboBox2; property: "currentText"; value: main.gpioDirection} // This binding does not do what it should do
263 | Timer { // and this is the reason for this timer
264 | repeat: true // updating the index of the combo box
265 | interval: 100
266 | running: parent.visible
267 | onTriggered: {
268 | if (parent.currentText !== main.gpioDirection)
269 | parent.currentIndex = parent.model.indexOf(main.gpioDirection)
270 | }
271 | }
272 |
273 | Keys.onPressed: {
274 | if ((event.key === Qt.Key_Menu) || (event.key === Qt.Key_Tab) || (event.key === Qt.Key_Return)) {
275 | textInput.forceActiveFocus()
276 | }
277 | }
278 | }
279 |
280 | ComboBox {
281 | id: comboBox3
282 | anchors.fill: parent
283 | model: main.gpioValues
284 | style: ComboBoxStyle {
285 | background: Item {}
286 | label: Item {}
287 | }
288 | visible: (main.editable && (main.configMode == 2))
289 |
290 | Binding { target: main; property: "gpioValue"; value: comboBox3.currentText}
291 | //Binding { target: comboBox3; property: "currentText"; value: main.gpioValue} // This binding does not do what it should do
292 | Timer { // and this is the reason for this timer
293 | repeat: true // updating the index of the combo box
294 | interval: 100
295 | running: parent.visible
296 | onTriggered: {
297 | if (parent.currentText !== main.gpioValue)
298 | parent.currentIndex = parent.model.indexOf(main.gpioValue)
299 | }
300 | }
301 |
302 | Keys.onPressed: {
303 | if ((event.key === Qt.Key_Menu) || (event.key === Qt.Key_Tab) || (event.key === Qt.Key_Return)) {
304 | textInput.forceActiveFocus()
305 | }
306 | }
307 | }
308 |
309 | TextInput {
310 | id: descriptionTextInput
311 | anchors.verticalCenter: parent.verticalCenter
312 | anchors.left: rightSide ? parent.right : undefined
313 | anchors.leftMargin: parent.width * 0.8
314 | anchors.right: rightSide ? undefined : parent.left
315 | anchors.rightMargin: anchors.leftMargin
316 | width: parent.width*8
317 | horizontalAlignment: rightSide ? TextInput.AlignLeft : TextInput.AlignRight
318 | font.pixelSize: parent.width*0.9
319 | visible: !previewActive
320 | readOnly: !main.editable
321 | selectByMouse: true
322 |
323 | MouseArea {
324 | anchors.fill: parent
325 | cursorShape: main.editable? Qt.IBeamCursor: Qt.ArrowCursor
326 | enabled: false
327 | }
328 |
329 | Binding { target: main; property: "description"; value: descriptionTextInput.text }
330 | Binding { target: descriptionTextInput; property: "text"; value: main.description }
331 |
332 | Keys.onPressed: {
333 | if ((event.key === Qt.Key_Menu) || (event.key === Qt.Key_Return)) {
334 | var target
335 | switch (main.configMode) {
336 | case 0: target = comboBox; break;
337 | case 1: target = comboBox2; break;
338 | case 2: target = comboBox3; break;
339 | }
340 | target.forceActiveFocus()
341 | }
342 | }
343 | }
344 |
345 | Text {
346 | id: descriptionInfoText
347 | anchors.verticalCenter: descriptionTextInput.verticalCenter
348 | anchors.left: rightSide ? descriptionTextInput.left : undefined
349 | anchors.right: rightSide ? undefined : descriptionTextInput.right
350 | width: descriptionTextInput.width
351 | horizontalAlignment: descriptionTextInput.horizontalAlignment
352 | font: descriptionTextInput.font
353 | visible: previewActive
354 | text: main.infoText
355 | }
356 |
357 | MouseArea {
358 | id: mouseArea
359 | anchors.fill: parent
360 | cursorShape: main.editable? Qt.PointingHandCursor: Qt.ArrowCursor
361 | enabled: (previewEnabled && (previewType == "")) || !editable
362 | hoverEnabled: enabled
363 | onHoveredChanged: {
364 | if (containsMouse)
365 | {
366 | previewEntered(main.type)
367 | }
368 | else
369 | {
370 | previewExited()
371 | }
372 | }
373 | }
374 | }
375 |
--------------------------------------------------------------------------------
/qml/Port.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.0
21 |
22 | Rectangle {
23 | property int pinCount: 92
24 | property int pinRows: 2
25 | property int pinNumberingInterval: 5
26 | property var pinList: []
27 | property var currentColorMap: [[["GPIO", "red"], ["I2C", "blue"], ["UART", "green"]]]
28 | property var loadedOverlays: []
29 | property string previewType: ""
30 | property string previewOverlay: ""
31 | property bool previewEnabled: false
32 | property int configMode: 0
33 | property int portNumber: 0
34 | property bool displayUneditablePins: true
35 | property bool ready: false
36 |
37 | signal dataChanged()
38 |
39 | function createPin(number, numPins) {
40 | var component;
41 | var sprite;
42 | var numberVisible;
43 |
44 | numberVisible = ((number % (main.pinNumberingInterval*main.pinRows) == 0)
45 | || (number % (main.pinNumberingInterval*main.pinRows) == ((main.pinNumberingInterval-1)*main.pinRows+1))
46 | || (number === 1)
47 | || (number === main.pinRows))
48 |
49 | component = Qt.createComponent("Pin.qml");
50 | sprite = component.createObject(grid, {"width": Qt.binding(function(){return main.width*0.36}),
51 | "height": Qt.binding(function(){return main.width*0.36}),
52 | "pinNumber": number,
53 | "portNumber": Qt.binding(function(){return main.portNumber}),
54 | "numberVisible": numberVisible,
55 | "colorMap": Qt.binding(function(){return main.currentColorMap}),
56 | "functions": [],
57 | "loadedOverlays": Qt.binding(function(){return main.loadedOverlays}),
58 | "previewType": Qt.binding(function(){return main.previewType}),
59 | "previewOverlay": Qt.binding(function(){return main.previewOverlay}),
60 | "previewEnabled": Qt.binding(function(){return main.previewEnabled}),
61 | "configMode": Qt.binding(function(){return main.configMode}),
62 | "displayUneditablePins": Qt.binding(function(){return main.displayUneditablePins}),
63 | "z": numPins-number,
64 | "visible": false});
65 |
66 | if (sprite === null) {
67 | // Error Handling
68 | console.log("Error creating object");
69 | }
70 |
71 | sprite.onDataChanged.connect(main.dataChanged)
72 |
73 | main.pinList.push(sprite)
74 | }
75 |
76 | function createTabOrder() {
77 | var numPins = main.pinCount
78 | // set tab order
79 | for (var i = 0; i < (numPins-1); ++i)
80 | {
81 | // skip reserved pins
82 | if (!pinList[i].editable)
83 | continue;
84 |
85 | // search tab
86 | for (var j = i+1; j < numPins; ++j)
87 | {
88 | if (pinList[j].editable) {
89 | pinList[i].textInput.KeyNavigation.tab = pinList[j].textInput
90 | break;
91 | }
92 | }
93 |
94 | // search up and down
95 | for (var j = i+2; j < numPins; j += 2)
96 | {
97 | if (pinList[j].editable) {
98 | pinList[i].textInput.KeyNavigation.down = pinList[j].textInput
99 | break;
100 | }
101 | }
102 | }
103 | }
104 |
105 | id: main
106 |
107 | width: 50
108 | height: grid.height + grid.spacing * 4
109 | color: "white"
110 | border.color: "black"
111 | border.width: main.width * 0.05
112 |
113 | Component.onCompleted: {
114 | var numPins = main.pinCount
115 | for (var i = 1; i < (numPins+1); ++i)
116 | {
117 | createPin(i, numPins)
118 | }
119 |
120 | main.ready = true
121 | }
122 |
123 | Grid {
124 | id: grid
125 | spacing: main.width * 0.06
126 | columns: main.pinRows
127 | anchors.horizontalCenter: parent.horizontalCenter
128 | anchors.top: parent.top
129 | anchors.margins: spacing * 2
130 | }
131 | }
132 |
133 |
--------------------------------------------------------------------------------
/qml/ToolTip.qml:
--------------------------------------------------------------------------------
1 | /*
2 | Part of QML ToolTip from bobbaluba
3 | https://github.com/bobbaluba/qmltooltip
4 | */
5 | import QtQuick 2.0
6 | import QtQuick.Controls 1.1
7 |
8 | Rectangle {
9 | property int verticalPadding: 1
10 | property int horizontalPadding: 5
11 |
12 | width: childrenRect.width + 10
13 | height: childrenRect.height + 10
14 |
15 | id:tooltip
16 | visible:false
17 | onVisibleChanged: if(visible)fadein.start();
18 |
19 | NumberAnimation {
20 | id: fadein
21 | target: tooltip
22 | property: "opacity"
23 | easing.type: Easing.InOutQuad
24 | duration: 300
25 | from: 0
26 | to: 1
27 | }
28 |
29 | NumberAnimation {
30 | id: fadeout
31 | target: tooltip
32 | property: "opacity"
33 | easing.type: Easing.InOutQuad
34 | from: 1
35 | to: 0
36 | onStopped: visible = false;
37 | }
38 |
39 | function show(){
40 | visible = true;
41 | fadein.start();
42 | }
43 | function hide(){
44 | fadeout.start();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/qml/ToolTipArea.qml:
--------------------------------------------------------------------------------
1 | /*
2 | Part of QML ToolTip from bobbaluba
3 | https://github.com/bobbaluba/qmltooltip
4 | */
5 | import QtQuick 2.0
6 |
7 | MouseArea {
8 | property alias tip: tip
9 | property alias text: tip.text
10 | property alias hideDelay: hideTimer.interval
11 | property alias showDelay: showTimer.interval
12 | id: mouseArea
13 | anchors.fill: parent
14 | hoverEnabled: true
15 | Timer {
16 | id:showTimer
17 | interval: 1000
18 | running: mouseArea.containsMouse && !tip.visible
19 | onTriggered: tip.show();
20 | }
21 | Timer {
22 | id:hideTimer
23 | interval: 100
24 | running: !mouseArea.containsMouse && tip.visible
25 | onTriggered: tip.hide();
26 | }
27 | ToolTip{
28 | id:tip
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/qml/colormap.txt:
--------------------------------------------------------------------------------
1 | power #800000
2 | gnd black
3 | system #008080
4 | adc #510051
5 | hdmi #00006B
6 | emmc #004000
7 | default grey
8 | gpio #0062FF
9 | gpio_pu #448CFF
10 | gpio_pd #4444FF
11 | pruout #00C000
12 | pruin #00AD00
13 | pru_ecap #009900
14 | pru_uart #009900
15 | pwm #FF0000
16 | pwm2 #FF4444
17 | uart #662222
18 | i2c #00FFFF
19 | spi #FF00FF
20 | spics #FF00FF
21 | spiclk #FF00FF
22 | can #AAFFAA
23 | qep orange
24 | timer yellow
25 |
--------------------------------------------------------------------------------
/qml/colormap1.txt:
--------------------------------------------------------------------------------
1 | unmodified grey
2 | in blue
3 | out red
4 |
--------------------------------------------------------------------------------
/qml/colormap2.txt:
--------------------------------------------------------------------------------
1 | unmodified grey
2 | low blue
3 | high red
4 |
--------------------------------------------------------------------------------
/qml/main.qml:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 | Copyright (c) 2014 Alexander Rössler
3 |
4 | This file is part of BBPinConfig.
5 |
6 | BBIOConfig is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | BBIOConfig is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with BBIOConfig. If not, see .
18 |
19 | *****************************************************************************/
20 | import QtQuick 2.2
21 | import QtQuick.Controls 1.1
22 | import QtQuick.Dialogs 1.1
23 |
24 | ApplicationWindow {
25 | property string name: qsTr("BB Universal IO Configurator (BBIOConfig)")
26 |
27 | id: applicationWindow
28 |
29 | title: (bbioConfig.currentFileName + (bbioConfig.modified? qsTr(" [modified] ") : "") + " - ") + applicationWindow.name
30 | visible: true
31 | width: 1000
32 | height: 800
33 |
34 | menuBar: MenuBar {
35 | Menu {
36 | title: qsTr("&File")
37 | MenuItem {
38 | text: qsTr("&New")
39 | iconName: "document-new"
40 |
41 | onTriggered: aboutToCreateNewDocument()
42 |
43 | action: Action {
44 | shortcut: "Ctrl+N"
45 | tooltip: qsTr("Create a new config")
46 | }
47 | }
48 |
49 | MenuItem {
50 | text: qsTr("&Open...")
51 | iconName: "document-open"
52 |
53 | onTriggered: fileOpenDialog.visible = true
54 |
55 | action: Action {
56 | shortcut: "Ctrl+O"
57 | tooltip: qsTr("Open a config file..")
58 | }
59 | }
60 |
61 | MenuSeparator {}
62 |
63 | MenuItem {
64 | text: qsTr("&Save")
65 | iconName: "document-save"
66 |
67 | onTriggered: bbioConfig.currentFile == "" ? fileSaveDialog.visible = true : bbioConfig.saveDocument("")
68 |
69 | action: Action {
70 | shortcut: "Ctrl+S"
71 | tooltip: qsTr("Saves the config file")
72 | }
73 | }
74 |
75 | MenuItem {
76 | text: qsTr("Save &As..")
77 | iconName: "document-save-as"
78 |
79 | onTriggered: fileSaveDialog.visible = true
80 |
81 | action: Action {
82 | shortcut: "Ctrl+Shift+S"
83 | tooltip: qsTr("Saves the config file as..")
84 | }
85 | }
86 |
87 | MenuSeparator {}
88 |
89 | MenuItem {
90 | text: qsTr("E&xit")
91 | iconName: "application-exit"
92 |
93 | onTriggered: aboutToClose()
94 |
95 | action: Action {
96 | shortcut: "Ctrl+Q"
97 | tooltip: qsTr("Exit")
98 | }
99 | }
100 | }
101 | Menu {
102 | title: qsTr("&Help")
103 | MenuItem {
104 | text: qsTr("&Online Documentation")
105 | iconName: "help-contents"
106 |
107 | onTriggered: Qt.openUrlExternally("https://github.com/strahlex/BBIOConfig/wiki/User-Manual")
108 | }
109 |
110 | MenuSeparator {}
111 |
112 | MenuItem {
113 | text: qsTr("&About")
114 | iconName: "help-about"
115 |
116 | onTriggered: aboutDialog.visible = true
117 | }
118 | }
119 | }
120 |
121 | function aboutToClose() {
122 | if (bbioConfig.modified)
123 | {
124 | quitSaveDialog.quit = true
125 | quitSaveDialog.visible = true
126 | }
127 | else {
128 | Qt.quit()
129 | }
130 | }
131 |
132 | function aboutToCreateNewDocument() {
133 | if (bbioConfig.modified)
134 | {
135 | quitSaveDialog.quit = false
136 | quitSaveDialog.visible = true
137 | }
138 | else {
139 | bbioConfig.newDocument()
140 | }
141 | }
142 |
143 | onClosing: {
144 | close.accepted = false
145 | aboutToClose() === false
146 | }
147 |
148 | MessageDialog {
149 | id: aboutDialog
150 | title: qsTr("About BBIOConfig")
151 | text: qsTr("
" +
154 | "BBIOConfig is free software: you can redistribute it and/or modify " +
155 | "it under the terms of the GNU General Public License as published by " +
156 | "the Free Software Foundation, either version 3 of the License, or " +
157 | "(at your option) any later version.
" +
158 |
159 | "BBIOConfig is distributed in the hope that it will be useful, " +
160 | "but WITHOUT ANY WARRANTY; without even the implied warranty of " +
161 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " +
162 | "GNU General Public License for more details.