Merge branch 'adb_address_resolution'
This commit is contained in:
commit
4923f09377
6 changed files with 3563 additions and 3434 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -47,9 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// https://github.com/tmk/tmk_keyboard/issues/724
|
// https://github.com/tmk/tmk_keyboard/issues/724
|
||||||
#define ADB_MOUSE_2ND_BUTTON_QUIRK
|
#define ADB_MOUSE_2ND_BUTTON_QUIRK
|
||||||
|
|
||||||
// Scan unsupported devices with register0 when SRQ is asserted
|
|
||||||
#define ADB_SRQ_SCAN_REG0
|
|
||||||
|
|
||||||
|
|
||||||
/* ADB port setting */
|
/* ADB port setting */
|
||||||
#define ADB_PORT PORTD
|
#define ADB_PORT PORTD
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -164,7 +164,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
|
||||||
// the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15."
|
// the stop by a minimum of 140 J.lS beyond its normal duration, as shown in Figure 8-15."
|
||||||
// http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf
|
// http://ww1.microchip.com/downloads/en/AppNotes/00591b.pdf
|
||||||
if (!data_in()) { adb_srq = true; } else { adb_srq = false; }
|
if (!data_in()) { adb_srq = true; } else { adb_srq = false; }
|
||||||
if (!wait_data_hi(500)) { // Service Request(310us Adjustable Keyboard): just ignored
|
if (!wait_data_hi(500)) { // wait for end of SRQ:(310us Adjustable Keyboard)
|
||||||
xprintf("R");
|
xprintf("R");
|
||||||
sei();
|
sei();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -198,12 +198,14 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
|
||||||
// |________| |
|
// |________| |
|
||||||
//
|
//
|
||||||
uint8_t lo = (uint8_t) wait_data_hi(130);
|
uint8_t lo = (uint8_t) wait_data_hi(130);
|
||||||
if (!lo)
|
if (!lo) {
|
||||||
goto error; // no more bit or after stop bit
|
goto error; // SRQ?
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t hi = (uint8_t) wait_data_lo(lo);
|
uint8_t hi = (uint8_t) wait_data_lo(lo);
|
||||||
if (!hi)
|
if (!hi) {
|
||||||
goto error; // stop bit extedned by Srq?
|
goto error; // stop bit
|
||||||
|
}
|
||||||
|
|
||||||
if (n/8 >= len) continue; // can't store in buf
|
if (n/8 >= len) continue; // can't store in buf
|
||||||
|
|
||||||
|
|
@ -216,6 +218,7 @@ uint8_t adb_host_talk_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
sei();
|
sei();
|
||||||
|
_delay_us(200);
|
||||||
return n/8;
|
return n/8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,6 +247,7 @@ void adb_host_listen_buf(uint8_t addr, uint8_t reg, uint8_t *buf, uint8_t len)
|
||||||
}
|
}
|
||||||
place_bit0(); // Stopbit(0);
|
place_bit0(); // Stopbit(0);
|
||||||
sei();
|
sei();
|
||||||
|
_delay_us(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l)
|
void adb_host_listen(uint8_t addr, uint8_t reg, uint8_t data_h, uint8_t data_l)
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define ADB_ADDR_13 13
|
#define ADB_ADDR_13 13
|
||||||
#define ADB_ADDR_14 14
|
#define ADB_ADDR_14 14
|
||||||
#define ADB_ADDR_15 15
|
#define ADB_ADDR_15 15
|
||||||
// for temporary purpose, do not use for polling
|
|
||||||
#define ADB_ADDR_KBD_POLL 9
|
|
||||||
#define ADB_ADDR_MOUSE_POLL 10
|
|
||||||
#define ADB_ADDR_KBD_TMP 14
|
|
||||||
#define ADB_ADDR_MOUSE_TMP 15
|
|
||||||
// Command Type
|
// Command Type
|
||||||
#define ADB_CMD_RESET 0
|
#define ADB_CMD_RESET 0
|
||||||
#define ADB_CMD_FLUSH 1
|
#define ADB_CMD_FLUSH 1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue