From 1ef815d5a807f99f635b47959334485cb9b5960f Mon Sep 17 00:00:00 2001 From: ayabusa Date: Fri, 5 Apr 2024 18:15:37 +0200 Subject: [PATCH] implemented the keyboard interface --- numworks_port/README.md | 2 +- numworks_port/build/Laplace/keyboard.o | Bin 4496 -> 5320 bytes numworks_port/build/Laplace/laplace.o | Bin 2440 -> 2480 bytes numworks_port/build/main.bin | Bin 67421 -> 67661 bytes numworks_port/build/main.elf | Bin 278784 -> 279792 bytes numworks_port/build/main.o | Bin 2384 -> 3076 bytes numworks_port/build/start_handler.o | Bin 4600 -> 4620 bytes numworks_port/src/Laplace/keyboard.c | 27 ++++++++++++++++++------- numworks_port/src/Laplace/keyboard.h | 21 ++++++++----------- numworks_port/src/main.c | 16 ++++++++++----- 10 files changed, 40 insertions(+), 26 deletions(-) diff --git a/numworks_port/README.md b/numworks_port/README.md index 8746b7b..e3da20b 100644 --- a/numworks_port/README.md +++ b/numworks_port/README.md @@ -12,7 +12,7 @@ This is a bare metal os attempt on the numworks n0110 ### Zeta bare minimum - [x] Working thing - [x] Led interface -- [ ] Keyboard interface +- [x] Keyboard interface - [ ] Set clock and all - [ ] adapt ms_wait() and us_wait() - [ ] Screen interface diff --git a/numworks_port/build/Laplace/keyboard.o b/numworks_port/build/Laplace/keyboard.o index 224bddf920496e6983ffe1f677e14707bb93e6ac..c52184b921b47e6b53f093e8b83454084295a78e 100644 GIT binary patch literal 5320 zcmbVQTWlQF8UD}Aj=lDJ*Iuukcx^80I4LG!cYR54ZceJu#wpcpm%{+ToD zNlGQuBh7y2|NhJQ&t?8I_G3p*riBpXHbKL*DG{9y+Zt`R4a3w+J#_xn3op}4G_;x> zx|}#MP}Q_@4qH)uN^mXV*NV46a0JGpyb{0+7SD_>;c3+ zkZnQi1Bm^{b$W~5>X>*l{lF)_)!I=aWs3aD)cMyQ$9&ZE#=|tUk!`!YQCPnuwnftv zyZZ6JuWld)Sj5;sj1Sj0R;a04v@PhZF2p?lrV|G-Od49t9=^PWIDKi3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wK%90 zD5{B+%|hAzcqQ12?*z{{sdGy8tJY^!%Rwb_Dz_USv(`&#pcT3UyF%-5DD<{dJ2XDw zWhbk(%E9W`Xtq+tQ21$_3crt?k-Y-&cw|=xpLWrwL!_#XYi{4h=KUG6xJf0581>13KL^x4)baGfLA$I_Qr-M#;0JiHau0P1OPwL45t8=7+a}T zs1)X#HQvie_s*Ru!_g0uoA$Psw(VNx|fkn4%3#*iFb@)M?-?!O$j7Sb& zcJs=j`y0TsWX;phb01!H^YTvv|8fiRi74h01v8}pE(+X}$jOl?P9zHIM=Hz0(}}$N z#lo)=1(^=v4T3{abdv=+AHv>bA^Hu~JxlMQ{|`8LIGIsHRKpCup3JA`>5|UzM)dIa F_8%84?eG8q diff --git a/numworks_port/build/Laplace/laplace.o b/numworks_port/build/Laplace/laplace.o index 2cb6cb80ea24d2d9372472c3addf3fe62dce1fc4..ac299558d1d9bdb813dced3616511ecd3827d8c3 100644 GIT binary patch delta 401 zcmX|+Jxc>Y5QcXqx3_yiEli=&CNaU&!e9!uu~8%9Uxw6gIB*g2boTiEB>;hlkcKQO{d%SB@0U^)pRRG7E?|^CF-}`p7>=?%Z?{Iba5irqBATsxL9M}q4Y9Kt z1Xa0hLei_ky zs~u1g69;P)h+^b008vcr?jVYVofo8pgZ&JUVrF5@%qsy20yzvUTY&^4GaHBvGMRA> z1LMTU8{|s!iZj#mQd1N_YIE}Q(iM zEIhe^U4T`9m4TsS@>F(Z)+<1jPGIp1>;jBplOM9HGtQXI$)V0@HrWtJu9zIjq0ZV0 z^nAwTRt{yRw@i~)ai}q>Ouh(|+%WkkkPMit$f?fQGT9SIE}2}&sm^);X#6sep#VxK BT(STF diff --git a/numworks_port/build/main.bin b/numworks_port/build/main.bin index db693a414c4fbc8c92d9422b1545feae7fd7e3bb..632f485714454486df4580b1082569772c62405b 100755 GIT binary patch delta 610 zcmY+APiWI{6vyAozqM3ZT!l65kZPQWMMQ!qGL+03S0;EBcM0erC#mcb&0$5oI)XBC zkcr?~rqwzyj9wJRV07*<2W60(crpj2^OvsmrGcq|4|(tVd%ySlzPB?kth<7HT=+4h zyYH~LJzSUXhI0?!z!HRu?8Z-KLU=R6B7}@Vc!^ywL3PaW;DMDjW*}R>Xl2U} zYobHwT;l_-;m9vecahiKgM>ni^WIYq=MODV{EB!>G>P@)vpk;0vByczd!R;UI*6=x z9gisn6#E^q=e-m#KiAp2Lw>m5(3H=w7`2sJBfdlRv!MFs<-n&qIiufc_2b#kkn46` zF*xe5+9S7B=8RQ*D^t$dg-WuOOc^!K$XDY^=AgD+KfHeu>&%h==C?Fv=c^HwMYG95 zBsFh1*0agAwoeQ4%{1jc((@l?53QIAM_sp*2v?u!Gl-xUX0QnK4!mL)ua+Q}|7 kQ-d9Srl&s<*U5%0Kyj7gv;;7zUnyTTu1!^dJ{bW20036w{Qv*} delta 333 zcmX>*f#q%=%LEk`Zg$5Bn;8{u@NW{x`yk4&p5cSeFaIyU5*R)_|HY`l@S*e9zp0NI z6@_*(I8I<@be!M|#M6QJA>(#2M#fW&LQ|O>CoBZwwLrWRh>tQ&|HQ=DCuqv-IKdf+ z1A#amh;z43WMdt|9=mh zewLMSE@R#Fel|u~c2-3RxBuUBKpbVpC=ew+{S+G`kDSL}4sYp-UzHFAj(=IfJO;3G ttH0a7uraDJs?Ykvupi>0qs$BnM}Rm67+hC?^a&v5WMg1p5MW?n1OQ<_eoz1a diff --git a/numworks_port/build/main.elf b/numworks_port/build/main.elf index efdedeaaac0a7789fc95d172a6ae339bc47c9825..e8a3275eed6d41a53a8dcc5bf2dba654a365dc8a 100755 GIT binary patch delta 8134 zcmb7J3v?XSdA>7qXLe_IXSJ)9tX)YKtB2oaB|pHzQ6#M~@&n^yFvQ2uNPbJTUbbYA zG3hGUyaI700*sr;973UoL$NVW1Y@@ArTI{r~?y=iaOS8^R}U4G%kOTbfl08cL8CxyV13iNB_cWTP8rr;+(MOcrQ zEAO3tyhe%TJrz90riV>?=vIXhZ*w4OKP zt=}L1p#O=T@T)bQy6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I0jnTqg25%9ljeiM%Yo yI065_Ws3;Y0O*tZM8I#N9232mCt^U$?h6kmDI;eQ;3Az{)cjZCmk{8Y%6|* z{bNt6E54`-{$cggKVZG2DLCu*@)1G3B>`eKORCDfO?{RIkB)=WF*ew6JN*Fb+w56f zhwTkTM#y7#f7c$0kX}9Xi^pL-)k4}In3RJhxBYoSF>?s0q238Z6j5?#mOi*k&4ECfaq{h}DBn;H~>*un6j z@PTkKek3)VYTpZ#q*1C?r`yrsM{uXAGxhYP%Ej{e%DKsOxl(VhswJZ_M@iBa;Or&2LQls6Tq%)U@cUdEeGdFlld}o<}=8Aued+rZ(aj<1VVxI7am>UZr{s t?>l+(v?;_xTye4zEd1;A!w{z2JT&nr)i+qCx{e;zceq6LIsR}H{{h1#evJSC delta 827 zcmX|;PiPZS5XRrUyxq5H{_L)+P10T>**1t#QG!}+Rq7w8h!;_N5GmD)w+1QRN)WWC z6pe%8Az~>C9xYoD@lre}MLh%&1TQKUk6Kjl=*;fJJ>MX%pjkoLzY)NYeLs=&o;AkF~ z`f;*+B3{-%N!f3xhrD|;UUpuQ(%jp#?7OjVwvG$B_Rd_LmJ;4Br~QXVT4Ijb1kd`f0r9 z7a+ivuT;ibeM6?4XzH{|!^g@;B*hA$1fhMx_8L{qtGfP45M{~A8xeRnJL;i_A) zL{^A#T&Hd{CB$z8H^7?b!EPM!sxXdIRL|f%)yw$Qt6HZlAr|qASCM}-+WsKaaGPI+ a2A-z+1ZSy!!$(w?@tt3_7IH$YaOgkVZFb54 diff --git a/numworks_port/src/Laplace/keyboard.c b/numworks_port/src/Laplace/keyboard.c index 46f2e13..ced4e49 100644 --- a/numworks_port/src/Laplace/keyboard.c +++ b/numworks_port/src/Laplace/keyboard.c @@ -41,6 +41,7 @@ const uint8_t number_of_rows = 9; const uint8_t number_of_columns = 6; +const char row_list[9] = {'B', 'A', 'C', 'D', 'E', 'F', 'G', 'H', 'I'}; void keyboard_init(){ for (int i = 0; i < number_of_rows; i++){ @@ -57,12 +58,6 @@ void keyboard_init(){ } } -bool keyboard_scan(){ - set_output_pin(GPIO_A, 6, true); - bool key_state = read_input_pin(GPIO_C, 3); - return key_state; - // A LOT TODO -} void activate_row(uint8_t row_nb){ // set all row to 0 and then reenable selected row @@ -71,4 +66,22 @@ void activate_row(uint8_t row_nb){ } set_output_pin(GPIO_A, row_nb, false); us_wait(100); -} \ No newline at end of file +} + +struct button* keyboard_scan(){ + static struct button result_button_list[54] = {}; + uint8_t i = 0; + for(int r = 0; r < number_of_rows; r++){ + activate_row(r); + + for(int c = 0; c < number_of_columns; c++){ + bool key_state = read_input_pin(GPIO_C, c); + result_button_list[i].row = row_list[r]; + result_button_list[i].column = c + 1; + result_button_list[i].state = key_state; + i++; + } + } + return result_button_list; +} + diff --git a/numworks_port/src/Laplace/keyboard.h b/numworks_port/src/Laplace/keyboard.h index 32d7b97..a06b45b 100644 --- a/numworks_port/src/Laplace/keyboard.h +++ b/numworks_port/src/Laplace/keyboard.h @@ -7,21 +7,16 @@ #ifndef KEYBOARD_H #define KEYBOARD_H -enum PIN_ROW { - A = 1, - B = 0, - C = 2, - D = 3, - E = 4, - F = 5, - G = 6, - H = 7, - I = 8 -}; - #include "gpio_helper.h" +struct button{ + uint8_t column; + char row; + bool state; +}; + + void keyboard_init(); -bool keyboard_scan(); +struct button* keyboard_scan(); #endif \ No newline at end of file diff --git a/numworks_port/src/main.c b/numworks_port/src/main.c index 81f4906..9bf2e4e 100644 --- a/numworks_port/src/main.c +++ b/numworks_port/src/main.c @@ -8,11 +8,17 @@ void main_entry(){ set_led_green(true); while (1) { - /*if(keyboard_scan()){ - set_led_green(true); - }else{ - set_led_green(false); - }*/ + struct button * keyboard_state = keyboard_scan(); + for(int i =0; i < 54; i++){ + if(keyboard_state[i].column == 4 && keyboard_state[i].row == 'H'){ + if(keyboard_state[i].state){ + set_led_green(true); + }else{ + set_led_green(false); + } + break; + } + } } } \ No newline at end of file