diff options
author | No0ne <[email protected]> | 2023-08-22 23:22:36 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-08-25 12:41:47 +0300 |
commit | 72df81540751cda96fa6dac84a202246f1d92cba (patch) | |
tree | e138b7f55673f6659ce704b3f8e935393dae8269 /hid/pico/src/ph_ps2_phy.h | |
parent | 94041d45fc789b1ed498c010486b1f4439b5a458 (diff) |
pico hid: ps/2 bytes and packets queue (#142)
Diffstat (limited to 'hid/pico/src/ph_ps2_phy.h')
-rw-r--r-- | hid/pico/src/ph_ps2_phy.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hid/pico/src/ph_ps2_phy.h b/hid/pico/src/ph_ps2_phy.h new file mode 100644 index 00000000..17dd9e0d --- /dev/null +++ b/hid/pico/src/ph_ps2_phy.h @@ -0,0 +1,19 @@ +#pragma once + +#include "ph_types.h" +#include "hardware/pio.h" +#include "pico/util/queue.h" + +typedef void (*rx_callback)(u8 byte); + +typedef struct { + PIO pio; + uint sm; + queue_t qbytes; + queue_t qpacks; + u8 sent; + rx_callback rx; +} ph_ps2_phy; + +void ph_ps2_phy_init(ph_ps2_phy* this, PIO pio, u8 data_pin, rx_callback rx); +void ph_ps2_phy_task(ph_ps2_phy* this);
\ No newline at end of file |