+#define ao_enable_analog(port,bit) do { \
+ vuint32_t *_ioconf = &lpc_ioconf.pio0_0 + ((port)*24+(bit)); \
+ ao_enable_port(port); \
+ lpc_gpio.dir[port] &= ~(1 << bit); \
+ *_ioconf = *_ioconf & ~((1 << LPC_IOCONF_ADMODE) | \
+ (LPC_IOCONF_MODE_MASK << LPC_IOCONF_MODE)); \
+ } while (0)
+