-// You can speed all of these slow GPIO calls up by using the SET/CLR macros!
-
-#define CMD(c) do { gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 1 ); \
- gpioSetValue( SSD1331_DC_PORT, SSD1331_DC_PIN, 0 ); \
- gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 0 ); \
- ssd1331SendByte( c ); \
- gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 1 ); \
- } while (0);
-#define DATA(c) do { gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 1 ); \
- gpioSetValue( SSD1331_DC_PORT, SSD1331_DC_PIN, 1 ); \
- gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 0 ); \
- ssd1331SendByte( c ); \
- gpioSetValue( SSD1331_CS_PORT, SSD1331_CS_PIN, 1 ); \
- } while (0);
+#define CMD(c) do { SET_CS; CLR_DC; CLR_CS; ssd1331SendByte( c ); SET_CS; } while (0)
+#define DATA(c) do { SET_CS; SET_DC; CLR_CS; ssd1331SendByte( c ); SET_CS; } while (0);