summaryrefslogtreecommitdiff
path: root/src/attiny/ao_arch_funcs.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-09-11 10:40:24 -0700
committerKeith Packard <keithp@keithp.com>2018-10-13 08:23:25 -0700
commitcdaa0d7b272505c49017f409b7c0b8e3240608f0 (patch)
tree75a8777ac04f7d4cc31260a5a7fd9dc9e3576948 /src/attiny/ao_arch_funcs.h
parentf7ca88282466c271bad5e25e804729580fe83c47 (diff)
altos: Eliminate 'pin' field from GPIO functions
This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/attiny/ao_arch_funcs.h')
-rw-r--r--src/attiny/ao_arch_funcs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/attiny/ao_arch_funcs.h b/src/attiny/ao_arch_funcs.h
index 35901154..69b259d9 100644
--- a/src/attiny/ao_arch_funcs.h
+++ b/src/attiny/ao_arch_funcs.h
@@ -28,21 +28,21 @@
(reg) |= (mask); \
} while (0)
-#define ao_spi_get_bit(reg,bit,pin,bus,speed) ao_spi_get_mask(reg,(1<<(bit)),bus,speed)
+#define ao_spi_get_bit(reg,bit,bus,speed) ao_spi_get_mask(reg,(1<<(bit)),bus,speed)
-#define ao_spi_put_bit(reg,bit,pin,bus) ao_spi_put_mask(reg,(1<<(bit)),bus)
+#define ao_spi_put_bit(reg,bit,bus) ao_spi_put_mask(reg,(1<<(bit)),bus)
#define ao_gpio_token_paster(x,y) x ## y
#define ao_gpio_token_evaluator(x,y) ao_gpio_token_paster(x,y)
-#define ao_gpio_set(port, bit, pin, v) do { \
+#define ao_gpio_set(port, bit, v) do { \
if (v) \
PORTB |= (1 << bit); \
else \
PORTB &= ~(1 << bit); \
} while (0)
-#define ao_gpio_get(port, bit, pin) ((PORTB >> (bit)) & 1)
+#define ao_gpio_get(port, bit) ((PORTB >> (bit)) & 1)
/*
* The SPI mutex must be held to call either of these
@@ -50,8 +50,8 @@
* from chip select low to chip select high
*/
-#define ao_enable_output(port, bit, pin, v) do { \
- ao_gpio_set(port, bit, pin, v); \
+#define ao_enable_output(port, bit, v) do { \
+ ao_gpio_set(port, bit, v); \
ao_gpio_token_evaluator(DDR,port) |= (1 << bit); \
} while (0)