2019-03-25 09:39:06 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <generated/csr.h>
|
|
|
|
|
|
|
|
#include "spi-gpio.h"
|
|
|
|
|
2019-03-26 01:39:55 +00:00
|
|
|
// static uint8_t do_mirror;
|
|
|
|
// static uint8_t oe_mirror;
|
2019-03-25 09:39:06 +00:00
|
|
|
|
2019-03-26 01:39:55 +00:00
|
|
|
// void gpioSetMode(int pin, int mode) {
|
|
|
|
// if (mode)
|
|
|
|
// oe_mirror |= 1 << pin;
|
|
|
|
// else
|
|
|
|
// oe_mirror &= ~(1 << pin);
|
|
|
|
// picospi_oe_write(oe_mirror);
|
|
|
|
// }
|
2019-03-25 09:39:06 +00:00
|
|
|
|
2019-03-26 01:39:55 +00:00
|
|
|
// void gpioWrite(int pin, int val) {
|
|
|
|
// if (val)
|
|
|
|
// do_mirror |= 1 << pin;
|
|
|
|
// else
|
|
|
|
// do_mirror &= ~(1 << pin);
|
|
|
|
// picospi_do_write(do_mirror);
|
|
|
|
// }
|
2019-03-25 09:39:06 +00:00
|
|
|
|
2019-03-26 01:39:55 +00:00
|
|
|
// int gpioRead(int pin) {
|
|
|
|
// return !!(picospi_di_read() & (1 << pin));
|
|
|
|
// }
|