├── .gitignore ├── .vscode ├── extensions.json └── settings.json ├── Assembly.md ├── Hardware ├── Case │ ├── Bottom-Magnets.stl │ ├── Bottom.stl │ ├── Bottom_Adafruit_Lipo.stl │ ├── GHHOSS_tripod_mount │ │ ├── M5_Tripod_Holder_v3.f3d │ │ └── M5_Tripod_Holder_v3.stl │ ├── M5-Remote-V2.f3z │ ├── M5-Remote_knob_with_offset.step │ ├── TOP-Cherry-Keycap-Standoff.stl │ ├── TOP-Cherry-Keycap-Standoff_Bigger_Ecoder_Space.stl │ ├── TOP-DSA-Keycap-Standoff.stl │ ├── TOP-DSA-Keycap-Standoff_Bigger_Ecoder_Space.stl │ └── m5_curved w6mm+5.stl ├── JRGs-M5-Mount │ ├── Main_part_M5_mount.stl │ ├── m5_mount_reder_angle.png │ ├── m5_mount_reder_split.png │ ├── readme.md │ ├── remote_mount.jpg │ └── top_part_m5_remote.stl └── PCB │ ├── OSSM-M5-Remote-V2.3-Gerber.zip │ ├── OSSM-M5-Remote-V2.3.f3z │ ├── OSSM-M5-Remote-V2.3.mnt │ ├── OSSM-M5-Remote-V2.3.pdf │ ├── OSSM-M5-Remote-V2.3.txt │ ├── PCB.7z │ └── PCBWay │ ├── BOM_PCBWay.xlsx │ └── OSSM-M5-Remote-V2-Centroid.csv ├── LICENCE.txt ├── OSSM-M5-Remote.code-workspace ├── README.md ├── SquareLine_Studio ├── OSSM-White.sll ├── OSSM-White.spj ├── OSSM-White_events.py ├── assets │ ├── km..png │ └── ortlodof.png ├── backup │ ├── OSSM-White_backup00.zip │ ├── OSSM-White_backup01.zip │ ├── OSSM-White_backup02.zip │ ├── OSSM-White_backup03.zip │ ├── OSSM-White_backup04.zip │ ├── OSSM-White_backup05.zip │ ├── OSSM-White_backup06.zip │ ├── OSSM-White_backup07.zip │ ├── OSSM-White_backup08.zip │ └── OSSM-White_backup09.zip └── export │ ├── test │ ├── ui.c │ ├── ui.h │ ├── ui_helpers.c │ └── ui_helpers.h │ ├── ui.c │ ├── ui.h │ ├── ui_events.c │ ├── ui_helpers.c │ ├── ui_helpers.h │ ├── ui_img_km__png.c │ └── ui_img_ortlodof_png.c ├── image ├── bottom+battery.jpg ├── bottom+m5.jpg ├── bottom+pcb.png ├── full-remote.jpg └── remote.png ├── include └── README ├── lib └── README ├── platformio.ini ├── src ├── PatternMath.h ├── certs │ └── x509_crt_bundle.bin ├── config.h ├── language.h ├── lv_conf.h ├── main.cpp ├── main.h └── ui │ ├── image50x50.c │ ├── ui.c │ ├── ui.h │ ├── ui_events.c │ ├── ui_helpers.c │ └── ui_helpers.h └── test └── README /.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | lvgl/backup/ 7 | lib/ -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "functional": "cpp", 4 | "m5core2.h": "c", 5 | "string": "cpp" 6 | }, 7 | "C_Cpp.dimInactiveRegions": false 8 | } -------------------------------------------------------------------------------- /Assembly.md: -------------------------------------------------------------------------------- 1 | 2 | # Assembling the OSSM M5 Remote 3 | 4 | **Some important notes** 5 | * Assembly will require soldering of small surface mount components in addition to through hole components. Be sure you have the proper tools and supplies: 6 | * Solder reflow oven or hot air gun with nozzles. You can use an old toaster oven as a reflow oven, just do not use it for food again after that. 7 | * Low temperature solder paste 8 | * Tweezers 9 | * Soldering iron 10 | * Rosin core solder 11 | * Flux 12 | * optional helping hands to hold the PCB while you solder 13 | * optional stencil provided by the PCB Manufacturer (not necessary but would make things easier) 14 | 15 | * Due to a lack of standardisation in LIPO battery polarity it is important to verify how yours is configured. If the battery is reversed it will result in the CORE M5 Stack being damaged. You may have to reverse the female pins in the connector so they align with the expected polarity on the PCB. 16 | 17 | ## Solder the components 18 | 19 | 1. If you purchased a stencil from PCBWay/ Your chosen PCB Manufacturer, align it over the PCB and tape it in place. Add a blob of low temperature solder paste to the stencil and scrape it across the holes with a credit card or similar. When you lift the stencil away the PCB should now have solder paste on it in the correct places. Example photos below are from PCBWay and are not of the OSSM M5 Remote PCB 20 | 21 | 22 | ![solderPaste](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/7bfadb82-3385-47ea-94f3-8652fe080af8) 23 | ![solderPaste2](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/62b96751-cfc3-4502-a370-034971e312ae) 24 | ![solderpaste3](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/51d70cb2-353b-47d7-a89a-ca4f13daa100) 25 | 26 | 27 | 28 | 29 | If you did not purchase a stencil then you will need to very carefully coat the solder pads of the PCB with solder paste. It doesn't need a ton. 30 | 31 | ![without_stencil](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/6e634335-d5ee-4417-ba8e-f26e55206448) 32 | 33 | Photo Credit Xue Ming. The amount of solder paste in the above photo is a little excessive. 34 | 35 | 2. Carefully place the 11 10k ohm resistors (Bourns CR1206-JW-103ELF) on the solder paste using tweezers. The polarity doesn't matter. Apply heat using a heat gun or reflow oven. The solder paste container will state what temperature to use. 36 | 37 | 38 | ![Resistors](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/87db8ef8-29a1-498f-b41d-2c0ce7b44b00) 39 | 40 | 3. Next, place the button encoders (Bourns PEC12R-4220F-S0024) at U1 and U4. Add flux to the pins and pad and solder the button encoders in place with a soldering iron. 41 | 42 | 4. Repeat the same for U2 and U3, adding flux and soldering the regular encoders (Bourns PEC12R-4220F-N0024) 43 | 44 | 5. The (Cherry MX1A-F1NN / switch is soldered to the center position in the white square. 45 | 46 | 6. Next, the headers. Insert the headers from the front of the PCB (Amphenol Communications Solution 10129381-916001BLF), add a generous amount of flux to the back side and solder each pin. 47 | 48 | 49 | ![PCB-Soldered](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/6c788856-cce5-42a2-8c96-6fc6ae87ce2c) 50 | 51 | 7. Finally we will solder the battery connector (JST S2B-PH-K-S(LF)(SN)) on the back side of the PCB. The positive pin is the pin closest to the bottom edge of the PCB, the negative pin is the pin the closest to the top edge of the PCB. 52 | 53 | 54 | ![BatteryConnectorSoldered](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/6c1c1cd7-7d8b-4631-922d-3177ff94a039) 55 | 56 | 8. Again pay special attention to the polarity of the Lithum battery you have, checking to see if the negative terminal of the battery connector will align with the negative pin of the connector on the PCB. Remove the wires from the battery terminal and reverse them if you need to (I had to, for example). 57 | 58 | ![FlippingWires](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/232e0879-97b6-4940-85c0-7890638a2a90) 59 | 60 | ## 3D printed parts 61 | 62 | All parts are printed with 6 walls and 20% infill with a .04 nozzle. No supports and no brim (just a skirt). 63 | 64 | A good quality PLA works well. While there are no threads it is recommended that your printer is well calibrated. 65 | 66 | * Be sure to choose the correct back to print based on the battery that you source 67 | 68 | USA - Adafruit 485-2011 / or [Alternate](https://www.amazon.com/EEMB-2000mAh-Battery-Rechargeable-Connector/dp/B08214DJLJ/) uses 'Bottom_Adafruit_Lipo.stl' OR you can use 'Bottom-Magnets.stl' if you want to add 6 x 3mm magnets. 69 | 70 | Other countries - [RS Pro 1449405](https://uk.rs-online.com/web/p/speciality-size-rechargeable-batteries/1449405) uses 'Bottom.stl', or if you want to use magnets in the base you can use 'Bottom-Magnets.stl' that will accept 6 x 3mm magnets. 71 | 72 | * You have options for the top depending on the keycap type you choose (cherry vs DSA). 73 | 74 | If you chose to buy a DSA keycap go with 'TOP-DSA-Keycap-Standoff_Bigger_Ecoder_Space.stl' 75 | 76 | If you chose to buy a Cherry Keycap go with 'TOP-Cherry-Keycap-Standoff_Bigger_Ecoder_Space.stl' 77 | 78 | * You can print encoder knobs or purchaes separate ones, 'M5_Remote_Knob_Customizable.scad' 79 | 80 | * If you would like to mount the OSSM M5 remote to a mini tripod you can print the excellent holder by KinkyMakers Discord community member GHHOSS, the file is called 'M5_Tripod_Holder_v3.stl' and can be found in the 'GHHOSS_tripod_mount' folder. 81 | 82 | * Finally you will add the M3 brass heatset inserts to the underside of the **TOP** piece. 83 | 84 | ## Final Assembly 85 | 86 | 1. Remove the M5 Core2 MIC/MPU Module from M5 Core2 Bottom, then unscrew the grey bottom and remove internal battery. Store the screws, the back and battery somewhere in case you want to use the M5 Stack Core2 for another project later. 87 | 88 | 2. Affix the battery to the bottom case with double sided tape. 89 | 90 | ![1](image/bottom+battery.jpg?raw=true "1" ) 91 | 92 | 3. Connect Battery to PCB connector on the back side of the PCB. 93 | 94 | ![2](image/bottom+pcb.png?raw=true "2" ) 95 | 96 | 4. Insert the PCB into Bottom case. 97 | ![AffixBattery](https://github.com/NightmareSyndrome/OSSM-M5-Remote/assets/131713378/392cc5ae-f787-404a-b128-40521d7e20d7) 98 | 99 | 5. Connect the M5 Core2 to the headers on the PCB and fasten with two 25mm M3 Bolts to Case. 100 | 101 | ![3](image/bottom+m5.jpg?raw=true "3" ) 102 | 103 | 6. Put top on Remote and fasten with four M3 20mm Bolts to the Case. 104 | 105 | ![4](image/full-remote.jpg?raw=true "4" ) 106 | 107 | 7. Install the Mx Cap and Encoder Knobs. 108 | 109 | 8. Charge the battery fully. 110 | 111 | ## Upload Software 112 | 113 | 1. Visit the [M5 website to download and install the drivers](https://docs.m5stack.com/en/core/core2) for the Core2 on your machine. 114 | 115 | 2. Clone or download this repository. If you download it as a zip, extract the files. 116 | **Note:** If you are one of the very small number of Version 1 PCB users, you will need to change your version to V1 in the config.h. The current version in this repository is V2. 117 | 118 | 3. Download Visual Studio Code and set up [PlatformIO](https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation) or [if you would prefer to watch a video](https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation) - Thanks KinkyMakers Disord community admin Ka D'argo for the video! 119 | 120 | Open the OSSM M5 Controller repository from step 2 in VS Code by clicking "File" > "Open Folder" and selecting the folder. 121 | 122 | 123 | 4. Once PlatformIO is set up you can select the M5 Core2 from your list of devices by clicking the 'Auto' button at the bottom center of the screen in the blue ribbon. If you aren't sure which device is the Core2 you can open DeviceManager on Windows and expand "Ports (COM & LPT)", then unplug the Core2 and plug it in again while keeping an eye on Device Manager to see what changes. 124 | 125 | __Note:__ 126 | If you are one of the very small number of Version 1 PCB users, you will need to change your version to V1 in the config.h file. The current version in this GitHub repository is V2. 127 | 128 | 5. Click the upload button at the bottom left of the screen. The program will build then automatically upload to the M5 Core2. Once the software has succesfully uploaded you may disconnect the Core2 from your computer. 129 | 130 | 6. Next, Clone or download the M5 fork of the OSSM Stroke Engine from [here](https://github.com/ortlof/OSSM-Stroke) using the same method as mentioned in Step 2. 131 | 132 | 7. Open the OSSM Stroke repository from Step 5 in VS Code, again by clicking "File" > "Open Folder" and selecting the folder. 133 | 134 | 8. Now connect the OSSM board to your computer using a USB cable. You can look for it in DeviceManager the same way as you did in step 4. [You can also reference this link for help](https://github.com/KinkyMakers/OSSM-hardware/blob/master/OSSM%20PlatformIO%20Readme.md) 135 | 136 | 9. Click upload. 137 | -------------------------------------------------------------------------------- /Hardware/Case/Bottom-Magnets.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/Bottom-Magnets.stl -------------------------------------------------------------------------------- /Hardware/Case/Bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/Bottom.stl -------------------------------------------------------------------------------- /Hardware/Case/Bottom_Adafruit_Lipo.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/Bottom_Adafruit_Lipo.stl -------------------------------------------------------------------------------- /Hardware/Case/GHHOSS_tripod_mount/M5_Tripod_Holder_v3.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/GHHOSS_tripod_mount/M5_Tripod_Holder_v3.f3d -------------------------------------------------------------------------------- /Hardware/Case/GHHOSS_tripod_mount/M5_Tripod_Holder_v3.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/GHHOSS_tripod_mount/M5_Tripod_Holder_v3.stl -------------------------------------------------------------------------------- /Hardware/Case/M5-Remote-V2.f3z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/M5-Remote-V2.f3z -------------------------------------------------------------------------------- /Hardware/Case/TOP-Cherry-Keycap-Standoff.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/TOP-Cherry-Keycap-Standoff.stl -------------------------------------------------------------------------------- /Hardware/Case/TOP-Cherry-Keycap-Standoff_Bigger_Ecoder_Space.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/TOP-Cherry-Keycap-Standoff_Bigger_Ecoder_Space.stl -------------------------------------------------------------------------------- /Hardware/Case/TOP-DSA-Keycap-Standoff.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/TOP-DSA-Keycap-Standoff.stl -------------------------------------------------------------------------------- /Hardware/Case/TOP-DSA-Keycap-Standoff_Bigger_Ecoder_Space.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/TOP-DSA-Keycap-Standoff_Bigger_Ecoder_Space.stl -------------------------------------------------------------------------------- /Hardware/Case/m5_curved w6mm+5.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/Case/m5_curved w6mm+5.stl -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/Main_part_M5_mount.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/JRGs-M5-Mount/Main_part_M5_mount.stl -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/m5_mount_reder_angle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/JRGs-M5-Mount/m5_mount_reder_angle.png -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/m5_mount_reder_split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/JRGs-M5-Mount/m5_mount_reder_split.png -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/readme.md: -------------------------------------------------------------------------------- 1 | # JRGs M5 Mount 2 | 3 | Hardware needed: 4 | 5 | | Quantity | Part | 6 | |----------|------| 7 | | 2x | m3x12 Hex Head Cap Bolt | 8 | | 2x | m5x20 Hex Head Cap Bolt | 9 | | 2x | T-Slot Nut M5 | 10 | 11 | Print Without Supports 12 | 13 | ![Mount](remote_mount.jpg?raw=true) 14 | 15 | ![Mount](m5_mount_reder_angle.png?raw=true) 16 | 17 | ![Mount](m5_mount_reder_split.png?raw=true) 18 | -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/remote_mount.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/JRGs-M5-Mount/remote_mount.jpg -------------------------------------------------------------------------------- /Hardware/JRGs-M5-Mount/top_part_m5_remote.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/JRGs-M5-Mount/top_part_m5_remote.stl -------------------------------------------------------------------------------- /Hardware/PCB/OSSM-M5-Remote-V2.3-Gerber.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/PCB/OSSM-M5-Remote-V2.3-Gerber.zip -------------------------------------------------------------------------------- /Hardware/PCB/OSSM-M5-Remote-V2.3.f3z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/PCB/OSSM-M5-Remote-V2.3.f3z -------------------------------------------------------------------------------- /Hardware/PCB/OSSM-M5-Remote-V2.3.mnt: -------------------------------------------------------------------------------- 1 | M5_CORE2; 2835; 1879; 90;M5-CORE 2 | 10k; 3390; 860;180;R1 3 | 10k; 800; 1220; 0;R2 4 | 10k; 800; 1100; 0;R3 5 | 10k; 800; 980; 0;R4 6 | 10k; 800; 860; 0;R5 7 | 10k; 3390; 1100;180;R6 8 | 10k; 3390; 1220;180;R7 9 | 10k; 1620; 330; 0;R8 10 | 10k; 1620; 450; 0;R9 11 | 10k; 3390; 980;180;R10 12 | 10k; 1620; 570;180;R11 13 | JST-PH-2MM,180; 2578; 1794;270;U$3 14 | CHERRY-MX-LED; 2087; 400; 0;U$4 15 | PEC12RS; 315; 1132; 0;U1 16 | PEC12R; 1102; 364;180;U2 17 | PEC12R; 3071; 364;180;U3 18 | PEC12RS; 3858; 1153; 0;U4 19 | -------------------------------------------------------------------------------- /Hardware/PCB/OSSM-M5-Remote-V2.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/PCB/OSSM-M5-Remote-V2.3.pdf -------------------------------------------------------------------------------- /Hardware/PCB/OSSM-M5-Remote-V2.3.txt: -------------------------------------------------------------------------------- 1 | Qty Value Device Package Parts Description ARROW_PART_NUMBER ARROW_PRICE-STOCK CATEGORY DESCRIPTION HEIGHT MANUFACTURER MANUFACTURER_NAME MANUFACTURER_PART_NUMBER MOUSER_PART_NUMBER MOUSER_PRICE-STOCK MPN OPERATING_TEMP PART_STATUS RATING ROHS_COMPLIANT SERIES SUB-CATEGORY THERMALLOSS TOLERANCE TYPE 2 | 10 10k R_CHIP-1206(3216-METRIC) RESC3216X70 R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11 Resistor Fixed - Generic Resistor Fixed 3 | 1 CHERRY-MX-LED CHERRY-MX-LED CHERRY-MX-LED U$4 Cherry MX series keyswitch with LED 4 | 1 JST-PH-2MM,180 JST-PH-2MM,180 JST-PH-2.0MM_180DEGREES U$3 5 | 1 M5_CORE2 M5_CORE2 M5_CORE2 M5-CORE 6 | 1 PEC12R PEC12R-4220F-S0024 PEC12R4017FN0024 U1, U4, Encoders HORZ 24DET 24PULSE 30mm SHAFT W/O SW https://www.arrow.com/en/products/pec12r-4230f-n0024/bourns 17.5mm Bourns https://www.mouser.co.uk/ProductDetail/Bourns/PEC12R-4230F-N0024?qs=Zq5ylnUbLm5pfnEk8CuZjg%3D%3D 7 | 3 PEC12R PEC12R-4230F-N0024 PEC12R4017FN0024 U2, U3, Encoders HORZ 24DET 24PULSE 30mm SHAFT W/O SW PEC12R-4230F-N0024 https://www.arrow.com/en/products/pec12r-4230f-n0024/bourns Encoders HORZ 24DET 24PULSE 30mm SHAFT W/O SW 17.5mm Bourns PEC12R-4230F-N0024 652-PEC12R-4230F-N24 https://www.mouser.co.uk/ProductDetail/Bourns/PEC12R-4230F-N0024?qs=Zq5ylnUbLm5pfnEk8CuZjg%3D%3D 8 | -------------------------------------------------------------------------------- /Hardware/PCB/PCB.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/PCB/PCB.7z -------------------------------------------------------------------------------- /Hardware/PCB/PCBWay/BOM_PCBWay.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/Hardware/PCB/PCBWay/BOM_PCBWay.xlsx -------------------------------------------------------------------------------- /Hardware/PCB/PCBWay/OSSM-M5-Remote-V2-Centroid.csv: -------------------------------------------------------------------------------- 1 | ; 3390; 860;180;R1 2 | ; 800; 1220; 0;R2 3 | ; 800; 1100; 0;R3 4 | ; 800; 980; 0;R4 5 | ; 800; 860; 0;R5 6 | ; 3390; 1100;180;R6 7 | ; 3390; 1220;180;R7 8 | ; 1620; 330; 0;R8 9 | ; 1620; 450; 0;R9 10 | ; 3390; 980;180;R10 11 | 10k; 1620; 570;180;R11 -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | Attribution-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-ShareAlike 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-ShareAlike 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. Share means to provide material to the public by any means or 126 | process that requires permission under the Licensed Rights, such 127 | as reproduction, public display, public performance, distribution, 128 | dissemination, communication, or importation, and to make material 129 | available to the public including in ways that members of the 130 | public may access the material from a place and at a time 131 | individually chosen by them. 132 | 133 | l. Sui Generis Database Rights means rights other than copyright 134 | resulting from Directive 96/9/EC of the European Parliament and of 135 | the Council of 11 March 1996 on the legal protection of databases, 136 | as amended and/or succeeded, as well as other essentially 137 | equivalent rights anywhere in the world. 138 | 139 | m. You means the individual or entity exercising the Licensed Rights 140 | under this Public License. Your has a corresponding meaning. 141 | 142 | 143 | Section 2 -- Scope. 144 | 145 | a. License grant. 146 | 147 | 1. Subject to the terms and conditions of this Public License, 148 | the Licensor hereby grants You a worldwide, royalty-free, 149 | non-sublicensable, non-exclusive, irrevocable license to 150 | exercise the Licensed Rights in the Licensed Material to: 151 | 152 | a. reproduce and Share the Licensed Material, in whole or 153 | in part; and 154 | 155 | b. produce, reproduce, and Share Adapted Material. 156 | 157 | 2. Exceptions and Limitations. For the avoidance of doubt, where 158 | Exceptions and Limitations apply to Your use, this Public 159 | License does not apply, and You do not need to comply with 160 | its terms and conditions. 161 | 162 | 3. Term. The term of this Public License is specified in Section 163 | 6(a). 164 | 165 | 4. Media and formats; technical modifications allowed. The 166 | Licensor authorizes You to exercise the Licensed Rights in 167 | all media and formats whether now known or hereafter created, 168 | and to make technical modifications necessary to do so. The 169 | Licensor waives and/or agrees not to assert any right or 170 | authority to forbid You from making technical modifications 171 | necessary to exercise the Licensed Rights, including 172 | technical modifications necessary to circumvent Effective 173 | Technological Measures. For purposes of this Public License, 174 | simply making modifications authorized by this Section 2(a) 175 | (4) never produces Adapted Material. 176 | 177 | 5. Downstream recipients. 178 | 179 | a. Offer from the Licensor -- Licensed Material. Every 180 | recipient of the Licensed Material automatically 181 | receives an offer from the Licensor to exercise the 182 | Licensed Rights under the terms and conditions of this 183 | Public License. 184 | 185 | b. Additional offer from the Licensor -- Adapted Material. 186 | Every recipient of Adapted Material from You 187 | automatically receives an offer from the Licensor to 188 | exercise the Licensed Rights in the Adapted Material 189 | under the conditions of the Adapter's License You apply. 190 | 191 | c. No downstream restrictions. You may not offer or impose 192 | any additional or different terms or conditions on, or 193 | apply any Effective Technological Measures to, the 194 | Licensed Material if doing so restricts exercise of the 195 | Licensed Rights by any recipient of the Licensed 196 | Material. 197 | 198 | 6. No endorsement. Nothing in this Public License constitutes or 199 | may be construed as permission to assert or imply that You 200 | are, or that Your use of the Licensed Material is, connected 201 | with, or sponsored, endorsed, or granted official status by, 202 | the Licensor or others designated to receive attribution as 203 | provided in Section 3(a)(1)(A)(i). 204 | 205 | b. Other rights. 206 | 207 | 1. Moral rights, such as the right of integrity, are not 208 | licensed under this Public License, nor are publicity, 209 | privacy, and/or other similar personality rights; however, to 210 | the extent possible, the Licensor waives and/or agrees not to 211 | assert any such rights held by the Licensor to the limited 212 | extent necessary to allow You to exercise the Licensed 213 | Rights, but not otherwise. 214 | 215 | 2. Patent and trademark rights are not licensed under this 216 | Public License. 217 | 218 | 3. To the extent possible, the Licensor waives any right to 219 | collect royalties from You for the exercise of the Licensed 220 | Rights, whether directly or through a collecting society 221 | under any voluntary or waivable statutory or compulsory 222 | licensing scheme. In all other cases the Licensor expressly 223 | reserves any right to collect such royalties. 224 | 225 | 226 | Section 3 -- License Conditions. 227 | 228 | Your exercise of the Licensed Rights is expressly made subject to the 229 | following conditions. 230 | 231 | a. Attribution. 232 | 233 | 1. If You Share the Licensed Material (including in modified 234 | form), You must: 235 | 236 | a. retain the following if it is supplied by the Licensor 237 | with the Licensed Material: 238 | 239 | i. identification of the creator(s) of the Licensed 240 | Material and any others designated to receive 241 | attribution, in any reasonable manner requested by 242 | the Licensor (including by pseudonym if 243 | designated); 244 | 245 | ii. a copyright notice; 246 | 247 | iii. a notice that refers to this Public License; 248 | 249 | iv. a notice that refers to the disclaimer of 250 | warranties; 251 | 252 | v. a URI or hyperlink to the Licensed Material to the 253 | extent reasonably practicable; 254 | 255 | b. indicate if You modified the Licensed Material and 256 | retain an indication of any previous modifications; and 257 | 258 | c. indicate the Licensed Material is licensed under this 259 | Public License, and include the text of, or the URI or 260 | hyperlink to, this Public License. 261 | 262 | 2. You may satisfy the conditions in Section 3(a)(1) in any 263 | reasonable manner based on the medium, means, and context in 264 | which You Share the Licensed Material. For example, it may be 265 | reasonable to satisfy the conditions by providing a URI or 266 | hyperlink to a resource that includes the required 267 | information. 268 | 269 | 3. If requested by the Licensor, You must remove any of the 270 | information required by Section 3(a)(1)(A) to the extent 271 | reasonably practicable. 272 | 273 | b. ShareAlike. 274 | 275 | In addition to the conditions in Section 3(a), if You Share 276 | Adapted Material You produce, the following conditions also apply. 277 | 278 | 1. The Adapter's License You apply must be a Creative Commons 279 | license with the same License Elements, this version or 280 | later, or a BY-SA Compatible License. 281 | 282 | 2. You must include the text of, or the URI or hyperlink to, the 283 | Adapter's License You apply. You may satisfy this condition 284 | in any reasonable manner based on the medium, means, and 285 | context in which You Share Adapted Material. 286 | 287 | 3. You may not offer or impose any additional or different terms 288 | or conditions on, or apply any Effective Technological 289 | Measures to, Adapted Material that restrict exercise of the 290 | rights granted under the Adapter's License You apply. 291 | 292 | 293 | Section 4 -- Sui Generis Database Rights. 294 | 295 | Where the Licensed Rights include Sui Generis Database Rights that 296 | apply to Your use of the Licensed Material: 297 | 298 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 299 | to extract, reuse, reproduce, and Share all or a substantial 300 | portion of the contents of the database; 301 | 302 | b. if You include all or a substantial portion of the database 303 | contents in a database in which You have Sui Generis Database 304 | Rights, then the database in which You have Sui Generis Database 305 | Rights (but not its individual contents) is Adapted Material, 306 | 307 | including for purposes of Section 3(b); and 308 | c. You must comply with the conditions in Section 3(a) if You Share 309 | all or a substantial portion of the contents of the database. 310 | 311 | For the avoidance of doubt, this Section 4 supplements and does not 312 | replace Your obligations under this Public License where the Licensed 313 | Rights include other Copyright and Similar Rights. 314 | 315 | 316 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 317 | 318 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 319 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 320 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 321 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 322 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 323 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 324 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 325 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 326 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 327 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 328 | 329 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 330 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 331 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 332 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 333 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 334 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 335 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 336 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 337 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 338 | 339 | c. The disclaimer of warranties and limitation of liability provided 340 | above shall be interpreted in a manner that, to the extent 341 | possible, most closely approximates an absolute disclaimer and 342 | waiver of all liability. 343 | 344 | 345 | Section 6 -- Term and Termination. 346 | 347 | a. This Public License applies for the term of the Copyright and 348 | Similar Rights licensed here. However, if You fail to comply with 349 | this Public License, then Your rights under this Public License 350 | terminate automatically. 351 | 352 | b. Where Your right to use the Licensed Material has terminated under 353 | Section 6(a), it reinstates: 354 | 355 | 1. automatically as of the date the violation is cured, provided 356 | it is cured within 30 days of Your discovery of the 357 | violation; or 358 | 359 | 2. upon express reinstatement by the Licensor. 360 | 361 | For the avoidance of doubt, this Section 6(b) does not affect any 362 | right the Licensor may have to seek remedies for Your violations 363 | of this Public License. 364 | 365 | c. For the avoidance of doubt, the Licensor may also offer the 366 | Licensed Material under separate terms or conditions or stop 367 | distributing the Licensed Material at any time; however, doing so 368 | will not terminate this Public License. 369 | 370 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 371 | License. 372 | 373 | 374 | Section 7 -- Other Terms and Conditions. 375 | 376 | a. The Licensor shall not be bound by any additional or different 377 | terms or conditions communicated by You unless expressly agreed. 378 | 379 | b. Any arrangements, understandings, or agreements regarding the 380 | Licensed Material not stated herein are separate from and 381 | independent of the terms and conditions of this Public License. 382 | 383 | 384 | Section 8 -- Interpretation. 385 | 386 | a. For the avoidance of doubt, this Public License does not, and 387 | shall not be interpreted to, reduce, limit, restrict, or impose 388 | conditions on any use of the Licensed Material that could lawfully 389 | be made without permission under this Public License. 390 | 391 | b. To the extent possible, if any provision of this Public License is 392 | deemed unenforceable, it shall be automatically reformed to the 393 | minimum extent necessary to make it enforceable. If the provision 394 | cannot be reformed, it shall be severed from this Public License 395 | without affecting the enforceability of the remaining terms and 396 | conditions. 397 | 398 | c. No term or condition of this Public License will be waived and no 399 | failure to comply consented to unless expressly agreed to by the 400 | Licensor. 401 | 402 | d. Nothing in this Public License constitutes or may be interpreted 403 | as a limitation upon, or waiver of, any privileges and immunities 404 | that apply to the Licensor or You, including from the legal 405 | processes of any jurisdiction or authority. 406 | 407 | 408 | ======================================================================= 409 | 410 | Creative Commons is not a party to its public licenses. 411 | Notwithstanding, Creative Commons may elect to apply one of its public 412 | licenses to material it publishes and in those instances will be 413 | considered the “Licensor.” The text of the Creative Commons public 414 | licenses is dedicated to the public domain under the CC0 Public Domain 415 | Dedication. Except for the limited purpose of indicating that material 416 | is shared under a Creative Commons public license or as otherwise 417 | permitted by the Creative Commons policies published at 418 | creativecommons.org/policies, Creative Commons does not authorize the 419 | use of the trademark "Creative Commons" or any other trademark or logo 420 | of Creative Commons without its prior written consent including, 421 | without limitation, in connection with any unauthorized modifications 422 | to any of its public licenses or any other arrangements, 423 | understandings, or agreements concerning use of licensed material. For 424 | the avoidance of doubt, this paragraph does not form part of the public 425 | licenses. 426 | 427 | Creative Commons may be contacted at creativecommons.org. 428 | -------------------------------------------------------------------------------- /OSSM-M5-Remote.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": { 8 | "files.associations": { 9 | "functional": "cpp", 10 | "istream": "cpp" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project OSSM M5 REMOTE 2 | ## Overview of the OSSM-M5-Remote 3 | 4 | A Remote Control Platform for all ESP Controlled Sex Toys,with a focus on the [OSSM](https://github.com/KinkyMakers/OSSM-hardware) and related toys. 5 | 6 | ![Final Addon](image/remote.png?raw=true "Remote" ) 7 | 8 | Intially developed for the OSSM Project: 9 | https://github.com/KinkyMakers/OSSM-hardware 10 | 11 | To help with development and design join the KinkyMakers Discord: https://discord.gg/MmpT9xE . Be sure to say hello in the #m5-remote channel. 12 | 13 | ## !!! It does not Work with the Official OSSM Firmware !!! 14 | This Branch is needed: https://github.com/ortlof/OSSM-Stroke 15 | 16 | The Cable remote is obsolete with this firmware. If you want to go back you need to flash the OSSM orginal firmware back. 17 | 18 | You can Easy flash the OSSM Mainboard with this [Online Flasher](https://openlust.org/lust-remote/lustremote-firmware/). 19 | 20 | 21 | ## Supported in this version of the M5 remote: 22 | | OSSM Machine | https://github.com/KinkyMakers/OSSM-hardware | 23 | 24 | ## Not Supported sex toys in this version 25 | 26 | | EJECT | https://github.com/ortlof/EJECT-cum-tube-project | [A Work in Progress] 27 | 28 | 29 | 30 | # Build the OSSM M5 Remote Yourself 31 | 32 | ### Assembly instructions: [Klick Here !](Assembly.md) 33 | 34 | ## Bill Of Materials for sourcing Electrical Components 35 | 36 | All M5Stack Core2 and CoreS3 are supported Now. 37 | 38 | BOM is on Octopart for Easy Sourcing: https://octopart.com/bom-tool/rURYMuwB 39 | 40 | PCB Files are located in the /OSSM-M5-Remote/Hardware/PCB folder if you want to make one yourself or use a different manufacturer other than PCBWay. 41 | 42 | ## Additional parts needed that are not PCB: 43 | 44 | | Quantity | Part | Sourcing EU | Price € | 45 | |----------|------|-------------|---------| 46 | | 1x | M5Stack CoreS3 SE | https://www.digikey.de/de/products/detail/m5stack-technology-co-ltd/K128-SE/23628221?s=N4IgTCBcDaILIFYDKAXAhgYwNYAIDCA9gE4CmSAzDkgKIgC6AvkA | 43 € | 47 | | 2x | M3x25mm Hex Head Cap Bolt | https://www.amazon.de/Edelstahl-Innensechskant-Bolzenset-Eisenrahmen-Mechanischer-Innensechskantschraube-Mutternset/dp/B07PPFT871/ | 12,97 € | 48 | | 4x | M3x20mm Hex Head Cap Bolt | Comes as part of the set mentioned above | " | 49 | | 4x | Heat Set inserts M3 | https://www.amazon.de/ruthex-Gewindeeinsatz-St%C3%BCck-Gewindebuchsen-Kunststoffteile/dp/B08BCRZZS3 | 8,99 € | 50 | | 1x | 3,7v 2000mAh Lipo Batterie Size 34,5 mm x 10,6 mm x 56 mm | https://www.amazon.de/EEMB-103454-2AhLithium-Schutzplatine-Isolationsbeschichtung/dp/B08214DJLJ/ | 14,89 € | 51 | | 4x | Encoder Knob Bought or 3D Printed | https://de.aliexpress.com/item/1005001394286414.html | 5 € | 52 | | 1x | OSSM M5 Remote PCB | KinyMaker Discord #M5-Remote Channel or https://www.pcbway.com/project/shareproject/M5Stack_Core2_Remote_Plattform_2cb5bac0.html | 15 € | 53 | 54 | -------------------------------------------- 55 | 56 | | Quantity | Part | Sourcing US | Price $ | 57 | |----------|------|-------------|---------| 58 | | 1x | M5Stack CoreS3 SE | https://www.digikey.de/de/products/detail/m5stack-technology-co-ltd/K128-SE/23628221?s=N4IgTCBcDaILIFYDKAXAhgYwNYAIDCA9gE4CmSAzDkgKIgC6AvkA | $47| 59 | | 2x | M3x25mm Hex Head Cap Bolt | https://www.amazon.com/dp/B09NR8X2LV | $17.99 | 60 | | 4x | M3x20mm Hex Head Cap Bolt | Comes as part of the set mentioned above | " | 61 | | 4x | Heat Set inserts M3 | https://www.amazon.com/ruthex-M3-Threaded-Inserts-RX-M3x5-7/dp/B08BCRZZS3 | $10.99 | 62 | | 1x | 3.7v 2000mAh Lipo Battery Size 34.5 X 56 X 10.6 mm (The wires will need to be reversed in the connector on this one! See Assembly instructions for more info.) | https://www.amazon.com/EEMB-2000mAh-Battery-Rechargeable-Connector/dp/B08214DJLJ/ | $14.99 | 63 | | 4x | Encoder Knob Bought or 3D Printed | https://www.aliexpress.us/item/3256801207971662.html?gatewayAdapt=deu2usa4itemAdapt | $5.00 | 64 | | 1x | M5 Remote PCB | KinyMaker Discord #M5-Remote Channel or https://www.pcbway.com/project/shareproject/M5Stack_Core2_Remote_Plattform_2cb5bac0.html | $30.00 | 65 | 66 | ## 3D Printed Parts Needed: 67 | 68 | | Quantity | Part | Information | 69 | |----------|------|-------------| 70 | | 1x | M5_curved_w6mm+5.stl Thanks to "Hoodlatch" KM Discord | There is a specific version for the wider Adafruit LIPO battery. Print with the base side facing down, 6 walls 20% Infill | 71 | | 1x | TOP-*-Keycap-Standoff.stl | Top Depends on your Keycap: Cherry or DSA (DSA is wider) | 72 | | 4x | M5_Remote_Knob_Customizable.scad | If you go for the 3d Printed knobs | 73 | 74 | Filament - A good quality PLA works well. While there are no threads it is recommended that your printer is well calibrated. 75 | 76 | ## Operation, or how do I use it? 77 | 78 | 1. Power on the OSSM and let it home. 79 | 2. Power on the OSSM M5 Remote. 80 | 3. Press the left encoder to select 'Connect' 81 | 4. You can verify it is connected by looking in the top left corner, it should say 'connected'. 82 | 5. You can now begin use. You'll need to set the speed, depth and stroke to more than 0 and press the middle key to start. Start the speed out slow. 83 | -------------------------------------------------------------------------------- /SquareLine_Studio/OSSM-White.sll: -------------------------------------------------------------------------------- 1 | {"name":"SquareLine_Project.spj","depth":1,"width":320,"height":240,"description":"","group":"LVGL","board":"LVGL/LVGL","image":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADwAUADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3auN8Q/ETS9CvDafPPMv31jXdt+vIH612VfK000lxPJNKxaSRizMe5Jya3oUlNu514WgqrfNsj17/AIXBp/8Az53X/fpf/i6P+Fwaf/z53X/f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kjlrW71O98LWlwl7dTWDarIqI16sF3PbAMFTzCww4cZILBtq4JBzVW31K9fSL2H7fqMUM/iKCyVprsPNHCVi3osiscYORkHPXJzmu9s/DmmWmjf2U9ut3bF2kkF2BKZXZizM2Rgkkk1BqfhHQ9Vs7K0n0+3W3s5lmhjjhQKMHJXBUja3cDGagzMyeMyeNNL0f+0r1bS205rhQl2waWQSIo8xs5fjPBznJrr6wj4P0L+3YNX/s62FxbwLDEggTYm0qUYDbkMoUAEHgcCt2gAooooAKKKKACiiigD//Z","pointfilter":false,"theme_simplified":false,"theme_dark":false,"theme_color1":5,"theme_color2":0,"exportFolderPath":"D:\\SM-Projekte\\OSSM-M5-Remote\\SquareLine_Studio\\export","exportLanguage":"C/C++","exportIde":"Eclipse","backup_cnt":88} -------------------------------------------------------------------------------- /SquareLine_Studio/OSSM-White_events.py: -------------------------------------------------------------------------------- 1 | 2 | def savesettings(event_struct): 3 | return 4 | 5 | 6 | def screenmachine(event_struct): 7 | return 8 | 9 | 10 | def savepattern(event_struct): 11 | return 12 | 13 | 14 | def ejectcreampie(event_struct): 15 | return 16 | 17 | 18 | def HomeButtonMEvent(event_struct): 19 | return 20 | 21 | 22 | def homebuttonmevent(event_struct): 23 | return 24 | 25 | 26 | def setupdepthI(event_struct): 27 | return 28 | 29 | 30 | def setupDepthInter(event_struct): 31 | return 32 | 33 | 34 | def setupdepthF(event_struct): 35 | return 36 | 37 | 38 | def connectbutton(event_struct): 39 | return 40 | 41 | -------------------------------------------------------------------------------- /SquareLine_Studio/assets/km..png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/assets/km..png -------------------------------------------------------------------------------- /SquareLine_Studio/assets/ortlodof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/assets/ortlodof.png -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup00.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup00.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup01.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup02.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup02.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup03.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup03.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup04.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup04.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup05.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup05.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup06.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup06.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup07.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup07.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup08.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup08.zip -------------------------------------------------------------------------------- /SquareLine_Studio/backup/OSSM-White_backup09.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/SquareLine_Studio/backup/OSSM-White_backup09.zip -------------------------------------------------------------------------------- /SquareLine_Studio/export/test/ui.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: asdfroject.asdfasdfspj 5 | 6 | #include "ui.h" 7 | #include "ui_helpers.h" 8 | 9 | ///////////////////// VARIABLES //////////////////// 10 | lv_obj_t * ui_Screen1; 11 | lv_obj_t * ui_Checkbox1; 12 | 13 | ///////////////////// TEST LVGL SETTINGS //////////////////// 14 | #if LV_COLOR_DEPTH != 32 15 | #error "LV_COLOR_DEPTH should be 32bit to match SquareLine Studio's settings" 16 | #endif 17 | #if LV_COLOR_16_SWAP !=0 18 | #error "#error LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings" 19 | #endif 20 | 21 | ///////////////////// ANIMATIONS //////////////////// 22 | 23 | ///////////////////// FUNCTIONS //////////////////// 24 | 25 | ///////////////////// SCREENS //////////////////// 26 | void ui_Screen1_screen_init(void) 27 | { 28 | 29 | // ui_Screen1 30 | 31 | ui_Screen1 = lv_obj_create(NULL); 32 | 33 | lv_obj_clear_flag(ui_Screen1, LV_OBJ_FLAG_SCROLLABLE); 34 | 35 | // ui_Checkbox1 36 | 37 | ui_Checkbox1 = lv_checkbox_create(ui_Screen1); 38 | lv_checkbox_set_text(ui_Checkbox1, "Checkbox"); 39 | 40 | lv_obj_set_width(ui_Checkbox1, LV_SIZE_CONTENT); 41 | lv_obj_set_height(ui_Checkbox1, LV_SIZE_CONTENT); 42 | 43 | lv_obj_set_x(ui_Checkbox1, -130); 44 | lv_obj_set_y(ui_Checkbox1, 72); 45 | 46 | lv_obj_set_align(ui_Checkbox1, LV_ALIGN_CENTER); 47 | 48 | lv_obj_add_flag(ui_Checkbox1, LV_OBJ_FLAG_SCROLL_ON_FOCUS); 49 | 50 | } 51 | 52 | void ui_init(void) 53 | { 54 | lv_disp_t * dispp = lv_disp_get_default(); 55 | lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), 56 | true, LV_FONT_DEFAULT); 57 | lv_disp_set_theme(dispp, theme); 58 | ui_Screen1_screen_init(); 59 | lv_disp_load_scr(ui_Screen1); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/test/ui.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: asdfroject.asdfasdfspj 5 | 6 | #ifndef _ASDFROJECT.ASDFASDFSPJ_UI_H 7 | #define _ASDFROJECT.ASDFASDFSPJ_UI_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #if __has_include("lvgl.h") 14 | #include "lvgl.h" 15 | #else 16 | #include "lvgl/lvgl.h" 17 | #endif 18 | 19 | extern lv_obj_t * ui_Screen1; 20 | extern lv_obj_t * ui_Checkbox1; 21 | 22 | 23 | 24 | 25 | 26 | 27 | void ui_init(void); 28 | 29 | #ifdef __cplusplus 30 | } /*extern "C"*/ 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/test/ui_helpers.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: asdfroject.asdfasdfspj 5 | 6 | #include "ui_helpers.h" 7 | 8 | void _ui_bar_set_property(lv_obj_t * target, int id, int val) 9 | { 10 | if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON); 11 | if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF); 12 | } 13 | 14 | void _ui_basic_set_property(lv_obj_t * target, int id, int val) 15 | { 16 | if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val); 17 | if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val); 18 | if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val); 19 | if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val); 20 | } 21 | 22 | 23 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val) 24 | { 25 | if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val); 26 | } 27 | 28 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val) 29 | { 30 | if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val); 31 | } 32 | 33 | void _ui_label_set_property(lv_obj_t * target, int id, char * val) 34 | { 35 | if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val); 36 | } 37 | 38 | 39 | void _ui_roller_set_property(lv_obj_t * target, int id, int val) 40 | { 41 | if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON); 42 | if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF); 43 | } 44 | 45 | void _ui_slider_set_property(lv_obj_t * target, int id, int val) 46 | { 47 | if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON); 48 | if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF); 49 | } 50 | 51 | 52 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 53 | { 54 | lv_scr_load_anim(target, fademode, spd, delay, false); 55 | } 56 | 57 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 58 | { 59 | lv_scr_load_anim(target, fademode, spd, delay, false); 60 | } 61 | 62 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 63 | { 64 | lv_scr_load_anim(target, fademode, spd, delay, false); 65 | } 66 | 67 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 68 | { 69 | lv_scr_load_anim(target, fademode, spd, delay, false); 70 | } 71 | 72 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value) 73 | { 74 | if(value == _UI_MODIFY_FLAG_TOGGLE) { 75 | if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag); 76 | else lv_obj_add_flag(target, flag); 77 | } 78 | else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag); 79 | else lv_obj_clear_flag(target, flag); 80 | } 81 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value) 82 | { 83 | if(value == _UI_MODIFY_STATE_TOGGLE) { 84 | if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state); 85 | else lv_obj_add_state(target, state); 86 | } 87 | else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state); 88 | else lv_obj_clear_state(target, state); 89 | } 90 | 91 | void _ui_opacity_set(lv_obj_t * target, int val) 92 | { 93 | lv_obj_set_style_opa(target, val, 0); 94 | } 95 | 96 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v) 97 | { 98 | lv_obj_set_x((lv_obj_t *)a->user_data, v); 99 | } 100 | 101 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v) 102 | { 103 | lv_obj_set_y((lv_obj_t *)a->user_data, v); 104 | } 105 | 106 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v) 107 | { 108 | lv_obj_set_width((lv_obj_t *)a->user_data, v); 109 | } 110 | 111 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v) 112 | { 113 | lv_obj_set_height((lv_obj_t *)a->user_data, v); 114 | } 115 | 116 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v) 117 | { 118 | lv_obj_set_style_opa((lv_obj_t *)a->user_data, v, 0); 119 | } 120 | 121 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v) 122 | { 123 | lv_img_set_zoom((lv_obj_t *)a->user_data, v); 124 | } 125 | 126 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v) 127 | { 128 | lv_img_set_angle((lv_obj_t *)a->user_data, v); 129 | } 130 | 131 | 132 | int32_t _ui_anim_callback_get_x(lv_anim_t * a) 133 | { 134 | return lv_obj_get_x_aligned((lv_obj_t *)a->user_data); 135 | } 136 | 137 | int32_t _ui_anim_callback_get_y(lv_anim_t * a) 138 | { 139 | return lv_obj_get_y_aligned((lv_obj_t *)a->user_data); 140 | } 141 | 142 | int32_t _ui_anim_callback_get_width(lv_anim_t * a) 143 | { 144 | return lv_obj_get_width((lv_obj_t *)a->user_data); 145 | } 146 | 147 | int32_t _ui_anim_callback_get_height(lv_anim_t * a) 148 | { 149 | return lv_obj_get_height((lv_obj_t *)a->user_data); 150 | } 151 | 152 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a) 153 | { 154 | return lv_obj_get_style_opa((lv_obj_t *)a->user_data, 0); 155 | } 156 | 157 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a) 158 | { 159 | return lv_img_get_zoom((lv_obj_t *)a->user_data); 160 | } 161 | 162 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a) 163 | { 164 | return lv_img_get_angle((lv_obj_t *)a->user_data); 165 | } 166 | 167 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 168 | { 169 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 170 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix); 171 | lv_label_set_text(trg, buf); 172 | } 173 | 174 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 175 | { 176 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 177 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix); 178 | lv_label_set_text(trg, buf); 179 | } 180 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off) 181 | { 182 | if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on); 183 | else lv_label_set_text(trg, txt_off); 184 | } 185 | 186 | 187 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/test/ui_helpers.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: asdfroject.asdfasdfspj 5 | 6 | #ifndef _ASDFROJECT.ASDFASDFSPJ_UI_HELPERS_H 7 | #define _ASDFROJECT.ASDFASDFSPJ_UI_HELPERS_H 8 | 9 | #if __has_include("lvgl.h") 10 | #include "lvgl.h" 11 | #else 12 | #include "lvgl/lvgl.h" 13 | #endif 14 | 15 | #define _UI_TEMPORARY_STRING_BUFFER_SIZE 32 16 | #define _UI_BAR_PROPERTY_VALUE 0 17 | #define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1 18 | void _ui_bar_set_property(lv_obj_t * target, int id, int val); 19 | 20 | #define _UI_BASIC_PROPERTY_POSITION_X 0 21 | #define _UI_BASIC_PROPERTY_POSITION_Y 1 22 | #define _UI_BASIC_PROPERTY_WIDTH 2 23 | #define _UI_BASIC_PROPERTY_HEIGHT 3 24 | void _ui_basic_set_property(lv_obj_t * target, int id, int val); 25 | 26 | #define _UI_DROPDOWN_PROPERTY_SELECTED 0 27 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val); 28 | 29 | #define _UI_IMAGE_PROPERTY_IMAGE 0 30 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val); 31 | 32 | #define _UI_LABEL_PROPERTY_TEXT 0 33 | void _ui_label_set_property(lv_obj_t * target, int id, char * val); 34 | 35 | #define _UI_ROLLER_PROPERTY_SELECTED 0 36 | #define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1 37 | void _ui_roller_set_property(lv_obj_t * target, int id, int val); 38 | 39 | #define _UI_SLIDER_PROPERTY_VALUE 0 40 | #define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1 41 | void _ui_slider_set_property(lv_obj_t * target, int id, int val); 42 | 43 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 44 | 45 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 46 | 47 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 48 | 49 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 50 | 51 | #define _UI_MODIFY_FLAG_ADD 0 52 | #define _UI_MODIFY_FLAG_REMOVE 1 53 | #define _UI_MODIFY_FLAG_TOGGLE 2 54 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value); 55 | 56 | #define _UI_MODIFY_STATE_ADD 0 57 | #define _UI_MODIFY_STATE_REMOVE 1 58 | #define _UI_MODIFY_STATE_TOGGLE 2 59 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value); 60 | 61 | void _ui_opacity_set(lv_obj_t * target, int val); 62 | 63 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v); 64 | 65 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v); 66 | 67 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v); 68 | 69 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v); 70 | 71 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v); 72 | 73 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v); 74 | 75 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v); 76 | 77 | int32_t _ui_anim_callback_get_x(lv_anim_t * a); 78 | 79 | int32_t _ui_anim_callback_get_y(lv_anim_t * a); 80 | 81 | int32_t _ui_anim_callback_get_width(lv_anim_t * a); 82 | 83 | int32_t _ui_anim_callback_get_height(lv_anim_t * a); 84 | 85 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a); 86 | 87 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a); 88 | 89 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a); 90 | 91 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 92 | 93 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 94 | 95 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off); 96 | 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/ui.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #ifndef _OSSM-WHITE_UI_H 7 | #define _OSSM-WHITE_UI_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #if __has_include("lvgl.h") 14 | #include "lvgl.h" 15 | #else 16 | #include "lvgl/lvgl.h" 17 | #endif 18 | 19 | extern lv_obj_t * ui_Start; 20 | extern lv_obj_t * ui_Logo; 21 | extern lv_obj_t * ui_StartButtonL; 22 | extern lv_obj_t * ui_StartButtonLText; 23 | extern lv_obj_t * ui_StartButtonM; 24 | extern lv_obj_t * ui_StartButtonMText; 25 | extern lv_obj_t * ui_StartButtonR; 26 | extern lv_obj_t * ui_StartButtonRText; 27 | extern lv_obj_t * ui_KMLogo; 28 | extern lv_obj_t * ui_OrtlofLogo; 29 | extern lv_obj_t * ui_Welcome; 30 | extern lv_obj_t * ui_Batt; 31 | extern lv_obj_t * ui_BattValue; 32 | extern lv_obj_t * ui_Battery; 33 | extern lv_obj_t * ui_Home; 34 | extern lv_obj_t * ui_Logo2; 35 | extern lv_obj_t * ui_HomeButtonL; 36 | extern lv_obj_t * ui_HomeButtonLText; 37 | extern lv_obj_t * ui_HomeButtonM; 38 | extern lv_obj_t * ui_HomeButtonMText; 39 | extern lv_obj_t * ui_HomeButtonR; 40 | extern lv_obj_t * ui_HomeButtonRText; 41 | extern lv_obj_t * ui_SpeedL; 42 | extern lv_obj_t * ui_homespeedslider; 43 | extern lv_obj_t * ui_homespeedvalue; 44 | extern lv_obj_t * ui_DepthL; 45 | extern lv_obj_t * ui_homedepthslider; 46 | extern lv_obj_t * ui_homedepthvalue; 47 | extern lv_obj_t * ui_StrokeL; 48 | extern lv_obj_t * ui_homestrokeslider; 49 | extern lv_obj_t * ui_homestrokevalue; 50 | extern lv_obj_t * ui_SensationL; 51 | extern lv_obj_t * ui_homesensationslider; 52 | extern lv_obj_t * ui_Batt2; 53 | extern lv_obj_t * ui_BattValue2; 54 | extern lv_obj_t * ui_Battery2; 55 | extern lv_obj_t * ui_HomePatternLabel1; 56 | extern lv_obj_t * ui_HomePatternLabel; 57 | extern lv_obj_t * ui_connect; 58 | extern lv_obj_t * ui_Menue; 59 | extern lv_obj_t * ui_Logo3; 60 | extern lv_obj_t * ui_MenueButtonL; 61 | extern lv_obj_t * ui_MenueButtonLText; 62 | extern lv_obj_t * ui_MenueButtonM; 63 | extern lv_obj_t * ui_MenueButtonMText; 64 | extern lv_obj_t * ui_MenueButtonR; 65 | extern lv_obj_t * ui_MenueButtonRText; 66 | extern lv_obj_t * ui_Batt3; 67 | extern lv_obj_t * ui_BattValue3; 68 | extern lv_obj_t * ui_Battery3; 69 | extern lv_obj_t * ui_SDepthI; 70 | extern lv_obj_t * ui_SDepthIL; 71 | extern lv_obj_t * ui_SDepthF; 72 | extern lv_obj_t * ui_SDepthFL; 73 | extern lv_obj_t * ui_SPattern; 74 | extern lv_obj_t * ui_SPatternL; 75 | extern lv_obj_t * ui_STorqe; 76 | extern lv_obj_t * ui_STorqeL; 77 | extern lv_obj_t * ui_EJECTSettingButton; 78 | extern lv_obj_t * ui_EJECTSettingButtonText; 79 | extern lv_obj_t * ui_Pattern; 80 | extern lv_obj_t * ui_Logo5; 81 | extern lv_obj_t * ui_PatternButtonL; 82 | extern lv_obj_t * ui_PatternButtonLText; 83 | extern lv_obj_t * ui_PatternButtonM; 84 | extern lv_obj_t * ui_PatternButtonMText; 85 | extern lv_obj_t * ui_PatternButtonR; 86 | extern lv_obj_t * ui_PatternButtonRText; 87 | extern lv_obj_t * ui_Batt5; 88 | extern lv_obj_t * ui_BattValue5; 89 | extern lv_obj_t * ui_Battery5; 90 | extern lv_obj_t * ui_Label4; 91 | extern lv_obj_t * ui_PatternS; 92 | extern lv_obj_t * ui_Torqe; 93 | extern lv_obj_t * ui_Logo4; 94 | extern lv_obj_t * ui_TorqeButtonL; 95 | extern lv_obj_t * ui_TorqeButtonLText; 96 | extern lv_obj_t * ui_TorqeButtonM; 97 | extern lv_obj_t * ui_TorqeButtonMText; 98 | extern lv_obj_t * ui_TorqeButtonR; 99 | extern lv_obj_t * ui_TorqeButtonRText; 100 | extern lv_obj_t * ui_outtroqelabel; 101 | extern lv_obj_t * ui_outtroqevalue; 102 | extern lv_obj_t * ui_outtroqeslider; 103 | extern lv_obj_t * ui_Low1; 104 | extern lv_obj_t * ui_High1; 105 | extern lv_obj_t * ui_introqelabel; 106 | extern lv_obj_t * ui_introqevalue; 107 | extern lv_obj_t * ui_introqeslider; 108 | extern lv_obj_t * ui_Low2; 109 | extern lv_obj_t * ui_High; 110 | extern lv_obj_t * ui_Batt4; 111 | extern lv_obj_t * ui_BattValue4; 112 | extern lv_obj_t * ui_Battery4; 113 | extern lv_obj_t * ui_EJECTSettings; 114 | extern lv_obj_t * ui_Logo6; 115 | extern lv_obj_t * ui_EJECTButtonL; 116 | extern lv_obj_t * ui_EJECTButtonLText; 117 | extern lv_obj_t * ui_EJECTButtonM; 118 | extern lv_obj_t * ui_EJECTButtonMText; 119 | extern lv_obj_t * ui_EJECTButtonR; 120 | extern lv_obj_t * ui_EJECTButtonRText; 121 | extern lv_obj_t * ui_Batt6; 122 | extern lv_obj_t * ui_BattValue6; 123 | extern lv_obj_t * ui_Battery6; 124 | extern lv_obj_t * ui_Settings; 125 | extern lv_obj_t * ui_Logo1; 126 | extern lv_obj_t * ui_SettingsButtonL; 127 | extern lv_obj_t * ui_SettingsButtonLText; 128 | extern lv_obj_t * ui_SettingsButtonM; 129 | extern lv_obj_t * ui_SettingsButtonMText; 130 | extern lv_obj_t * ui_SettingsButtonR; 131 | extern lv_obj_t * ui_SettingsButtonRText; 132 | extern lv_obj_t * ui_Batt1; 133 | extern lv_obj_t * ui_BattValue1; 134 | extern lv_obj_t * ui_Battery1; 135 | extern lv_obj_t * ui_ejectaddon; 136 | extern lv_obj_t * ui_darkmode; 137 | extern lv_obj_t * ui_vibrate; 138 | extern lv_obj_t * ui_lefty; 139 | 140 | void screenmachine(lv_event_t * e); 141 | void connectbutton(lv_event_t * e); 142 | void screenmachine(lv_event_t * e); 143 | void ejectcreampie(lv_event_t * e); 144 | void homebuttonmevent(lv_event_t * e); 145 | void screenmachine(lv_event_t * e); 146 | void setupDepthInter(lv_event_t * e); 147 | void setupdepthF(lv_event_t * e); 148 | void screenmachine(lv_event_t * e); 149 | void savepattern(lv_event_t * e); 150 | void screenmachine(lv_event_t * e); 151 | void screenmachine(lv_event_t * e); 152 | void screenmachine(lv_event_t * e); 153 | void savesettings(lv_event_t * e); 154 | 155 | LV_IMG_DECLARE(ui_img_km__png); // assets\km..png 156 | LV_IMG_DECLARE(ui_img_ortlodof_png); // assets\ortlodof.png 157 | 158 | 159 | 160 | 161 | void ui_init(void); 162 | 163 | #ifdef __cplusplus 164 | } /*extern "C"*/ 165 | #endif 166 | 167 | #endif 168 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/ui_events.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #include "ui.h" 7 | 8 | void savesettings(lv_event_t * e) 9 | { 10 | // Your code here 11 | } 12 | 13 | void screenmachine(lv_event_t * e) 14 | { 15 | // Your code here 16 | } 17 | 18 | void savepattern(lv_event_t * e) 19 | { 20 | // Your code here 21 | } 22 | 23 | void ejectcreampie(lv_event_t * e) 24 | { 25 | // Your code here 26 | } 27 | 28 | void homebuttonmevent(lv_event_t * e) 29 | { 30 | // Your code here 31 | } 32 | 33 | void setupDepthInter(lv_event_t * e) 34 | { 35 | // Your code here 36 | } 37 | 38 | void setupdepthF(lv_event_t * e) 39 | { 40 | // Your code here 41 | } 42 | 43 | void connectbutton(lv_event_t * e) 44 | { 45 | // Your code here 46 | } 47 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/ui_helpers.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #include "ui_helpers.h" 7 | 8 | void _ui_bar_set_property(lv_obj_t * target, int id, int val) 9 | { 10 | if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON); 11 | if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF); 12 | } 13 | 14 | void _ui_basic_set_property(lv_obj_t * target, int id, int val) 15 | { 16 | if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val); 17 | if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val); 18 | if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val); 19 | if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val); 20 | } 21 | 22 | 23 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val) 24 | { 25 | if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val); 26 | } 27 | 28 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val) 29 | { 30 | if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val); 31 | } 32 | 33 | void _ui_label_set_property(lv_obj_t * target, int id, char * val) 34 | { 35 | if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val); 36 | } 37 | 38 | 39 | void _ui_roller_set_property(lv_obj_t * target, int id, int val) 40 | { 41 | if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON); 42 | if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF); 43 | } 44 | 45 | void _ui_slider_set_property(lv_obj_t * target, int id, int val) 46 | { 47 | if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON); 48 | if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF); 49 | } 50 | 51 | 52 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 53 | { 54 | lv_scr_load_anim(target, fademode, spd, delay, false); 55 | } 56 | 57 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 58 | { 59 | lv_scr_load_anim(target, fademode, spd, delay, false); 60 | } 61 | 62 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 63 | { 64 | lv_scr_load_anim(target, fademode, spd, delay, false); 65 | } 66 | 67 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 68 | { 69 | lv_scr_load_anim(target, fademode, spd, delay, false); 70 | } 71 | 72 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value) 73 | { 74 | if(value == _UI_MODIFY_FLAG_TOGGLE) { 75 | if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag); 76 | else lv_obj_add_flag(target, flag); 77 | } 78 | else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag); 79 | else lv_obj_clear_flag(target, flag); 80 | } 81 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value) 82 | { 83 | if(value == _UI_MODIFY_STATE_TOGGLE) { 84 | if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state); 85 | else lv_obj_add_state(target, state); 86 | } 87 | else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state); 88 | else lv_obj_clear_state(target, state); 89 | } 90 | 91 | void _ui_opacity_set(lv_obj_t * target, int val) 92 | { 93 | lv_obj_set_style_opa(target, val, 0); 94 | } 95 | 96 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v) 97 | { 98 | lv_obj_set_x((lv_obj_t *)a->user_data, v); 99 | } 100 | 101 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v) 102 | { 103 | lv_obj_set_y((lv_obj_t *)a->user_data, v); 104 | } 105 | 106 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v) 107 | { 108 | lv_obj_set_width((lv_obj_t *)a->user_data, v); 109 | } 110 | 111 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v) 112 | { 113 | lv_obj_set_height((lv_obj_t *)a->user_data, v); 114 | } 115 | 116 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v) 117 | { 118 | lv_obj_set_style_opa((lv_obj_t *)a->user_data, v, 0); 119 | } 120 | 121 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v) 122 | { 123 | lv_img_set_zoom((lv_obj_t *)a->user_data, v); 124 | } 125 | 126 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v) 127 | { 128 | lv_img_set_angle((lv_obj_t *)a->user_data, v); 129 | } 130 | 131 | 132 | int32_t _ui_anim_callback_get_x(lv_anim_t * a) 133 | { 134 | return lv_obj_get_x_aligned((lv_obj_t *)a->user_data); 135 | } 136 | 137 | int32_t _ui_anim_callback_get_y(lv_anim_t * a) 138 | { 139 | return lv_obj_get_y_aligned((lv_obj_t *)a->user_data); 140 | } 141 | 142 | int32_t _ui_anim_callback_get_width(lv_anim_t * a) 143 | { 144 | return lv_obj_get_width((lv_obj_t *)a->user_data); 145 | } 146 | 147 | int32_t _ui_anim_callback_get_height(lv_anim_t * a) 148 | { 149 | return lv_obj_get_height((lv_obj_t *)a->user_data); 150 | } 151 | 152 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a) 153 | { 154 | return lv_obj_get_style_opa((lv_obj_t *)a->user_data, 0); 155 | } 156 | 157 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a) 158 | { 159 | return lv_img_get_zoom((lv_obj_t *)a->user_data); 160 | } 161 | 162 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a) 163 | { 164 | return lv_img_get_angle((lv_obj_t *)a->user_data); 165 | } 166 | 167 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 168 | { 169 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 170 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix); 171 | lv_label_set_text(trg, buf); 172 | } 173 | 174 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 175 | { 176 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 177 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix); 178 | lv_label_set_text(trg, buf); 179 | } 180 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off) 181 | { 182 | if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on); 183 | else lv_label_set_text(trg, txt_off); 184 | } 185 | 186 | 187 | -------------------------------------------------------------------------------- /SquareLine_Studio/export/ui_helpers.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #ifndef _OSSM-WHITE_UI_HELPERS_H 7 | #define _OSSM-WHITE_UI_HELPERS_H 8 | 9 | #if __has_include("lvgl.h") 10 | #include "lvgl.h" 11 | #else 12 | #include "lvgl/lvgl.h" 13 | #endif 14 | 15 | #define _UI_TEMPORARY_STRING_BUFFER_SIZE 32 16 | #define _UI_BAR_PROPERTY_VALUE 0 17 | #define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1 18 | void _ui_bar_set_property(lv_obj_t * target, int id, int val); 19 | 20 | #define _UI_BASIC_PROPERTY_POSITION_X 0 21 | #define _UI_BASIC_PROPERTY_POSITION_Y 1 22 | #define _UI_BASIC_PROPERTY_WIDTH 2 23 | #define _UI_BASIC_PROPERTY_HEIGHT 3 24 | void _ui_basic_set_property(lv_obj_t * target, int id, int val); 25 | 26 | #define _UI_DROPDOWN_PROPERTY_SELECTED 0 27 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val); 28 | 29 | #define _UI_IMAGE_PROPERTY_IMAGE 0 30 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val); 31 | 32 | #define _UI_LABEL_PROPERTY_TEXT 0 33 | void _ui_label_set_property(lv_obj_t * target, int id, char * val); 34 | 35 | #define _UI_ROLLER_PROPERTY_SELECTED 0 36 | #define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1 37 | void _ui_roller_set_property(lv_obj_t * target, int id, int val); 38 | 39 | #define _UI_SLIDER_PROPERTY_VALUE 0 40 | #define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1 41 | void _ui_slider_set_property(lv_obj_t * target, int id, int val); 42 | 43 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 44 | 45 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 46 | 47 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 48 | 49 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 50 | 51 | #define _UI_MODIFY_FLAG_ADD 0 52 | #define _UI_MODIFY_FLAG_REMOVE 1 53 | #define _UI_MODIFY_FLAG_TOGGLE 2 54 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value); 55 | 56 | #define _UI_MODIFY_STATE_ADD 0 57 | #define _UI_MODIFY_STATE_REMOVE 1 58 | #define _UI_MODIFY_STATE_TOGGLE 2 59 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value); 60 | 61 | void _ui_opacity_set(lv_obj_t * target, int val); 62 | 63 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v); 64 | 65 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v); 66 | 67 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v); 68 | 69 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v); 70 | 71 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v); 72 | 73 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v); 74 | 75 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v); 76 | 77 | int32_t _ui_anim_callback_get_x(lv_anim_t * a); 78 | 79 | int32_t _ui_anim_callback_get_y(lv_anim_t * a); 80 | 81 | int32_t _ui_anim_callback_get_width(lv_anim_t * a); 82 | 83 | int32_t _ui_anim_callback_get_height(lv_anim_t * a); 84 | 85 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a); 86 | 87 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a); 88 | 89 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a); 90 | 91 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 92 | 93 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 94 | 95 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off); 96 | 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /image/bottom+battery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/image/bottom+battery.jpg -------------------------------------------------------------------------------- /image/bottom+m5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/image/bottom+m5.jpg -------------------------------------------------------------------------------- /image/bottom+pcb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/image/bottom+pcb.png -------------------------------------------------------------------------------- /image/full-remote.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/image/full-remote.jpg -------------------------------------------------------------------------------- /image/remote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/image/remote.png -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:m5stack-core2] 12 | platform = espressif32 13 | board = m5stack-core2 14 | framework = arduino 15 | monitor_speed = 115200 16 | upload_protocol = esptool 17 | board_build.partitions = default_16MB.csv 18 | lib_deps = 19 | https://github.com/m5stack/M5Unified.git 20 | https://github.com/madhephaestus/ESP32Encoder.git 21 | mathertel/OneButton@^2.0.3 22 | lvgl/lvgl@^9.0.0 23 | build_flags = 24 | -D LV_CONF_INCLUDE_SIMPLE 25 | -I src 26 | 27 | 28 | [env:m5stack-cores3] 29 | platform = espressif32@6.5.0 30 | board = m5stack-cores3 31 | framework = arduino 32 | monitor_speed = 115200 33 | upload_protocol = esptool 34 | board_build.partitions = default_16MB.csv 35 | board_upload.use_1200bps_touch = yes 36 | board_upload.wait_for_upload_port = yes 37 | board_upload.require_upload_port = yes 38 | lib_deps = 39 | https://github.com/m5stack/M5Unified.git 40 | https://github.com/madhephaestus/ESP32Encoder.git 41 | mathertel/OneButton@^2.0.3 42 | lvgl/lvgl@^9.0.0 43 | build_flags = 44 | -D LV_CONF_INCLUDE_SIMPLE 45 | -I src 46 | -D SERIAL_INFO 47 | -D ARDUINO_USB_MODE=1 48 | -D ARDUINO_USB_CDC_ON_BOOT=1 49 | -DCORE_DEBUG_LEVEL=5 50 | 51 | ;upload_port = com3 52 | ;monitor_port = com3 -------------------------------------------------------------------------------- /src/PatternMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | 7 | /**************************************************************************/ 8 | /*! 9 | @brief This function will scale one set of floating point numbers (range) 10 | to another set of floating point numbers (range). It has a "curve" parameter 11 | so that it can be made to favor either the end of the output. 12 | (Logarithmic mapping) Source: https://playground.arduino.cc/Main/Fscale/ 13 | @param originalMin the minimum value of the original range 14 | this MUST be less than originalMax 15 | @param originalMax the maximum value of the original range 16 | this MUST be greater than originalMin 17 | @param newBegin the end of the new range which maps to originalMin 18 | it can be smaller, or larger, than newEnd, to 19 | facilitate inverting the ranges 20 | @param newEnd the end of the new range which maps to originalMax 21 | it can be larger, or smaller, than newBegin, to 22 | facilitate inverting the ranges 23 | @param inputValue the variable for input that will mapped to the given ranges, 24 | this variable is constrained to 25 | originaMin <= inputValue <= originalMax 26 | @param curve curve is the curve which can be made to favor either 27 | end of the output scale in the mapping. 28 | Parameters are from -10 to 10 with 0 being a linear mapping 29 | (which basically takes curve out of the equation) 30 | @returns the scaled value 31 | */ 32 | /**************************************************************************/ 33 | inline float fscale( float originalMin, float originalMax, float newBegin, float 34 | newEnd, float inputValue, float curve){ 35 | 36 | float OriginalRange = 0; 37 | float NewRange = 0; 38 | float zeroRefCurVal = 0; 39 | float normalizedCurVal = 0; 40 | float rangedValue = 0; 41 | bool invFlag = 0; 42 | 43 | // condition curve parameter 44 | // limit range 45 | 46 | if (curve > 10) curve = 10; 47 | if (curve < -10) curve = -10; 48 | 49 | curve = (curve * -.1) ; // - invert and scale - this seems more intuitive - positive numbers give more weight to high end on output 50 | curve = pow(10, curve); // convert linear scale into logarithmic exponent for other pow function 51 | 52 | // Check for out of range inputValues 53 | if (inputValue < originalMin) { 54 | inputValue = originalMin; 55 | } 56 | if (inputValue > originalMax) { 57 | inputValue = originalMax; 58 | } 59 | 60 | // Zero Reference the values 61 | OriginalRange = originalMax - originalMin; 62 | 63 | if (newEnd > newBegin){ 64 | NewRange = newEnd - newBegin; 65 | } 66 | else 67 | { 68 | NewRange = newBegin - newEnd; 69 | invFlag = 1; 70 | } 71 | 72 | zeroRefCurVal = inputValue - originalMin; 73 | normalizedCurVal = zeroRefCurVal / OriginalRange; // normalize to 0 - 1 float 74 | 75 | // Check for originalMin > originalMax - the math for all other cases i.e. negative numbers seems to work out fine 76 | if (originalMin > originalMax ) { 77 | return 0; 78 | } 79 | 80 | if (invFlag == 0){ 81 | rangedValue = (pow(normalizedCurVal, curve) * NewRange) + newBegin; 82 | 83 | } 84 | else // invert the ranges 85 | { 86 | rangedValue = newBegin - (pow(normalizedCurVal, curve) * NewRange); 87 | } 88 | 89 | return rangedValue; 90 | } 91 | 92 | /**************************************************************************/ 93 | /*! 94 | @brief Float version of Arduino's map() function. 95 | @param x The value to be mapped 96 | @param in_min in_min gets mapped to out_min 97 | @param in_max in_max gets mapped to out_max 98 | @param out_min in_min gets mapped to out_min 99 | @param out_max in_max gets mapped to out_max 100 | @returns mapped value 101 | */ 102 | /**************************************************************************/ 103 | inline float fmap(float x, float in_min, float in_max, float out_min, float out_max) { 104 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 105 | } 106 | 107 | /**************************************************************************/ 108 | /*! 109 | @brief Maps a Sensation value from -100 to +100 to an arbitrary factor. 110 | Positive values become a factor > 1. 0 maps to 1.0 and negative values are 111 | mapped to the invers between 0 and 1.0. A curve argument may be given if the 112 | mapping should be curved (log). It uses fscale() under the hood. 113 | @param maximumFactor the factor +100 gets mapped to. Should be > 1.0 114 | @param inputValue Input parameter to be mapped 115 | @param curve curve is the curve which can be made to favor either 116 | end of the output scale in the mapping. 117 | Parameters are from -10 to 10 with 0 being a linear mapping 118 | (which basically takes curve out of the equation) 119 | @returns the scaled factor 120 | */ 121 | /**************************************************************************/ 122 | inline float mapSensationToFactor(float maximumFactor, float inputValue, float curve = 0.0) { 123 | inputValue = constrain(inputValue, -100.0, 100.0); 124 | float fscaledValue = 0.0; 125 | 126 | if (inputValue == 0.0) { 127 | return 1.0; 128 | } 129 | 130 | fscaledValue = fscale(0.0, 100.0, 1.0, maximumFactor, abs(inputValue), curve); 131 | 132 | if (inputValue >= 0) { 133 | return fscaledValue; 134 | } else { 135 | return 1.0/fscaledValue; 136 | } 137 | 138 | } 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/certs/x509_crt_bundle.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ortlof/OSSM-M5-Remote/fd5aae86e60ba676a8f79ce793f3cc8001a83df5/src/certs/x509_crt_bundle.bin -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | 2 | #define OSSM 1 3 | 4 | #define CUM 2 5 | uint8_t CUM_Address[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 6 | 7 | 8 | #define OSSM_ID 1 //OSSM_ID Default can be changed with M5 Remote in the Future will be Saved in EPROOM 9 | #define M5_ID 99 //M5_ID Default can be changed with M5 Remote in the Future will be Saved in EPROOM 10 | #define BATTERY_CHARGE_CURRENT 100 // Charge current, must be one of AXP192::CHGCurrent 11 | 12 | #ifdef ARDUINO_M5STACK_CORES3 13 | //Pin Definitons Encoders S3: 14 | 15 | #define ENC_1_CLK 5 16 | #define ENC_1_DT 9 17 | 18 | #define ENC_2_CLK 18 19 | #define ENC_2_DT 17 20 | 21 | #define ENC_3_CLK 1 22 | #define ENC_3_DT 2 23 | 24 | #define ENC_4_CLK 7 25 | #define ENC_4_DT 6 26 | OneButton Button1(10, false); // MX Button 27 | OneButton Button2(8, false); // Encoder Left 28 | OneButton Button3(14, false, true); // Encoder Right 29 | #else 30 | 31 | #define ENC_1_CLK 25 32 | #define ENC_1_DT 26 33 | 34 | #define ENC_2_CLK 13 35 | #define ENC_2_DT 14 36 | 37 | #define ENC_3_CLK 33 38 | #define ENC_3_DT 32 39 | 40 | #define ENC_4_CLK 19 41 | #define ENC_4_DT 27 42 | OneButton Button1(35, false); //MX Button 43 | OneButton Button2(36, false); //Encoder Left 44 | OneButton Button3(34, false, true); //Encoder Right 45 | #endif 46 | 47 | 48 | 49 | #define Encoder_MAP 144 50 | 51 | #define LV_HOR_RES_MAX 320 52 | #define LV_VER_RES_MAX 240 53 | 54 | // Color 55 | #define TextColor TFT_PURPLE 56 | #define BgColor TFT_WHITE 57 | #define FrontColor TFT_PURPLE 58 | #define HighlightColor TFT_BLACK 59 | 60 | -------------------------------------------------------------------------------- /src/language.h: -------------------------------------------------------------------------------- 1 | //EN 2 | // Language 3 | #define T_HEADER "OSSM Remote" 4 | #define T_BLANK "" 5 | #define T_MENUE "Menu" 6 | #define T_DEMO "Demo" 7 | #define T_CONNECT "Connect" 8 | #define T_SETTINGS "Settings" 9 | #define T_MOTD "Welcome to OSSM M5 Remote" 10 | #define T_BATT "Battery" 11 | #define T_CREAMPIE "Creampie" 12 | #define T_START "Start/Stop" 13 | #define T_CUM "Cum" 14 | #define T_HOME "Home" 15 | #define T_MEN1 "Up" 16 | #define T_MEN2 "Down" 17 | #define T_SPEED "Speed:" 18 | #define T_DEPTH "Depth:" 19 | #define T_MM " mm" 20 | #define T_STROKE "Stroke:" 21 | #define T_SENSATION "Sensation:" 22 | #define T_SETUP_DEPTH_I "Set Depth Interactively" 23 | #define T_SETUP_DEPTH_F "Set Depth Fancy" 24 | #define T_SELECT_PATTERN "Select Pattern" 25 | #define T_PATTERN_Button "Select Pattern \n Menue" 26 | #define T_RESTART "Restart" 27 | #define T_SETUP_TORQE "Setup Torque" 28 | #define T_OUT_TORQE "Outward Torque:" 29 | #define T_IN_TORQE "Inward Torque:" 30 | #define T_EJECT_SETTINGS "EJECT Settings" 31 | #define T_EJECT "EJECT" 32 | #define T_SAVE "Save" 33 | #define T_LOW "Low" 34 | #define T_HIGH "High" 35 | #define T_DARKM "Dark Mode" 36 | #define T_VIBRATE "Vibrate" 37 | #define T_TOUCHSETTING "Touch Disabled" 38 | 39 | 40 | #define T_Patterns "Pattern:" 41 | #define T_SimpleStroke "Simple Stroke" 42 | #define T_TeasingPounding "Teasing or Pounding" 43 | #define T_RoboStroke "Robo Stroke" 44 | #define T_HalfnHalf "Half 'n' Half" 45 | #define T_Deeper "Deeper" 46 | #define T_StopNGo "Stop'n'Go" 47 | #define T_Insist "Insist" 48 | #define T_JackHammer "Jack Hammer" 49 | #define T_StrokeNibbler "Stroke Nibbler" 50 | 51 | #define T_CUM_SPEED "CUM Speed" 52 | #define T_CUM_TIME "CUM Time" 53 | #define T_CUM_Volume "CUM Volume" 54 | #define T_CUM_Accel "CUM Force" 55 | 56 | #define T_FUCKS_MIN " F/m" 57 | -------------------------------------------------------------------------------- /src/lv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_conf.h 3 | * Configuration file for v9.0.1-dev 4 | */ 5 | 6 | /* 7 | * Copy this file as `lv_conf.h` 8 | * 1. simply next to the `lvgl` folder 9 | * 2. or any other places and 10 | * - define `LV_CONF_INCLUDE_SIMPLE` 11 | * - add the path as include path 12 | */ 13 | 14 | /* clang-format off */ 15 | #if 1 /*Set it to "1" to enable content*/ 16 | 17 | #ifndef LV_CONF_H 18 | #define LV_CONF_H 19 | 20 | /*==================== 21 | COLOR SETTINGS 22 | *====================*/ 23 | 24 | /*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ 25 | #define LV_COLOR_DEPTH 16 26 | 27 | /*========================= 28 | STDLIB WRAPPER SETTINGS 29 | *=========================*/ 30 | 31 | /* Possible values 32 | * - LV_STDLIB_BUILTIN: LVGL's built in implementation 33 | * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc 34 | * - LV_STDLIB_MICROPYTHON: MicroPython implementation 35 | * - LV_STDLIB_RTTHREAD: RT-Thread implementation 36 | * - LV_STDLIB_CUSTOM: Implement the functions externally 37 | */ 38 | #define LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB 39 | #define LV_USE_STDLIB_STRING LV_STDLIB_CLIB 40 | #define LV_USE_STDLIB_SPRINTF LV_STDLIB_CLIB 41 | 42 | 43 | #if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN 44 | /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ 45 | #define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/ 46 | 47 | /*Size of the memory expand for `lv_malloc()` in bytes*/ 48 | #define LV_MEM_POOL_EXPAND_SIZE 0 49 | 50 | /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ 51 | #define LV_MEM_ADR 0 /*0: unused*/ 52 | /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ 53 | #if LV_MEM_ADR == 0 54 | #undef LV_MEM_POOL_INCLUDE 55 | #undef LV_MEM_POOL_ALLOC 56 | #endif 57 | #endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ 58 | 59 | /*==================== 60 | HAL SETTINGS 61 | *====================*/ 62 | 63 | /*Default display refresh, input device read and animation step period.*/ 64 | #define LV_DEF_REFR_PERIOD 33 /*[ms]*/ 65 | 66 | /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. 67 | *(Not so important, you can adjust it to modify default sizes and spaces)*/ 68 | #define LV_DPI_DEF 130 /*[px/inch]*/ 69 | 70 | /*================= 71 | * OPERATING SYSTEM 72 | *=================*/ 73 | /*Select an operating system to use. Possible options: 74 | * - LV_OS_NONE 75 | * - LV_OS_PTHREAD 76 | * - LV_OS_FREERTOS 77 | * - LV_OS_CMSIS_RTOS2 78 | * - LV_OS_RTTHREAD 79 | * - LV_OS_WINDOWS 80 | * - LV_OS_CUSTOM */ 81 | #define LV_USE_OS LV_OS_NONE 82 | 83 | #if LV_USE_OS == LV_OS_CUSTOM 84 | #define LV_OS_CUSTOM_INCLUDE 85 | #endif 86 | 87 | /*======================== 88 | * RENDERING CONFIGURATION 89 | *========================*/ 90 | 91 | /*Align the stride of all layers and images to this bytes*/ 92 | #define LV_DRAW_BUF_STRIDE_ALIGN 1 93 | 94 | /*Align the start address of draw_buf addresses to this bytes*/ 95 | #define LV_DRAW_BUF_ALIGN 4 96 | 97 | #define LV_USE_DRAW_SW 1 98 | #if LV_USE_DRAW_SW == 1 99 | /* Set the number of draw unit. 100 | * > 1 requires an operating system enabled in `LV_USE_OS` 101 | * > 1 means multiply threads will render the screen in parallel */ 102 | #define LV_DRAW_SW_DRAW_UNIT_CNT 1 103 | 104 | /* Use Arm-2D to accelerate the sw render */ 105 | #define LV_USE_DRAW_ARM2D_SYNC 0 106 | 107 | /* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode 108 | * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. 109 | * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers 110 | * and can't be drawn in chunks. */ 111 | 112 | /*The target buffer size for simple layer chunks.*/ 113 | #define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ 114 | 115 | /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only 116 | * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ 117 | #define LV_DRAW_SW_COMPLEX 1 118 | 119 | #if LV_DRAW_SW_COMPLEX == 1 120 | /*Allow buffering some shadow calculation. 121 | *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` 122 | *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ 123 | #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 124 | 125 | /* Set number of maximally cached circle data. 126 | * The circumference of 1/4 circle are saved for anti-aliasing 127 | * radius * 4 bytes are used per circle (the most often used radiuses are saved) 128 | * 0: to disable caching */ 129 | #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 130 | #endif 131 | 132 | #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE 133 | 134 | #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM 135 | #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" 136 | #endif 137 | #endif 138 | 139 | /* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ 140 | #define LV_USE_DRAW_VGLITE 0 141 | 142 | #if LV_USE_DRAW_VGLITE 143 | /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ 144 | #define LV_USE_VGLITE_BLIT_SPLIT 0 145 | 146 | #if LV_USE_OS 147 | /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ 148 | #define LV_USE_VGLITE_DRAW_ASYNC 1 149 | #endif 150 | 151 | /* Enable VGLite asserts. */ 152 | #define LV_USE_VGLITE_ASSERT 0 153 | #endif 154 | 155 | /* Use NXP's PXP on iMX RTxxx platforms. */ 156 | #define LV_USE_DRAW_PXP 0 157 | 158 | #if LV_USE_DRAW_PXP 159 | /* Enable PXP asserts. */ 160 | #define LV_USE_PXP_ASSERT 0 161 | #endif 162 | 163 | /* Use Renesas Dave2D on RA platforms. */ 164 | #define LV_USE_DRAW_DAVE2D 0 165 | 166 | /* Draw using cached SDL textures*/ 167 | #define LV_USE_DRAW_SDL 0 168 | 169 | /* Use VG-Lite GPU. */ 170 | #define LV_USE_DRAW_VG_LITE 0 171 | 172 | #if LV_USE_DRAW_VG_LITE 173 | /* Enable VG-Lite custom external 'gpu_init()' function */ 174 | #define LV_VG_LITE_USE_GPU_INIT 0 175 | 176 | /* Enable VG-Lite assert. */ 177 | #define LV_VG_LITE_USE_ASSERT 0 178 | 179 | /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ 180 | #define LV_VG_LITE_FLUSH_MAX_COUNT 8 181 | 182 | /* Enable border to simulate shadow 183 | * NOTE: which usually improves performance, 184 | * but does not guarantee the same rendering quality as the software. */ 185 | #define LV_VG_LITE_USE_BOX_SHADOW 0 186 | 187 | #endif 188 | 189 | /*======================= 190 | * FEATURE CONFIGURATION 191 | *=======================*/ 192 | 193 | /*------------- 194 | * Logging 195 | *-----------*/ 196 | 197 | /*Enable the log module*/ 198 | #define LV_USE_LOG 0 199 | #if LV_USE_LOG 200 | 201 | /*How important log should be added: 202 | *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 203 | *LV_LOG_LEVEL_INFO Log important events 204 | *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 205 | *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 206 | *LV_LOG_LEVEL_USER Only logs added by the user 207 | *LV_LOG_LEVEL_NONE Do not log anything*/ 208 | #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 209 | 210 | /*1: Print the log with 'printf'; 211 | *0: User need to register a callback with `lv_log_register_print_cb()`*/ 212 | #define LV_LOG_PRINTF 0 213 | 214 | /*1: Enable print timestamp; 215 | *0: Disable print timestamp*/ 216 | #define LV_LOG_USE_TIMESTAMP 1 217 | 218 | /*1: Print file and line number of the log; 219 | *0: Do not print file and line number of the log*/ 220 | #define LV_LOG_USE_FILE_LINE 1 221 | 222 | /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ 223 | #define LV_LOG_TRACE_MEM 1 224 | #define LV_LOG_TRACE_TIMER 1 225 | #define LV_LOG_TRACE_INDEV 1 226 | #define LV_LOG_TRACE_DISP_REFR 1 227 | #define LV_LOG_TRACE_EVENT 1 228 | #define LV_LOG_TRACE_OBJ_CREATE 1 229 | #define LV_LOG_TRACE_LAYOUT 1 230 | #define LV_LOG_TRACE_ANIM 1 231 | #define LV_LOG_TRACE_CACHE 1 232 | 233 | #endif /*LV_USE_LOG*/ 234 | 235 | /*------------- 236 | * Asserts 237 | *-----------*/ 238 | 239 | /*Enable asserts if an operation is failed or an invalid data is found. 240 | *If LV_USE_LOG is enabled an error message will be printed on failure*/ 241 | #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ 242 | #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ 243 | #define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/ 244 | #define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ 245 | #define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ 246 | 247 | /*Add a custom handler when assert happens e.g. to restart the MCU*/ 248 | #define LV_ASSERT_HANDLER_INCLUDE 249 | #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ 250 | 251 | /*------------- 252 | * Debug 253 | *-----------*/ 254 | 255 | /*1: Draw random colored rectangles over the redrawn areas*/ 256 | #define LV_USE_REFR_DEBUG 0 257 | 258 | /*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ 259 | #define LV_USE_LAYER_DEBUG 0 260 | 261 | /*1: Draw overlays with different colors for each draw_unit's tasks. 262 | *Also add the index number of the draw unit on white background. 263 | *For layers add the index number of the draw unit on black background.*/ 264 | #define LV_USE_PARALLEL_DRAW_DEBUG 0 265 | 266 | /*------------- 267 | * Others 268 | *-----------*/ 269 | 270 | #define LV_ENABLE_GLOBAL_CUSTOM 0 271 | #if LV_ENABLE_GLOBAL_CUSTOM 272 | /*Header to include for the custom 'lv_global' function"*/ 273 | #define LV_GLOBAL_CUSTOM_INCLUDE 274 | #endif 275 | 276 | /*Default cache size in bytes. 277 | *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. 278 | *If size is not set to 0, the decoder will fail to decode when the cache is full. 279 | *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ 280 | #define LV_CACHE_DEF_SIZE 0 281 | 282 | /*Default number of image header cache entries. The cache is used to store the headers of images 283 | *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ 284 | #define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 285 | 286 | /*Number of stops allowed per gradient. Increase this to allow more stops. 287 | *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ 288 | #define LV_GRADIENT_MAX_STOPS 2 289 | 290 | /* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. 291 | * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ 292 | #define LV_COLOR_MIX_ROUND_OFS 0 293 | 294 | /* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ 295 | #define LV_OBJ_STYLE_CACHE 0 296 | 297 | /* Add `id` field to `lv_obj_t` */ 298 | #define LV_USE_OBJ_ID 0 299 | 300 | /* Use lvgl builtin method for obj ID */ 301 | #define LV_USE_OBJ_ID_BUILTIN 0 302 | 303 | /*Use obj property set/get API*/ 304 | #define LV_USE_OBJ_PROPERTY 0 305 | 306 | /* VG-Lite Simulator */ 307 | /*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ 308 | #define LV_USE_VG_LITE_THORVG 0 309 | 310 | #if LV_USE_VG_LITE_THORVG 311 | 312 | /*Enable LVGL's blend mode support*/ 313 | #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 314 | 315 | /*Enable YUV color format support*/ 316 | #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 317 | 318 | /*Enable 16 pixels alignment*/ 319 | #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 320 | 321 | /*Buffer address alignment*/ 322 | #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 323 | 324 | /*Enable multi-thread render*/ 325 | #define LV_VG_LITE_THORVG_THREAD_RENDER 0 326 | 327 | #endif 328 | 329 | /*===================== 330 | * COMPILER SETTINGS 331 | *====================*/ 332 | 333 | /*For big endian systems set to 1*/ 334 | #define LV_BIG_ENDIAN_SYSTEM 0 335 | 336 | /*Define a custom attribute to `lv_tick_inc` function*/ 337 | #define LV_ATTRIBUTE_TICK_INC 338 | 339 | /*Define a custom attribute to `lv_timer_handler` function*/ 340 | #define LV_ATTRIBUTE_TIMER_HANDLER 341 | 342 | /*Define a custom attribute to `lv_display_flush_ready` function*/ 343 | #define LV_ATTRIBUTE_FLUSH_READY 344 | 345 | /*Required alignment size for buffers*/ 346 | #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 347 | 348 | /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). 349 | * E.g. __attribute__((aligned(4)))*/ 350 | #define LV_ATTRIBUTE_MEM_ALIGN 351 | 352 | /*Attribute to mark large constant arrays for example font's bitmaps*/ 353 | #define LV_ATTRIBUTE_LARGE_CONST 354 | 355 | /*Compiler prefix for a big array declaration in RAM*/ 356 | #define LV_ATTRIBUTE_LARGE_RAM_ARRAY 357 | 358 | /*Place performance critical functions into a faster memory (e.g RAM)*/ 359 | #define LV_ATTRIBUTE_FAST_MEM 360 | 361 | /*Export integer constant to binding. This macro is used with constants in the form of LV_ that 362 | *should also appear on LVGL binding API such as Micropython.*/ 363 | #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ 364 | 365 | /*Prefix all global extern data with this*/ 366 | #define LV_ATTRIBUTE_EXTERN_DATA 367 | 368 | /* Use `float` as `lv_value_precise_t` */ 369 | #define LV_USE_FLOAT 0 370 | 371 | /*================== 372 | * FONT USAGE 373 | *===================*/ 374 | 375 | /*Montserrat fonts with ASCII range and some symbols using bpp = 4 376 | *https://fonts.google.com/specimen/Montserrat*/ 377 | #define LV_FONT_MONTSERRAT_8 1 378 | #define LV_FONT_MONTSERRAT_10 1 379 | #define LV_FONT_MONTSERRAT_12 1 380 | #define LV_FONT_MONTSERRAT_14 1 381 | #define LV_FONT_MONTSERRAT_16 1 382 | #define LV_FONT_MONTSERRAT_18 1 383 | #define LV_FONT_MONTSERRAT_20 1 384 | #define LV_FONT_MONTSERRAT_22 1 385 | #define LV_FONT_MONTSERRAT_24 1 386 | #define LV_FONT_MONTSERRAT_26 1 387 | #define LV_FONT_MONTSERRAT_28 1 388 | #define LV_FONT_MONTSERRAT_30 1 389 | #define LV_FONT_MONTSERRAT_32 0 390 | #define LV_FONT_MONTSERRAT_34 0 391 | #define LV_FONT_MONTSERRAT_36 0 392 | #define LV_FONT_MONTSERRAT_38 0 393 | #define LV_FONT_MONTSERRAT_40 0 394 | #define LV_FONT_MONTSERRAT_42 0 395 | #define LV_FONT_MONTSERRAT_44 0 396 | #define LV_FONT_MONTSERRAT_46 0 397 | #define LV_FONT_MONTSERRAT_48 0 398 | 399 | /*Demonstrate special features*/ 400 | #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ 401 | #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ 402 | #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ 403 | 404 | /*Pixel perfect monospace fonts*/ 405 | #define LV_FONT_UNSCII_8 0 406 | #define LV_FONT_UNSCII_16 0 407 | 408 | /*Optionally declare custom fonts here. 409 | *You can use these fonts as default font too and they will be available globally. 410 | *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ 411 | #define LV_FONT_CUSTOM_DECLARE 412 | 413 | /*Always set a default font*/ 414 | #define LV_FONT_DEFAULT &lv_font_montserrat_14 415 | 416 | /*Enable handling large font and/or fonts with a lot of characters. 417 | *The limit depends on the font size, font face and bpp. 418 | *Compiler error will be triggered if a font needs it.*/ 419 | #define LV_FONT_FMT_TXT_LARGE 0 420 | 421 | /*Enables/disables support for compressed fonts.*/ 422 | #define LV_USE_FONT_COMPRESSED 0 423 | 424 | /*Enable drawing placeholders when glyph dsc is not found*/ 425 | #define LV_USE_FONT_PLACEHOLDER 1 426 | 427 | /*================= 428 | * TEXT SETTINGS 429 | *=================*/ 430 | 431 | /** 432 | * Select a character encoding for strings. 433 | * Your IDE or editor should have the same character encoding 434 | * - LV_TXT_ENC_UTF8 435 | * - LV_TXT_ENC_ASCII 436 | */ 437 | #define LV_TXT_ENC LV_TXT_ENC_UTF8 438 | 439 | /*Can break (wrap) texts on these chars*/ 440 | #define LV_TXT_BREAK_CHARS " ,.;:-_)]}" 441 | 442 | /*If a word is at least this long, will break wherever "prettiest" 443 | *To disable, set to a value <= 0*/ 444 | #define LV_TXT_LINE_BREAK_LONG_LEN 0 445 | 446 | /*Minimum number of characters in a long word to put on a line before a break. 447 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 448 | #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 449 | 450 | /*Minimum number of characters in a long word to put on a line after a break. 451 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 452 | #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 453 | 454 | /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. 455 | *The direction will be processed according to the Unicode Bidirectional Algorithm: 456 | *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ 457 | #define LV_USE_BIDI 0 458 | #if LV_USE_BIDI 459 | /*Set the default direction. Supported values: 460 | *`LV_BASE_DIR_LTR` Left-to-Right 461 | *`LV_BASE_DIR_RTL` Right-to-Left 462 | *`LV_BASE_DIR_AUTO` detect texts base direction*/ 463 | #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO 464 | #endif 465 | 466 | /*Enable Arabic/Persian processing 467 | *In these languages characters should be replaced with an other form based on their position in the text*/ 468 | #define LV_USE_ARABIC_PERSIAN_CHARS 0 469 | 470 | /*================== 471 | * WIDGETS 472 | *================*/ 473 | 474 | /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ 475 | 476 | #define LV_WIDGETS_HAS_DEFAULT_VALUE 1 477 | 478 | #define LV_USE_ANIMIMG 1 479 | 480 | #define LV_USE_ARC 1 481 | 482 | #define LV_USE_BAR 1 483 | 484 | #define LV_USE_BUTTON 1 485 | 486 | #define LV_USE_BUTTONMATRIX 1 487 | 488 | #define LV_USE_CALENDAR 1 489 | #if LV_USE_CALENDAR 490 | #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 491 | #if LV_CALENDAR_WEEK_STARTS_MONDAY 492 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} 493 | #else 494 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} 495 | #endif 496 | 497 | #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} 498 | #define LV_USE_CALENDAR_HEADER_ARROW 1 499 | #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 500 | #endif /*LV_USE_CALENDAR*/ 501 | 502 | #define LV_USE_CANVAS 1 503 | 504 | #define LV_USE_CHART 1 505 | 506 | #define LV_USE_CHECKBOX 1 507 | 508 | #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ 509 | 510 | #define LV_USE_IMAGE 1 /*Requires: lv_label*/ 511 | 512 | #define LV_USE_IMAGEBUTTON 1 513 | 514 | #define LV_USE_KEYBOARD 1 515 | 516 | #define LV_USE_LABEL 1 517 | #if LV_USE_LABEL 518 | #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ 519 | #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ 520 | #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ 521 | #endif 522 | 523 | #define LV_USE_LED 1 524 | 525 | #define LV_USE_LINE 1 526 | 527 | #define LV_USE_LIST 1 528 | 529 | #define LV_USE_MENU 1 530 | 531 | #define LV_USE_MSGBOX 1 532 | 533 | #define LV_USE_ROLLER 1 /*Requires: lv_label*/ 534 | 535 | #define LV_USE_SCALE 1 536 | 537 | #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ 538 | 539 | #define LV_USE_SPAN 1 540 | #if LV_USE_SPAN 541 | /*A line text can contain maximum num of span descriptor */ 542 | #define LV_SPAN_SNIPPET_STACK_SIZE 64 543 | #endif 544 | 545 | #define LV_USE_SPINBOX 1 546 | 547 | #define LV_USE_SPINNER 1 548 | 549 | #define LV_USE_SWITCH 1 550 | 551 | #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ 552 | #if LV_USE_TEXTAREA != 0 553 | #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ 554 | #endif 555 | 556 | #define LV_USE_TABLE 1 557 | 558 | #define LV_USE_TABVIEW 1 559 | 560 | #define LV_USE_TILEVIEW 1 561 | 562 | #define LV_USE_WIN 1 563 | 564 | /*================== 565 | * THEMES 566 | *==================*/ 567 | 568 | /*A simple, impressive and very complete theme*/ 569 | #define LV_USE_THEME_DEFAULT 1 570 | #if LV_USE_THEME_DEFAULT 571 | 572 | /*0: Light mode; 1: Dark mode*/ 573 | #define LV_THEME_DEFAULT_DARK 0 574 | 575 | /*1: Enable grow on press*/ 576 | #define LV_THEME_DEFAULT_GROW 1 577 | 578 | /*Default transition time in [ms]*/ 579 | #define LV_THEME_DEFAULT_TRANSITION_TIME 80 580 | #endif /*LV_USE_THEME_DEFAULT*/ 581 | 582 | /*A very simple theme that is a good starting point for a custom theme*/ 583 | #define LV_USE_THEME_SIMPLE 1 584 | 585 | /*A theme designed for monochrome displays*/ 586 | #define LV_USE_THEME_MONO 1 587 | 588 | /*================== 589 | * LAYOUTS 590 | *==================*/ 591 | 592 | /*A layout similar to Flexbox in CSS.*/ 593 | #define LV_USE_FLEX 1 594 | 595 | /*A layout similar to Grid in CSS.*/ 596 | #define LV_USE_GRID 1 597 | 598 | /*==================== 599 | * 3RD PARTS LIBRARIES 600 | *====================*/ 601 | 602 | /*File system interfaces for common APIs */ 603 | 604 | /*API for fopen, fread, etc*/ 605 | #define LV_USE_FS_STDIO 0 606 | #if LV_USE_FS_STDIO 607 | #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 608 | #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 609 | #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 610 | #endif 611 | 612 | /*API for open, read, etc*/ 613 | #define LV_USE_FS_POSIX 0 614 | #if LV_USE_FS_POSIX 615 | #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 616 | #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 617 | #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 618 | #endif 619 | 620 | /*API for CreateFile, ReadFile, etc*/ 621 | #define LV_USE_FS_WIN32 0 622 | #if LV_USE_FS_WIN32 623 | #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 624 | #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 625 | #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 626 | #endif 627 | 628 | /*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ 629 | #define LV_USE_FS_FATFS 0 630 | #if LV_USE_FS_FATFS 631 | #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 632 | #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 633 | #endif 634 | 635 | /*API for memory-mapped file access. */ 636 | #define LV_USE_FS_MEMFS 0 637 | #if LV_USE_FS_MEMFS 638 | #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 639 | #endif 640 | 641 | /*LODEPNG decoder library*/ 642 | #define LV_USE_LODEPNG 0 643 | 644 | /*PNG decoder(libpng) library*/ 645 | #define LV_USE_LIBPNG 0 646 | 647 | /*BMP decoder library*/ 648 | #define LV_USE_BMP 0 649 | 650 | /* JPG + split JPG decoder library. 651 | * Split JPG is a custom format optimized for embedded systems. */ 652 | #define LV_USE_TJPGD 0 653 | 654 | /* libjpeg-turbo decoder library. 655 | * Supports complete JPEG specifications and high-performance JPEG decoding. */ 656 | #define LV_USE_LIBJPEG_TURBO 0 657 | 658 | /*GIF decoder library*/ 659 | #define LV_USE_GIF 0 660 | #if LV_USE_GIF 661 | /*GIF decoder accelerate*/ 662 | #define LV_GIF_CACHE_DECODE_DATA 0 663 | #endif 664 | 665 | 666 | /*Decode bin images to RAM*/ 667 | #define LV_BIN_DECODER_RAM_LOAD 0 668 | 669 | /*RLE decompress library*/ 670 | #define LV_USE_RLE 0 671 | 672 | /*QR code library*/ 673 | #define LV_USE_QRCODE 0 674 | 675 | /*Barcode code library*/ 676 | #define LV_USE_BARCODE 0 677 | 678 | /*FreeType library*/ 679 | #define LV_USE_FREETYPE 0 680 | #if LV_USE_FREETYPE 681 | /*Memory used by FreeType to cache characters in kilobytes*/ 682 | #define LV_FREETYPE_CACHE_SIZE 768 683 | 684 | /*Let FreeType to use LVGL memory and file porting*/ 685 | #define LV_FREETYPE_USE_LVGL_PORT 0 686 | 687 | /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ 688 | /* (0:use system defaults) */ 689 | #define LV_FREETYPE_CACHE_FT_FACES 8 690 | #define LV_FREETYPE_CACHE_FT_SIZES 8 691 | #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 692 | #endif 693 | 694 | /* Built-in TTF decoder */ 695 | #define LV_USE_TINY_TTF 0 696 | #if LV_USE_TINY_TTF 697 | /* Enable loading TTF data from files */ 698 | #define LV_TINY_TTF_FILE_SUPPORT 0 699 | #endif 700 | 701 | /*Rlottie library*/ 702 | #define LV_USE_RLOTTIE 0 703 | 704 | /*Enable Vector Graphic APIs*/ 705 | #define LV_USE_VECTOR_GRAPHIC 0 706 | 707 | /* Enable ThorVG (vector graphics library) from the src/libs folder */ 708 | #define LV_USE_THORVG_INTERNAL 0 709 | 710 | /* Enable ThorVG by assuming that its installed and linked to the project */ 711 | #define LV_USE_THORVG_EXTERNAL 0 712 | 713 | /*Use lvgl built-in LZ4 lib*/ 714 | #define LV_USE_LZ4_INTERNAL 0 715 | 716 | /*Use external LZ4 library*/ 717 | #define LV_USE_LZ4_EXTERNAL 0 718 | 719 | /*FFmpeg library for image decoding and playing videos 720 | *Supports all major image formats so do not enable other image decoder with it*/ 721 | #define LV_USE_FFMPEG 0 722 | #if LV_USE_FFMPEG 723 | /*Dump input information to stderr*/ 724 | #define LV_FFMPEG_DUMP_FORMAT 0 725 | #endif 726 | 727 | /*================== 728 | * OTHERS 729 | *==================*/ 730 | 731 | /*1: Enable API to take snapshot for object*/ 732 | #define LV_USE_SNAPSHOT 0 733 | 734 | /*1: Enable system monitor component*/ 735 | #define LV_USE_SYSMON 0 736 | #if LV_USE_SYSMON 737 | /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ 738 | #define LV_SYSMON_GET_IDLE lv_timer_get_idle 739 | 740 | /*1: Show CPU usage and FPS count 741 | * Requires `LV_USE_SYSMON = 1`*/ 742 | #define LV_USE_PERF_MONITOR 0 743 | #if LV_USE_PERF_MONITOR 744 | #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT 745 | 746 | /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ 747 | #define LV_USE_PERF_MONITOR_LOG_MODE 0 748 | #endif 749 | 750 | /*1: Show the used memory and the memory fragmentation 751 | * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` 752 | * Requires `LV_USE_SYSMON = 1`*/ 753 | #define LV_USE_MEM_MONITOR 0 754 | #if LV_USE_MEM_MONITOR 755 | #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT 756 | #endif 757 | 758 | #endif /*LV_USE_SYSMON*/ 759 | 760 | /*1: Enable the runtime performance profiler*/ 761 | #define LV_USE_PROFILER 0 762 | #if LV_USE_PROFILER 763 | /*1: Enable the built-in profiler*/ 764 | #define LV_USE_PROFILER_BUILTIN 1 765 | #if LV_USE_PROFILER_BUILTIN 766 | /*Default profiler trace buffer size*/ 767 | #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ 768 | #endif 769 | 770 | /*Header to include for the profiler*/ 771 | #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" 772 | 773 | /*Profiler start point function*/ 774 | #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN 775 | 776 | /*Profiler end point function*/ 777 | #define LV_PROFILER_END LV_PROFILER_BUILTIN_END 778 | 779 | /*Profiler start point function with custom tag*/ 780 | #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG 781 | 782 | /*Profiler end point function with custom tag*/ 783 | #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG 784 | #endif 785 | 786 | /*1: Enable Monkey test*/ 787 | #define LV_USE_MONKEY 0 788 | 789 | /*1: Enable grid navigation*/ 790 | #define LV_USE_GRIDNAV 0 791 | 792 | /*1: Enable lv_obj fragment*/ 793 | #define LV_USE_FRAGMENT 0 794 | 795 | /*1: Support using images as font in label or span widgets */ 796 | #define LV_USE_IMGFONT 0 797 | 798 | /*1: Enable an observer pattern implementation*/ 799 | #define LV_USE_OBSERVER 1 800 | 801 | /*1: Enable Pinyin input method*/ 802 | /*Requires: lv_keyboard*/ 803 | #define LV_USE_IME_PINYIN 0 804 | #if LV_USE_IME_PINYIN 805 | /*1: Use default thesaurus*/ 806 | /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ 807 | #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 808 | /*Set the maximum number of candidate panels that can be displayed*/ 809 | /*This needs to be adjusted according to the size of the screen*/ 810 | #define LV_IME_PINYIN_CAND_TEXT_NUM 6 811 | 812 | /*Use 9 key input(k9)*/ 813 | #define LV_IME_PINYIN_USE_K9_MODE 1 814 | #if LV_IME_PINYIN_USE_K9_MODE == 1 815 | #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 816 | #endif /*LV_IME_PINYIN_USE_K9_MODE*/ 817 | #endif 818 | 819 | /*1: Enable file explorer*/ 820 | /*Requires: lv_table*/ 821 | #define LV_USE_FILE_EXPLORER 0 822 | #if LV_USE_FILE_EXPLORER 823 | /*Maximum length of path*/ 824 | #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) 825 | /*Quick access bar, 1:use, 0:not use*/ 826 | /*Requires: lv_list*/ 827 | #define LV_FILE_EXPLORER_QUICK_ACCESS 1 828 | #endif 829 | 830 | /*================== 831 | * DEVICES 832 | *==================*/ 833 | 834 | /*Use SDL to open window on PC and handle mouse and keyboard*/ 835 | #define LV_USE_SDL 0 836 | #if LV_USE_SDL 837 | #define LV_SDL_INCLUDE_PATH 838 | #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ 839 | #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ 840 | #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ 841 | #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ 842 | #endif 843 | 844 | /*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ 845 | #define LV_USE_X11 0 846 | #if LV_USE_X11 847 | #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ 848 | #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/ 849 | /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ 850 | #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ 851 | #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ 852 | #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ 853 | #endif 854 | 855 | /*Driver for /dev/fb*/ 856 | #define LV_USE_LINUX_FBDEV 0 857 | #if LV_USE_LINUX_FBDEV 858 | #define LV_LINUX_FBDEV_BSD 0 859 | #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL 860 | #define LV_LINUX_FBDEV_BUFFER_COUNT 0 861 | #define LV_LINUX_FBDEV_BUFFER_SIZE 60 862 | #endif 863 | 864 | /*Use Nuttx to open window and handle touchscreen*/ 865 | #define LV_USE_NUTTX 0 866 | 867 | #if LV_USE_NUTTX 868 | #define LV_USE_NUTTX_LIBUV 0 869 | 870 | /*Use Nuttx custom init API to open window and handle touchscreen*/ 871 | #define LV_USE_NUTTX_CUSTOM_INIT 0 872 | 873 | /*Driver for /dev/lcd*/ 874 | #define LV_USE_NUTTX_LCD 0 875 | #if LV_USE_NUTTX_LCD 876 | #define LV_NUTTX_LCD_BUFFER_COUNT 0 877 | #define LV_NUTTX_LCD_BUFFER_SIZE 60 878 | #endif 879 | 880 | /*Driver for /dev/input*/ 881 | #define LV_USE_NUTTX_TOUCHSCREEN 0 882 | 883 | #endif 884 | 885 | /*Driver for /dev/dri/card*/ 886 | #define LV_USE_LINUX_DRM 0 887 | 888 | /*Interface for TFT_eSPI*/ 889 | #define LV_USE_TFT_ESPI 0 890 | 891 | /*Driver for evdev input devices*/ 892 | #define LV_USE_EVDEV 0 893 | 894 | /*Driver for libinput input devices*/ 895 | #define LV_USE_LIBINPUT 0 896 | 897 | #if LV_USE_LIBINPUT 898 | #define LV_LIBINPUT_BSD 0 899 | 900 | /*Full keyboard support*/ 901 | #define LV_LIBINPUT_XKB 0 902 | #if LV_LIBINPUT_XKB 903 | /*"setxkbmap -query" can help find the right values for your keyboard*/ 904 | #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } 905 | #endif 906 | #endif 907 | 908 | /*Drivers for LCD devices connected via SPI/parallel port*/ 909 | #define LV_USE_ST7735 0 910 | #define LV_USE_ST7789 0 911 | #define LV_USE_ST7796 0 912 | #define LV_USE_ILI9341 0 913 | 914 | #define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) 915 | 916 | /* LVGL Windows backend */ 917 | #define LV_USE_WINDOWS 0 918 | 919 | /*================== 920 | * EXAMPLES 921 | *==================*/ 922 | 923 | /*Enable the examples to be built with the library*/ 924 | #define LV_BUILD_EXAMPLES 1 925 | 926 | /*=================== 927 | * DEMO USAGE 928 | ====================*/ 929 | 930 | /*Show some widget. It might be required to increase `LV_MEM_SIZE` */ 931 | #define LV_USE_DEMO_WIDGETS 0 932 | 933 | /*Demonstrate the usage of encoder and keyboard*/ 934 | #define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 935 | 936 | /*Benchmark your system*/ 937 | #define LV_USE_DEMO_BENCHMARK 0 938 | 939 | /*Render test for each primitives. Requires at least 480x272 display*/ 940 | #define LV_USE_DEMO_RENDER 0 941 | 942 | /*Stress test for LVGL*/ 943 | #define LV_USE_DEMO_STRESS 0 944 | 945 | /*Music player demo*/ 946 | #define LV_USE_DEMO_MUSIC 0 947 | #if LV_USE_DEMO_MUSIC 948 | #define LV_DEMO_MUSIC_SQUARE 0 949 | #define LV_DEMO_MUSIC_LANDSCAPE 0 950 | #define LV_DEMO_MUSIC_ROUND 0 951 | #define LV_DEMO_MUSIC_LARGE 0 952 | #define LV_DEMO_MUSIC_AUTO_PLAY 0 953 | #endif 954 | 955 | /*Flex layout demo*/ 956 | #define LV_USE_DEMO_FLEX_LAYOUT 0 957 | 958 | /*Smart-phone like multi-language demo*/ 959 | #define LV_USE_DEMO_MULTILANG 0 960 | 961 | /*Widget transformation demo*/ 962 | #define LV_USE_DEMO_TRANSFORM 0 963 | 964 | /*Demonstrate scroll settings*/ 965 | #define LV_USE_DEMO_SCROLL 0 966 | 967 | /*Vector graphic demo*/ 968 | #define LV_USE_DEMO_VECTOR_GRAPHIC 0 969 | /*--END OF LV_CONF_H--*/ 970 | 971 | #endif /*LV_CONF_H*/ 972 | 973 | #endif /*End of "Content enable"*/ -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #pragma GCC optimize ("Ofast") 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "OneButton.h" //For Button Debounce and Longpress 8 | #include "config.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "ui/ui.h" 14 | #include 15 | #include "main.h" 16 | 17 | #define LV_CONF_INCLUDE_SIMPLE 18 | #include 19 | #include 20 | 21 | constexpr int32_t HOR_RES=320; 22 | constexpr int32_t VER_RES=240; 23 | 24 | /////////////////////////////////////////// 25 | //// 26 | //// To Debug or not to Debug 27 | //// 28 | /////////////////////////////////////////// 29 | 30 | // Uncomment the following line if you wish to print DEBUG info 31 | #define DEBUG 32 | 33 | #ifdef DEBUG 34 | #define LogDebug(...) Serial.println(__VA_ARGS__) 35 | #define LogDebugFormatted(...) Serial.printf(__VA_ARGS__) 36 | #else 37 | #define LogDebug(...) ((void)0) 38 | #define LogDebugFormatted(...) ((void)0) 39 | #endif 40 | 41 | #define OFF 0.0 42 | #define ON 1.0 43 | 44 | // Screens 45 | 46 | #define ST_UI_START 0 47 | #define ST_UI_HOME 1 48 | 49 | #define ST_UI_MENUE 10 50 | #define ST_UI_PATTERN 11 51 | #define ST_UI_Torqe 12 52 | #define ST_UI_EJECTSETTINGS 13 53 | 54 | #define ST_UI_SETTINGS 20 55 | 56 | int st_screens = ST_UI_START; 57 | 58 | 59 | 60 | // Menü States 61 | 62 | #define CONNECT 0 63 | #define HOME 1 64 | #define MENUE 2 65 | #define MENUE2 3 66 | #define TORQE 4 67 | #define PATTERN_MENUE 5 68 | #define PATTERN_MENUE2 6 69 | #define PATTERN_MENUE3 7 70 | #define CUM_MENUE 20 71 | 72 | int menuestatus = CONNECT; 73 | 74 | // EEPROM Area: 75 | 76 | #define EJECT 0 77 | #define DARKMODE 1 78 | #define VIBRATE 2 79 | #define LEFTY 6 80 | 81 | bool eject_status = false; 82 | bool dark_mode = false; 83 | bool vibrate_mode = true; 84 | bool touch_home = false; 85 | bool touch_disabled = false; 86 | 87 | // Command States 88 | #define CONN 0 89 | #define SPEED 1 90 | #define DEPTH 2 91 | #define STROKE 3 92 | #define SENSATION 4 93 | #define PATTERN 5 94 | #define TORQE_F 6 95 | #define TORQE_R 7 96 | #define OFF 10 97 | #define ON 11 98 | #define SETUP_D_I 12 99 | #define SETUP_D_I_F 13 100 | #define REBOOT 14 101 | 102 | #define CUMSPEED 20 103 | #define CUMTIME 21 104 | #define CUMSIZE 22 105 | #define CUMACCEL 23 106 | 107 | #define CONNECT 88 108 | #define HEARTBEAT 99 109 | 110 | int displaywidth; 111 | int displayheight; 112 | int progheight = 30; 113 | int distheight = 10; 114 | int S1Pos; 115 | int S2Pos; 116 | int S3Pos; 117 | int S4Pos; 118 | bool rstate = false; 119 | int pattern = 2; 120 | char patternstr[20]; 121 | bool onoff = false; 122 | 123 | 124 | long speedenc = 0; 125 | long depthenc = 0; 126 | long strokeenc = 0; 127 | long sensationenc = 0; 128 | long torqe_f_enc = 0; 129 | long torqe_r_enc = 0; 130 | long cum_t_enc = 0; 131 | long cum_si_enc =0; 132 | long cum_s_enc = 0; 133 | long cum_a_enc = 0; 134 | long encoder4_enc = 0; 135 | 136 | extern float maxdepthinmm = 400.0; 137 | extern float speedlimit = 600; 138 | int speedscale = -5; 139 | 140 | float speed = 0.0; 141 | float depth = 0.0; 142 | float stroke = 0.0; 143 | float sensation = 0.0; 144 | float torqe_f = 100.0; 145 | float torqe_r = -180.0; 146 | float cum_time = 0.0; 147 | float cum_speed = 0.0; 148 | float cum_size = 0.0; 149 | float cum_accel = 0.0; 150 | 151 | ESP32Encoder encoder1; 152 | ESP32Encoder encoder2; 153 | ESP32Encoder encoder3; 154 | ESP32Encoder encoder4; 155 | 156 | // Variable to store if sending data was successful 157 | String success; 158 | 159 | float out_esp_speed; 160 | float out_esp_depth; 161 | float out_esp_stroke; 162 | float out_esp_sensation; 163 | float out_esp_pattern; 164 | bool out_esp_rstate; 165 | bool out_esp_connected; 166 | int out_esp_command; 167 | float out_esp_value; 168 | int out_esp_target; 169 | 170 | float incoming_esp_speed; 171 | float incoming_esp_depth; 172 | float incoming_esp_stroke; 173 | float incoming_esp_sensation; 174 | float incoming_esp_pattern; 175 | bool incoming_esp_rstate; 176 | bool incoming_esp_connected; 177 | bool incoming_esp_heartbeat; 178 | int incoming_esp_target; 179 | 180 | typedef struct struct_message { 181 | float esp_speed; 182 | float esp_depth; 183 | float esp_stroke; 184 | float esp_sensation; 185 | float esp_pattern; 186 | bool esp_rstate; 187 | bool esp_connected; 188 | bool esp_heartbeat; 189 | int esp_command; 190 | float esp_value; 191 | int esp_target; 192 | } struct_message; 193 | 194 | bool Ossm_paired = false; 195 | 196 | struct_message outgoingcontrol; 197 | struct_message incomingcontrol; 198 | 199 | esp_now_peer_info_t peerInfo; 200 | uint8_t OSSM_Address[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; // Broadcast to all ESP32s, upon connection gets updated to the actual address 201 | 202 | #define HEARTBEAT_INTERVAL 5000/portTICK_PERIOD_MS // 5 seconds 203 | 204 | // Bool 205 | 206 | bool EJECT_On = false; 207 | bool OSSM_On = false; 208 | 209 | #define EEPROM_SIZE 200 210 | 211 | // Tasks: 212 | 213 | TaskHandle_t eRemote_t = nullptr; // Esp Now Remote Task 214 | 215 | void espNowRemoteTask(void *pvParameters); // Handels the EspNow Remote 216 | bool connectbtn(); //Handels Connectbtn 217 | int64_t touchmenue(); 218 | void vibrate(); 219 | void mxclick(); 220 | bool mxclick_short_waspressed = false; 221 | void mxlong(); 222 | bool mxclick_long_waspressed = false; 223 | void click2(); 224 | bool click2_short_waspressed = false; 225 | void click3(); 226 | bool click3_short_waspressed = false; 227 | 228 | lv_display_t *display; 229 | lv_indev_t *indev; 230 | 231 | static lv_draw_buf_t *draw_buf1; 232 | static lv_draw_buf_t *draw_buf2; 233 | 234 | // Display flushing 235 | void my_display_flush(lv_display_t *disp, const lv_area_t *area, uint8_t *px_map) { 236 | uint32_t w = (area->x2 - area->x1 + 1); 237 | uint32_t h = (area->y2 - area->y1 + 1); 238 | 239 | lv_draw_sw_rgb565_swap(px_map, w*h); 240 | M5.Display.pushImageDMA(area->x1, area->y1, w, h, (uint16_t *)px_map); 241 | lv_disp_flush_ready(disp); 242 | } 243 | 244 | uint32_t my_tick_function() { 245 | return (esp_timer_get_time() / 1000LL); 246 | } 247 | 248 | void my_touchpad_read(lv_indev_t * drv, lv_indev_data_t * data) { 249 | M5.update(); 250 | auto count = M5.Touch.getCount(); 251 | 252 | if ( count == 0 ) { 253 | data->state = LV_INDEV_STATE_RELEASED; 254 | } else { 255 | auto touch = M5.Touch.getDetail(0); 256 | data->state = LV_INDEV_STATE_PRESSED; 257 | data->point.x = touch.x; 258 | data->point.y = touch.y; 259 | } 260 | } 261 | 262 | static void event_cb(lv_event_t *e) 263 | { 264 | lv_event_code_t code = lv_event_get_code(e); 265 | lv_obj_t *label = reinterpret_cast(lv_event_get_user_data(e)); 266 | 267 | switch (code) 268 | { 269 | case LV_EVENT_PRESSED: 270 | lv_label_set_text(label, "The last button event:\nLV_EVENT_PRESSED"); 271 | break; 272 | case LV_EVENT_CLICKED: 273 | lv_label_set_text(label, "The last button event:\nLV_EVENT_CLICKED"); 274 | break; 275 | case LV_EVENT_LONG_PRESSED: 276 | lv_label_set_text(label, "The last button event:\nLV_EVENT_LONG_PRESSED"); 277 | break; 278 | case LV_EVENT_LONG_PRESSED_REPEAT: 279 | lv_label_set_text(label, "The last button event:\nLV_EVENT_LONG_PRESSED_REPEAT"); 280 | break; 281 | default: 282 | break; 283 | } 284 | } 285 | 286 | 287 | 288 | void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) { 289 | } 290 | 291 | void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) { 292 | memcpy(&incomingcontrol, incomingData, sizeof(incomingcontrol)); 293 | 294 | if(incomingcontrol.esp_target == M5_ID && Ossm_paired == false){ 295 | 296 | // Remove the existing peer (0xFF:0xFF:0xFF:0xFF:0xFF:0xFF) 297 | esp_err_t result = esp_now_del_peer(peerInfo.peer_addr); 298 | 299 | if (result == ESP_OK) { 300 | 301 | memcpy(OSSM_Address, mac, 6); //get the mac address of the sender 302 | 303 | // Add the new peer 304 | memcpy(peerInfo.peer_addr, OSSM_Address, 6); 305 | if (esp_now_add_peer(&peerInfo) == ESP_OK) { 306 | LogDebugFormatted("New peer added successfully, OSSM addresss : %02X:%02X:%02X:%02X:%02X:%02X\n", OSSM_Address[0], OSSM_Address[1], OSSM_Address[2], OSSM_Address[3], OSSM_Address[4], OSSM_Address[5]); 307 | Ossm_paired = true; 308 | } 309 | else { 310 | LogDebug("Failed to add new peer"); 311 | } 312 | } 313 | else { 314 | LogDebug("Failed to remove peer"); 315 | } 316 | 317 | 318 | if(incomingcontrol.esp_speed > speedlimit){ 319 | speedlimit = 600; 320 | } else ( 321 | speedlimit = incomingcontrol.esp_speed); 322 | LogDebug(speedlimit); 323 | maxdepthinmm = incomingcontrol.esp_depth; 324 | LogDebug(maxdepthinmm); 325 | pattern = incomingcontrol.esp_pattern; 326 | LogDebug(pattern); 327 | outgoingcontrol.esp_target = OSSM_ID; 328 | 329 | result = esp_now_send(OSSM_Address, (uint8_t *) &outgoingcontrol, sizeof(outgoingcontrol)); 330 | LogDebug(result); 331 | 332 | if (result == ESP_OK) { 333 | Ossm_paired = true; 334 | lv_label_set_text(ui_connect, "Connected"); 335 | lv_scr_load_anim(ui_Home, LV_SCR_LOAD_ANIM_FADE_ON,20,0,false); 336 | } 337 | } 338 | switch(incomingcontrol.esp_command) 339 | { 340 | case OFF: 341 | { 342 | OSSM_On = false; 343 | } 344 | break; 345 | case ON: 346 | { 347 | OSSM_On = true; 348 | } 349 | break; 350 | } 351 | } 352 | 353 | //Sends Commands and Value to Remote device returns ture or false if sended 354 | bool SendCommand(int Command, float Value, int Target){ 355 | 356 | if(Ossm_paired == true){ 357 | 358 | outgoingcontrol.esp_connected = true; 359 | outgoingcontrol.esp_command = Command; 360 | outgoingcontrol.esp_value = Value; 361 | outgoingcontrol.esp_target = Target; 362 | esp_err_t result = esp_now_send(OSSM_Address, (uint8_t *) &outgoingcontrol, sizeof(outgoingcontrol)); 363 | 364 | if (result == ESP_OK) { 365 | return true; 366 | } 367 | else { 368 | delay(20); 369 | esp_err_t result = esp_now_send(OSSM_Address, (uint8_t *) &outgoingcontrol, sizeof(outgoingcontrol)); 370 | return false; 371 | } 372 | } 373 | } 374 | 375 | void connectbutton(lv_event_t * e) 376 | { 377 | if(!Ossm_paired){ 378 | outgoingcontrol.esp_command = HEARTBEAT; 379 | outgoingcontrol.esp_heartbeat = true; 380 | outgoingcontrol.esp_target = OSSM_ID; 381 | esp_err_t result = esp_now_send(OSSM_Address, (uint8_t *) &outgoingcontrol, sizeof(outgoingcontrol)); 382 | } 383 | } 384 | 385 | void savesettings(lv_event_t * e) 386 | { 387 | if(lv_obj_get_state(ui_ejectaddon) == 1){ 388 | EEPROM.writeBool(EJECT,true); 389 | } else if(lv_obj_get_state(ui_ejectaddon) == 0){ 390 | EEPROM.writeBool(EJECT,false); 391 | } 392 | if(lv_obj_get_state(ui_darkmode) == 1){ 393 | EEPROM.writeBool(DARKMODE,true); 394 | } else if(lv_obj_get_state(ui_darkmode) == 0){ 395 | EEPROM.writeBool(DARKMODE,false); 396 | } 397 | if(lv_obj_get_state(ui_vibrate) == 1){ 398 | EEPROM.writeBool(VIBRATE,true); 399 | } else if(lv_obj_get_state(ui_vibrate) == 0){ 400 | EEPROM.writeBool(VIBRATE,false); 401 | } 402 | if(lv_obj_get_state(ui_lefty) == 1){ 403 | EEPROM.writeBool(LEFTY,true); 404 | } else if(lv_obj_get_state(ui_lefty) == 0){ 405 | EEPROM.writeBool(LEFTY,false); 406 | } 407 | EEPROM.commit(); 408 | delay(100); 409 | ESP.restart(); 410 | } 411 | 412 | void screenmachine(lv_event_t * e) 413 | { 414 | if (lv_scr_act() == ui_Start){ 415 | st_screens = ST_UI_START; 416 | } else if (lv_scr_act() == ui_Home){ 417 | st_screens = ST_UI_HOME; 418 | speed = lv_slider_get_value(ui_homespeedslider); 419 | LogDebug(speedenc); 420 | LogDebug(speed); 421 | speedenc = fscale(0.5, speedlimit, 0, Encoder_MAP, speed, 0); 422 | encoder1.setCount(speedenc); 423 | LogDebug(speedenc); 424 | 425 | lv_slider_set_range(ui_homedepthslider, 0, maxdepthinmm); 426 | depth = lv_slider_get_value(ui_homedepthslider); 427 | depthenc = fscale(0, maxdepthinmm, 0, Encoder_MAP, depth, 0); 428 | encoder2.setCount(depthenc); 429 | 430 | lv_slider_set_range(ui_homestrokeslider, 0, maxdepthinmm); 431 | stroke = lv_slider_get_value(ui_homestrokeslider); 432 | strokeenc = fscale(0, maxdepthinmm, 0, Encoder_MAP, stroke, 0); 433 | encoder3.setCount(strokeenc); 434 | 435 | sensation = lv_slider_get_value(ui_homesensationslider); 436 | sensationenc = fscale(-100, 100, (Encoder_MAP/2*-1), (Encoder_MAP/2), sensation, 0); 437 | encoder4.setCount(sensationenc); 438 | 439 | } else if (lv_scr_act() == ui_Menue){ 440 | st_screens = ST_UI_MENUE; 441 | } else if (lv_scr_act() == ui_Pattern){ 442 | st_screens = ST_UI_PATTERN; 443 | } else if (lv_scr_act() == ui_Torqe){ 444 | st_screens = ST_UI_Torqe; 445 | torqe_f = lv_slider_get_value(ui_outtroqeslider); 446 | torqe_f_enc = fscale(50, 200, 0, Encoder_MAP, torqe_f, 0); 447 | encoder1.setCount(torqe_f_enc); 448 | 449 | torqe_r = lv_slider_get_value(ui_introqeslider); 450 | torqe_r_enc = fscale(20, 200, 0, Encoder_MAP, torqe_r, 0); 451 | encoder4.setCount(torqe_r_enc); 452 | 453 | } else if (lv_scr_act() == ui_EJECTSettings){ 454 | st_screens = ST_UI_EJECTSETTINGS; 455 | } else if (lv_scr_act() == ui_Settings){ 456 | st_screens = ST_UI_SETTINGS; 457 | } 458 | } 459 | 460 | void ejectcreampie(lv_event_t * e){ 461 | if(EJECT_On == true){ 462 | lv_obj_clear_state(ui_HomeButtonL, LV_STATE_CHECKED); 463 | EJECT_On = false; 464 | } else if(EJECT_On == false){ 465 | lv_obj_add_state(ui_HomeButtonL, LV_STATE_CHECKED); 466 | EJECT_On = true; 467 | } 468 | } 469 | 470 | void savepattern(lv_event_t * e){ 471 | pattern = lv_roller_get_selected(ui_PatternS); 472 | lv_roller_get_selected_str(ui_PatternS,patternstr,0); 473 | lv_label_set_text(ui_HomePatternLabel,patternstr); 474 | LogDebug(pattern); 475 | float patterns = pattern; 476 | SendCommand(PATTERN, patterns, OSSM_ID); 477 | } 478 | 479 | void homebuttonmevent(lv_event_t * e){ 480 | LogDebug("HomeButton"); 481 | if(OSSM_On == false){ 482 | SendCommand(ON, 0.0, OSSM_ID); 483 | } else if(OSSM_On == true){ 484 | SendCommand(OFF, 0.0, OSSM_ID); 485 | } 486 | } 487 | 488 | void setupDepthInter(lv_event_t * e){ 489 | SendCommand(SETUP_D_I, 0.0, OSSM_ID); 490 | } 491 | 492 | void setupdepthF(lv_event_t * e){ 493 | SendCommand(SETUP_D_I_F, 0.0, OSSM_ID); 494 | } 495 | 496 | void setup(){ 497 | auto cfg = M5.config(); 498 | M5.begin(cfg); 499 | EEPROM.begin(EEPROM_SIZE); 500 | 501 | M5.Power.setChargeCurrent(BATTERY_CHARGE_CURRENT); 502 | LogDebug("\n Starting"); // Start LogDebug 503 | 504 | WiFi.mode(WIFI_STA); 505 | LogDebug(WiFi.macAddress()); 506 | 507 | // Init ESP-NOW 508 | if (esp_now_init() != ESP_OK) { 509 | Serial.println("Error initializing ESP-NOW"); 510 | } 511 | // Once ESPNow is successfully Init, we will register for Send CB to 512 | // get the status of Trasnmitted packet 513 | esp_now_register_send_cb(OnDataSent); 514 | 515 | // register peer 516 | peerInfo.channel = 0; 517 | peerInfo.encrypt = false; 518 | // register first peer 519 | memcpy(peerInfo.peer_addr, OSSM_Address, 6); 520 | if (esp_now_add_peer(&peerInfo) != ESP_OK){ 521 | Serial.println("Failed to add peer"); 522 | } 523 | // Register for a callback function that will be called when data is received 524 | esp_now_register_recv_cb(OnDataRecv); 525 | 526 | xTaskCreatePinnedToCore(espNowRemoteTask, /* Task function. */ 527 | "espNowRemoteTask", /* name of task. */ 528 | 3096, /* Stack size of task */ 529 | NULL, /* parameter of the task */ 530 | 5, /* priority of the task */ 531 | &eRemote_t, /* Task handle to keep track of created task */ 532 | 0); /* pin task to core 0 */ 533 | delay(200); 534 | 535 | encoder1.attachHalfQuad(ENC_1_CLK, ENC_1_DT); 536 | encoder2.attachHalfQuad(ENC_2_CLK, ENC_2_DT); 537 | encoder3.attachHalfQuad(ENC_3_CLK, ENC_3_DT); 538 | encoder4.attachHalfQuad(ENC_4_CLK, ENC_4_DT); 539 | Button1.attachClick(mxclick); 540 | Button1.attachLongPressStop(mxlong); 541 | Button2.attachClick(click2); 542 | Button3.attachClick(click3); 543 | 544 | //****Load EEPROOM: 545 | eject_status = EEPROM.readBool(EJECT); 546 | dark_mode = EEPROM.readBool(DARKMODE); 547 | vibrate_mode = EEPROM.readBool(VIBRATE); 548 | touch_home = EEPROM.readBool(LEFTY); 549 | 550 | // Initialize `disp_buf` display buffer with the buffer(s). 551 | // lv_draw_buf_init(&draw_buf, LV_HOR_RES_MAX, LV_VER_RES_MAX); 552 | M5.Display.setEpdMode(epd_mode_t::epd_fastest); // fastest but very-low quality. 553 | if (M5.Display.width() < M5.Display.height()) 554 | { /// Landscape mode. 555 | M5.Display.setRotation(M5.Display.getRotation() ^ 1); 556 | } 557 | 558 | lv_init(); 559 | lv_tick_set_cb(my_tick_function); 560 | 561 | display = lv_display_create(HOR_RES, VER_RES); 562 | lv_display_set_flush_cb(display, my_display_flush); 563 | 564 | static lv_color_t buf1[HOR_RES * 15]; 565 | lv_display_set_buffers(display, buf1, nullptr, sizeof(buf1), LV_DISPLAY_RENDER_MODE_PARTIAL); 566 | 567 | indev = lv_indev_create(); 568 | lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); 569 | lv_indev_set_read_cb(indev, my_touchpad_read); 570 | ui_init(); 571 | 572 | if(eject_status == true){ 573 | lv_obj_add_state(ui_ejectaddon, LV_STATE_CHECKED); 574 | lv_obj_clear_state(ui_EJECTSettingButton, LV_STATE_DISABLED); 575 | lv_obj_clear_state(ui_HomeButtonL, LV_STATE_DISABLED); 576 | } 577 | if(dark_mode == true){ 578 | lv_obj_add_state(ui_darkmode, LV_STATE_CHECKED); 579 | } 580 | if(vibrate_mode == true){ 581 | lv_obj_add_state(ui_vibrate, LV_STATE_CHECKED); 582 | } 583 | if(touch_home == true){ 584 | lv_obj_add_state(ui_lefty, LV_STATE_CHECKED); 585 | } 586 | lv_roller_set_selected(ui_PatternS,2,LV_ANIM_OFF); 587 | lv_roller_get_selected_str(ui_PatternS,patternstr,0); 588 | lv_label_set_text(ui_HomePatternLabel,patternstr); 589 | 590 | 591 | } 592 | 593 | void loop() 594 | { 595 | const int BatteryLevel = M5.Power.getBatteryLevel(); 596 | String BatteryValue = (String(BatteryLevel, DEC) + "%"); 597 | const char *battVal = BatteryValue.c_str(); 598 | lv_bar_set_value(ui_Battery, BatteryLevel, LV_ANIM_OFF); 599 | lv_label_set_text(ui_BattValue, battVal); 600 | lv_bar_set_value(ui_Battery1, BatteryLevel, LV_ANIM_OFF); 601 | lv_label_set_text(ui_BattValue1, battVal); 602 | lv_bar_set_value(ui_Battery2, BatteryLevel, LV_ANIM_OFF); 603 | lv_label_set_text(ui_BattValue2, battVal); 604 | lv_bar_set_value(ui_Battery3, BatteryLevel, LV_ANIM_OFF); 605 | lv_label_set_text(ui_BattValue3, battVal); 606 | lv_bar_set_value(ui_Battery4, BatteryLevel, LV_ANIM_OFF); 607 | lv_label_set_text(ui_BattValue4, battVal); 608 | lv_bar_set_value(ui_Battery5, BatteryLevel, LV_ANIM_OFF); 609 | lv_label_set_text(ui_BattValue5, battVal); 610 | 611 | M5.update(); 612 | lv_task_handler(); 613 | Button1.tick(); 614 | Button2.tick(); 615 | Button3.tick(); 616 | 617 | switch(st_screens){ 618 | 619 | case ST_UI_START: 620 | { 621 | if(click2_short_waspressed == true){ 622 | lv_obj_send_event(ui_StartButtonL, LV_EVENT_CLICKED, NULL); 623 | } else if(mxclick_short_waspressed == true){ 624 | lv_obj_send_event(ui_StartButtonM, LV_EVENT_CLICKED, NULL); 625 | } else if(click3_short_waspressed == true){ 626 | lv_obj_send_event(ui_StartButtonR, LV_EVENT_CLICKED, NULL); 627 | } 628 | } 629 | break; 630 | 631 | case ST_UI_HOME: 632 | { 633 | if(touch_home == true){ 634 | touch_disabled = true; 635 | } 636 | // Encoder 1 Speed 637 | if(lv_slider_is_dragged(ui_homespeedslider) == false){ 638 | if (encoder1.getCount() != speedenc){ 639 | lv_slider_set_value(ui_homespeedslider, speed, LV_ANIM_OFF); 640 | if(encoder1.getCount() <= 0){ 641 | encoder1.setCount(0); 642 | } else if (encoder1.getCount() >= Encoder_MAP){ 643 | encoder1.setCount(Encoder_MAP); 644 | } 645 | speedenc = encoder1.getCount(); 646 | speed = fscale(0.5, Encoder_MAP, 0, speedlimit, speedenc, 0); 647 | SendCommand(SPEED, speed, OSSM_ID); 648 | } 649 | } else if(lv_slider_get_value(ui_homespeedslider) != speed){ 650 | speedenc = fscale(0.5, speedlimit, 0, Encoder_MAP, speed, 0); 651 | encoder1.setCount(speedenc); 652 | speed = lv_slider_get_value(ui_homespeedslider); 653 | SendCommand(SPEED, speed, OSSM_ID); 654 | } 655 | char speed_v[7]; 656 | dtostrf(speed, 6, 0, speed_v); 657 | lv_label_set_text(ui_homespeedvalue, speed_v); 658 | 659 | 660 | // Encoder2 Depth 661 | if(lv_slider_is_dragged(ui_homedepthslider) == false){ 662 | if (encoder2.getCount() != depthenc){ 663 | lv_slider_set_value(ui_homedepthslider, depth, LV_ANIM_OFF); 664 | if(encoder2.getCount() <= 0){ 665 | encoder2.setCount(0); 666 | } else if (encoder2.getCount() >= Encoder_MAP){ 667 | encoder2.setCount(Encoder_MAP); 668 | } 669 | depthenc = encoder2.getCount(); 670 | depth = fscale(0, Encoder_MAP, 0, maxdepthinmm, depthenc, 0); 671 | SendCommand(DEPTH, depth, OSSM_ID); 672 | } 673 | } else if(lv_slider_get_value(ui_homedepthslider) != depth){ 674 | depthenc = fscale(0, maxdepthinmm, 0, Encoder_MAP, depth, 0); 675 | encoder2.setCount(depthenc); 676 | depth = lv_slider_get_value(ui_homedepthslider); 677 | SendCommand(DEPTH, depth, OSSM_ID); 678 | } 679 | char depth_v[7]; 680 | dtostrf(depth, 6, 0, depth_v); 681 | lv_label_set_text(ui_homedepthvalue, depth_v); 682 | 683 | 684 | // Encoder3 Stroke 685 | if(lv_slider_is_dragged(ui_homestrokeslider) == false){ 686 | if (encoder3.getCount() != strokeenc){ 687 | lv_slider_set_value(ui_homestrokeslider, stroke, LV_ANIM_OFF); 688 | if(encoder3.getCount() <= 0){ 689 | encoder3.setCount(0); 690 | } else if (encoder3.getCount() >= Encoder_MAP){ 691 | encoder3.setCount(Encoder_MAP); 692 | } 693 | strokeenc = encoder3.getCount(); 694 | stroke = fscale(0, Encoder_MAP, 0, maxdepthinmm, strokeenc, 0); 695 | SendCommand(STROKE, stroke, OSSM_ID); 696 | } 697 | } else if(lv_slider_get_value(ui_homestrokeslider) != stroke){ 698 | strokeenc = fscale(0, maxdepthinmm, 0, Encoder_MAP, stroke, 0); 699 | encoder3.setCount(strokeenc); 700 | stroke = lv_slider_get_value(ui_homestrokeslider); 701 | SendCommand(STROKE, stroke, OSSM_ID); 702 | } 703 | char stroke_v[7]; 704 | dtostrf(stroke, 6, 0, stroke_v); 705 | lv_label_set_text(ui_homestrokevalue, stroke_v); 706 | 707 | // Encoder4 Senstation 708 | if(lv_slider_is_dragged(ui_homesensationslider) == false){ 709 | if (encoder4.getCount() != sensationenc){ 710 | lv_slider_set_value(ui_homesensationslider, sensation, LV_ANIM_OFF); 711 | if(encoder4.getCount() <= (Encoder_MAP/2*-1)){ 712 | encoder4.setCount((Encoder_MAP/2*-1)); 713 | } else if (encoder4.getCount() >= (Encoder_MAP/2)){ 714 | encoder4.setCount((Encoder_MAP/2)); 715 | } 716 | sensationenc = encoder4.getCount(); 717 | sensation = fscale((Encoder_MAP/2*-1), (Encoder_MAP/2), -100, 100, sensationenc, 0); 718 | SendCommand(SENSATION, sensation, OSSM_ID); 719 | } 720 | } else if(lv_slider_get_value(ui_homesensationslider) != sensation){ 721 | sensationenc = fscale(-100, 100, (Encoder_MAP/2*-1), (Encoder_MAP/2), sensation, 0); 722 | encoder4.setCount(sensationenc); 723 | sensation = lv_slider_get_value(ui_homesensationslider); 724 | SendCommand(SENSATION, sensation, OSSM_ID); 725 | } 726 | 727 | if(click2_short_waspressed == true){ 728 | lv_obj_send_event(ui_HomeButtonL, LV_EVENT_CLICKED, NULL); 729 | } else if(mxclick_short_waspressed == true){ 730 | lv_obj_send_event(ui_HomeButtonM, LV_EVENT_CLICKED, NULL); 731 | } else if(click3_short_waspressed == true){ 732 | lv_obj_send_event(ui_HomeButtonR, LV_EVENT_CLICKED, NULL); 733 | } 734 | 735 | 736 | } 737 | break; 738 | 739 | case ST_UI_MENUE: 740 | { 741 | if(touch_home == true){ 742 | touch_disabled = true; 743 | } 744 | if(encoder4.getCount() > encoder4_enc + 2){ 745 | LogDebug("next"); 746 | lv_group_focus_next(ui_g_menue); 747 | encoder4_enc = encoder4.getCount(); 748 | } else if(encoder4.getCount() < encoder4_enc -2){ 749 | lv_group_focus_prev(ui_g_menue); 750 | LogDebug("Preview"); 751 | encoder4_enc = encoder4.getCount(); 752 | } 753 | 754 | if(click2_short_waspressed == true){ 755 | lv_obj_send_event(ui_MenueButtonL, LV_EVENT_CLICKED, NULL); 756 | } else if(mxclick_short_waspressed == true){ 757 | lv_obj_send_event(ui_MenueButtonM, LV_EVENT_CLICKED, NULL); 758 | } else if(click3_short_waspressed == true){ 759 | lv_obj_send_event(lv_group_get_focused(ui_g_menue), LV_EVENT_CLICKED, NULL); 760 | } 761 | } 762 | break; 763 | 764 | case ST_UI_PATTERN: 765 | { 766 | if(touch_home == true){ 767 | touch_disabled = true; 768 | } 769 | if(encoder4.getCount() > encoder4_enc + 2){ 770 | LogDebug("next"); 771 | uint32_t t = LV_KEY_DOWN; 772 | lv_obj_send_event(ui_PatternS, LV_EVENT_KEY, &t); 773 | encoder4_enc = encoder4.getCount(); 774 | } else if(encoder4.getCount() < encoder4_enc -2){ 775 | uint32_t t = LV_KEY_UP; 776 | lv_obj_send_event(ui_PatternS, LV_EVENT_KEY, &t); 777 | LogDebug("Preview"); 778 | encoder4_enc = encoder4.getCount(); 779 | } 780 | if(click2_short_waspressed == true){ 781 | lv_obj_send_event(ui_PatternButtonL, LV_EVENT_CLICKED, NULL); 782 | } else if(mxclick_short_waspressed == true){ 783 | lv_obj_send_event(ui_PatternButtonM, LV_EVENT_CLICKED, NULL); 784 | } else if(click3_short_waspressed == true){ 785 | lv_obj_send_event(ui_PatternButtonR, LV_EVENT_CLICKED, NULL); 786 | } 787 | } 788 | break; 789 | 790 | case ST_UI_Torqe: 791 | { 792 | if(touch_home == true){ 793 | touch_disabled = true; 794 | } 795 | // Encoder 1 Torqe Out 796 | if(lv_slider_is_dragged(ui_outtroqeslider) == false){ 797 | if (encoder1.getCount() != torqe_f_enc){ 798 | lv_slider_set_value(ui_outtroqeslider, torqe_f, LV_ANIM_OFF); 799 | if(encoder1.getCount() <= 0){ 800 | encoder1.setCount(0); 801 | } else if (encoder1.getCount() >= Encoder_MAP){ 802 | encoder1.setCount(Encoder_MAP); 803 | } 804 | torqe_f_enc = encoder1.getCount(); 805 | torqe_f = fscale(0, Encoder_MAP, 50, 200, torqe_f_enc, 0); 806 | SendCommand(TORQE_F, torqe_f, OSSM_ID); 807 | } 808 | } else if(lv_slider_get_value(ui_outtroqeslider) != torqe_f){ 809 | torqe_f_enc = fscale(50, 200, 0, Encoder_MAP, torqe_f, 0); 810 | encoder1.setCount(torqe_f_enc); 811 | torqe_f = lv_slider_get_value(ui_outtroqeslider); 812 | SendCommand(TORQE_F, torqe_f, OSSM_ID); 813 | } 814 | char torqe_f_v[7]; 815 | dtostrf((torqe_f*-1), 6, 0, torqe_f_v); 816 | lv_label_set_text(ui_outtroqevalue, torqe_f_v); 817 | 818 | // Encoder 4 Torqe IN 819 | if(lv_slider_is_dragged(ui_introqeslider) == false){ 820 | if (encoder4.getCount() != torqe_r_enc){ 821 | lv_slider_set_value(ui_introqeslider, torqe_r, LV_ANIM_OFF); 822 | if(encoder4.getCount() <= 0){ 823 | encoder4.setCount(0); 824 | } else if (encoder4.getCount() >= Encoder_MAP){ 825 | encoder4.setCount(Encoder_MAP); 826 | } 827 | torqe_r_enc = encoder4.getCount(); 828 | torqe_r = fscale(0, Encoder_MAP, 20, 200, torqe_r_enc, 0); 829 | SendCommand(TORQE_R, torqe_r, OSSM_ID); 830 | } 831 | } else if(lv_slider_get_value(ui_introqeslider) != torqe_r){ 832 | torqe_r_enc = fscale(20, 200, 0, Encoder_MAP, torqe_r, 0); 833 | encoder4.setCount(torqe_r_enc); 834 | torqe_r = lv_slider_get_value(ui_introqeslider); 835 | SendCommand(TORQE_R, torqe_r, OSSM_ID); 836 | } 837 | char torqe_r_v[7]; 838 | dtostrf(torqe_r, 6, 0, torqe_r_v); 839 | lv_label_set_text(ui_introqevalue, torqe_r_v); 840 | 841 | if(click2_short_waspressed == true){ 842 | lv_obj_send_event(ui_TorqeButtonL, LV_EVENT_CLICKED, NULL); 843 | } else if(mxclick_short_waspressed == true){ 844 | lv_obj_send_event(ui_TorqeButtonM, LV_EVENT_CLICKED, NULL); 845 | } else if(click3_short_waspressed == true){ 846 | lv_obj_send_event(ui_TorqeButtonR, LV_EVENT_CLICKED, NULL); 847 | } 848 | } 849 | break; 850 | 851 | case ST_UI_EJECTSETTINGS: 852 | { 853 | if(touch_home == true){ 854 | touch_disabled = true; 855 | } 856 | 857 | if(click2_short_waspressed == true){ 858 | lv_obj_send_event(ui_EJECTButtonL, LV_EVENT_CLICKED, NULL); 859 | } else if(mxclick_short_waspressed == true){ 860 | lv_obj_send_event(ui_EJECTButtonM, LV_EVENT_CLICKED, NULL); 861 | } else if(click3_short_waspressed == true){ 862 | 863 | } 864 | } 865 | break; 866 | 867 | case ST_UI_SETTINGS: 868 | { 869 | touch_disabled = false; 870 | if(encoder4.getCount() > encoder4_enc + 2){ 871 | LogDebug("next"); 872 | lv_group_focus_next(ui_g_settings); 873 | encoder4_enc = encoder4.getCount(); 874 | } else if(encoder4.getCount() < encoder4_enc -2){ 875 | lv_group_focus_prev(ui_g_settings); 876 | LogDebug("Preview"); 877 | encoder4_enc = encoder4.getCount(); 878 | } 879 | 880 | if(click2_short_waspressed == true){ 881 | lv_obj_send_event(ui_MenueButtonL, LV_EVENT_CLICKED, NULL); 882 | } else if(mxclick_short_waspressed == true){ 883 | lv_obj_send_event(ui_MenueButtonM, LV_EVENT_CLICKED, NULL); 884 | } else if(click3_short_waspressed == true){ 885 | lv_obj_send_event(ui_EJECTButtonR, LV_EVENT_CLICKED, NULL); 886 | } 887 | } 888 | break; 889 | 890 | } 891 | mxclick_long_waspressed = false; 892 | mxclick_short_waspressed = false; 893 | click2_short_waspressed = false; 894 | click3_short_waspressed = false; 895 | 896 | delay(5); 897 | } 898 | 899 | void espNowRemoteTask(void *pvParameters) 900 | { 901 | for(;;){ 902 | if(Ossm_paired){ 903 | outgoingcontrol.esp_command = HEARTBEAT; 904 | outgoingcontrol.esp_heartbeat = true; 905 | outgoingcontrol.esp_target = OSSM_ID; 906 | esp_err_t result = esp_now_send(OSSM_Address, (uint8_t *) &outgoingcontrol, sizeof(outgoingcontrol)); 907 | } 908 | vTaskDelay(HEARTBEAT_INTERVAL); 909 | } 910 | } 911 | 912 | /* 913 | void cumscreentask(void *pvParameters) 914 | { 915 | for(;;) 916 | { 917 | M5.Lcd.setTextColor(FrontColor); 918 | if(encoder1.getCount() != cum_s_enc) 919 | { 920 | cum_s_enc = encoder1.getCount(); 921 | cum_speed = map(constrain(cum_s_enc,0,Encoder_MAP),0,Encoder_MAP,1000,30000); 922 | M5.Lcd.fillRect(199,S1Pos,85,30,BgColor); 923 | M5.Lcd.setCursor(200,S1Pos+progheight-5); 924 | M5.Lcd.print(cum_speed); 925 | SendCommand(CUMSPEED, cum_speed, CUM); 926 | } 927 | 928 | if(encoder2.getCount() != cum_t_enc) 929 | { 930 | cum_t_enc = encoder2.getCount(); 931 | cum_time = map(constrain(cum_t_enc,0,Encoder_MAP),0,Encoder_MAP,0,60); 932 | M5.Lcd.fillRect(199,S2Pos,85,30,BgColor); 933 | M5.Lcd.setCursor(200,S2Pos+progheight-5); 934 | M5.Lcd.print(cum_time); 935 | SendCommand(CUMTIME, cum_time, CUM); 936 | } 937 | 938 | if(encoder3.getCount() != cum_si_enc) 939 | { 940 | cum_si_enc = encoder3.getCount(); 941 | cum_size = map(constrain(cum_si_enc,0,Encoder_MAP),0,Encoder_MAP,0,40); 942 | M5.Lcd.fillRect(199,S3Pos,85,30,BgColor); 943 | M5.Lcd.setCursor(200,S3Pos+progheight-5); 944 | M5.Lcd.print(cum_size); 945 | SendCommand(CUMSIZE, cum_size, CUM); 946 | } 947 | 948 | if(encoder4.getCount() != cum_a_enc) 949 | { 950 | cum_a_enc = encoder4.getCount(); 951 | cum_accel = map(constrain(cum_a_enc,0,Encoder_MAP),0,Encoder_MAP,0,20); 952 | M5.Lcd.fillRect(199,S4Pos,85,30,BgColor); 953 | M5.Lcd.setCursor(200,S4Pos+progheight-5); 954 | M5.Lcd.print(cum_accel); 955 | SendCommand(CUMACCEL, cum_accel, CUM); 956 | } 957 | vTaskDelay(100); 958 | } 959 | } 960 | */ 961 | 962 | void vibrate(){ 963 | if(vibrate_mode == true){ 964 | M5.Power.setVibration(255); 965 | //M5.Power.Axp192.setLDO3(true); 966 | //M5.Power.Axp192.setLDO3(false); 967 | M5.Power.setVibration(0); 968 | } 969 | } 970 | 971 | void mxclick() { 972 | vibrate(); 973 | mxclick_short_waspressed = true; 974 | } 975 | 976 | void mxlong(){ 977 | vibrate(); 978 | mxclick_long_waspressed = true; 979 | } 980 | 981 | void click2() { 982 | vibrate(); 983 | click2_short_waspressed = true; 984 | } // click1 985 | 986 | void click3() { 987 | vibrate(); 988 | click3_short_waspressed = true; 989 | } // click1 -------------------------------------------------------------------------------- /src/main.h: -------------------------------------------------------------------------------- 1 | extern float maxdepthinmm; 2 | extern float speedlimit; 3 | extern bool dark_mode; 4 | 5 | 6 | 7 | // UI Colors 8 | 9 | -------------------------------------------------------------------------------- /src/ui/ui.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #ifndef _OSSM-WHITE_UI_H 7 | #define _OSSM-WHITE_UI_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #if __has_include("lvgl.h") 14 | #include "lvgl.h" 15 | #else 16 | #include "lvgl/lvgl.h" 17 | #endif 18 | 19 | extern lv_obj_t * ui_Start; 20 | extern lv_obj_t * ui_Logo; 21 | extern lv_obj_t * ui_StartButtonL; 22 | extern lv_obj_t * ui_StartButtonLText; 23 | extern lv_obj_t * ui_StartButtonM; 24 | extern lv_obj_t * ui_StartButtonMText; 25 | extern lv_obj_t * ui_StartButtonR; 26 | extern lv_obj_t * ui_StartButtonRText; 27 | extern lv_obj_t * ui_LOVE_Logo; 28 | extern lv_obj_t * ui_OrtlofLogo; 29 | extern lv_obj_t * ui_Welcome; 30 | extern lv_obj_t * ui_Batt; 31 | extern lv_obj_t * ui_BattValue; 32 | extern lv_obj_t * ui_Battery; 33 | extern lv_obj_t * ui_Home; 34 | extern lv_obj_t * ui_Logo2; 35 | extern lv_obj_t * ui_HomeButtonL; 36 | extern lv_obj_t * ui_HomeButtonLText; 37 | extern lv_obj_t * ui_HomeButtonM; 38 | extern lv_obj_t * ui_HomeButtonMText; 39 | extern lv_obj_t * ui_HomeButtonR; 40 | extern lv_obj_t * ui_HomeButtonRText; 41 | extern lv_obj_t * ui_SpeedL; 42 | extern lv_obj_t * ui_homespeedslider; 43 | extern lv_obj_t * ui_homespeedvalue; 44 | extern lv_obj_t * ui_DepthL; 45 | extern lv_obj_t * ui_homedepthslider; 46 | extern lv_obj_t * ui_homedepthvalue; 47 | extern lv_obj_t * ui_StrokeL; 48 | extern lv_obj_t * ui_homestrokeslider; 49 | extern lv_obj_t * ui_homestrokevalue; 50 | extern lv_obj_t * ui_SensationL; 51 | extern lv_obj_t * ui_homesensationslider; 52 | extern lv_obj_t * ui_Batt2; 53 | extern lv_obj_t * ui_BattValue2; 54 | extern lv_obj_t * ui_Battery2; 55 | extern lv_obj_t * ui_HomePatternLabel1; 56 | extern lv_obj_t * ui_HomePatternLabel; 57 | extern lv_obj_t * ui_connect; 58 | extern lv_obj_t * ui_Menue; 59 | extern lv_obj_t * ui_Logo3; 60 | extern lv_obj_t * ui_MenueButtonL; 61 | extern lv_obj_t * ui_MenueButtonLText; 62 | extern lv_obj_t * ui_MenueButtonM; 63 | extern lv_obj_t * ui_MenueButtonMText; 64 | extern lv_obj_t * ui_MenueButtonR; 65 | extern lv_obj_t * ui_MenueButtonRText; 66 | extern lv_obj_t * ui_Batt3; 67 | extern lv_obj_t * ui_BattValue3; 68 | extern lv_obj_t * ui_Battery3; 69 | extern lv_obj_t * ui_SDepthI; 70 | extern lv_obj_t * ui_SDepthIL; 71 | extern lv_obj_t * ui_SDepthF; 72 | extern lv_obj_t * ui_SDepthFL; 73 | extern lv_obj_t * ui_SPattern; 74 | extern lv_obj_t * ui_SPatternL; 75 | extern lv_obj_t * ui_STorqe; 76 | extern lv_obj_t * ui_STorqeL; 77 | extern lv_obj_t * ui_EJECTSettingButton; 78 | extern lv_obj_t * ui_EJECTSettingButtonText; 79 | extern lv_obj_t * ui_Pattern; 80 | extern lv_obj_t * ui_Logo5; 81 | extern lv_obj_t * ui_PatternButtonL; 82 | extern lv_obj_t * ui_PatternButtonLText; 83 | extern lv_obj_t * ui_PatternButtonM; 84 | extern lv_obj_t * ui_PatternButtonMText; 85 | extern lv_obj_t * ui_PatternButtonR; 86 | extern lv_obj_t * ui_PatternButtonRText; 87 | extern lv_obj_t * ui_Batt5; 88 | extern lv_obj_t * ui_BattValue5; 89 | extern lv_obj_t * ui_Battery5; 90 | extern lv_obj_t * ui_Label4; 91 | extern lv_obj_t * ui_PatternS; 92 | extern lv_obj_t * ui_Torqe; 93 | extern lv_obj_t * ui_Logo4; 94 | extern lv_obj_t * ui_TorqeButtonL; 95 | extern lv_obj_t * ui_TorqeButtonLText; 96 | extern lv_obj_t * ui_TorqeButtonM; 97 | extern lv_obj_t * ui_TorqeButtonMText; 98 | extern lv_obj_t * ui_TorqeButtonR; 99 | extern lv_obj_t * ui_TorqeButtonRText; 100 | extern lv_obj_t * ui_outtroqelabel; 101 | extern lv_obj_t * ui_outtroqevalue; 102 | extern lv_obj_t * ui_outtroqeslider; 103 | extern lv_obj_t * ui_Low1; 104 | extern lv_obj_t * ui_High1; 105 | extern lv_obj_t * ui_introqelabel; 106 | extern lv_obj_t * ui_introqevalue; 107 | extern lv_obj_t * ui_introqeslider; 108 | extern lv_obj_t * ui_Low2; 109 | extern lv_obj_t * ui_High; 110 | extern lv_obj_t * ui_Batt4; 111 | extern lv_obj_t * ui_BattValue4; 112 | extern lv_obj_t * ui_Battery4; 113 | extern lv_obj_t * ui_EJECTSettings; 114 | extern lv_obj_t * ui_Logo6; 115 | extern lv_obj_t * ui_EJECTButtonL; 116 | extern lv_obj_t * ui_EJECTButtonLText; 117 | extern lv_obj_t * ui_EJECTButtonM; 118 | extern lv_obj_t * ui_EJECTButtonMText; 119 | extern lv_obj_t * ui_EJECTButtonR; 120 | extern lv_obj_t * ui_EJECTButtonRText; 121 | extern lv_obj_t * ui_Batt6; 122 | extern lv_obj_t * ui_BattValue6; 123 | extern lv_obj_t * ui_Battery6; 124 | extern lv_obj_t * ui_Settings; 125 | extern lv_obj_t * ui_Logo1; 126 | extern lv_obj_t * ui_SettingsButtonL; 127 | extern lv_obj_t * ui_SettingsButtonLText; 128 | extern lv_obj_t * ui_SettingsButtonM; 129 | extern lv_obj_t * ui_SettingsButtonMText; 130 | extern lv_obj_t * ui_SettingsButtonR; 131 | extern lv_obj_t * ui_SettingsButtonRText; 132 | extern lv_obj_t * ui_Batt1; 133 | extern lv_obj_t * ui_BattValue1; 134 | extern lv_obj_t * ui_Battery1; 135 | extern lv_obj_t * ui_ejectaddon; 136 | extern lv_obj_t * ui_darkmode; 137 | extern lv_obj_t * ui_vibrate; 138 | extern lv_obj_t * ui_lefty; 139 | extern lv_group_t * ui_g_menue; 140 | extern lv_group_t * ui_g_settings; 141 | 142 | 143 | void screenmachine(lv_event_t * e); 144 | void connectbutton(lv_event_t * e); 145 | void screenmachine(lv_event_t * e); 146 | void ejectcreampie(lv_event_t * e); 147 | void homebuttonmevent(lv_event_t * e); 148 | void screenmachine(lv_event_t * e); 149 | void setupDepthInter(lv_event_t * e); 150 | void setupdepthF(lv_event_t * e); 151 | void screenmachine(lv_event_t * e); 152 | void savepattern(lv_event_t * e); 153 | void screenmachine(lv_event_t * e); 154 | void screenmachine(lv_event_t * e); 155 | void screenmachine(lv_event_t * e); 156 | void savesettings(lv_event_t * e); 157 | 158 | LV_IMG_DECLARE(image50x50); // assets\logo.svg 159 | 160 | void ui_init(void); 161 | 162 | #ifdef __cplusplus 163 | } /*extern "C"*/ 164 | #endif 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /src/ui/ui_events.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: SquareLine_Project 5 | 6 | #include "ui.h" 7 | -------------------------------------------------------------------------------- /src/ui/ui_helpers.c: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #include "ui_helpers.h" 7 | 8 | void _ui_bar_set_property(lv_obj_t * target, int id, int val) 9 | { 10 | if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON); 11 | if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF); 12 | } 13 | 14 | void _ui_basic_set_property(lv_obj_t * target, int id, int val) 15 | { 16 | if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val); 17 | if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val); 18 | if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val); 19 | if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val); 20 | } 21 | 22 | 23 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val) 24 | { 25 | if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val); 26 | } 27 | 28 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val) 29 | { 30 | if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val); 31 | } 32 | 33 | void _ui_label_set_property(lv_obj_t * target, int id, char * val) 34 | { 35 | if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val); 36 | } 37 | 38 | 39 | void _ui_roller_set_property(lv_obj_t * target, int id, int val) 40 | { 41 | if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON); 42 | if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF); 43 | } 44 | 45 | void _ui_slider_set_property(lv_obj_t * target, int id, int val) 46 | { 47 | if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON); 48 | if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF); 49 | } 50 | 51 | 52 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 53 | { 54 | lv_scr_load_anim(target, fademode, spd, delay, false); 55 | } 56 | 57 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 58 | { 59 | lv_scr_load_anim(target, fademode, spd, delay, false); 60 | } 61 | 62 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 63 | { 64 | lv_scr_load_anim(target, fademode, spd, delay, false); 65 | } 66 | 67 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay) 68 | { 69 | lv_scr_load_anim(target, fademode, spd, delay, false); 70 | } 71 | 72 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value) 73 | { 74 | if(value == _UI_MODIFY_FLAG_TOGGLE) { 75 | if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag); 76 | else lv_obj_add_flag(target, flag); 77 | } 78 | else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag); 79 | else lv_obj_clear_flag(target, flag); 80 | } 81 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value) 82 | { 83 | if(value == _UI_MODIFY_STATE_TOGGLE) { 84 | if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state); 85 | else lv_obj_add_state(target, state); 86 | } 87 | else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state); 88 | else lv_obj_clear_state(target, state); 89 | } 90 | 91 | void _ui_opacity_set(lv_obj_t * target, int val) 92 | { 93 | lv_obj_set_style_opa(target, val, 0); 94 | } 95 | 96 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v) 97 | { 98 | lv_obj_set_x((lv_obj_t *)a->user_data, v); 99 | } 100 | 101 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v) 102 | { 103 | lv_obj_set_y((lv_obj_t *)a->user_data, v); 104 | } 105 | 106 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v) 107 | { 108 | lv_obj_set_width((lv_obj_t *)a->user_data, v); 109 | } 110 | 111 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v) 112 | { 113 | lv_obj_set_height((lv_obj_t *)a->user_data, v); 114 | } 115 | 116 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v) 117 | { 118 | lv_obj_set_style_opa((lv_obj_t *)a->user_data, v, 0); 119 | } 120 | 121 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v) 122 | { 123 | lv_img_set_zoom((lv_obj_t *)a->user_data, v); 124 | } 125 | 126 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v) 127 | { 128 | lv_img_set_angle((lv_obj_t *)a->user_data, v); 129 | } 130 | 131 | 132 | int32_t _ui_anim_callback_get_x(lv_anim_t * a) 133 | { 134 | return lv_obj_get_x_aligned((lv_obj_t *)a->user_data); 135 | } 136 | 137 | int32_t _ui_anim_callback_get_y(lv_anim_t * a) 138 | { 139 | return lv_obj_get_y_aligned((lv_obj_t *)a->user_data); 140 | } 141 | 142 | int32_t _ui_anim_callback_get_width(lv_anim_t * a) 143 | { 144 | return lv_obj_get_width((lv_obj_t *)a->user_data); 145 | } 146 | 147 | int32_t _ui_anim_callback_get_height(lv_anim_t * a) 148 | { 149 | return lv_obj_get_height((lv_obj_t *)a->user_data); 150 | } 151 | 152 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a) 153 | { 154 | return lv_obj_get_style_opa((lv_obj_t *)a->user_data, 0); 155 | } 156 | 157 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a) 158 | { 159 | return lv_img_get_zoom((lv_obj_t *)a->user_data); 160 | } 161 | 162 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a) 163 | { 164 | return lv_img_get_angle((lv_obj_t *)a->user_data); 165 | } 166 | 167 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 168 | { 169 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 170 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix); 171 | lv_label_set_text(trg, buf); 172 | } 173 | 174 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix) 175 | { 176 | char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE]; 177 | lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix); 178 | lv_label_set_text(trg, buf); 179 | } 180 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off) 181 | { 182 | if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on); 183 | else lv_label_set_text(trg, txt_off); 184 | } 185 | 186 | 187 | -------------------------------------------------------------------------------- /src/ui/ui_helpers.h: -------------------------------------------------------------------------------- 1 | // SquareLine LVGL GENERATED FILE 2 | // EDITOR VERSION: SquareLine Studio 1.0.5 3 | // LVGL VERSION: 8.2 4 | // PROJECT: OSSM-White 5 | 6 | #define _OSSM-WHITE_UI_HELPERS_H 7 | 8 | #if __has_include("lvgl.h") 9 | #include "lvgl.h" 10 | #else 11 | #include "lvgl/lvgl.h" 12 | #endif 13 | 14 | #define _UI_TEMPORARY_STRING_BUFFER_SIZE 32 15 | #define _UI_BAR_PROPERTY_VALUE 0 16 | #define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1 17 | void _ui_bar_set_property(lv_obj_t * target, int id, int val); 18 | 19 | #define _UI_BASIC_PROPERTY_POSITION_X 0 20 | #define _UI_BASIC_PROPERTY_POSITION_Y 1 21 | #define _UI_BASIC_PROPERTY_WIDTH 2 22 | #define _UI_BASIC_PROPERTY_HEIGHT 3 23 | void _ui_basic_set_property(lv_obj_t * target, int id, int val); 24 | 25 | #define _UI_DROPDOWN_PROPERTY_SELECTED 0 26 | void _ui_dropdown_set_property(lv_obj_t * target, int id, int val); 27 | 28 | #define _UI_IMAGE_PROPERTY_IMAGE 0 29 | void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val); 30 | 31 | #define _UI_LABEL_PROPERTY_TEXT 0 32 | void _ui_label_set_property(lv_obj_t * target, int id, char * val); 33 | 34 | #define _UI_ROLLER_PROPERTY_SELECTED 0 35 | #define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1 36 | void _ui_roller_set_property(lv_obj_t * target, int id, int val); 37 | 38 | #define _UI_SLIDER_PROPERTY_VALUE 0 39 | #define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1 40 | void _ui_slider_set_property(lv_obj_t * target, int id, int val); 41 | 42 | void _ui_screen_change(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 43 | 44 | void _ui_arc_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 45 | 46 | void _ui_bar_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 47 | 48 | void _ui_slider_increment(lv_obj_t * target, lv_scr_load_anim_t fademode, int spd, int delay); 49 | 50 | #define _UI_MODIFY_FLAG_ADD 0 51 | #define _UI_MODIFY_FLAG_REMOVE 1 52 | #define _UI_MODIFY_FLAG_TOGGLE 2 53 | void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value); 54 | 55 | #define _UI_MODIFY_STATE_ADD 0 56 | #define _UI_MODIFY_STATE_REMOVE 1 57 | #define _UI_MODIFY_STATE_TOGGLE 2 58 | void _ui_state_modify(lv_obj_t * target, int32_t state, int value); 59 | 60 | void _ui_opacity_set(lv_obj_t * target, int val); 61 | 62 | void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v); 63 | 64 | void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v); 65 | 66 | void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v); 67 | 68 | void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v); 69 | 70 | void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v); 71 | 72 | void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v); 73 | 74 | void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v); 75 | 76 | int32_t _ui_anim_callback_get_x(lv_anim_t * a); 77 | 78 | int32_t _ui_anim_callback_get_y(lv_anim_t * a); 79 | 80 | int32_t _ui_anim_callback_get_width(lv_anim_t * a); 81 | 82 | int32_t _ui_anim_callback_get_height(lv_anim_t * a); 83 | 84 | int32_t _ui_anim_callback_get_opacity(lv_anim_t * a); 85 | 86 | int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a); 87 | 88 | int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a); 89 | 90 | void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 91 | 92 | void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * prefix, char * postfix); 93 | 94 | void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, char * txt_on, char * txt_off); -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | --------------------------------------------------------------------------------