From c2a229808959268e0b39ee19fe3dae877cccbefd Mon Sep 17 00:00:00 2001 From: fly Date: Tue, 16 Apr 2024 14:35:14 +0200 Subject: [PATCH] Clean up to only leave the revision of the controller Signed-off-by: fly --- 3d/knob.stl | Bin 28884 -> 0 bytes LICENSE.md | 484 ------------------------------------- blockdiagram.svg | 192 --------------- firmware/.cargo/config | 11 - firmware/.gdbinit | 18 -- firmware/Cargo.lock | 505 --------------------------------------- firmware/Cargo.toml | 38 --- firmware/descriptor.wara | 25 -- firmware/hidtools.sh | 3 - firmware/memory.x | 6 - firmware/openocd.cfg | 12 - firmware/openocd.sh | 2 - firmware/src/device.rs | 142 ----------- firmware/src/main.rs | 143 ----------- firmware/swd.cfg | 1 - 15 files changed, 1582 deletions(-) delete mode 100644 3d/knob.stl delete mode 100644 LICENSE.md delete mode 100644 blockdiagram.svg delete mode 100644 firmware/.cargo/config delete mode 100644 firmware/.gdbinit delete mode 100644 firmware/Cargo.lock delete mode 100644 firmware/Cargo.toml delete mode 100644 firmware/descriptor.wara delete mode 100755 firmware/hidtools.sh delete mode 100644 firmware/memory.x delete mode 100644 firmware/openocd.cfg delete mode 100755 firmware/openocd.sh delete mode 100644 firmware/src/device.rs delete mode 100644 firmware/src/main.rs delete mode 100644 firmware/swd.cfg diff --git a/3d/knob.stl b/3d/knob.stl deleted file mode 100644 index 8a454fa3813f2e7509940e671afd4808f1386edc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28884 zcmbWgcT^Nf*v8umVgPdjT}2T@K@>0m(=%OW#kiv4x~P~}MT{hoU={^bkTomDg>}uD z>6tEd4JhUS=A3iR;Z`v_-#)e9z5DIC{Nd?y`uWvc@vXPQv~6O>j2;&;WN@va<3@+q zYB_SqsKGfbiV! z-5k9nU1EgYzYttyP02!}7bGifT1Jr{>1(xH`Fx%Kb8o%WW!df|UB0fqlaId1+YP#s z^XJNoySeJK3pVH^Y5reCOQT4jN==$8XS=)Vr7dfAOVZ{=He_T*2zeTFQ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D^VKuCH`F{f&hZU?_a48qFG(TaV|AlTSCmgM8~6slZd+oclkN_yN6U!amZ8_J z4Xa)_qL4tNus*b;fk_;<;- z?QL#s*m;MJ&x1&yYD??_O0? zMqyo9>xA3D7|#0q-w3X00ZAKl9RBXJqTMh3L!hTz>Iqk37wbnbghaSiJ{5N53kN-Eq zYJ<-!7J`rS39QHSbglKypZQ3&##Gkl|3+|?H6;td`V>9O%EHsN);oXZHENB6tj`vL zw_wD-5L{(V$wKh-tnGnoKx>Wix7O$XMsSriB@5Aq`9sgYe2KN*dAc~0S)VOL-~WT) zDr-s>!khW^F?}pP(OU1^2F6#`=l@1Gw<-w3X< zreqxA17B7nbQhW|!zl{F;`@!(DyGIgkBuC>+)w}CO0_1Qu^WyHjP zA-Kw#l7%??Vjy|@^hx17XdTbo2Cq?TU0I(k#AQZY{uhF)tSMQD^}o2#_qW>=`dzFa z>#Wc1S)czK!By6jEW}0@ldwpm(1x{6c)HeEAD=D67Dl}M7lNy-DOm`fhUIS(L9cK1 zL|i5IcB`I^T!L?~oyBq>fp4&W#0Vg`(Jl6W#qhsL|Fh%8bAodp@4I~V`QPQhH|TN1 z-fl_XVgujcC=z`M66lw(XNdg@3ABOfVoHDO|5IlzW)i`u2-_c1 zV!v^B9r!=(f&ItY6L}k8N^IA;;Vt&Rvhcr2g?kx%Ug9boshE-^J$L`R%`rB>c}et% zZ-Bsh=LDalxIIkCk{`>zlM46xtSW2+Oi3iLPOwJ*zuN;#i1mXhvD-T*hy71oVScf+ tn9|?5`p#BGXdUy8Dg90G_Q13-CzujD+rCzb{l9GdPpm6U7gLg?{|8LrrJw)+ diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index a512019..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,484 +0,0 @@ -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -COOPERATIVE NON-VIOLENT PUBLIC LICENSE (\"LICENSE\"). THE WORK IS -PROTECTED BY COPYRIGHT AND ALL OTHER APPLICABLE LAWS. ANY USE OF THE -WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS -PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED IN THIS -LICENSE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE -EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR -GRANTS YOU THE RIGHTS CONTAINED HERE IN AS CONSIDERATION FOR ACCEPTING -THE TERMS AND CONDITIONS OF THIS LICENSE AND FOR AGREEING TO BE BOUND BY -THE TERMS AND CONDITIONS OF THIS LICENSE. - -# Definitions - -An Act of War is any action of one country against any group either with -an intention to provoke a conflict or an action that occurs during a -declared war or during armed conflict between military forces of any -origin. This includes but is not limited to enforcing sanctions or -sieges, supplying armed forces, or profiting from the manufacture of -tools or weaponry used in military conflict. - -An Adaptation is a work based upon the Work, or upon the Work and other -pre-existing works, such as a translation, adaptation, derivative work, -arrangement of music or other alterations of a literary or artistic -work, or phonogram or performance and includes cinematographic -adaptations or any other form in which the Work may be recast, -transformed, or adapted including in any form recognizably derived from -the original, except that a work that constitutes a Collection will not -be considered an Adaptation for the purpose of this License. For the -avoidance of doubt, where the Work is a musical work, performance or -phonogram, the synchronization of the Work in timed-relation with a -moving image (\"synching\") will be considered an Adaptation for the -purpose of this License. In addition, where the Work is designed to -output a neural network the output of the neural network will be -considered an Adaptation for the purpose of this license. - -Bodily Harm is any physical hurt or injury to a person that interferes -with the health or comfort of the person and that is more than merely -transient or trifling in nature. - -Distribute is to make available to the public the original and copies of -the Work or Adaptation, as appropriate, through sale, gift or any other -transfer of possession or ownership. - -Incarceration is Confinement in a jail, prison, or any other place where -individuals of any kind are held against either their will or (if their -will cannot be determined) the will of their legal guardian or -guardians. In the case of a conflict between the will of the individual -and the will of their legal guardian or guardians, the will of the -individual will take precedence. - -Licensor is The individual, individuals, entity, or entities that -offer(s) the Work under the terms of this License - -Original Author is in the case of a literary or artistic work, the -individual, individuals, entity or entities who created the Work or if -no individual or entity can be identified, the publisher; and in -addition - -- in the case of a performance the actors, singers, musicians, - dancers, and other persons who act, sing, deliver, declaim, play in, - interpret or otherwise perform literary or artistic works or - expressions of folklore; - -- in the case of a phonogram the producer being the person or legal - entity who first fixes the sounds of a performance or other sounds; - and, - -- in the case of broadcasts, the organization that transmits the - broadcast. - -Work is the literary and/or artistic work offered under the terms of -this License including without limitation any production in the -literary, scientific and artistic domain, whatever may be the mode or -form of its expression including digital form, such as a book, pamphlet -and other writing; a lecture, address, sermon or other work of the same -nature; a dramatic or dramatico-musical work; a choreographic work or -entertainment in dumb show; a musical composition with or without words; -a cinematographic work to which are assimilated works expressed by a -process analogous to cinematography; a work of drawing, painting, -architecture, sculpture, engraving or lithography; a photographic work -to which are assimilated works expressed by a process analogous to -photography; a work of applied art; an illustration, map, plan, sketch -or three-dimensional work relative to geography, topography, -architecture or science; a performance; a broadcast; a phonogram; a -compilation of data to the extent it is protected as a copyrightable -work; or a work performed by a variety or circus performer to the extent -it is not otherwise considered a literary or artistic work. - -You means an individual or entity exercising rights under this License -who has not previously violated the terms of this License with respect -to the Work, or who has received express permission from the Licensor to -exercise rights under this License despite a previous violation. - -Publicly Perform means to perform public recitations of the Work and to -communicate to the public those public recitations, by any means or -process, including by wire or wireless means or public digital -performances; to make available to the public Works in such a way that -members of the public may access these Works from a place and at a place -individually chosen by them; to perform the Work to the public by any -means or process and the communication to the public of the performances -of the Work, including by public digital performance; to broadcast and -rebroadcast the Work by any means including signs, sounds or images. - -Reproduce is to make copies of the Work by any means including without -limitation by sound or visual recordings and the right of fixation and -reproducing fixations of the Work, including storage of a protected -performance or phonogram in digital form or other electronic medium. - -Software is any digital Work which, through use of a third-party piece -of Software or through the direct usage of itself on a computer system, -the memory of the computer is modified dynamically or semi-dynamically. -\"Software\", secondly, processes or interprets information. - -Source Code is Any digital Work which, through use of a third-party -piece of Software or through the direct usage of itself on a computer -system, the memory of the computer is modified dynamically or -semi-dynamically. \"Software\", secondly, processes or interprets -information. - -Surveilling is the use of the Work to either overtly or covertly observe -and record persons and or their activities. - -A Network Service is the use of a piece of Software to interpret or -modify information that is subsequently and directly served to users -over the Internet. - -To Discriminate is use of a work to differentiate between humans in a -such a way which prioritizes some above others on the basis of percieved -membership within certain groups. - -Hate Speech is Communication or any form of expression which is solely -for the purpose of expressing hatred for some group or advocating a form -of Discrimination between humans. - -Coercion is leveraging of the threat of force or use of force to -intimidate a person in order to gain compliance, or to offer large -incentives which aim to entice a person to act against their will. - -# Fair Dealing Rights - -Nothing in this License is intended to reduce, limit, or restrict any -uses free from copyright or rights arising from limitations or -exceptions that are provided for in connection with the copyright -protection under copyright law or other applicable laws. - -# License Grant - -Subject to the terms and conditions of this License, Licensor hereby -grants You a worldwide, royalty-free, non-exclusive, perpetual (for the -duration of the applicable copyright) license to exercise the rights in -the Work as stated below: - -To Reproduce the Work, to incorporate the Work into one or more -Collections, and to Reproduce the Work as incorporated in the -Collections - -To create and Reproduce Adaptations provided that any such Adaptation, -including any translation in any medium, takes reasonable steps to -clearly label, demarcate or otherwise identify that changes were made to -the original Work. For example, a translation could be marked \"The -original work was translated from English to Spanish,\" or a -modification could indicate \"The original work has been modified.\" - -To Distribute and Publicly Perform the Work including as incorporated in -Collections. - -To Distribute and Publicly Perform Adaptations. The above rights may be -exercised in all media and formats whether now known or hereafter -devised. The above rights include the right to make such modifications -as are technically necessary to exercise the rights in other media and -formats. This License constitutes the entire agreement between the -parties with respect to the Work licensed here. There are no -understandings, agreements or representations with respect to the Work -not specified here. Licensor shall not be bound by any additional -provisions that may appear in any communication from You. This License -may not be modified without the mutual written agreement of the Licensor -and You. All rights not expressly granted by Licensor are hereby -reserved, including but not limited to the rights set forth in -Non-waivable Compulsory License Schemes, Waivable Compulsory License -Schemes, and Voluntary License Schemes in the restrictions. - -# Restrictions - -The license granted in the license grant above is expressly made subject -to and limited by the following restrictions: - -You may Distribute or Publicly Perform the Work only under the terms of -this License. You must include a copy of, or the Uniform Resource -Identifier (URI) for, this License with every copy of the Work You -Distribute or Publicly Perform. You may not offer or impose any terms on -the Work that restrict the terms of this License or the ability of the -recipient of the Work to exercise the rights granted to that recipient -under the terms of the License. You may not sublicense the Work. You -must keep intact all notices that refer to this License and to the -disclaimer of warranties with every copy of the Work You Distribute or -Publicly Perform. When You Distribute or Publicly Perform the Work, You -may not impose any effective technological measures on the Work that -restrict the ability of a recipient of the Work from You to exercise the -rights granted to that recipient under the terms of the License. This -Section applies to the Work as incorporated in a Collection, but this -does not require the Collection apart from the Work itself to be made -subject to the terms of this License. If You create a Collection, upon -notice from any Licensor You must, to the extent practicable, remove -from the Collection any credit as requested. If You create an -Adaptation, upon notice from any Licensor You must, to the extent -practicable, remove from the Adaptation any credit as requested. - -## Commercial Restrictions - -You may not exercise any of the rights granted to You in the above -section in any manner that is primarily intended for or directed toward -commercial advantage or private monetary compensation unless you meet -the following requirements. - -i. You are a worker-owned business or worker-owned collective. - -ii. after tax, all financial gain, surplus, profits and benefits - produced by the business or collective are distributed among the - worker-owners unless a set amount is to be allocated towards - community projects as decided by a previously-established consensus - agreement between the worker-owners where all worker-owners agreed. - -iii. You are not using such rights on behalf of a business other than - those specified in (i) or (ii) above, nor are using such rights as - a proxy on behalf of a business with the intent to circumvent the - aforementioned restrictions on such a business. - -The exchange of the Work for other copyrighted works by means of digital -file-sharing or otherwise shall not be considered to be intended for or -directed toward commercial advantage or private monetary compensation, -provided there is no payment of any monetary compensation in connection -with the exchange of copyrighted works. - -If the Work meets the definition of Software, You may exercise the -rights granted in the license grant only if You provide a copy of the -corresponding Source Code from which the Work was derived in digital -form, or You provide a URI for the corresponding Source Code of the -Work, to any recipients upon request. - -If the Work is used as or for a Network Service, You may exercise the -rights granted in the license grant only if You provide a copy of the -corresponding Source Code from which the Work was derived in digital -form, or You provide a URI for the corresponding Source Code to the -Work, to any recipients of the data served or modified by the Web -Service. - -Any use by a business that is privately owned and managed, and that -seeks to generate profit from the labor of employees paid by salary or -other wages, is not permitted under this license. - -## - -You may exercise the rights granted in the license grant for any -purposes only if: - -i. You do not use the Work for the purpose of inflicting Bodily Harm on - human beings (subject to criminal prosecution or otherwise) outside - of providing medical aid or undergoing a voluntary procedure under - no form of Coercion. - -ii. You do not use the Work for the purpose of Surveilling or tracking - individuals for financial gain. - -iii. You do not use the Work in an Act of War. - -iv. You do not use the Work for the purpose of supporting or profiting - from an Act of War. - -v. You do not use the Work for the purpose of Incarceration. - -vi. You do not use the Work for the purpose of extracting, processing, - or refining, oil, gas, or coal. Or to in any other way to - deliberately pollute the environment as a byproduct of manufacturing - or irresponsible disposal of hazardous materials. - -vii. You do not use the Work for the purpose of expediting, - coordinating, or facilitating paid work undertaken by individuals - under the age of 12 years. - -viii. You do not use the Work to either Discriminate or spread Hate - Speech on the basis of sex, sexual orientation, gender identity, - race, age, disability, color, national origin, religion, caste, or - lower economic status. - -## - -If You Distribute, or Publicly Perform the Work or any Adaptations or -Collections, You must, unless a request has been made by any Licensor to -remove credit from a Collection or Adaptation, keep intact all copyright -notices for the Work and provide, reasonable to the medium or means You -are utilizing: - -i. the name of the Original Author (or pseudonym, if applicable) if - supplied, and/or if the Original Author and/or Licensor designate - another party or parties (e.g., a sponsor institute, publishing - entity, journal) for attribution (\"Attribution Parties\") in - Licensor\'s copyright notice, terms of service or by other - reasonable means, the name of such party or parties; - -ii. the title of the Work if supplied; - -iii. to the extent reasonably practicable, the URI, if any, that - Licensor to be associated with the Work, unless such URI does not - refer to the copyright notice or licensing information for the - Work; and, - -iv. in the case of an Adaptation, a credit identifying the use of the - Work in the Adaptation (e.g., \"French translation of the Work by - Original Author,\" or \"Screenplay based on original Work by - Original Author\"). - -If any Licensor has sent notice to request removing credit, You must, to -the extent practicable, remove any credit as requested. The credit -required by this Section may be implemented in any reasonable manner; -provided, however, that in the case of an Adaptation or Collection, at a -minimum such credit will appear, if a credit for all contributing -authors of the Adaptation or Collection appears, then as part of these -credits and in a manner at least as prominent as the credits for the -other contributing authors. For the avoidance of doubt, You may only use -the credit required by this Section for the purpose of attribution in -the manner set out above and, by exercising Your rights under this -License, You may not implicitly or explicitly assert or imply any -connection with, sponsorship or endorsement by the Original Author, -Licensor and/or Attribution Parties, as appropriate, of You or Your use -of the Work, without the separate, express prior written permission of -the Original Author, Licensor and/or Attribution Parties. - -Non-waivable Compulsory License Schemes. In those jurisdictions in which -the right to collect royalties through any statutory or compulsory -licensing scheme cannot be waived, the Licensor reserves the exclusive -right to collect such royalties for any exercise by You of the rights -granted under this License - -Waivable Compulsory License Schemes. In those jurisdictions in which the -right to collect royalties through any statutory or compulsory licensing -scheme can be waived, the Licensor reserves the exclusive right to -collect such royalties for any exercise by You of the rights granted -under this License if Your exercise of such rights is for a purpose or -use which is otherwise than noncommercial as permitted under Commercial -Restrictions and otherwise waives the right to collect royalties through -any statutory or compulsory licensing scheme. - -Voluntary License Schemes. The Licensor reserves the right to collect -royalties, whether individually or, in the event that the Licensor is a -member of a collecting society that administers voluntary licensing -schemes, via that society, from any exercise by You of the rights -granted under this License that is for a purpose or use which is -otherwise than noncommercial as permitted under the license grant. - -Except as otherwise agreed in writing by the Licensor or as may be -otherwise permitted by applicable law, if You Reproduce, Distribute or -Publicly Perform the Work either by itself or as part of any Adaptations -or Collections, You must not distort, mutilate, modify or take other -derogatory action in relation to the Work which would be prejudicial to -the Original Author\'s honor or reputation. Licensor agrees that in -those jurisdictions (e.g. Japan), in which any exercise of the right -granted in the license grant of this License (the right to make -Adaptations) would be deemed to be a distortion, mutilation, -modification or other derogatory action prejudicial to the Original -Author\'s honor and reputation, the Licensor will waive or not assert, -as appropriate, this Section, to the fullest extent permitted by the -applicable national law, to enable You to reasonably exercise Your right -under the license grant of this License (right to make Adaptations) but -not otherwise. - -Do not make any legal claim against anyone accusing the Work, with or -without changes, alone or with other works, of infringing any patent -claim. - -# Representations Warranties and Disclaimer - -UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR -OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY -KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, -INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, -FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF -LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, -WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -# Limitation on Liability - -EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL -LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, -INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF -THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED -OF THE POSSIBILITY OF SUCH DAMAGES. - -# Termination - -This License and the rights granted hereunder will terminate -automatically upon any breach by You of the terms of this License. -Individuals or entities who have received Adaptations or Collections -from You under this License, however, will not have their licenses -terminated provided such individuals or entities remain in full -compliance with those licenses. The Sections on definitions, fair -dealing rights, representations, warranties, and disclaimer, limitation -on liability, termination, and revised license versions will survive any -termination of this License. - -Subject to the above terms and conditions, the license granted here is -perpetual (for the duration of the applicable copyright in the Work). -Notwithstanding the above, Licensor reserves the right to release the -Work under different license terms or to stop distributing the Work at -any time; provided, however that any such election will not serve to -withdraw this License (or any other license that has been, or is -required to be, granted under the terms of this License), and this -License will continue in full force and effect unless terminated as -stated above. - -# Revised License Versions - -This License may receive future revisions in the original spirit of the -license intended to strengthen This License. Each version of This -License has an incrementing version number. - -Unless otherwise specified like in the below subsection The Licensor has -only granted this current version of This License for The Work. In this -case future revisions do not apply. - -The Licensor may specify that the latest available revision of This -License be used for The Work by either explicitly writing so or by -suffixing the License URI with a \"+\" symbol. - -The Licensor may specify that The Work is also available under the terms -of This License\'s current revision as well as specific future -revisions. The Licensor may do this by writing it explicitly or -suffixing the License URI with any additional version numbers each -separated by a comma. - -# Miscellaneous - -Each time You Distribute or Publicly Perform the Work or a Collection, -the Licensor offers to the recipient a license to the Work on the same -terms and conditions as the license granted to You under this License. - -Each time You Distribute or Publicly Perform an Adaptation, Licensor -offers to the recipient a license to the original Work on the same terms -and conditions as the license granted to You under this License. - -If the Work is classified as Software, each time You Distribute or -Publicly Perform an Adaptation, Licensor offers to the recipient a copy -and/or URI of the corresponding Source Code on the same terms and -conditions as the license granted to You under this License. - -If the Work is used as a Network Service, each time You Distribute or -Publicly Perform an Adaptation, or serve data derived from the Software, -the Licensor offers to any recipients of the data a copy and/or URI of -the corresponding Source Code on the same terms and conditions as the -license granted to You under this License. - -If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this License, and without further action -by the parties to this agreement, such provision shall be reformed to -the minimum extent necessary to make such provision valid and -enforceable. - -No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - -This License constitutes the entire agreement between the parties with -respect to the Work licensed here. There are no understandings, -agreements or representations with respect to the Work not specified -here. Licensor shall not be bound by any additional provisions that may -appear in any communication from You. This License may not be modified -without the mutual written agreement of the Licensor and You. - -The rights granted under, and the subject matter referenced, in this -License were drafted utilizing the terminology of the Berne Convention -for the Protection of Literary and Artistic Works (as amended on -September 28, 1979), the Rome Convention of 1961, the WIPO Copyright -Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and -the Universal Copyright Convention (as revised on July 24, 1971). These -rights and subject matter take effect in the relevant jurisdiction in -which the License terms are sought to be enforced according to the -corresponding provisions of the implementation of those treaty -provisions in the applicable national law. If the standard suite of -rights granted under applicable copyright law includes additional rights -not granted under this License, such additional rights are deemed to be -included in the License; this License is not intended to restrict the -license of any rights under applicable law. - diff --git a/blockdiagram.svg b/blockdiagram.svg deleted file mode 100644 index 38a0c77..0000000 --- a/blockdiagram.svg +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - 2x LEDs - - - - USB-? port - - - - Somecontroler - - - - Pot orrot-encFLOOD LT - - - - Pot orrot-encINTEG LT - - - - - - - diff --git a/firmware/.cargo/config b/firmware/.cargo/config deleted file mode 100644 index af1f29b..0000000 --- a/firmware/.cargo/config +++ /dev/null @@ -1,11 +0,0 @@ -[target.thumbv7m-none-eabi] -runner = 'arm-none-eabi-gdb' -rustflags = [ - "-C", "link-arg=-Tlink.x", -] - -[build] -target = "thumbv7m-none-eabi" - -[unstable] -build-std = ["core", "alloc"] diff --git a/firmware/.gdbinit b/firmware/.gdbinit deleted file mode 100644 index 098ff6f..0000000 --- a/firmware/.gdbinit +++ /dev/null @@ -1,18 +0,0 @@ -target remote :3333 - -monitor arm semihosting enable - -# # send captured ITM to the file itm.fifo -# # (the microcontroller SWO pin must be connected to the programmer SWO pin) -# # 8000000 must match the core clock frequency -# monitor tpiu config internal itm.fifo uart off 8000000 - -# # OR: make the microcontroller SWO pin output compatible with UART (8N1) -# # 2000000 is the frequency of the SWO pin -# monitor tpiu config external uart off 8000000 2000000 - -# # enable ITM port 0 -# monitor itm port 0 on - -load -step diff --git a/firmware/Cargo.lock b/firmware/Cargo.lock deleted file mode 100644 index 84b9dff..0000000 --- a/firmware/Cargo.lock +++ /dev/null @@ -1,505 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "bare-metal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "bare-metal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" - -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "bxcan" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ac3d0c0a542d0ab5521211f873f62706a7136df415676f676d347e5a41dd80" -dependencies = [ - "bitflags", - "embedded-hal", - "nb 1.1.0", - "vcell", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cortex-m" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" -dependencies = [ - "bare-metal 0.2.5", - "bitfield", - "embedded-hal", - "volatile-register", -] - -[[package]] -name = "cortex-m-rt" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" -dependencies = [ - "cortex-m-rt-macros", -] - -[[package]] -name = "cortex-m-rt-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cortex-m-semihosting" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c23234600452033cc77e4b761e740e02d2c4168e11dbf36ab14a0f58973592b0" -dependencies = [ - "cortex-m", -] - -[[package]] -name = "embedded-dma" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "firmware" -version = "0.1.0" -dependencies = [ - "cortex-m", - "cortex-m-rt", - "embedded-hal", - "fugit", - "nb 1.1.0", - "packed_struct", - "panic-halt", - "panic-semihosting", - "ryu", - "stm32f1xx-hal", - "usb-device", - "usbd-human-interface-device", - "usbd-serial", -] - -[[package]] -name = "frunk" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287" -dependencies = [ - "frunk_core", - "frunk_derives", -] - -[[package]] -name = "frunk_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6" - -[[package]] -name = "frunk_derives" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" -dependencies = [ - "frunk_proc_macro_helpers", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "frunk_proc_macro_helpers" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c" -dependencies = [ - "frunk_core", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "fugit" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" -dependencies = [ - "gcd", -] - -[[package]] -name = "fugit-timer" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9607bfc4c388f9d629704f56ede4a007546cad417b3bcd6fc7c87dc7edce04a" -dependencies = [ - "fugit", - "nb 1.1.0", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "gcd" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32", - "stable_deref_trait", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "option-block" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f2c5d345596a14d7c8b032a68f437955f0059f2eb9a5972371c84f7eef3227" - -[[package]] -name = "packed_struct" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b29691432cc9eff8b282278473b63df73bea49bc3ec5e67f31a3ae9c3ec190" -dependencies = [ - "bitvec", - "packed_struct_codegen", -] - -[[package]] -name = "packed_struct_codegen" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd6706dfe50d53e0f6aa09e12c034c44faacd23e966ae5a209e8bdb8f179f98" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "panic-halt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" - -[[package]] -name = "panic-semihosting" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8a3e1233d9073d76a870223512ce4eeea43c067a94a445c13bd6d792d7b1ab" -dependencies = [ - "cortex-m", - "cortex-m-semihosting", -] - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "stm32-usbd" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c94998f166d66b210a164648a0b7866428d8f1e0740bf8a4c5edd89d4750c1" -dependencies = [ - "cortex-m", - "usb-device", - "vcell", -] - -[[package]] -name = "stm32f1" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dc80735831c28fe85384e1e28428fb6d201f67c696e369a239ed9c5eba369d" -dependencies = [ - "bare-metal 1.0.0", - "cortex-m", - "cortex-m-rt", - "vcell", -] - -[[package]] -name = "stm32f1xx-hal" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30845662b9ce46a2ec04da97666a2b32458bee5032bb0452d0caf1536a96a542" -dependencies = [ - "bitflags", - "bxcan", - "cortex-m", - "cortex-m-rt", - "embedded-dma", - "embedded-hal", - "fugit", - "fugit-timer", - "nb 1.1.0", - "stm32-usbd", - "stm32f1", - "void", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "usb-device" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" - -[[package]] -name = "usbd-human-interface-device" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69710303c06f23a1259d086bfb241212ae1ccfb5d582ebd596bb042d662ed73" -dependencies = [ - "frunk", - "fugit", - "heapless", - "num_enum", - "option-block", - "packed_struct", - "usb-device", -] - -[[package]] -name = "usbd-serial" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db75519b86287f12dcf0d171c7cf4ecc839149fe9f3b720ac4cfce52959e1dfe" -dependencies = [ - "embedded-hal", - "nb 0.1.3", - "usb-device", -] - -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "volatile-register" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" -dependencies = [ - "vcell", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] diff --git a/firmware/Cargo.toml b/firmware/Cargo.toml deleted file mode 100644 index caa1db3..0000000 --- a/firmware/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "firmware" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -embedded-hal = "0.2.7" -nb = "1" -cortex-m = "0.7.6" -cortex-m-rt = "0.7.1" -# Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives -panic-halt = "0.2.0" -#stm32-usbd = "0.6.0" -usb-device = "0.2.9" -usbd-serial = "0.1.1" -ryu = "1.0.16" -panic-semihosting = "0.6.0" -usbd-human-interface-device = "0.4.5" -packed_struct = { version = "0.10.1", default-features = false } -fugit = "0.3.7" - -[dependencies.stm32f1xx-hal] -version = "0.10.0" -features = ["rt", "stm32f103"] - -[profile.dev] -codegen-units = 1 -opt-level = "z" - -[profile.dev.package."*"] -codegen-units = 1 -opt-level = "z" - -[profile.release] -# or "z" -opt-level = "z" diff --git a/firmware/descriptor.wara b/firmware/descriptor.wara deleted file mode 100644 index 1f08e83..0000000 --- a/firmware/descriptor.wara +++ /dev/null @@ -1,25 +0,0 @@ -[[applicationCollection]] -usage = ['Generic Desktop', 'Joystick'] - -[[applicationCollection.inputReport]] - -[[applicationCollection.inputReport.physicalCollection]] -usage = ['Generic Desktop', 'Pointer'] - -[[applicationCollection.inputReport.physicalCollection.variableItem]] -usage = ['Generic Desktop', 'X'] -logicalValueRange = [0, 65535] - -[[applicationCollection.inputReport.physicalCollection.variableItem]] -usage = ['Generic Desktop', 'Z'] -logicalValueRange = [0, 65535] - -[[applicationCollection.outputReport]] - -[[applicationCollection.outputReport.variableItem]] -usage = ['Haptics', 'Manual Trigger'] -logicalValueRange = [0, 48000] - -[[applicationCollection.outputReport.variableItem]] -usage = ['Haptics', 'Manual Trigger'] -logicalValueRange = [0, 65535] diff --git a/firmware/hidtools.sh b/firmware/hidtools.sh deleted file mode 100755 index 85f7524..0000000 --- a/firmware/hidtools.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env bash -nix run github:feathecutie/hidtools -- -s descriptor.wara -cat descriptor.h |grep " 0x"|grep -v "ReportId" diff --git a/firmware/memory.x b/firmware/memory.x deleted file mode 100644 index 71f245d..0000000 --- a/firmware/memory.x +++ /dev/null @@ -1,6 +0,0 @@ -/* Linker script for the STM32F103C8T6 */ -MEMORY -{ - FLASH : ORIGIN = 0x08000000, LENGTH = 64K - RAM : ORIGIN = 0x20000000, LENGTH = 20K -} diff --git a/firmware/openocd.cfg b/firmware/openocd.cfg deleted file mode 100644 index 0f1a070..0000000 --- a/firmware/openocd.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Sample OpenOCD configuration for the STM32F3DISCOVERY development board - -# Depending on the hardware revision you got you'll have to pick ONE of these -# interfaces. At any time only one interface should be commented out. - -# Revision C (newer revision) -source [find interface/jlink.cfg] - -# Revision A and B (older revisions) -# source [find interface/stlink-v2.cfg] - -source [find target/stm32f1x.cfg] diff --git a/firmware/openocd.sh b/firmware/openocd.sh deleted file mode 100755 index d312b75..0000000 --- a/firmware/openocd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -openocd -f interface/jlink.cfg -f ./swd.cfg -f target/stm32f1x.cfg diff --git a/firmware/src/device.rs b/firmware/src/device.rs deleted file mode 100644 index 990fac7..0000000 --- a/firmware/src/device.rs +++ /dev/null @@ -1,142 +0,0 @@ -use core::default::Default; -use fugit::ExtU32; -use packed_struct::prelude::*; -use usb_device::bus::UsbBus; -use usb_device::class_prelude::UsbBusAllocator; -use usbd_human_interface_device::{ - descriptor::InterfaceProtocol, - device::DeviceClass, - interface::{ - InBytes8, Interface, InterfaceBuilder, InterfaceConfig, OutBytes8, ReportSingle, - UsbAllocatable, - }, - UsbHidError, -}; - -// Generated using Waratah -#[rustfmt::skip] -pub const CUSTOM_DESCRIPTOR: &[u8] = &[ - 0x05, 0x01, // UsagePage(Generic Desktop[0x0001]) - 0x09, 0x04, // UsageId(Joystick[0x0004]) - 0xA1, 0x01, // Collection(Application) - 0x09, 0x01, // UsageId(Pointer[0x0001]) - 0xA1, 0x00, // Collection(Physical) - 0x09, 0x30, // UsageId(X[0x0030]) - 0x09, 0x32, // UsageId(Z[0x0032]) - 0x15, 0x00, // LogicalMinimum(0) - 0x26, 0xFF, 0x0F, // LogicalMaximum(4,095) - 0x95, 0x02, // ReportCount(2) - 0x75, 0x10, // ReportSize(16) - 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) - 0xC0, // EndCollection() - 0x05, 0x09, // UsagePage(Button[0x0009]) - 0x19, 0x01, // UsageIdMin(Button 1[0x0001]) - 0x29, 0x10, // UsageIdMax(Button 16[0x0010]) - 0x25, 0x01, // LogicalMaximum(1) - 0x95, 0x10, // ReportCount(16) - 0x75, 0x01, // ReportSize(1) - 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) - 0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00) - 0x09, 0x01, // Usage (0x01) - 0x27, 0x80, 0xBB, 0x00, 0x00, // LogicalMaximum(48,000) - 0x95, 0x01, // ReportCount(1) - 0x75, 0x10, // ReportSize(16) - 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) - 0x09, 0x21, // UsageId(Manual Trigger[0x0021]) - 0x27, 0xFF, 0xFF, 0x00, 0x00, // LogicalMaximum(65,535) - 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) - 0xC0, // EndCollection() -]; - -#[derive(Clone, Copy, Debug, Eq, PartialEq, Default, PackedStruct)] -#[packed_struct(endian = "lsb", size_bytes = "6")] -pub struct CustomInputReport { - #[packed_field] - pub x: u16, - #[packed_field] - pub y: u16, - #[packed_field] - pub buttons: u16, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, Default, PackedStruct)] -#[packed_struct(endian = "lsb", size_bytes = "4")] -pub struct CustomOutputReport { - #[packed_field] - pub integ_lt: u16, - pub test: u16, -} - -pub struct CustomDevice<'a, B: UsbBus> { - interface: Interface<'a, B, InBytes8, OutBytes8, ReportSingle>, -} - -impl<'a, B: UsbBus> CustomDevice<'a, B> { - pub fn write_report(&mut self, report: &CustomInputReport) -> Result<(), UsbHidError> { - let data = report.pack().map_err(|_| UsbHidError::SerializationError)?; - self.interface - .write_report(&data) - .map(|_| ()) - .map_err(UsbHidError::from) - } - - pub fn read_report(&mut self) -> Result { - let mut data = [0, 0, 0, 0]; - self.interface - .read_report(&mut data[..]) - .map(|_| CustomOutputReport::unpack(&data).unwrap()) - .map_err(UsbHidError::from) - } -} - -impl<'a, B: UsbBus> DeviceClass<'a> for CustomDevice<'a, B> { - type I = Interface<'a, B, InBytes8, OutBytes8, ReportSingle>; - - fn interface(&mut self) -> &mut Self::I { - &mut self.interface - } - - fn reset(&mut self) {} - - fn tick(&mut self) -> Result<(), UsbHidError> { - Ok(()) - } -} - -pub struct CustomConfig<'a> { - interface: InterfaceConfig<'a, InBytes8, OutBytes8, ReportSingle>, -} - -impl<'a> Default for CustomConfig<'a> { - #[must_use] - fn default() -> Self { - Self::new( - InterfaceBuilder::new(CUSTOM_DESCRIPTOR) - .unwrap() - .boot_device(InterfaceProtocol::None) - .description(" CustomDevice") - .in_endpoint(10.millis()) - .unwrap() - .with_out_endpoint(10.millis()) - .unwrap() - .build(), - ) - } -} - -impl<'a> CustomConfig<'a> { - #[must_use] - pub fn new(interface: InterfaceConfig<'a, InBytes8, OutBytes8, ReportSingle>) -> Self { - Self { interface } - } -} - -impl<'a, B: UsbBus + 'a> UsbAllocatable<'a, B> for CustomConfig<'a> { - type Allocated = CustomDevice<'a, B>; - - fn allocate(self, usb_alloc: &'a UsbBusAllocator) -> Self::Allocated { - Self::Allocated { - interface: Interface::new(usb_alloc, self.interface), - } - } -} diff --git a/firmware/src/main.rs b/firmware/src/main.rs deleted file mode 100644 index 6512ce3..0000000 --- a/firmware/src/main.rs +++ /dev/null @@ -1,143 +0,0 @@ -#![deny(unsafe_code)] -#![no_main] -#![no_std] - -mod device; - -use panic_halt as _; - -use cortex_m::asm::delay; -use cortex_m_rt::entry; -use stm32f1xx_hal::{ - adc, - gpio::{Analog, Pin}, - pac, - prelude::*, - timer::{Channel, Tim2NoRemap}, -}; - -use stm32f1xx_hal::usb::{Peripheral, UsbBus}; -use usb_device::prelude::*; -use usbd_human_interface_device::prelude::*; - -use crate::device::{CustomConfig, CustomInputReport, CustomOutputReport}; - -struct MyPins { - pa1: Pin<'A', 1, Analog>, - pa2: Pin<'A', 2, Analog>, -} - -#[entry] -fn main() -> ! { - // ====================== general setup ================= - // Acquire peripherals - // let cp = cortex_m::Peripherals::take().unwrap(); - let p = pac::Peripherals::take().unwrap(); - let mut flash = p.FLASH.constrain(); - let rcc = p.RCC.constrain(); - - // Setup GPIOA - let mut gpioa = p.GPIOA.split(); - - // configure clock - let clocks = rcc - .cfgr - .use_hse(16.MHz()) - .sysclk(48.MHz()) - .pclk1(24.MHz()) - .freeze(&mut flash.acr); - - // ====================== USB setup ================= - assert!(clocks.usbclk_valid()); - let mut usb_dp = gpioa.pa12.into_push_pull_output(&mut gpioa.crh); - usb_dp.set_low(); - delay(clocks.sysclk().raw() / 100); - - let usb = Peripheral { - usb: p.USB, - pin_dm: gpioa.pa11, - pin_dp: usb_dp.into_floating_input(&mut gpioa.crh), - }; - let usb_bus = UsbBus::new(usb); - - let mut consumer = UsbHidClassBuilder::new() - .add_device(CustomConfig::default()) - .build(&usb_bus); - - let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd)) - .manufacturer("FLC Meow") - .product("Pedestal box") - .serial_number("01189998819991197253") - .build(); - - // ====================== ADC setup ================= - // Setup ADC - let mut adc1 = adc::Adc::adc1(p.ADC1, clocks); - - // ====================== Pin setup ================= - let mut input_pins = MyPins { - pa1: gpioa.pa1.into_analog(&mut gpioa.crl), - pa2: gpioa.pa2.into_analog(&mut gpioa.crl), - }; - - let mut last = get_report(&mut input_pins, &mut adc1); - - // ====================== PWM setup ================= - let mut afio = p.AFIO.constrain(); - let c1 = gpioa.pa0.into_alternate_push_pull(&mut gpioa.crl); - let mut pwm = p - .TIM2 - .pwm_hz::(c1, &mut afio.mapr, 1.kHz(), &clocks); - pwm.enable(Channel::C1); - let pwm_max = pwm.get_max_duty() as u16; //48000 in our case - - // ====================== Main loop ================= - loop { - let report = get_report(&mut input_pins, &mut adc1); - if report != last { - match consumer.device().write_report(&report) { - Err(UsbHidError::WouldBlock) => {} - Ok(_) => { - last = report; - } - Err(e) => { - core::panic!("Failed to write consumer report: {:?}", e) - } - } - } - - if usb_dev.poll(&mut [&mut consumer]) { - match consumer.device().read_report() { - Err(UsbHidError::WouldBlock) => {} - Ok(output) => { - let pwm_val: u16; - if output.integ_lt > pwm_max { - pwm_val = pwm_max; - } - else { - pwm_val = output.integ_lt; - } - pwm.set_duty(Channel::C1, pwm_val); - } - Err(e) => { - core::panic!("Failed to write consumer report: {:?}", e) - } - } - } - - } -} - -// Returns a CustomInputReport from the inputs given -fn get_report(pins: &mut MyPins, adc1: &mut adc::Adc) -> CustomInputReport { - let integ_lt: u16 = adc1.read(&mut pins.pa1).unwrap(); - let flood_lt: u16 = adc1.read(&mut pins.pa2).unwrap(); - let buttons: u16 = 0; - - - CustomInputReport { - x: integ_lt.into(), - y: flood_lt.into(), - buttons, - } -} diff --git a/firmware/swd.cfg b/firmware/swd.cfg deleted file mode 100644 index b263065..0000000 --- a/firmware/swd.cfg +++ /dev/null @@ -1 +0,0 @@ -transport select swd