summaryrefslogtreecommitdiff
path: root/hid/pico/src/ph_ps2_phy.h
blob: 17dd9e0d45655718d900f85e8695202f1d1218be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);