diff --git a/.gitattributes b/.gitattributes index 83b55b8f..c3d5d7d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ docs/assets/P2_Silicon-1.JPG filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.xlsx filter=lfs diff=lfs merge=lfs -text diff --git a/docs/p2.md b/docs/p2.md index 8374dadf..2671533c 100644 --- a/docs/p2.md +++ b/docs/p2.md @@ -211,6 +211,8 @@ by Dave Hein ## Recent Activity ##### _Full details [here](https://github.com/parallaxinc/propeller/pulls?q=is%3Aclosed)._ +* Added Bill Tuss's [Stepper Motor Driver](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/Stepper) +* Updated Greg LaPolla's P2 [ILI9341](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ili9341) object * Added Jon "JonnyMac" McPhalen's [DHTxx Temperature/Humidity](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_dhtxx) object * Added object from Greg LaPolla's * P1 [ADS1118 C](https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/ads1118/C) diff --git a/libraries/community/p2/All/Stepper/README.md b/libraries/community/p2/All/Stepper/README.md new file mode 100644 index 00000000..8db7e774 --- /dev/null +++ b/libraries/community/p2/All/Stepper/README.md @@ -0,0 +1,23 @@ +# Stepper Motor Driver Ver 2 + +## Author +Bill Tuss (forum: btuss) + +## Language +Spin2, PASM2 + +## Created: +February 9, 2021 + +## Category +Motor control + +## Description +This object implements a step motor driver. +The trajectory is sinusoidal, ramp up, a period at constant speed, ramp down. +A STOP input is monitored that will decelerate the motor to a stop in a controlled fashion. +There are two versions. One for drivers that use step and direction inputs and one for drivers with cw and ccw inputs. +A demo program in spin2 is included. + +## License +MIT (see end of source code) diff --git a/libraries/community/p2/All/Stepper/Step driver2 info.pdf b/libraries/community/p2/All/Stepper/Step driver2 info.pdf new file mode 100644 index 00000000..46b975e2 Binary files /dev/null and b/libraries/community/p2/All/Stepper/Step driver2 info.pdf differ diff --git a/libraries/community/p2/All/Stepper/Step_driver2_cc.spin2 b/libraries/community/p2/All/Stepper/Step_driver2_cc.spin2 new file mode 100644 index 00000000..42f4c702 --- /dev/null +++ b/libraries/community/p2/All/Stepper/Step_driver2_cc.spin2 @@ -0,0 +1,322 @@ +{P2 Stepper motor driver } + + +CON + + +VAR + long cog ' cog flag/id + + long CP 'current position + long SPD 'Speed in steps/sec + long STM 'steps to move +/- Routine clears this after values are read + long Asteps 'Number of steps for acceleration phase + long Offset 'degrees at ends of range to skip + + + long MODEb 'mode bits + 'b0 = 0 - stopped, 1 - moving + 'b1 = 1 - accel + 'b2 = 1 - decel + 'b3 = 1 - at slew speed + 'b4 = direction, 1=cw + 'b5 1 = decel to stop + + long sspn 'SSPIN - set to 0 to stop, 1 to start + long cwpin 'cw pin to driver + long ccwpin 'ccw pin to driver + long frequency 'clock frequency + long del + long vel + long as + long ds + long ss + long stn + + +PUB start(sp, cw, ccw): result + stop() + longmove(@sspn, @sp, 3) ' save pins + frequency := clkfreq + cog := COGINIT(COGEXEC_NEW,@_begin,@cp) +1 + return cog + +PUB stop() + +'' Stop stepper driver +'' -- frees a cog if driver was running + + if (cog) ' cog active? + cogstop(cog-1) ' yes, shut it down + cog := 0 ' and mark stopped + +PUB move(sp,st)| t + + asteps := sp/10 +2 'effectively sets max acceleration + t := abs(st/2) + offset := 40 + if asteps > t + asteps := t 'limits accel/ decel steps to 1/2 the total steps + ss := abs(st) - (asteps*2) + if ss == 0 + sp := 10*(asteps -2) 'limit acceleration for short moves + + longmove(@spd, @sp, 2) 'copy values - start the move + +PUB getpos(): result + return @cp + +PUB getsteps(): result + return @stm + +PUB getmode(): result + return @modeb + +PUB getoff(): result + return @offset + +PUB getvel(): result + return @vel + +PUB getas(): result + return @asteps + +PUB getss(): result + return @ss + + +DAT ORG 0 + +_begin mov ptrb, ptra + add ptrb, #24 '4 bytes * 6 longs + setq #4-1 + rdlong sspin,ptrb[0] 'get three pin numbers and frequency + + drvl cwpn + drvl ccwpn + +_stopped rdlong steps, ptra[2] wz 'wait for steps to be non zero + if_z jmp #_stopped + + setq #5-1 'get 5 parameters from hub + rdlong cpos, ptra[0] + + wrlong #0, ptra[2] 'set steps to zero to indicate we received them + + ' wrlong astps, ptra[12] + ' wrlong angoff, ptra[13] + + drvl cwpn + drvl ccwpn + mov stepp, cwpn 'anticipate cw + mov mode, #0 + abs steps wc 'convert neg steps to pos + muxc mode, #16 + if_nc jmp #_dirset 'set direction pin based on c D[31] + mov stepp, ccwpn 'if ccw swap the pins +_dirset wrlong mode, ptra[5] 'output the mode with dir bit set + +_setup mov halfsp, speed + shr halfsp, #1 'make half speed variable + + mov stepn, #0 + mov stom, steps + mov newmin, angoff + mov newrange, n360 + sub newrange, angoff + sub newrange, angoff 'newrange = angoff to (360-angoff) + shl newmin, #7 'partial multiply x128 11930464/128 = 93206 remaining + mov xsteps, #0 + mov t3, astps + shl t3, #1 'x2 - accel and decel + cmp t3, stom wc 'more than accel + decel steps? + if_nc jmp #_waitstart + mov xsteps, steps + sub xsteps, t3 'xsteps = excess steps above accel +decel or zero + mov stom, t3 + + +'****************************************************************************************************** + +_waitstart testp sspin wc 'wait for start pin = 1 + if_nc jmp #_waitstart + + or mode, #%011 'moving, accel + wrlong mode, ptra[5] + call #_dostep 'output a step + +_mainloop testp sspin wc 'still in run mode? + if_c jmp #_mlp1 'yes, keep running + 'if stop pressed + or mode, #%100000 'turn on decel_to_stop + sub steps, xsteps + mov xsteps, #0 + +_mlp1 cmp astps, stepn wz 'done accelerating? + if_z jmp # _mlp2 + if_nz call #_waitstep + jmp #_mainloop + +_mlp2 cmp xsteps, #1 wz 'wait till the last at_speed step + if_z jmp #_checknextmove + +_mlp3 tjz xsteps, #_mlp5 'if xsteps = 0, decelerate +_mlp4 andn mode, #%01110 'acceleration done + or mode, #%01000 'set mode -> at speed + jmp #_mlp6 + +_mlp5 andn mode, #%01110 + or mode, #%00100 'set mode -> decel + wrlong t2, ptra[11] 'output top speed + +_mlp6 wrlong mode, ptra[5] + call #_waitstep + jmp #_mainloop + +'****************************************************************************************************** + +_checknextmove + rdlong steps2, ptra[2] wz + if_z jmp #_mlp3 'no new move to consider + + mov t1, #0 'else- check if direction is same + abs steps2 wc 'convert neg steps to pos + muxc t1, #16 'set direction bit + mov t2, mode + and t2, #%10000 'clear all but direction bit + cmp t1, t2 wz ' is direction the same as current + if_nz jmp #_mlp3 'direction is different we need to stop before starting next move + + rdlong speed2, ptra[1] + cmp speed, speed2 wz 'is speed the same + if_nz jmp #_mlp3 'not the same, can't continue + +_same_speed add steps, steps2 'add new steps to current steps + add xsteps, steps2 'new steps are all at_speed steps + wrlong #0, ptra[2] 'set steps to zero to indicate we received them + jmp #_mlp4 + +'***************************************************************************************************** + +_waitstep waitct2 'wait for the delay period to end + 'then start another pulse +_dostep tjnz steps, #_dostep1 'zero steps left, we're done + pop t1 'pop the unused return address + and mode, #%0100000 'indicate stopped but leave b5 set if decelerate_to_stop + wrlong cpos, ptra[0] + wrlong mode, ptra[5] + jmp #_stopped + +_dostep1 drvh stepp 'step pin high + getct cv + addct1 cv,delayh 'start the pulse high timer + + testb mode, #4 wc 'check the direction bit + sumc cpos, #1 'add/subtract from current position + wrlong cpos, ptra[0] 'update current position + + waitct1 + drvl stepp 'step pulse end + +_ws1 testb mode, #3 wc 'at speed? + if_c sub xsteps, #1 'yes, dec xsteps + if_c jmp #_ws2 'yes, keep old delay + + call #_getdelay 'get new delay if accel or decel + +_ws2 addct2 cv, delay 'start the delay timer + sub steps, #1 'decrement the steps to go + testb mode, #3 wc 'mode = at speed? + if_nc add stepn, #1 'inc stepn if not + ret + +_getdelay qmul stepn, newrange 'scale step to range angoff - (360 - angoff) + getqx t1 + shl t1, #7 'partial multiply *32 + qdiv t1, stom + getqx newvalue + add newvalue, newmin 'new value is converted oldvalue + qmul newvalue, mult 'finish multiply * 93206 + getqx newvalue + qrotate halfsp, newvalue 'get cosine of vector + getqx t1 + mov t2, halfsp + sub t2, t1 'get velocity + + fges t2, #1 'avoid divide by zero + qdiv freq, t2 'delay = frequency/ velocity + getqx delay + fles delay, maxdelay + ret + + +'----------------------------------------------------------------------------------------------- + +delayh long 1000 'step output high time 1000/200_000_000 = 5µs +delay long 1 'delay between steps - calculated +n360 long 360 'the number 360 +mult long 93206 '372827 * 32 = 11930464 * 360 = FFFFFFFF = 4294967295 = 359.999999999degress +maxdelay long 95000000 + +cpos res 1 'current position - steps +speed res 1 'speed -steps/sec +steps res 1 'steps to move +astps res 1 'accel/ decel steps +angoff res 1 + +mode res 1 'b0 = 0 - stopped, 1 - moving + 'b1 = 1 - accel + 'b2 = 1 - decel + 'b3 = 1 - at slew speed + 'b4 = 1 direction = cw + +sspin res 1 'start =1 stop =0 pin (input) +cwpn res 1 'output to driver +ccwpn res 1 ' " +freq res 1 'system clock frequency + +stepp res 1 'depending on direction, either cwpn or ccwpn + +t1 res 1 'temp variables +t2 res 1 +t3 res 1 +cv res 1 'counter value + +stepn res 1 'step number +oldval res 1 +newmin res 1 +newvalue res 1 'converted old value +newrange res 1 +halfsp res 1 'speed/2 +stom res 1 'steps to move +xsteps res 1 'excess steps = total steps - (2*asteps) + +steps2 res 1 'second move steps and speed +speed2 res 1 + + fit 150 + +con { license } + +{{ + + Terms of Use: MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy of this + software and associated documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included in all copies + or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +}} \ No newline at end of file diff --git a/libraries/community/p2/All/Stepper/Step_driver2_sd.spin2 b/libraries/community/p2/All/Stepper/Step_driver2_sd.spin2 new file mode 100644 index 00000000..f452734e --- /dev/null +++ b/libraries/community/p2/All/Stepper/Step_driver2_sd.spin2 @@ -0,0 +1,317 @@ +{P2 Stepper motor driver } + + +CON + + +VAR + long cog ' cog flag/id + + long CP 'current position + long SPD 'Speed in steps/sec + long STM 'steps to move +/- Routine clears this after values are read + long Asteps 'Number of steps for acceleration phase + long Offset 'degrees at ends of range to skip + + + long MODEb 'mode bits + 'b0 = 0 - stopped, 1 - moving + 'b1 = 1 - accel + 'b2 = 1 - decel + 'b3 = 1 - at slew speed + 'b4 = direction, 1=cw + 'b5 1 = decel to stop + + long sspn 'SSPIN - set to 0 to stop, 1 to start + long ckpn 'cw pin to driver + long drpn 'ccw pin to driver + long frequency 'clock frequency + long del + long vel + long as + long ds + long ss + long stn + + +PUB start(sp, cpn, dpn): result + stop() + longmove(@sspn, @sp, 3) ' save pins + frequency := clkfreq + cog := COGINIT(COGEXEC_NEW,@_begin,@cp) +1 + return cog + +PUB stop() + +'' Stop stepper driver +'' -- frees a cog if driver was running + + if (cog) ' cog active? + cogstop(cog-1) ' yes, shut it down + cog := 0 ' and mark stopped + +PUB move(sp,st) | t + + asteps := sp/10 +2 'effectively sets max acceleration + t := abs(st/2) + offset := 40 + if asteps > t + asteps := t 'limits accel/ decel steps to 1/2 the total steps + ss := abs(st) - (asteps*2) + if ss == 0 + sp := 10*(asteps -2) 'limit acceleration for short moves + + longmove(@spd, @sp, 2) 'copy values - start the move + +PUB getpos(): result + return @cp + +PUB getsteps(): result + return @stm + +PUB getmode(): result + return @modeb + +PUB getoff(): result + return @offset + +PUB getvel(): result + return @vel + +PUB getas(): result + return @asteps + +PUB getss(): result + return @ss + + +DAT ORG 0 + +_begin mov ptrb, ptra + add ptrb, #24 '4 bytes * 6 longs + setq #4-1 + rdlong sspin,ptrb[0] 'get three pin numbers and frequency + + drvl dirpin + drvl steppin + +_stopped rdlong steps, ptra[2] wz 'wait for steps to be non zero + if_z jmp #_stopped + + setq #5-1 'get 5 parameters from hub + rdlong cpos, ptra[0] + + wrlong #0, ptra[2] 'set steps to zero to indicate we received them + + drvl dirpin + drvl steppin + + mov mode, #0 + abs steps wc 'convert neg steps to pos + muxc mode, #16 + if_c drvh dirpin 'set direction pin based on c D[31] + if_nc drvl dirpin +_dirset wrlong mode, ptra[5] 'output the mode with dir bit set + +_setup mov halfsp, speed + shr halfsp, #1 'make half speed variable + + mov stepn, #0 + mov stom, steps + mov newmin, angoff + mov newrange, n360 + sub newrange, angoff + sub newrange, angoff 'newrange = angoff to (360-angoff) + shl newmin, #7 'partial multiply x128 11930464/128 = 93206 remaining + mov xsteps, #0 + mov t3, astps + shl t3, #1 'x2 - accel and decel + cmp t3, stom wc 'more than accel + decel steps? + if_nc jmp #_waitstart + mov xsteps, steps + sub xsteps, t3 'xsteps = excess steps above accel +decel or zero + mov stom, t3 + + +'****************************************************************************************************** + +_waitstart testp sspin wc 'wait for start pin = 1 + if_nc jmp #_waitstart + + or mode, #%011 'moving, accel + wrlong mode, ptra[5] + call #_dostep 'output a step + +_mainloop testp sspin wc 'still in run mode? + if_c jmp #_mlp1 'yes, keep running + 'if stop pressed + or mode, #%100000 'turn on decel_to_stop + sub steps, xsteps + mov xsteps, #0 + +_mlp1 cmp astps, stepn wz 'done accelerating? + if_z jmp # _mlp2 + if_nz call #_waitstep + jmp #_mainloop + +_mlp2 cmp xsteps, #1 wz 'wait till the last at_speed step + if_z jmp #_checknextmove + +_mlp3 tjz xsteps, #_mlp5 'if xsteps = 0, decelerate +_mlp4 andn mode, #%01110 'acceleration done + or mode, #%01000 'set mode -> at speed + jmp #_mlp6 + +_mlp5 andn mode, #%01110 + or mode, #%00100 'set mode -> decel + wrlong t2, ptra[11] 'output top speed + +_mlp6 wrlong mode, ptra[5] + call #_waitstep + jmp #_mainloop + +'****************************************************************************************************** + +_checknextmove + rdlong steps2, ptra[2] wz + if_z jmp #_mlp3 'no new move to consider + + mov t1, #0 'else- check if direction is same + abs steps2 wc 'convert neg steps to pos + muxc t1, #16 'set direction bit + mov t2, mode + and t2, #%10000 'clear all but direction bit + cmp t1, t2 wz ' is direction the same as current + if_nz jmp #_mlp3 'direction is different we need to stop before starting next move + + rdlong speed2, ptra[1] + cmp speed, speed2 wz 'is speed the same + if_nz jmp #_mlp3 'not the same, can't continue + +_same_speed add steps, steps2 'add new steps to current steps + add xsteps, steps2 'new steps are all at_speed steps + wrlong #0, ptra[2] 'set steps to zero to indicate we received them + jmp #_mlp4 + +'***************************************************************************************************** + +_waitstep waitct2 'wait for the delay period to end + 'then start another pulse +_dostep tjnz steps, #_dostep1 'zero steps left, we're done + pop t1 'pop the unused return address + and mode, #%0100000 'indicate stopped but leave b5 set if decelerate_to_stop + wrlong cpos, ptra[0] + wrlong mode, ptra[5] + jmp #_stopped + +_dostep1 drvh steppin 'step pin high + getct cv + addct1 cv,delayh 'start the pulse high timer + + testb mode, #4 wc 'check the direction bit + sumc cpos, #1 'add/subtract from current position + wrlong cpos, ptra[0] 'update current position + + waitct1 + drvl steppin 'step pulse end + +_ws1 testb mode, #3 wc 'at speed? + if_c sub xsteps, #1 'yes, dec xsteps + if_c jmp #_ws2 'yes, keep old delay + + call #_getdelay 'get new delay if accel or decel + +_ws2 addct2 cv, delay 'start the delay timer + sub steps, #1 'decrement the steps to go + testb mode, #3 wc 'mode = at speed? + if_nc add stepn, #1 'inc stepn if not + ret + +_getdelay qmul stepn, newrange 'scale step to range angoff - (360 - angoff) + getqx t1 + shl t1, #7 'partial multiply *32 + qdiv t1, stom + getqx newvalue + add newvalue, newmin 'new value is converted oldvalue + qmul newvalue, mult 'finish multiply * 93206 + getqx newvalue + qrotate halfsp, newvalue 'get cosine of vector + getqx t1 + mov t2, halfsp + sub t2, t1 'get velocity + + fges t2, #1 'avoid divide by zero + qdiv freq, t2 'delay = frequency/ velocity + getqx delay + fles delay, maxdelay + ret + + +'----------------------------------------------------------------------------------------------- + +delayh long 1000 'step output high time 1000/200_000_000 = 5µs +delay long 1 'delay between steps - calculated +n360 long 360 'the number 360 +mult long 93206 '93206 * 128 = 11930464 * 360 = FFFFFFFF = 4294967295 = 359.999999999degress +maxdelay long 95000000 + +cpos res 1 'current position - steps +speed res 1 'speed -steps/sec +steps res 1 'steps to move +astps res 1 'accel/ decel steps +angoff res 1 + +mode res 1 'b0 = 0 - stopped, 1 - moving + 'b1 = 1 - accel + 'b2 = 1 - decel + 'b3 = 1 - at slew speed + 'b4 = 1 direction = cw + +sspin res 1 'start =1 stop =0 pin (input) +steppin res 1 'output to driver +dirpin res 1 ' " +freq res 1 'system clock frequency + +t1 res 1 'temp variables +t2 res 1 +t3 res 1 +cv res 1 'counter value + +stepn res 1 'step number +oldval res 1 +newmin res 1 +newvalue res 1 'converted old value +newrange res 1 +halfsp res 1 'speed/2 +stom res 1 'steps to move +xsteps res 1 'excess steps = total steps - (2*asteps) + +steps2 res 1 'second move steps and speed +speed2 res 1 + + fit 150 + +con { license } + +{{ + + Terms of Use: MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy of this + software and associated documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included in all copies + or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +}} \ No newline at end of file diff --git a/libraries/community/p2/All/Stepper/sine wave stepper.xlsx b/libraries/community/p2/All/Stepper/sine wave stepper.xlsx new file mode 100644 index 00000000..38a98f18 --- /dev/null +++ b/libraries/community/p2/All/Stepper/sine wave stepper.xlsx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd6e34932c977376325a7882256a626487f986e137da3a56b3ef1945f4f0e239 +size 120383 diff --git a/libraries/community/p2/All/Stepper/step_driver2 demo.spin2 b/libraries/community/p2/All/Stepper/step_driver2 demo.spin2 new file mode 100644 index 00000000..9c637d0b --- /dev/null +++ b/libraries/community/p2/All/Stepper/step_driver2 demo.spin2 @@ -0,0 +1,232 @@ +CON debug_log_size = 100_000 + +con { timing } + + CLK_FREQ = 200_000_000 ' system freq as a constant + MS_001 = CLK_FREQ / 1_000 ' ticks in 1ms + US_001 = CLK_FREQ / 1_000_000 ' ticks in 1us + + BR_TERM = 115_200 ' terminal baud rate + + _clkfreq = CLK_FREQ ' set system clock + + +con { fixed io pins } + + RX1 = 63 { I } ' programming / debug + TX1 = 62 { O } + + SF_CS = 61 { O } ' serial flash + SF_SCK = 60 { O } + SF_SDO = 59 { O } + SF_SDI = 58 { I } + + SD_SCK = 61 { O } ' sd card + SD_CS = 60 { O } + SD_SDI = 59 { O } + SD_SDO = 58 { I } + + SDA1 = 57 { IO } ' i2c (optional) + SCL1 = 56 { IO } + + +con { app io pins } + enpin = 14 ' motor enable + _spin = 15 'start stop pin (input) + _cpin = 17 'step output pin (or cw pin) + _dpin = 19 'direction output pin (or ccw pin) + + NL = 13 ''NL: New Line + + + + MAXSTR_LENGTH = 99 'Maximum length of received numerical string (not including zero terminator). + + + +obj + +' main ' * master Spin cog + stepper : "step_driver2_cc" ' pasm stepper routine + ' use step_driver2_sd for step and direction + ' use step_driver2_cc or cw, ccw motor drivers + term : "jm_serial" ' serial IO for terminal + + + +dat + + Banner byte "Stepper Demo", 0 + +var + long cpos + long mode + long stm + long spd + long ofs + long ve + long ast + long sst + long start + long endt + + byte char + byte spin + byte cpin + byte dpin + byte str_buffer[MAXSTR_LENGTH+1] 'String buffer for numerical strings + +CON '1 - Run this program with F10 + '2 - Start the PST with F12 , check echo on, Baud rate set above (BR_TERM = 115_200) + '3 - press any key to start + +pub main() | t, value,st, sp + spin := _spin + cpin := _cpin + dpin := _dpin + + setup() 'start the stepper driver, get the addresses for program values + + wait_for_terminal(true) 'press any key after the parallax serial terminal (PST) is started + + long[cpos][0] := 1000 'preset the starting position (just an arbitrary value, defaults to zero) + showvalues() + + repeat + term.fstr0(string("\r\rEnter steps: ")) ' ex: 500 -> 500 steps cw, -1000 -> 1000 steps ccw + st := decin() + + term.fstr0(string("\rEnter speed: ")) ' 1 to approx 45_000, steps per second + sp := abs(decin()) ' negative speed not allowed + if sp == 0 'zero speed not allowed + sp++ + + endt := start := getms() + + 'this is the call to the stepper driver + stepper.move(sp,st) 'speed, steps + + + term.tx(16) 'cls + repeat + showvalues() + endt := getms() + while long[mode][0] & %00001 == 1 'repeat while mode[bit0] = 1 (moving) + + + term.tx(16) 'cls + showvalues() 'one more time after all the results are in + + + + +pub setup() + + stepper.start(spin, cpin, dpin) 'start/stop pin, (step pin, dir pin to driver) + cpos := stepper.getpos() + mode := stepper.getmode() + stm := stepper.getsteps() + ofs := stepper.getoff() + ve := stepper.getvel() + ast := stepper.getas() + sst := stepper.getss() + + term.start(BR_TERM) ' start terminal io + pinlow(enpin) + +pub wait_for_terminal(clear) + + ' Download to RAM with F10 + ' F12 to open PST + ' Click [Enable] + ' Press Enter + + term.rxflush() + term.rx() + if (clear) + term.tx(term.CLS) + +PUB DecIn() : value +{{Receive carriage return terminated string of characters representing a decimal value. + Returns: the corresponding decimal value.}} + + StrInMax(@str_buffer, MAXSTR_LENGTH) + value := StrToBase(@str_buffer, 10) + +PUB StrInMax(stringptr, maxcount) |c +{{Receive a string of characters (either carriage return terminated or maxcount in length) and stores it (zero terminated) +starting at stringptr. Waits until either full string received or maxcount characters received. + Parameters: + stringptr - pointer to memory in which to store received string characters. + Memory reserved must be large enough for all string characters plus a zero terminator (maxcount + 1). + maxcount - maximum length of string to receive, or -1 for unlimited.}} + + repeat while (maxcount--) 'While maxcount not reached + c := term.rx() + if c == 8 'backspace + byte[stringptr--] := 0 + quit + elseif (byte[stringptr++] := c) == NL 'Get chars until NL + quit + byte[stringptr+(byte[stringptr-1] == NL)]~ 'Zero terminate string; overwrite NL or append 0 char + +PRI StrToBase(stringptr, base) : value | chr, index +{Converts a zero terminated string representation of a number to a value in the designated base. +Ignores all non-digit characters (except negative (-) when base is decimal (10)).} + + value := index := 0 + repeat until ((chr := byte[stringptr][index++]) == 0) + chr := -15 + --chr & %11011111 + 39*(chr > 56) 'Make "0"-"9","A"-"F","a"-"f" be 0 - 15, others out of range + if (chr > -1) and (chr < base) 'Accumulate valid values into result; ignore others + value := value * base + chr + if (base == 10) and (byte[stringptr] == "-") 'If decimal, address negative sign; ignore otherwise + value := - value + +PRI Showvalues() + term.fstr1(string("\001%s\r"), @Banner) + + term.fstr0(string("\rCurrent Position: ")) + term.jdpdec(long[cpos][0],0 ,6," ") + + term.fstr0(string("\r Mode: ")) + term.fbin(long[mode][0],6) + + term.fstr0(string("\r Offset: ")) + term.jdpdec(long[ofs][0],0,6," ") + + term.fstr0(string("\r Accel steps: ")) + term.jdpdec(long[ast][0], 0, 6, " ") + + term.fstr0(string("\r Steps at speed: ")) + term.jdpdec(long[sst][0], 0,6," ") + + term.fstr0(string("\r Max Velocity: ")) + term.jdpdec(long[ve][0],0,6," ") + + term.fstr0(string("\r\011Elapsed time (msec): ")) + term.jdpdec(endt - start,0,6," ") + +con { license } + +{{ + + Terms of Use: MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy of this + software and associated documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be included in all copies + or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +}} \ No newline at end of file diff --git a/libraries/community/p2/All/Stepper/stepper_sin_fc.pdf b/libraries/community/p2/All/Stepper/stepper_sin_fc.pdf new file mode 100644 index 00000000..c94802ff Binary files /dev/null and b/libraries/community/p2/All/Stepper/stepper_sin_fc.pdf differ diff --git a/libraries/community/p2/All/ili9341/Demo_ILI9341_XPT2046.spin2 b/libraries/community/p2/All/ili9341/Demo_ILI9341_XPT2046.spin2 new file mode 100644 index 00000000..fa0529ae --- /dev/null +++ b/libraries/community/p2/All/ili9341/Demo_ILI9341_XPT2046.spin2 @@ -0,0 +1,699 @@ +{{ + + ILI9341_XPT2046 Demo + +320x240 LCD driver for ILI9341 controller and XPT2046 touch screen. This version is SPI based. + +Author: Greg LaPolla +Updated: 2021-02-15 +Designed For: P2X8C4M64P +Version: 1.0 + +'' Based on Cluso's Demo ST7796 4.0in SPI 480x320 w Touch LCD Driver + +}} + +CON + _clkfreq = 200_000_000 ' clock frequency + + width = 320 ' screen width (cols) + height = 280 ' screen height (rows) + textwidth = width / 6 ' 80 chars per line 80*6=480 + + LCD_rotate_0 = $00 '\ 0 degrees + LCD_rotate_90 = $A0 '| 90 degrees + LCD_rotate_180 = $C0 '| 180 degrees + LCD_rotate_270 = $60 '/ 270 degrees + LCD_mirror_90 = $20 ' 90 degrees H-mirror +' Set the following to suit... + LCD_rotate = LCD_mirror_90 ' <--- set to suit + +' ILI9341 registers... + LCD_NOP = $00 + LCD_SW_RESET = $01 + LCD_SLEEP_ON = $10 + LCD_SLEEP_OFF = $11 + LCD_PARTIAL = $12 + LCD_NORMAL = $13 + LCD_INVERSION_OFF = $20 + LCD_INVERSION_ON = $21 + LCD_GAMMA_SET = $26 + LCD_DISPLAY_OFF = $28 + LCD_DISPLAY_ON = $29 + LCD_COL_ADR = $2A + LCD_ROW_ADR = $2B + LCD_RAM_WRITE = $2C + LCD_COLOR_SPACE = $2D '4K/65K/262K +' LCD_RAMRD = $2E + LCD_MADCTR = $36 'Mem Addr Contol (rotate screen) + LCD_PIXEL_FORMAT = $3A + LCD_FRAME_CTL1 = $B1 + LCD_INVERSION_CTL = $B4 + LCD_POWER_CTL1 = $C0 + LCD_POWER_CTL2 = $C1 + LCD_VCOM_CTL1 = $C5 + LCD_VCOM_OFFSET = $C7 + LCD_POS_GAMMA = $E0 + LCD_NEG_GAMMA = $E1 + LCD_GAMMA_RS = $F2 + +' BGR 5+6+5 16bits/pixel (RGB reversed) + black = $0000 + white = $FFFF + blue = $F800 + green = $07E0 + red = $001F + yellow= red+green + purple= red+blue + +' ' sin(x) * 1024 ' degrees +Z00 = 0 ' 0.0000 * 1024 ' 0 +Z01 = 107 ' 0.1045 * 1024 ' 6 +Z02 = 213 ' 0.2079 * 1024 ' 12 +Z03 = 316 ' 0.3090 * 1024 ' 18 +Z04 = 416 ' 0.4067 * 1024 ' 24 +Z05 = 512 ' 0.5000 * 1024 ' 30 +Z06 = 602 ' 0.5878 * 1024 ' 36 +Z07 = 685 ' 0.6691 * 1024 ' 42 +Z08 = 761 ' 0.7431 * 1024 ' 48 +Z09 = 828 ' 0.8090 * 1024 ' 54 +Z10 = 887 ' 0.8660 * 1024 ' 60 +Z11 = 935 ' 0.9135 * 1024 ' 66 +Z12 = 974 ' 0.9511 * 1024 ' 72 +Z13 = 1002 ' 0.9781 * 1024 ' 78 +Z14 = 1018 ' 0.9945 * 1024 ' 84 +Z15 = 1024 ' 1.0000 * 1024 ' 90 +'180 = ' 0.0000 * 1024 ' 180 +'270 = '-1.0000 * 1024 ' 270 + +' Clock constants +_CX = 64 '\ clock center +_CY = 64 '/ +_CD = 120 ' clock face dia +_CS = 45 ' second hand length +_CM = 40 ' minute hand length +_CH = 30 ' hour hand length +fgd = blue/2 'green ' foreground dial color (clock dial) +bgd = black ' background dial color +fgh = red ' hour hand color +fgm = yellow ' minute hand color +fgs = white ' second hand color + +baud = 2_000_000 + +OBJ + lcd: "LCD_ILI9341_XPT2046" + 'term : "jm_serial" ' LCD pasm cog driver (supports 6*8 and 8*8 pixel font) + +VAR + long cog ' pasm cog+1 + long tx,ty,tx40,ty40,tx280,ty200,spotx,spoty,int,clock_button + long cr + +DAT + colorlist word white, red+green, blue, green, red, red+blue, blue+green, blue/2 + +PUB start() | i + + cog := lcd.Start(LCD_rotate) ' sw/hw initialise LCD (rotate 0/90/180/270) + lcd.start_TS() + 'term.start(baud) +' screen defaults... + lcd.setFGcolor(blue) ' set foreground color + lcd.setBGcolor(black) ' set background color + lcd.clearScreen() ' clear screen (background color) +' Touchscreen enable interupt + lcd.get_ts($90) 'turn on ts_int + + waitms(50) + +' Select one/some of the following... + waitms(1000) ' wait + drawSomeChars() + waitms(1000) ' wait + drawSomeLines() + waitms(1000) ' wait + drawSomeBoxes() + waitms(1000) ' wait + drawSomeCircles() + 'waitms(1000) ' wait + 'waitms(5000) ' wait + +' draw some text and then do clock... + lcd.clearScreen() + lcd.setFGcolor(green) + lcd.setBGcolor(black) + lcd.SetColRow(0, height/2) ' 2nd half of screen + repeat i from $20 to $7F ' 6*8 font 96 char set + lcd.DrawChar6x8(i) + lcd.SetColRow(0, height/2+20) + repeat i from $20 to $7F ' 8*8 font 96 char set + lcd.DrawChar8x8(i) + +' do clock... + + lcd.clearScreen() + drawstring(100,160, string("CALIBRATE TOP LEFT")) + lcd.SetColRow(40, 40) + lcd.DrawChar8x8($78) 'draw top left calibration X + cr := 13 + int := 1 + + lcd.Wait_for_touch() 'wait for touch + + tx := lcd.get_ts($91) '$91 turns off interupt and collects x position + tx40 := lcd.get_ts($91) '$91 keeps off interupt after x data, calibration point tx40 + ty := lcd.get_ts($D1) '$D1 keeps off interupt and collects y position + ty40 := lcd.get_ts($D0) 'D0 turns interupt back on after calibration point ty40 + + 'term.fstr4(string("X %d Y %d int %d %s"),tx40,ty40,int,@cr) + lcd.clearscreen() + drawstring(100,160, string("CALIBRATE BOTTOM RIGHT")) + lcd.SetColRow(280,200) + lcd.DrawChar8x8($78) 'draw bottom right calibration X + + lcd.wait_for_untouch() 'wait until not touched + lcd.wait_for_touch() 'wait until touched + + tx := lcd.get_ts($91) + tx280 := lcd.get_ts($91) 'calibration point tx280 + ty := lcd.get_ts($D1) + ty200 := lcd.get_ts($D0) 'calibration point ty200 + + 'term.fstr4(string("X %d Y %d int %d %s"),tx280,ty200,spotx,@cr) + + lcd.clearscreen() + drawstring(100,160, string("TOUCH DISPLAY TO MAKE X")) + lcd.SetWindow(240,20,280,60) + lcd.FillWindow(white) + lcd.setBGcolor(white) + lcd.setFGcolor(black) + drawstring(245,36, string("CLOCK")) + lcd.setBGcolor(black) + lcd.setFGcolor(green) + + clock_button := false + + repeat until clock_button + + lcd.wait_for_untouch() 'wait until not touched + lcd.wait_for_touch() 'wait until touched + + tx := lcd.get_ts($91) + tx := lcd.get_ts($91) + ty := lcd.get_ts($D1) + ty := lcd.get_ts($D0) + + spotx := 280-(((tx-tx280)*240)/(tx40-tx280)) 'the 240 is pixels in x direction between calibration marks + spoty := 200-(((ty-ty200)*160)/(ty40-ty200)) 'the 160 is pixels in y direction between calibration marks + + if((spotx > 240) and (spotx < 300) and (spoty > 20) and (spoty < 60)) + clock_button := true + + if not clock_button + lcd.SetColRow(spotx,spoty) + lcd.DrawChar8x8($78) + + 'term.fstr4(string("X %d Y %d int %d %s"),spotx,spoty,spotx,@cr) + + main_roundclock() + +'---------------------------end main----------------------------------------------------- + +PRI drawString(col,row, str) | i + lcd.setColRow(col, row) + repeat i from 0 to 25 ' 6*8 font 96 char set + if byte[str][i] == 0 + quit + lcd.DrawChar6x8(byte[str][i]) + +PRI drawLEDs(ys, v) | x, y, z, i + + repeat i from 0 to 7 + x := 46 + (i * 6) + if i > 3 + x += 6 + lcd.setWindow(x+1, ys+1, x+4, ys+6) + if (v >> (7-i)) & 1 == 1 + lcd.fillWindow(red) + else + lcd.fillWindow(green) + lcd.setColRow(114, ys) + lcd.setFGcolor(yellow) + z := (v >> 4) | $30 + if z > $39 + z += 7 + lcd.drawChar6x8(z) + z := (v & $F) | $30 + if z > $39 + z += 7 + lcd.drawChar6x8(z) + +PRI drawStateLEDs(ys, v) | x, y, z, i + + repeat i from 0 to 5 + x := 58 + (i * 6) + if i > 3 + x += 6 + lcd.setWindow(x+1, ys+1, x+4, ys+6) + if (v >> (5-i)) & 1 == 1 + lcd.fillWindow(red) + else + lcd.fillWindow(green) + lcd.setColRow(120, ys) + lcd.setFGcolor(red) + case v + 1 : z := $30 + 2 : z := $31 + 4 : z := $32 + 8 : z := $33 + 16: z := $34 + 32: z := $35 + lcd.drawChar6x8(z) + +PRI drawSomeChars() | i +' Draw some chars ($20..$7F) + + lcd.clearScreen() + lcd.setFGcolor(green) + lcd.setBGcolor(black) + + repeat i from $20 to $7F ' 6*8 font 96 char set + lcd.DrawChar6x8(i) + + lcd.SetColRow(0, height/2) ' 2nd half of screen + + repeat i from $20 to $7F ' 8*8 font 96 char set + lcd.DrawChar8x8(i) + +PRI drawSomeLines() +' Draw some lines + + lcd.setBGcolor(black) + lcd.clearScreen() + + drawLine(0, 0, width-1, height-1, blue) + drawLine(0, height-1, width-1, 0, blue) + drawLine(0, height/2-1, width-1, height/2-1, yellow) + drawLine(width/2-1, 0, width/2-1, height-1, yellow) + drawLine(width/4-1, 0, width-width/4-1, height-1, red) + drawLine(width/4-1, height-1, width-width/4-1, 0, red) + +PRI drawSomeBoxes() | i, xs, ys, xe, ye, z +' Draw some diagonal boxes + + lcd.clearScreen() + + z := 40 + xs := 0 + ys := 0 + xe := z + ye := z + repeat i from 0 to 7 + lcd.SetWindow(xs,ys,xe,ye) + lcd.FillWindow(colorlist[i]) + xs += z + ys += z + xe += z + ye += z + + z := 40 + xs := 0 + ys := height-z + xe := z + ye := height-1 + repeat i from 0 to 7 + lcd.SetWindow(xs,ys,xe,ye) + lcd.FillWindow(colorlist[i]) + xs += z + ys -= z + xe += z + ye -= z + +PRI drawSomeCircles() | i, z, dia +' Draw some circles + + lcd.clearScreen() + + z := height/2/8 + repeat i from 0 to 7 + dia := z + (z * i) + drawCircle(width/2, height/2, dia, colorlist[i]) + +''+-----------------------------------------------------+ +''| High Level Drivers | +''+-----------------------------------------------------+ + +PRI drawLine(xs, ys, xe, ye, rgb) | i, x, y +' Draw Line - start co-ords, end co-ords, color + 'plot incrementing x axis + repeat i from 0 to xe-xs + y := (ye-ys)*i/(xe-xs) + drawPixel(xs+i, ys+y, rgb) + 'plot incrementing y axis + repeat i from 0 to ye-ys + x := (xe-xs)*i/(ye-ys) + drawPixel(xs+x, ys+i, rgb) + +PRI drawCircle(xc, yc, dia, rgb) | x, y +' Draw Circle d^2 = x^2 + y^2; y = SQRT(d^2 - x^2) (Pythagoras theorum) + repeat x from 0 to dia + y := SQRT((dia*dia) - (x*x)) + 'plot 4 quadrants for incrementing x axis + drawPixel(xc+x, yc+y, rgb) + drawPixel(xc-x, yc+y, rgb) + drawPixel(xc+x, yc-y, rgb) + drawPixel(xc-x, yc-y, rgb) + 'plot 4 quadrants for incrementing y axis (fills in more dots on circle) + drawPixel(xc+y, yc+x, rgb) + drawPixel(xc-y, yc+x, rgb) + drawPixel(xc+y, yc-x, rgb) + drawPixel(xc-y, yc-x, rgb) + +PRI drawPixel(x, y, rgb) | i +' Draw 1 pixel + lcd.setWindow(x, y, x, y) ' 1 pixel + lcd.fillWindow(rgb) + +PRI fillRectangle(xs, ys, xe, ye, rgb) + lcd.setWindow(xs, ys, xe, ye) + lcd.fillWindow(rgb) + +''+-----------------------------------------------------+ +''| Special Functions... | +''+-----------------------------------------------------+ + +PRI main_roundclock() | h, hprev, m, mprev, s, sprev, tick, hx, hz, x +' Round Clock + + lcd.setFGcolor(fgd) + lcd.setBGcolor(bgd) +' lcd.clearScreen() + +' Draw Clock Face + drawCircle(_CX, _CY, _CD/2, fgd) + lcd.setColRow( 56, 8) + lcd.DrawChar6x8("1") + lcd.DrawChar6x8("2") + lcd.setColRow( 31, 16) + lcd.DrawChar6x8("1") + lcd.DrawChar6x8("1") + lcd.setColRow( 89, 16) + lcd.DrawChar6x8("1") + lcd.setColRow( 15, 36) + lcd.DrawChar6x8("1") + lcd.DrawChar6x8("0") + lcd.setColRow(106, 36) + lcd.DrawChar6x8("2") + lcd.setColRow( 8, 60) + lcd.DrawChar6x8("9") + lcd.setColRow(112, 60) + lcd.DrawChar6x8("3") + lcd.setColRow( 15, 84) + lcd.DrawChar6x8("8") + lcd.setColRow(106, 84) + lcd.DrawChar6x8("4") + lcd.setColRow( 31, 104) + lcd.DrawChar6x8("7") + lcd.setColRow( 89, 104) + lcd.DrawChar6x8("5") + lcd.setColRow( 60, 112) + lcd.DrawChar6x8("6") + + tick := GETCT() + +' Draw the date ' date incrementing left as an exercise + lcd.SetWindow(92,0,0,0) ' only need to set x,y + lcd.DrawChar6x8("0") + lcd.DrawChar6x8("7") + lcd.DrawChar6x8(" ") + lcd.DrawChar6x8("N") + lcd.DrawChar6x8("O") + lcd.DrawChar6x8("V") + lcd.SetWindow(104,9,0,0) ' next line +1 pixel + lcd.DrawChar6x8("2") + lcd.DrawChar6x8("0") + lcd.DrawChar6x8("2") + lcd.DrawChar6x8("0") + +' Draw Clock Hands + hprev~ + mprev~ + sprev~ + repeat + repeat h from 0 to 11 + hx := h*5 ' hx= 0..59 for hour hand angle + drawLine(_CX, _CY, byte[@HH00][hprev*2], byte[@HH00][hprev*2+1], bgd) ' remove prev hour hand + drawLine(_CX, _CY, byte[@HH00][hx*2], byte[@HH00][hx*2+1], bgd) ' show hour hand + hprev := hx + repeat m from 0 to 59 + drawLine(_CX, _CY, byte[@MH00][mprev*2], byte[@MH00][mprev*2+1], bgd) ' remove prev minute hand + drawLine(_CX, _CY, byte[@MH00][m*2], byte[@MH00][m*2+1], fgm) ' show minute hand + case m + 12,24,36,48: '\ hx is +0/1/2/3/4 offset... + hx++ '| ...for hour hand to... + drawLine(_CX, _CY, byte[@HH00][hprev*2], byte[@HH00][hprev*2+1], bgd) '| ...advance every... + drawLine(_CX, _CY, byte[@HH00][hx*2], byte[@HH00][hx*2+1], fgh) '| ...12 minutes... + hprev := hx '/ ... + mprev := m + repeat s from 0 to 59 + drawLine(_CX, _CY, byte[@SH00][sprev*2], byte[@SH00][sprev*2+1], bgd) ' remove prev second hand + drawLine(_CX, _CY, byte[@SH00][s*2], byte[@SH00][s*2+1], fgs) ' show second hand + drawLine(_CX, _CY, byte[@MH00][m*2], byte[@MH00][m*2+1], fgm) ' show minute hand + drawLine(_CX, _CY, byte[@HH00][hx*2], byte[@HH00][hx*2+1], fgh) ' show hour hand + sprev := s + lcd.SetWindow(0,0,0,0) + if h<10 + lcd.DrawChar6x8("0") + lcd.DrawChar6x8(h | $30) + else + lcd.DrawChar6x8("1") + lcd.DrawChar6x8((h-10) | $30) + lcd.DrawChar6x8(":") + x := m/10 + lcd.DrawChar6x8(x | $30) + x := m//10 + lcd.DrawChar6x8(x | $30) + lcd.DrawChar6x8(":") + x := s/10 + lcd.DrawChar6x8(x | $30) + x := s//10 + lcd.DrawChar6x8(x | $30) + tick += _clkfreq ' +1S + waitct(tick) + +DAT + orgh +' Hands (seconds) x & y co-ords +SH00 byte _CX + ((_CS * Z00) >> 10), _CY - ((_CS * Z15) >> 10) '00 + byte _CX + ((_CS * Z01) >> 10), _CY - ((_CS * Z14) >> 10) '01 + byte _CX + ((_CS * Z02) >> 10), _CY - ((_CS * Z13) >> 10) '02 + byte _CX + ((_CS * Z03) >> 10), _CY - ((_CS * Z12) >> 10) '... + byte _CX + ((_CS * Z04) >> 10), _CY - ((_CS * Z11) >> 10) + byte _CX + ((_CS * Z05) >> 10), _CY - ((_CS * Z10) >> 10) + byte _CX + ((_CS * Z06) >> 10), _CY - ((_CS * Z09) >> 10) + byte _CX + ((_CS * Z07) >> 10), _CY - ((_CS * Z08) >> 10) + byte _CX + ((_CS * Z08) >> 10), _CY - ((_CS * Z07) >> 10) + byte _CX + ((_CS * Z09) >> 10), _CY - ((_CS * Z06) >> 10) + byte _CX + ((_CS * Z10) >> 10), _CY - ((_CS * Z05) >> 10) + byte _CX + ((_CS * Z11) >> 10), _CY - ((_CS * Z04) >> 10) + byte _CX + ((_CS * Z12) >> 10), _CY - ((_CS * Z03) >> 10) + byte _CX + ((_CS * Z13) >> 10), _CY - ((_CS * Z02) >> 10) + byte _CX + ((_CS * Z14) >> 10), _CY - ((_CS * Z01) >> 10) + + byte _CX + ((_CS * Z15) >> 10), _CY + ((_CS * Z00) >> 10) + byte _CX + ((_CS * Z14) >> 10), _CY + ((_CS * Z01) >> 10) + byte _CX + ((_CS * Z13) >> 10), _CY + ((_CS * Z02) >> 10) + byte _CX + ((_CS * Z12) >> 10), _CY + ((_CS * Z03) >> 10) + byte _CX + ((_CS * Z11) >> 10), _CY + ((_CS * Z04) >> 10) + byte _CX + ((_CS * Z10) >> 10), _CY + ((_CS * Z05) >> 10) + byte _CX + ((_CS * Z09) >> 10), _CY + ((_CS * Z06) >> 10) + byte _CX + ((_CS * Z08) >> 10), _CY + ((_CS * Z07) >> 10) + byte _CX + ((_CS * Z07) >> 10), _CY + ((_CS * Z08) >> 10) + byte _CX + ((_CS * Z06) >> 10), _CY + ((_CS * Z09) >> 10) + byte _CX + ((_CS * Z05) >> 10), _CY + ((_CS * Z10) >> 10) + byte _CX + ((_CS * Z04) >> 10), _CY + ((_CS * Z11) >> 10) + byte _CX + ((_CS * Z03) >> 10), _CY + ((_CS * Z12) >> 10) + byte _CX + ((_CS * Z02) >> 10), _CY + ((_CS * Z13) >> 10) + byte _CX + ((_CS * Z01) >> 10), _CY + ((_CS * Z14) >> 10) + + byte _CX - ((_CS * Z00) >> 10), _CY + ((_CS * Z15) >> 10) + byte _CX - ((_CS * Z01) >> 10), _CY + ((_CS * Z14) >> 10) + byte _CX - ((_CS * Z02) >> 10), _CY + ((_CS * Z13) >> 10) + byte _CX - ((_CS * Z03) >> 10), _CY + ((_CS * Z12) >> 10) + byte _CX - ((_CS * Z04) >> 10), _CY + ((_CS * Z11) >> 10) + byte _CX - ((_CS * Z05) >> 10), _CY + ((_CS * Z10) >> 10) + byte _CX - ((_CS * Z06) >> 10), _CY + ((_CS * Z09) >> 10) + byte _CX - ((_CS * Z07) >> 10), _CY + ((_CS * Z08) >> 10) + byte _CX - ((_CS * Z08) >> 10), _CY + ((_CS * Z07) >> 10) + byte _CX - ((_CS * Z09) >> 10), _CY + ((_CS * Z06) >> 10) + byte _CX - ((_CS * Z10) >> 10), _CY + ((_CS * Z05) >> 10) + byte _CX - ((_CS * Z11) >> 10), _CY + ((_CS * Z04) >> 10) + byte _CX - ((_CS * Z12) >> 10), _CY + ((_CS * Z03) >> 10) + byte _CX - ((_CS * Z13) >> 10), _CY + ((_CS * Z02) >> 10) + byte _CX - ((_CS * Z14) >> 10), _CY + ((_CS * Z01) >> 10) + + byte _CX - ((_CS * Z15) >> 10), _CY - ((_CS * Z00) >> 10) + byte _CX - ((_CS * Z14) >> 10), _CY - ((_CS * Z01) >> 10) + byte _CX - ((_CS * Z13) >> 10), _CY - ((_CS * Z02) >> 10) + byte _CX - ((_CS * Z12) >> 10), _CY - ((_CS * Z03) >> 10) + byte _CX - ((_CS * Z11) >> 10), _CY - ((_CS * Z04) >> 10) + byte _CX - ((_CS * Z10) >> 10), _CY - ((_CS * Z05) >> 10) + byte _CX - ((_CS * Z09) >> 10), _CY - ((_CS * Z06) >> 10) + byte _CX - ((_CS * Z08) >> 10), _CY - ((_CS * Z07) >> 10) + byte _CX - ((_CS * Z07) >> 10), _CY - ((_CS * Z08) >> 10) + byte _CX - ((_CS * Z06) >> 10), _CY - ((_CS * Z09) >> 10) + byte _CX - ((_CS * Z05) >> 10), _CY - ((_CS * Z10) >> 10) + byte _CX - ((_CS * Z04) >> 10), _CY - ((_CS * Z11) >> 10) + byte _CX - ((_CS * Z03) >> 10), _CY - ((_CS * Z12) >> 10) + byte _CX - ((_CS * Z02) >> 10), _CY - ((_CS * Z13) >> 10) + byte _CX - ((_CS * Z01) >> 10), _CY - ((_CS * Z14) >> 10) + +' Hands (minutes) x & y co-ords +MH00 byte _CX + ((_CM * Z00) >> 10), _CY - ((_CM * Z15) >> 10) '00 + byte _CX + ((_CM * Z01) >> 10), _CY - ((_CM * Z14) >> 10) '01 + byte _CX + ((_CM * Z02) >> 10), _CY - ((_CM * Z13) >> 10) '02 + byte _CX + ((_CM * Z03) >> 10), _CY - ((_CM * Z12) >> 10) '... + byte _CX + ((_CM * Z04) >> 10), _CY - ((_CM * Z11) >> 10) + byte _CX + ((_CM * Z05) >> 10), _CY - ((_CM * Z10) >> 10) + byte _CX + ((_CM * Z06) >> 10), _CY - ((_CM * Z09) >> 10) + byte _CX + ((_CM * Z07) >> 10), _CY - ((_CM * Z08) >> 10) + byte _CX + ((_CM * Z08) >> 10), _CY - ((_CM * Z07) >> 10) + byte _CX + ((_CM * Z09) >> 10), _CY - ((_CM * Z06) >> 10) + byte _CX + ((_CM * Z10) >> 10), _CY - ((_CM * Z05) >> 10) + byte _CX + ((_CM * Z11) >> 10), _CY - ((_CM * Z04) >> 10) + byte _CX + ((_CM * Z12) >> 10), _CY - ((_CM * Z03) >> 10) + byte _CX + ((_CM * Z13) >> 10), _CY - ((_CM * Z02) >> 10) + byte _CX + ((_CM * Z14) >> 10), _CY - ((_CM * Z01) >> 10) + + byte _CX + ((_CM * Z15) >> 10), _CY + ((_CM * Z00) >> 10) + byte _CX + ((_CM * Z14) >> 10), _CY + ((_CM * Z01) >> 10) + byte _CX + ((_CM * Z13) >> 10), _CY + ((_CM * Z02) >> 10) + byte _CX + ((_CM * Z12) >> 10), _CY + ((_CM * Z03) >> 10) + byte _CX + ((_CM * Z11) >> 10), _CY + ((_CM * Z04) >> 10) + byte _CX + ((_CM * Z10) >> 10), _CY + ((_CM * Z05) >> 10) + byte _CX + ((_CM * Z09) >> 10), _CY + ((_CM * Z06) >> 10) + byte _CX + ((_CM * Z08) >> 10), _CY + ((_CM * Z07) >> 10) + byte _CX + ((_CM * Z07) >> 10), _CY + ((_CM * Z08) >> 10) + byte _CX + ((_CM * Z06) >> 10), _CY + ((_CM * Z09) >> 10) + byte _CX + ((_CM * Z05) >> 10), _CY + ((_CM * Z10) >> 10) + byte _CX + ((_CM * Z04) >> 10), _CY + ((_CM * Z11) >> 10) + byte _CX + ((_CM * Z03) >> 10), _CY + ((_CM * Z12) >> 10) + byte _CX + ((_CM * Z02) >> 10), _CY + ((_CM * Z13) >> 10) + byte _CX + ((_CM * Z01) >> 10), _CY + ((_CM * Z14) >> 10) + + byte _CX - ((_CM * Z00) >> 10), _CY + ((_CM * Z15) >> 10) + byte _CX - ((_CM * Z01) >> 10), _CY + ((_CM * Z14) >> 10) + byte _CX - ((_CM * Z02) >> 10), _CY + ((_CM * Z13) >> 10) + byte _CX - ((_CM * Z03) >> 10), _CY + ((_CM * Z12) >> 10) + byte _CX - ((_CM * Z04) >> 10), _CY + ((_CM * Z11) >> 10) + byte _CX - ((_CM * Z05) >> 10), _CY + ((_CM * Z10) >> 10) + byte _CX - ((_CM * Z06) >> 10), _CY + ((_CM * Z09) >> 10) + byte _CX - ((_CM * Z07) >> 10), _CY + ((_CM * Z08) >> 10) + byte _CX - ((_CM * Z08) >> 10), _CY + ((_CM * Z07) >> 10) + byte _CX - ((_CM * Z09) >> 10), _CY + ((_CM * Z06) >> 10) + byte _CX - ((_CM * Z10) >> 10), _CY + ((_CM * Z05) >> 10) + byte _CX - ((_CM * Z11) >> 10), _CY + ((_CM * Z04) >> 10) + byte _CX - ((_CM * Z12) >> 10), _CY + ((_CM * Z03) >> 10) + byte _CX - ((_CM * Z13) >> 10), _CY + ((_CM * Z02) >> 10) + byte _CX - ((_CM * Z14) >> 10), _CY + ((_CM * Z01) >> 10) + + byte _CX - ((_CM * Z15) >> 10), _CY - ((_CM * Z00) >> 10) + byte _CX - ((_CM * Z14) >> 10), _CY - ((_CM * Z01) >> 10) + byte _CX - ((_CM * Z13) >> 10), _CY - ((_CM * Z02) >> 10) + byte _CX - ((_CM * Z12) >> 10), _CY - ((_CM * Z03) >> 10) + byte _CX - ((_CM * Z11) >> 10), _CY - ((_CM * Z04) >> 10) + byte _CX - ((_CM * Z10) >> 10), _CY - ((_CM * Z05) >> 10) + byte _CX - ((_CM * Z09) >> 10), _CY - ((_CM * Z06) >> 10) + byte _CX - ((_CM * Z08) >> 10), _CY - ((_CM * Z07) >> 10) + byte _CX - ((_CM * Z07) >> 10), _CY - ((_CM * Z08) >> 10) + byte _CX - ((_CM * Z06) >> 10), _CY - ((_CM * Z09) >> 10) + byte _CX - ((_CM * Z05) >> 10), _CY - ((_CM * Z10) >> 10) + byte _CX - ((_CM * Z04) >> 10), _CY - ((_CM * Z11) >> 10) + byte _CX - ((_CM * Z03) >> 10), _CY - ((_CM * Z12) >> 10) + byte _CX - ((_CM * Z02) >> 10), _CY - ((_CM * Z13) >> 10) + byte _CX - ((_CM * Z01) >> 10), _CY - ((_CM * Z14) >> 10) + +' Hands (hours) x & y co-ords +HH00 byte _CX + ((_CH * Z00) >> 10), _CY - ((_CH * Z15) >> 10) '00 + byte _CX + ((_CH * Z01) >> 10), _CY - ((_CH * Z14) >> 10) '01 + byte _CX + ((_CH * Z02) >> 10), _CY - ((_CH * Z13) >> 10) '02 + byte _CX + ((_CH * Z03) >> 10), _CY - ((_CH * Z12) >> 10) '... + byte _CX + ((_CH * Z04) >> 10), _CY - ((_CH * Z11) >> 10) + byte _CX + ((_CH * Z05) >> 10), _CY - ((_CH * Z10) >> 10) + byte _CX + ((_CH * Z06) >> 10), _CY - ((_CH * Z09) >> 10) + byte _CX + ((_CH * Z07) >> 10), _CY - ((_CH * Z08) >> 10) + byte _CX + ((_CH * Z08) >> 10), _CY - ((_CH * Z07) >> 10) + byte _CX + ((_CH * Z09) >> 10), _CY - ((_CH * Z06) >> 10) + byte _CX + ((_CH * Z10) >> 10), _CY - ((_CH * Z05) >> 10) + byte _CX + ((_CH * Z11) >> 10), _CY - ((_CH * Z04) >> 10) + byte _CX + ((_CH * Z12) >> 10), _CY - ((_CH * Z03) >> 10) + byte _CX + ((_CH * Z13) >> 10), _CY - ((_CH * Z02) >> 10) + byte _CX + ((_CH * Z14) >> 10), _CY - ((_CH * Z01) >> 10) + + byte _CX + ((_CH * Z15) >> 10), _CY + ((_CH * Z00) >> 10) + byte _CX + ((_CH * Z14) >> 10), _CY + ((_CH * Z01) >> 10) + byte _CX + ((_CH * Z13) >> 10), _CY + ((_CH * Z02) >> 10) + byte _CX + ((_CH * Z12) >> 10), _CY + ((_CH * Z03) >> 10) + byte _CX + ((_CH * Z11) >> 10), _CY + ((_CH * Z04) >> 10) + byte _CX + ((_CH * Z10) >> 10), _CY + ((_CH * Z05) >> 10) + byte _CX + ((_CH * Z09) >> 10), _CY + ((_CH * Z06) >> 10) + byte _CX + ((_CH * Z08) >> 10), _CY + ((_CH * Z07) >> 10) + byte _CX + ((_CH * Z07) >> 10), _CY + ((_CH * Z08) >> 10) + byte _CX + ((_CH * Z06) >> 10), _CY + ((_CH * Z09) >> 10) + byte _CX + ((_CH * Z05) >> 10), _CY + ((_CH * Z10) >> 10) + byte _CX + ((_CH * Z04) >> 10), _CY + ((_CH * Z11) >> 10) + byte _CX + ((_CH * Z03) >> 10), _CY + ((_CH * Z12) >> 10) + byte _CX + ((_CH * Z02) >> 10), _CY + ((_CH * Z13) >> 10) + byte _CX + ((_CH * Z01) >> 10), _CY + ((_CH * Z14) >> 10) + + byte _CX - ((_CH * Z00) >> 10), _CY + ((_CH * Z15) >> 10) + byte _CX - ((_CH * Z01) >> 10), _CY + ((_CH * Z14) >> 10) + byte _CX - ((_CH * Z02) >> 10), _CY + ((_CH * Z13) >> 10) + byte _CX - ((_CH * Z03) >> 10), _CY + ((_CH * Z12) >> 10) + byte _CX - ((_CH * Z04) >> 10), _CY + ((_CH * Z11) >> 10) + byte _CX - ((_CH * Z05) >> 10), _CY + ((_CH * Z10) >> 10) + byte _CX - ((_CH * Z06) >> 10), _CY + ((_CH * Z09) >> 10) + byte _CX - ((_CH * Z07) >> 10), _CY + ((_CH * Z08) >> 10) + byte _CX - ((_CH * Z08) >> 10), _CY + ((_CH * Z07) >> 10) + byte _CX - ((_CH * Z09) >> 10), _CY + ((_CH * Z06) >> 10) + byte _CX - ((_CH * Z10) >> 10), _CY + ((_CH * Z05) >> 10) + byte _CX - ((_CH * Z11) >> 10), _CY + ((_CH * Z04) >> 10) + byte _CX - ((_CH * Z12) >> 10), _CY + ((_CH * Z03) >> 10) + byte _CX - ((_CH * Z13) >> 10), _CY + ((_CH * Z02) >> 10) + byte _CX - ((_CH * Z14) >> 10), _CY + ((_CH * Z01) >> 10) + + byte _CX - ((_CH * Z15) >> 10), _CY - ((_CH * Z00) >> 10) + byte _CX - ((_CH * Z14) >> 10), _CY - ((_CH * Z01) >> 10) + byte _CX - ((_CH * Z13) >> 10), _CY - ((_CH * Z02) >> 10) + byte _CX - ((_CH * Z12) >> 10), _CY - ((_CH * Z03) >> 10) + byte _CX - ((_CH * Z11) >> 10), _CY - ((_CH * Z04) >> 10) + byte _CX - ((_CH * Z10) >> 10), _CY - ((_CH * Z05) >> 10) + byte _CX - ((_CH * Z09) >> 10), _CY - ((_CH * Z06) >> 10) + byte _CX - ((_CH * Z08) >> 10), _CY - ((_CH * Z07) >> 10) + byte _CX - ((_CH * Z07) >> 10), _CY - ((_CH * Z08) >> 10) + byte _CX - ((_CH * Z06) >> 10), _CY - ((_CH * Z09) >> 10) + byte _CX - ((_CH * Z05) >> 10), _CY - ((_CH * Z10) >> 10) + byte _CX - ((_CH * Z04) >> 10), _CY - ((_CH * Z11) >> 10) + byte _CX - ((_CH * Z03) >> 10), _CY - ((_CH * Z12) >> 10) + byte _CX - ((_CH * Z02) >> 10), _CY - ((_CH * Z13) >> 10) + byte _CX - ((_CH * Z01) >> 10), _CY - ((_CH * Z14) >> 10) + +dat +{{ ++------------------------------------------------------------------------------------------------------------------------------+ +| TERMS OF USE: MIT License | ++------------------------------------------------------------------------------------------------------------------------------+ +|Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | +|files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | +|modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software| +|is furnished to do so, subject to the following conditions: | +| | +|The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.| +| | +|THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | +|WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | +|COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | +|ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ++------------------------------------------------------------------------------------------------------------------------------+ +}} \ No newline at end of file diff --git a/libraries/community/p2/All/ili9341/ILI9341-test.spin2 b/libraries/community/p2/All/ili9341/ILI9341-test.spin2 deleted file mode 100644 index 15b911de..00000000 --- a/libraries/community/p2/All/ili9341/ILI9341-test.spin2 +++ /dev/null @@ -1,102 +0,0 @@ -{{ - ILI9341-test.spin2 - -Test the ILI9341-spi.spin2 driver - -Author: Greg LaPolla -Updated: 2020-12-24 -Designed For: P2X8C4M64P -Version: 1.0 - -This driver was converted to spin2 from the original spin file that was written by Mark Tillotson - -Update History: -v1.0 - Initial version 2013-11-16 - -}} - -CON - - CLK_FREQ = 200_000_000 - - RX1 = 63 'programming output - TX1 = 62 'programming input - - BR_TERM = 230_400 - - nRESET= 25 - RS = 26 - CS = 24 - MOSI = 27 - SCLK = 28 - MISO = 29 - -OBJ - disp : "ILI9341" - -VAR - BYTE buffer[100] 'buffer to assemble output strings - -PUB Main() | i, j, k - - disp.Start (nRESET, CS, RS, MOSI, SCLK) - - repeat - disp.SetColours ($0, $0F800) - disp.ClearScreen() - repeat i from 0 to 115 step 3 - disp.SetColours ($0000+i*$0842, $001F) - disp.DrawRect (40+i, i, 279-i, 239-i) - waitct (getct() + clkfreq/2) - repeat i from 0 to 63 - disp.SetColours (j+56*(i>>1), $001F) - disp.DrawRect (i*3, 17+i*2, i*3+100, 50+i*2) - waitct (getct() + clkfreq/2) - disp.SetColours ($F81F, $E) - disp.ClearScreen() - disp.DrawString (0, 0, @stringy) - disp.DrawStringSmall (0, 100, @stringy) - repeat i from 0 to 319 step 5 - disp.SetColours ($F000+$12*i, $E) - disp.DrawLine (i, 0, 319-i, 239) - waitct (getct() + clkfreq/2) - disp.SetColours ($FFFF, $0) - repeat i from 0 to 239 step 5 - disp.DrawDot (270, i) - repeat i from 0 to 239 - disp.DrawCharSmall ((i & 15)*10, (i >> 4)* 16, i) - waitct (getct() + clkfreq/2) - disp.SetColours ($0, $FFFF) - repeat i from 0 to 63 - disp.DrawChar (170+(i & 7)*18, (i >> 3)* 32, i+$20) - waitct (getct() + clkfreq/2) - disp.SetColours ($FFE0, $0010) - repeat i from 0 to 63 - disp.DrawChar (170+(i & 7)*18, (i >> 3)* 32, i+$40) - waitct (getct() + clkfreq/2) - disp.SetColours ($F800, $07F0) - repeat i from 0 to 14 - disp.DrawStringSmall (0, i<<4, @stringy2) - waitct (getct() + clkfreq) - -DAT -stringy byte "Test string",0 -stringy2 byte "The quick brown fox jumps over the lazy ",0 - -{{ - - TERMS OF USE: MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -}} \ No newline at end of file diff --git a/libraries/community/p2/All/ili9341/ILI9341.spin2 b/libraries/community/p2/All/ili9341/ILI9341.spin2 deleted file mode 100644 index 8c028fe4..00000000 Binary files a/libraries/community/p2/All/ili9341/ILI9341.spin2 and /dev/null differ diff --git a/libraries/community/p2/All/ili9341/LCD_ILI9341_XPT2046.spin2 b/libraries/community/p2/All/ili9341/LCD_ILI9341_XPT2046.spin2 new file mode 100644 index 00000000..43fc9168 Binary files /dev/null and b/libraries/community/p2/All/ili9341/LCD_ILI9341_XPT2046.spin2 differ diff --git a/libraries/community/p2/All/ili9341/README.md b/libraries/community/p2/All/ili9341/README.md index 32e1cc6f..f1bede52 100644 --- a/libraries/community/p2/All/ili9341/README.md +++ b/libraries/community/p2/All/ili9341/README.md @@ -1,4 +1,4 @@ -# ILI9341 +# ILI9341_XPT2046 ## Language @@ -10,7 +10,7 @@ Display ## Description -ILI9341 is a spin2 object that interfaces the ILI9341 chip with the Propeller 2 P2X8C4M64P +ILI9341_XPT2046 is a spin2 object that interfaces the ILI9341 Video chip and the XPT2046 chip with the Propeller 2 P2X8C4M64P Learn more about the Propeller 2 at [www.parallax.com](http://www.parallax.com). @@ -18,9 +18,9 @@ Learn more about the Propeller 2 at [www.parallax.com](http://www.parallax.com). ## License -Copyright © 2020 Greg LaPolla ILI9341 Spin 2 Object is licensed under the MIT License. +Copyright © 2021 Greg LaPolla ILI9341_XPT2046 Spin 2 Object is licensed under the MIT License. ## Credits -ILI9341 Spin 2 Object is developed by Greg LaPolla. -This Driver was derived from The object ILI9341-spi by Mark Tillotson +ILI9341_XPT2046 Spin 2 Object is maintained by Greg LaPolla.
+This Driver was derived from Cluso's ST7796 4.0in SPI 480x320 w Touch LCD Driver diff --git a/libraries/community/p2/Motor Control/README.md b/libraries/community/p2/Motor Control/README.md index 86ef6859..755defa1 100644 --- a/libraries/community/p2/Motor Control/README.md +++ b/libraries/community/p2/Motor Control/README.md @@ -2,4 +2,6 @@ [JM Servo](../All/jm_servo) +[Stepper](../All/Stepper) + [Park Transformation](../All/ParkTransformation) \ No newline at end of file