From 6e5e5ddda69cfc618d95d95722d58eeedbcfa32b Mon Sep 17 00:00:00 2001 From: ayabusa Date: Fri, 5 Apr 2024 20:59:57 +0200 Subject: [PATCH] Documentation and clean up --- .vscode/settings.json | 3 ++- numworks_port/README.md | 5 ++++- numworks_port/build/Laplace/gpio_helper.o | Bin 6224 -> 6228 bytes numworks_port/build/Laplace/keyboard.o | Bin 5320 -> 5320 bytes numworks_port/build/Laplace/laplace.o | Bin 2480 -> 2480 bytes numworks_port/build/Laplace/led.o | Bin 4176 -> 4176 bytes numworks_port/build/Laplace/time.o | Bin 2912 -> 2912 bytes numworks_port/build/main.bin | Bin 67661 -> 67797 bytes numworks_port/build/main.elf | Bin 279792 -> 279868 bytes numworks_port/build/main.o | Bin 3076 -> 3372 bytes numworks_port/src/Laplace/gpio_helper.c | 7 +++++++ numworks_port/src/Laplace/gpio_helper.h | 9 +++++++++ numworks_port/src/Laplace/keyboard.c | 7 ++++++- numworks_port/src/Laplace/keyboard.h | 12 ++++++++---- numworks_port/src/Laplace/laplace.c | 11 ++++++----- numworks_port/src/Laplace/laplace.h | 1 + numworks_port/src/Laplace/led.c | 14 ++++++++++++++ numworks_port/src/Laplace/led.h | 18 ++++++++++++++++++ numworks_port/src/Laplace/time.c | 2 ++ numworks_port/src/Laplace/time.h | 2 ++ numworks_port/src/main.c | 21 ++++++++++++++++++--- numworks_port/src/main.h | 5 +++-- 22 files changed, 100 insertions(+), 17 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 02bb9b3..90879a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -21,6 +21,7 @@ "led.h": "c", "stm32f730xx.h": "c", "keyboard.h": "c", - "gpio_helper.h": "c" + "gpio_helper.h": "c", + "stdint.h": "c" } } \ No newline at end of file diff --git a/numworks_port/README.md b/numworks_port/README.md index e3da20b..6957788 100644 --- a/numworks_port/README.md +++ b/numworks_port/README.md @@ -17,6 +17,9 @@ This is a bare metal os attempt on the numworks n0110 - [ ] adapt ms_wait() and us_wait() - [ ] Screen interface - [ ] UI toolkit + - [ ] set pixel - [ ] text display - [ ] fill rect - - [ ] image display \ No newline at end of file + - [ ] image display +- [ ] File system + - [ ] Plan what to do \ No newline at end of file diff --git a/numworks_port/build/Laplace/gpio_helper.o b/numworks_port/build/Laplace/gpio_helper.o index 3a0b9593130df5230eac96cd64a07e52e0efe777..d291bcf6117a92650ea23a68cdafd67ab8a507d3 100644 GIT binary patch delta 312 zcmca$aK&JP0;9=B#l>vuiEJ%Q3=Ay{3=E8ORxmR#@L7YHi3*NDifLjw1HTW5?=tx{ zn`D}cEJQS4pdd33D5wkJ<_R`40@b+j!t^jPG93bn2+4tjdDwskFx&w#=RgeSff`c| zF@^_fOc|dk$SR)AS?pnqj0+|ory@>MZq#*oQB#nc&7CM$}o xGcKF#2_)}KE(DS>lV<|Sl*tEyvuQEV+t3=Ay{3=E8ORxmR#@L7YHQ3{SgifLjw1HTW5Z#Vfh zn`D}uEJQS4pdd33D5wkJ<_R`40@XP1!t^jPG93bn2+4tjIoW^)Fx&w#=RgeSgc?&0 zF@_UrOc|dk$STgwS?pnqjPoWRF2V%m(0CMSvs zPktjNz!)(3ub4Vx(qvU}b;c!=eSzeS$)!LtV)9&Zb=Cwv1_q YP;83;14AQNOh-b1wL^q~VHt=A05#l9Z~y=R diff --git a/numworks_port/build/Laplace/keyboard.o b/numworks_port/build/Laplace/keyboard.o index c52184b921b47e6b53f093e8b83454084295a78e..84570ffd4694a6a632a17e4dd4d8e653bdef95e6 100644 GIT binary patch delta 231 zcmX@1c|vo;HD+xe0Uss?1_?$6hBXWf42*L?JfRREm(f=$2*_q-1`0C>XEHGQO=e^f z75C?@2lAOF7Kj)D6%~Nwk{K9-ChM|@GX_s~Wzh(5WV-+q^#EeVIU9i{h#P`TbCh-j z>&urY2FbXyf{d97l$K-=xdmjZ05QlGXQ=rl3=C3%Ae9D__p-=H81g}^EnyIe1B%8# oRhw`A$Wp+>s?W&EXFK^KyVc|c>}wb|O!no_Wc1ry&JoB10I~5W$p8QV delta 231 zcmX@1c|vo;HD+yh0Uss?1_?$6hBXWf42*L?JfRREm(fEi2*_q-1`0C>XEHE)PG)2g z75Cz;2lAOF7Kj)D6%~Nwk{K9%C+o6^Gx|+-Wzh(*W4izp^#EeVIU9i{h#P`Tvy*lN z>&urY2FbXvf{d97l$K-=xdmjZ05QlG2dMca3=C3%AeDNP_p-=H=<`9WEnyIe1B%8# oRhw@9$Wp+>s>{gAXFK^KyVc|c>}wd;Pxj@|Wc1lw&JoB10G2{0lmGw# diff --git a/numworks_port/build/Laplace/laplace.o b/numworks_port/build/Laplace/laplace.o index ac299558d1d9bdb813dced3616511ecd3827d8c3..699b906f65a7176356a540c00ae2e416cce4287f 100644 GIT binary patch delta 24 gcmdlWyg_)vRYsPH*VeL&va%Z38rp8|VpQV*0Bei~asU7T delta 24 gcmdlWyg_)vRYvBC*VeL&u(BH18rW^_VpQV*0BddsZ~y=R diff --git a/numworks_port/build/Laplace/led.o b/numworks_port/build/Laplace/led.o index 6284c5539b2b0ef408aceed1f119977b0c054081..0fcbf308745087be2750774bdd0ed5cb26e976b4 100644 GIT binary patch delta 207 zcmcbha6w_i8m16qwl@q63=TldI47Htfq{lk$< nS%r<#(=)+{l`)-Fww;wVl9jQPRX!Wakb^N~vp1`=YH|YrkF+8a delta 207 zcmcbha6w_i8m16cwl@q63=TldI47Htfq{lk&# nS%r<#(=)+{l`)-FwuO~7l9jQPRXzjCkb^N~Gd8QUYH|YrV!9!> diff --git a/numworks_port/build/Laplace/time.o b/numworks_port/build/Laplace/time.o index 1c566c504e5209921bc030acf4aa8150ec28e4e0..bc8f70a863612ac4be5d55b4e984dddd28553826 100644 GIT binary patch delta 132 zcmaDL_CRcd31b>Jn;ruLg9Q*X&bbIA*(WdpncU(bKsM9FJPweI0uXa%GBEN;6@x`f z7#O&Ofhu4gdgq6XpN_ delta 132 zcmaDL_CRcd31b>3n;ruLg9Q*X&bbIA*(WdpnVjMwKsM9FJPweI0uXa%GB9#U6@x`f z7#O&Ofhu4gmdY6Wag) diff --git a/numworks_port/build/main.bin b/numworks_port/build/main.bin index 632f485714454486df4580b1082569772c62405b..e7aefdb6bf149dc676765304599d73dc28122c7e 100755 GIT binary patch delta 387 zcmX>*f#vE%mI*2> z)d?97sxpM#q8Wr;tTKdMq$^moB`zY1L|1rd^P`B&u3*q+z5p^u=Qq;>1|Y5R8(D{R z1v9!C^>_^V@e5+emtUxcFrgcQ$BZLTGYc>)t-E}=Q#sI!%_JmI*2>@7WzEY-Uur!M{nMAl6RI;zwXfYh|GZ&K^9F|X%x=F6x!rab3QwXCGX%>Ri(Qd44B0__tP{Otl zSX1PvWoi@A&glfF+foM7)|HBBWu0)VJ{G3*k9L|Gx=h-nlop9;f~}g7s5ZqC+wa&; z=Jt;|x!=9N^Z4E4bM8H#lM~)IC%y49*QhfZZ&6A;J{8@bR8{&u1h*J+A7_IpJwY86PXm z_oi|^Dvz6==ZJj)$$u6zBzG1+OJaPUXEKVVvW=Eq!=~wTX#_`#s4A-b3V~{ zqhLL)QA5{B6^-8j%yWyZpj?E;)DhPtg}>ND_V9j1AaH z#CS4I_7W8Cr{Jsy0#Qhesbk9Xtl%zKDb)kZm(rGkGL~Ic8O!0KBSVK_xF!P+d-oae z>n>d4F|-i`lW(nv3v7vF0eF?3&hQjud5&dx3bH(-?oVK)3pnMZn!FL@Z5DXWU_@V+ z=y%b5x_AZ$v}gk&()FGl2+uOF@QZm=7n_B`J1mO6qCV_<%8JG>rsEgnyC|9+6%Sx- znRCc_G4j;E6miKJSjS;q{9UDY7RInbPD@^d^oU6JDgA&qBRy1d5z=o!>gy5Cull}^ zAPxRXK80dYy9>%5DE0IuY_;+iViK*4rU{43P6*s?3Db|EE>|V}unz-DINP!tk0@0! zAeN1`Bw;R1SNRy0U&rzq9L2iHoe5|}m3#oz9;hslxAN_L3cK3uXgma29iMkoHE%AU zEkt&k&9MRsx%NQYfVhu}wwV_S=-;u3-Q$SHx57tHAA~MbjmSz_%jw8g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g_N>XR)%{gBO431PXGV^ch5PuyXilx+zrtZ&93RFvvM1jF*FUv zV2@=C2GVN8fBTzEr$-{CcBUdia}fG`&wu{D45XF+wbMV^%Zl4G7HQASW~|N#KJ3`1 zL6Wy`PFnK-K=ud$;C^ABL}>xZN-89z_A(EO_$W%B2ja#fl5@+U;%OkbOSjd2=IzCx z(yYcR0ZzWP@DU%ttIWRafb&tlQ_aJy$^|fv zqdZL82rh9`%04T{GwzZ0N|2NbpM~^LbZaJiqW~d1WCq4G4~=r15zwaqG~qQja8JM( z$8*i3{VLvRCb`8At)99ZXzC`N;5eq6tjht=R#>v5dss@OaXi$+?7|5!Tj2MCCpf^d FOkaDqjx+!O delta 413 zcmYjLJxIe~5WVkfuTAm=X-Ku!LW$OcVD>(t3suAOTYPER &= ~(1 << BLUE_LED_PIN); } +/* Set the status of the red led + true -> ON + false -> OFF */ void set_led_red(bool state){ set_output_pin(gpio_b, RED_LED_PIN, state); } +/* Set the status of the green led + true -> ON + false -> OFF */ void set_led_green(bool state){ set_output_pin(gpio_b, GREEN_LED_PIN, state); } +/* Set the status of the blue led + true -> ON + false -> OFF */ void set_led_blue(bool state){ set_output_pin(gpio_b, BLUE_LED_PIN, state); } +/* Set the status of all 3 leds at the same time + true -> ON + false -> OFF */ void set_led_all(bool state){ set_output_pin(gpio_b, RED_LED_PIN, state); set_output_pin(gpio_b, GREEN_LED_PIN, state); diff --git a/numworks_port/src/Laplace/led.h b/numworks_port/src/Laplace/led.h index 2be3080..72f5e0b 100644 --- a/numworks_port/src/Laplace/led.h +++ b/numworks_port/src/Laplace/led.h @@ -15,10 +15,28 @@ #include "../device/stm32f730xx.h" #include "gpio_helper.h" +/* This should be called before accessing any other led related feature + as it sets up all led related peripherals */ void led_init(); + +/* Set the status of the red led + true -> ON + false -> OFF */ void set_led_red(bool state); + +/* Set the status of the green led + true -> ON + false -> OFF */ void set_led_green(bool state); + +/* Set the status of the blue led + true -> ON + false -> OFF */ void set_led_blue(bool state); + +/* Set the status of all 3 leds at the same time + true -> ON + false -> OFF */ void set_led_all(bool state); #endif \ No newline at end of file diff --git a/numworks_port/src/Laplace/time.c b/numworks_port/src/Laplace/time.c index c257d18..3df54ba 100644 --- a/numworks_port/src/Laplace/time.c +++ b/numworks_port/src/Laplace/time.c @@ -1,11 +1,13 @@ #include "time.h" +/* Pause the os for x micro seconds */ void us_wait(uint8_t micro_seconds) { for (volatile uint32_t i=0; i