summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/pio.c
blob: e8c7e24ee5640a8ad68b7cf9d40824df35360309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "pio.h"

static uint8_t *pio_port_a = (uint8_t *) ADDR_DEV_PIO;
static uint8_t *pio_port_b = (uint8_t *) ADDR_DEV_PIO + 1;
static uint8_t *pio_ctrl_a = (uint8_t *) ADDR_DEV_PIO + 2;
static uint8_t *pio_ctrl_b = (uint8_t *) ADDR_DEV_PIO + 3;

void pio_data(int port, uint8_t data)
{
    if (port == PIO_A)
        *pio_port_a = cmd;
    else
        *pio_port_b = cmd;
}

void pio_command(int port, uint8_t cmd)
{
    if (port == PIO_A)
        *pio_ctrl_a = cmd;
    else
        *pio_ctrl_b = cmd;
}



inline int pio_read_pin(int port, uint8_t pin)
{

}