+#define token_paster(x,y) x ## y
+#define token_paster3(x,y,z) x ## y ## z
+#define token_evaluator(x,y) token_paster(x,y)
+#define token_evaluator3(x,y,z) token_paster3(x,y,z)
+
+#define ao_spi_init_cs(port, mask) do { \
+ port |= mask; \
+ token_evaluator(port,DIR) |= mask; \
+ token_evaluator(port,SEL) &= ~mask; \
+ } while (0)
+
+#define cc1111_enable_output(port,dir,sel,pin,bit,v) do { \
+ pin = v; \
+ dir |= (1 << bit); \
+ sel &= ~(1 << bit); \
+ } while (0)
+
+#define disable_unreachable _Pragma("disable_warning 126")
+
+#define ao_enable_output(port,bit,pin,v) cc1111_enable_output(port,token_evaluator(port,DIR), token_evaluator(port,SEL), pin, bit, v)
+#define ao_gpio_set(port, bit, pin, v) ((pin) = (v))
+#define ao_gpio_get(port, bit, pin) (pin)
+#define ao_gpio_get_bits(port) (port)
+#define ao_gpio_set_bits(port, bits) ((port) |= bits)
+#define ao_gpio_clr_bits(port, bits) ((port) &= ~bits)