summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bus.c10
-rw-r--r--bus.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/bus.c b/bus.c
index 38298d0..0683113 100644
--- a/bus.c
+++ b/bus.c
@@ -358,6 +358,16 @@ void bus_init()
}
}
+
+int bus_getpin(int pin)
+{
+ if (isbb) {
+ return gpio_readvalue(gpio_pins[pin]);
+ } else {
+ return 0;
+ }
+}
+
void bus_setpin(int pin, int value)
{
if (isbb) {
diff --git a/bus.h b/bus.h
index 6bb3e83..f13f203 100644
--- a/bus.h
+++ b/bus.h
@@ -27,9 +27,13 @@
#define GPMCACCESSTIME 0x07
void bus_init(void); // call this before doing anything
+
+int bus_getpin(int pin);
void bus_setpin(int pin, int value); // set the value of a pin
+
void bus_writebyte(uint8_t address, uint8_t data); // write a byte to the bus
uint8_t bus_readbyte(uint8_t address); // read a pin from the bus
+
void bus_shutdown(void); // shutdown the bus
#endif /* BUS_H_ */