diff options
| author | siggie0815 <dev.siggie@gmail.com> | 2020-12-30 04:18:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-29 19:18:16 -0800 |
| commit | 1b3504e3292db2074b83944c32b67a7c88bb4f51 (patch) | |
| tree | d6d857822fd9c9fe036faa829d1bf936aa1850e6 | |
| parent | 9410b15ac98d0a67d7eb851c074078c75ac420f2 (diff) | |
| download | qmk_firmware-1b3504e3292db2074b83944c32b67a7c88bb4f51.tar.gz qmk_firmware-1b3504e3292db2074b83944c32b67a7c88bb4f51.zip | |
Update ADB impelemtation in TMK Core (#11168)
* Update ADB impelmentation in tmk_core to recent version.
Pcked from tmk_keyboard repository revision: 48d696443857512d45f9a7329e0dd0a76345860f
* Restore convenient ADB functions used in QMK port.
* Do cformat.
| -rw-r--r-- | tmk_core/protocol/adb.c | 256 | ||||
| -rw-r--r-- | tmk_core/protocol/adb.h | 58 |
2 files changed, 229 insertions, 85 deletions
diff --git a/tmk_core/protocol/adb.c b/tmk_core/protocol/adb.c index a23c91961..367f1b09f 100644 --- a/tmk_core/protocol/adb.c +++ b/tmk_core/protocol/adb.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright 2011 Jun WAKO <wakojun@gmail.com> | 2 | Copyright 2011-19 Jun WAKO <wakojun@gmail.com> |
| 3 | Copyright 2013 Shay Green <gblargg@gmail.com> | 3 | Copyright 2013 Shay Green <gblargg@gmail.com> |
| 4 | 4 | ||
| 5 | This software is licensed with a Modified BSD License. | 5 | This software is licensed with a Modified BSD License. |
| @@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. | |||
| 41 | #include <avr/io.h> | 41 | #include <avr/io.h> |
| 42 | #include <avr/interrupt.h> | 42 | #include <avr/interrupt.h> |
| 43 | #include "adb.h" | 43 | #include "adb.h" |
| 44 | #include "print.h" | ||
| 44 | 45 | ||
| 45 | // GCC doesn't inline functions normally | 46 | // GCC doesn't inline functions normally |
| 46 | #define data_lo() (ADB_DDR |= (1 << ADB_DATA_BIT)) | 47 | #define data_lo() (ADB_DDR |= (1 << ADB_DATA_BIT)) |
| @@ -59,7 +60,6 @@ static inline void place_bit1(void); | |||
| 59 | static inline void send_byte(uint8_t data); | 60 | static inline void send_byte(uint8_t data); |
| 60 | static inline uint16_t wait_data_lo(uint16_t us); | 61 | static inline uint16_t wait_data_lo(uint16_t us); |
| 61 | static inline uint16_t wait_data_hi(uint16_t us); | 62 | static inline uint16_t wait_data_hi(uint16_t us); |
| 62 | static inline uint16_t adb_host_dev_recv(uint8_t device); | ||
| 63 | 63 | ||
| 64 | void adb_host_init(void) { | 64 | void adb_host_init(void) { |
| 65 | ADB_PORT &= ~(1 << ADB_DATA_BIT); | 65 | ADB_PORT &= ~(1 << ADB_DATA_BIT); |
| @@ -81,119 +81,164 @@ bool adb_host_psw(void) { return psw_in(); } | |||
| 81 | * <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919> | 81 | * <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919> |
| 82 | * <http://geekhack.org/index.php?topic=14290.msg1070139#msg1070139> | 82 | * <http://geekhack.org/index.php?topic=14290.msg1070139#msg1070139> |
| 83 | */ | 83 | */ |
| 84 | 84 | uint16_t adb_host_kbd_recv(void) { return adb_host_talk(ADB_ADDR_KEYBOARD, ADB_REG_0); } | |
| 85 | // ADB Bit Cells | ||
| 86 | // | ||
| 87 | // bit cell time: 70-130us | ||
| 88 | // low part of bit0: 60-70% of bit cell | ||
| 89 | // low part of bit1: 30-40% of bit cell | ||
| 90 | // | ||
| 91 | // bit cell time 70us 130us | ||
| 92 | // -------------------------------------------- | ||
| 93 | // low part of bit0 42-49 78-91 | ||
| 94 | // high part of bit0 21-28 39-52 | ||
| 95 | // low part of bit1 21-28 39-52 | ||
| 96 | // high part of bit1 42-49 78-91 | ||
| 97 | // | ||
| 98 | // | ||
| 99 | // bit0: | ||
| 100 | // 70us bit cell: | ||
| 101 | // ____________~~~~~~ | ||
| 102 | // 42-49 21-28 | ||
| 103 | // | ||
| 104 | // 130us bit cell: | ||
| 105 | // ____________~~~~~~ | ||
| 106 | // 78-91 39-52 | ||
| 107 | // | ||
| 108 | // bit1: | ||
| 109 | // 70us bit cell: | ||
| 110 | // ______~~~~~~~~~~~~ | ||
| 111 | // 21-28 42-49 | ||
| 112 | // | ||
| 113 | // 130us bit cell: | ||
| 114 | // ______~~~~~~~~~~~~ | ||
| 115 | // 39-52 78-91 | ||
| 116 | // | ||
| 117 | // [from Apple IIgs Hardware Reference Second Edition] | ||
| 118 | |||
| 119 | enum { ADDR_KEYB = 0x20, ADDR_MOUSE = 0x30 }; | ||
| 120 | |||
| 121 | uint16_t adb_host_kbd_recv(void) { return adb_host_dev_recv(ADDR_KEYB); } | ||
| 122 | 85 | ||
| 123 | #ifdef ADB_MOUSE_ENABLE | 86 | #ifdef ADB_MOUSE_ENABLE |
| 124 | void adb_mouse_init(void) { return; } | 87 | __attribute__((weak)) void adb_mouse_init(void) { return; } |
| 88 | |||
| 89 | __attribute__((weak)) void adb_mouse_task(void) { return; } | ||
| 125 | 90 | ||
| 126 | uint16_t adb_host_mouse_recv(void) { return adb_host_dev_recv(ADDR_MOUSE); } | 91 | uint16_t adb_host_mouse_recv(void) { return adb_host_talk(ADB_ADDR_MOUSE, ADB_REG_0); } |
| 127 | #endif | 92 | #endif |
| 128 | 93 | ||
| 129 | static inline uint16_t adb_host_dev_recv(uint8_t device) { | 94 | // This sends Talk command to read data from register and returns length of the data. |
| 130 | uint16_t data = 0; | 95 | uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len) { |
| 96 | for (int8_t i = 0; i < len; i++) buf[i] = 0; | ||
| 97 | |||
| 131 | cli(); | 98 | cli(); |
| 132 | attention(); | 99 | attention(); |
| 133 | send_byte(device | 0x0C); // Addr:Keyboard(0010)/Mouse(0011), Cmd:Talk(11), Register0(00) | 100 | send_byte((addr << 4) | ADB_CMD_TALK | reg); |
| 134 | place_bit0(); // Stopbit(0) | 101 | place_bit0(); // Stopbit(0) |
| 102 | // TODO: Service Request(Srq): | ||
| 103 | // Device holds low part of comannd stopbit for 140-260us | ||
| 104 | // | ||
| 105 | // Command: | ||
| 106 | // ......._ ______________________ ___ ............_ ------- | ||
| 107 | // | | | | | | | | ||
| 108 | // Command | | | | | Data bytes | | | ||
| 109 | // ........|___| | 140-260 |__| |_............|___| | ||
| 110 | // |stop0 | Tlt Stop-to-Start |start1| |stop0 | | ||
| 111 | // | ||
| 112 | // Command without data: | ||
| 113 | // ......._ __________________________ | ||
| 114 | // | | | ||
| 115 | // Command | | | ||
| 116 | // ........|___| | 140-260 | | ||
| 117 | // |stop0 | Tlt Stop-to-Start | | ||
| 118 | // | ||
| 119 | // Service Request: | ||
| 120 | // ......._ ______ ___ ............_ ------- | ||
| 121 | // | 140-260 | | | | | | | ||
| 122 | // Command | Service Request | | | | Data bytes | | | ||
| 123 | // ........|___________________| |__| |_............|___| | ||
| 124 | // |stop0 | |start1| |stop0 | | ||
| 125 | // ......._ __________ | ||
| 126 | // | 140-260 | | ||
| 127 | // Command | Service Request | | ||
| 128 | // ........|___________________| | ||
| 129 | // |stop0 | | ||
| 130 | // This can be happened? | ||
| 131 | // ......._ ______________________ ___ ............_ ----- | ||
| 132 | // | | | | | | 140-260 | | ||
| 133 | // Command | | | | | Data bytes | Service Request | | ||
| 134 | // ........|___| | 140-260 |__| |_............|_________________| | ||
| 135 | // |stop0 | Tlt Stop-to-Start |start1| |stop0 | | ||
| 136 | // | ||
| 137 | // "Service requests are issued by the devices during a very specific time at the | ||
| 138 | // end of the reception of the command packet. | ||
| 139 | // If a device in need of service issues a service request, it must do so within | ||
| 140 | // the 65 µs of the Stop Bit’s low time and maintain the line low for a total of 300 µs." | ||
| 141 | // | ||
| 142 | // "A device sends a Service Request signal by holding the bus low during the low | ||
| 143 | // portion of the stop bit of any command or data transaction. The device must lengthen | ||
| 144 | // the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15." | ||
| 145 | // http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf | ||
| 135 | if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored | 146 | if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored |
| 147 | xprintf("R"); | ||
| 136 | sei(); | 148 | sei(); |
| 137 | return -30; // something wrong | 149 | return 0; |
| 138 | } | 150 | } |
| 139 | if (!wait_data_lo(500)) { // Tlt/Stop to Start(140-260us) | 151 | if (!wait_data_lo(500)) { // Tlt/Stop to Start(140-260us) |
| 140 | sei(); | 152 | sei(); |
| 141 | return 0; // No data to send | 153 | return 0; // No data from device(not error); |
| 154 | } | ||
| 155 | |||
| 156 | // start bit(1) | ||
| 157 | if (!wait_data_hi(40)) { | ||
| 158 | xprintf("S"); | ||
| 159 | sei(); | ||
| 160 | return 0; | ||
| 161 | } | ||
| 162 | if (!wait_data_lo(100)) { | ||
| 163 | xprintf("s"); | ||
| 164 | sei(); | ||
| 165 | return 0; | ||
| 142 | } | 166 | } |
| 143 | 167 | ||
| 144 | uint8_t n = 17; // start bit + 16 data bits | 168 | uint8_t n = 0; // bit count |
| 145 | do { | 169 | do { |
| 170 | // | ||
| 171 | // |<- bit_cell_max(130) ->| | ||
| 172 | // | |<- lo ->| | ||
| 173 | // | | |<-hi->| | ||
| 174 | // _______ | ||
| 175 | // | | | | ||
| 176 | // | 130-lo | lo-hi | | ||
| 177 | // |________| | | ||
| 178 | // | ||
| 146 | uint8_t lo = (uint8_t)wait_data_hi(130); | 179 | uint8_t lo = (uint8_t)wait_data_hi(130); |
| 147 | if (!lo) goto error; | 180 | if (!lo) goto error; // no more bit or after stop bit |
| 148 | 181 | ||
| 149 | uint8_t hi = (uint8_t)wait_data_lo(lo); | 182 | uint8_t hi = (uint8_t)wait_data_lo(lo); |
| 150 | if (!hi) goto error; | 183 | if (!hi) goto error; // stop bit extedned by Srq? |
| 151 | 184 | ||
| 152 | hi = lo - hi; | 185 | if (n / 8 >= len) continue; // can't store in buf |
| 153 | lo = 130 - lo; | ||
| 154 | 186 | ||
| 155 | data <<= 1; | 187 | buf[n / 8] <<= 1; |
| 156 | if (lo < hi) { | 188 | if ((130 - lo) < (lo - hi)) { |
| 157 | data |= 1; | 189 | buf[n / 8] |= 1; |
| 158 | } else if (n == 17) { | ||
| 159 | sei(); | ||
| 160 | return -20; | ||
| 161 | } | 190 | } |
| 162 | } while (--n); | 191 | } while (++n); |
| 163 | |||
| 164 | // Stop bit can't be checked normally since it could have service request lenghtening | ||
| 165 | // and its high state never goes low. | ||
| 166 | if (!wait_data_hi(351) || wait_data_lo(91)) { | ||
| 167 | sei(); | ||
| 168 | return -21; | ||
| 169 | } | ||
| 170 | sei(); | ||
| 171 | return data; | ||
| 172 | 192 | ||
| 173 | error: | 193 | error: |
| 174 | sei(); | 194 | sei(); |
| 175 | return -n; | 195 | return n / 8; |
| 176 | } | 196 | } |
| 177 | 197 | ||
| 178 | void adb_host_listen(uint8_t cmd, uint8_t data_h, uint8_t data_l) { | 198 | uint16_t adb_host_talk(uint8_t addr, uint8_t reg) { |
| 199 | uint8_t len; | ||
| 200 | uint8_t buf[8]; | ||
| 201 | len = adb_host_talk_buf(addr, reg, buf, 8); | ||
| 202 | if (len != 2) return 0; | ||
| 203 | return (buf[0] << 8 | buf[1]); | ||
| 204 | } | ||
| 205 | |||
| 206 | void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len) { | ||
| 179 | cli(); | 207 | cli(); |
| 180 | attention(); | 208 | attention(); |
| 181 | send_byte(cmd); | 209 | send_byte((addr << 4) | ADB_CMD_LISTEN | reg); |
| 182 | place_bit0(); // Stopbit(0) | 210 | place_bit0(); // Stopbit(0) |
| 211 | // TODO: Service Request | ||
| 183 | _delay_us(200); // Tlt/Stop to Start | 212 | _delay_us(200); // Tlt/Stop to Start |
| 184 | place_bit1(); // Startbit(1) | 213 | place_bit1(); // Startbit(1) |
| 185 | send_byte(data_h); | 214 | for (int8_t i = 0; i < len; i++) { |
| 186 | send_byte(data_l); | 215 | send_byte(buf[i]); |
| 216 | // xprintf("%02X ", buf[i]); | ||
| 217 | } | ||
| 187 | place_bit0(); // Stopbit(0); | 218 | place_bit0(); // Stopbit(0); |
| 188 | sei(); | 219 | sei(); |
| 189 | } | 220 | } |
| 190 | 221 | ||
| 222 | void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l) { | ||
| 223 | uint8_t buf[2] = {data_h, data_l}; | ||
| 224 | adb_host_listen_buf(addr, reg, buf, 2); | ||
| 225 | } | ||
| 226 | |||
| 227 | void adb_host_flush(uint8_t addr) { | ||
| 228 | cli(); | ||
| 229 | attention(); | ||
| 230 | send_byte((addr << 4) | ADB_CMD_FLUSH); | ||
| 231 | place_bit0(); // Stopbit(0) | ||
| 232 | _delay_us(200); // Tlt/Stop to Start | ||
| 233 | sei(); | ||
| 234 | } | ||
| 235 | |||
| 191 | // send state of LEDs | 236 | // send state of LEDs |
| 192 | void adb_host_kbd_led(uint8_t led) { | 237 | void adb_host_kbd_led(uint8_t led) { |
| 193 | // Addr:Keyboard(0010), Cmd:Listen(10), Register2(10) | 238 | // Listen Register2 |
| 194 | // send upper byte (not used) | 239 | // upper byte: not used |
| 195 | // send lower byte (bit2: ScrollLock, bit1: CapsLock, bit0: | 240 | // lower byte: bit2=ScrollLock, bit1=CapsLock, bit0=NumLock |
| 196 | adb_host_listen(0x2A, 0, led & 0x07); | 241 | adb_host_listen(ADB_ADDR_KEYBOARD, ADB_REG_2, 0, led & 0x07); |
| 197 | } | 242 | } |
| 198 | 243 | ||
| 199 | #ifdef ADB_PSW_BIT | 244 | #ifdef ADB_PSW_BIT |
| @@ -327,7 +372,7 @@ Commands | |||
| 327 | 372 | ||
| 328 | bits commands | 373 | bits commands |
| 329 | ------------------------------------------------------ | 374 | ------------------------------------------------------ |
| 330 | - - - - 0 0 0 0 Send Request(reset all devices) | 375 | - - - - 0 0 0 0 Send Reset(reset all devices) |
| 331 | A A A A 0 0 0 1 Flush(reset a device) | 376 | A A A A 0 0 0 1 Flush(reset a device) |
| 332 | - - - - 0 0 1 0 Reserved | 377 | - - - - 0 0 1 0 Reserved |
| 333 | - - - - 0 0 1 1 Reserved | 378 | - - - - 0 0 1 1 Reserved |
| @@ -435,5 +480,56 @@ Keyboard LEDs & state of keys(Register2) | |||
| 435 | | +----------------------------- Delete | 480 | | +----------------------------- Delete |
| 436 | +------------------------------- Reserved | 481 | +------------------------------- Reserved |
| 437 | 482 | ||
| 483 | Address, Handler ID and bits(Register3) | ||
| 484 | 1514131211 . . 8 7 . . . . . . 0 | ||
| 485 | | | | | | | | | | | | | | | | | | ||
| 486 | | | | | | | | | +-+-+-+-+-+-+-+- Handler ID | ||
| 487 | | | | | +-+-+-+----------------- Address | ||
| 488 | | | | +------------------------- 0 | ||
| 489 | | | +--------------------------- Service request enable(1 = enabled) | ||
| 490 | | +----------------------------- Exceptional event(alwyas 1 if not used) | ||
| 491 | +------------------------------- 0 | ||
| 492 | |||
| 493 | ADB Bit Cells | ||
| 494 | bit cell time: 70-130us | ||
| 495 | low part of bit0: 60-70% of bit cell | ||
| 496 | low part of bit1: 30-40% of bit cell | ||
| 497 | |||
| 498 | bit cell time 70us 130us | ||
| 499 | -------------------------------------------- | ||
| 500 | low part of bit0 42-49 78-91 | ||
| 501 | high part of bit0 21-28 39-52 | ||
| 502 | low part of bit1 21-28 39-52 | ||
| 503 | high part of bit1 42-49 78-91 | ||
| 504 | |||
| 505 | |||
| 506 | bit0: | ||
| 507 | 70us bit cell: | ||
| 508 | ____________~~~~~~ | ||
| 509 | 42-49 21-28 | ||
| 510 | |||
| 511 | 130us bit cell: | ||
| 512 | ____________~~~~~~ | ||
| 513 | 78-91 39-52 | ||
| 514 | |||
| 515 | bit1: | ||
| 516 | 70us bit cell: | ||
| 517 | ______~~~~~~~~~~~~ | ||
| 518 | 21-28 42-49 | ||
| 519 | |||
| 520 | 130us bit cell: | ||
| 521 | ______~~~~~~~~~~~~ | ||
| 522 | 39-52 78-91 | ||
| 523 | |||
| 524 | [from Apple IIgs Hardware Reference Second Edition] | ||
| 525 | |||
| 526 | Keyboard Handle ID | ||
| 527 | Apple Standard Keyboard M0116: 0x01 | ||
| 528 | Apple Extended Keyboard M0115: 0x02 | ||
| 529 | Apple Extended Keyboard II M3501: 0x02 | ||
| 530 | Apple Adjustable Keybaord: 0x10 | ||
| 531 | |||
| 532 | http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c?v=4.4#L802 | ||
| 533 | |||
| 438 | END_OF_ADB | 534 | END_OF_ADB |
| 439 | */ | 535 | */ |
diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h index 34cbcf769..fe8becc2d 100644 --- a/tmk_core/protocol/adb.h +++ b/tmk_core/protocol/adb.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright 2011 Jun WAKO <wakojun@gmail.com> | 2 | Copyright 2011-19 Jun WAKO <wakojun@gmail.com> |
| 3 | 3 | ||
| 4 | This software is licensed with a Modified BSD License. | 4 | This software is licensed with a Modified BSD License. |
| 5 | All of this is supposed to be Free Software, Open Source, DFSG-free, | 5 | All of this is supposed to be Free Software, Open Source, DFSG-free, |
| @@ -47,12 +47,60 @@ POSSIBILITY OF SUCH DAMAGE. | |||
| 47 | #define ADB_POWER 0x7F | 47 | #define ADB_POWER 0x7F |
| 48 | #define ADB_CAPS 0x39 | 48 | #define ADB_CAPS 0x39 |
| 49 | 49 | ||
| 50 | /* ADB commands */ | ||
| 51 | // Default Address | ||
| 52 | #define ADB_ADDR_0 0 | ||
| 53 | #define ADB_ADDR_DONGLE 1 | ||
| 54 | #define ADB_ADDR_KEYBOARD 2 | ||
| 55 | #define ADB_ADDR_MOUSE 3 | ||
| 56 | #define ADB_ADDR_TABLET 4 | ||
| 57 | #define ADB_ADDR_APPLIANCE 7 | ||
| 58 | #define ADB_ADDR_8 8 | ||
| 59 | #define ADB_ADDR_9 9 | ||
| 60 | #define ADB_ADDR_10 10 | ||
| 61 | #define ADB_ADDR_11 11 | ||
| 62 | #define ADB_ADDR_12 12 | ||
| 63 | #define ADB_ADDR_13 13 | ||
| 64 | #define ADB_ADDR_14 14 | ||
| 65 | #define ADB_ADDR_15 15 | ||
| 66 | // for temporary purpose, do not use for polling | ||
| 67 | #define ADB_ADDR_TMP 15 | ||
| 68 | #define ADB_ADDR_MOUSE_POLL 10 | ||
| 69 | // Command Type | ||
| 70 | #define ADB_CMD_RESET 0 | ||
| 71 | #define ADB_CMD_FLUSH 1 | ||
| 72 | #define ADB_CMD_LISTEN 8 | ||
| 73 | #define ADB_CMD_TALK 12 | ||
| 74 | // Register | ||
| 75 | #define ADB_REG_0 0 | ||
| 76 | #define ADB_REG_1 1 | ||
| 77 | #define ADB_REG_2 2 | ||
| 78 | #define ADB_REG_3 3 | ||
| 79 | |||
| 80 | /* ADB keyboard handler id */ | ||
| 81 | #define ADB_HANDLER_STD 0x01 /* IIGS, M0116 */ | ||
| 82 | #define ADB_HANDLER_AEK 0x02 /* M0115, M3501 */ | ||
| 83 | #define ADB_HANDLER_AEK_RMOD 0x03 /* M0115, M3501, alternate mode enableing right modifiers */ | ||
| 84 | #define ADB_HANDLER_STD_ISO 0x04 /* M0118, ISO swapping keys */ | ||
| 85 | #define ADB_HANDLER_AEK_ISO 0x05 /* M0115, M3501, ISO swapping keys */ | ||
| 86 | #define ADB_HANDLER_M1242_ANSI 0x10 /* Adjustable keyboard */ | ||
| 87 | #define ADB_HANDLER_CLASSIC1_MOUSE 0x01 | ||
| 88 | #define ADB_HANDLER_CLASSIC2_MOUSE 0x02 | ||
| 89 | #define ADB_HANDLER_EXTENDED_MOUSE 0x04 | ||
| 90 | #define ADB_HANDLER_TURBO_MOUSE 0x32 | ||
| 91 | |||
| 50 | // ADB host | 92 | // ADB host |
| 51 | void adb_host_init(void); | 93 | void adb_host_init(void); |
| 52 | bool adb_host_psw(void); | 94 | bool adb_host_psw(void); |
| 95 | uint16_t adb_host_talk(uint8_t addr, uint8_t reg); | ||
| 96 | uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len); | ||
| 97 | void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l); | ||
| 98 | void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len); | ||
| 99 | void adb_host_flush(uint8_t addr); | ||
| 100 | void adb_host_kbd_led(uint8_t led); | ||
| 53 | uint16_t adb_host_kbd_recv(void); | 101 | uint16_t adb_host_kbd_recv(void); |
| 54 | uint16_t adb_host_mouse_recv(void); | 102 | uint16_t adb_host_mouse_recv(void); |
| 55 | void adb_host_listen(uint8_t cmd, uint8_t data_h, uint8_t data_l); | 103 | |
| 56 | void adb_host_kbd_led(uint8_t led); | 104 | // ADB Mouse |
| 57 | void adb_mouse_task(void); | 105 | void adb_mouse_task(void); |
| 58 | void adb_mouse_init(void); | 106 | void adb_mouse_init(void); |
