152 lines
5.1 KiB
C++
152 lines
5.1 KiB
C++
|
|
|
|
|
|
/*
|
|
use U8X8_PIN_NONE as value for "reset", if there is no reset line
|
|
*/
|
|
void u8x8_Setup_4Wire_SW_SPI(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_SPI_CLOCK, clock);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_SPI_DATA, data);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_CS, cs);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_DC, dc);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_4wire_sw_spi;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|
|
|
|
void u8x8_Setup_3Wire_SW_SPI(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_SPI_CLOCK, clock);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_SPI_DATA, data);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_CS, cs);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_3wire_sw_spi;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|
|
/*
|
|
use U8X8_PIN_NONE as value for "reset", if there is no reset line
|
|
*/
|
|
void u8x8_Setup_4Wire_HW_SPI(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t cs, uint8_t dc, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_CS, cs);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_DC, dc);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_arduino_hw_spi;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|
|
void u8x8_Setup_SSD13xx_SW_I2C(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t clock, uint8_t data, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_I2C_CLOCK, clock);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_I2C_DATA, data);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_ssd13xx_sw_i2c;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|
|
void u8x8_Setup_8Bit_6800(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t enable, uint8_t cs, uint8_t dc, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D0, d0);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D1, d1);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D2, d2);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D3, d3);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D4, d4);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D5, d5);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D6, d6);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D7, d7);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_E, enable);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_CS, cs);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_DC, dc);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_8bit_6800mode;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|
|
void u8x8_Setup_8Bit_8080(u8x8_t *u8x8, u8x8_msg_cb display_cb, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t wr, uint8_t cs, uint8_t dc, uint8_t reset)
|
|
{
|
|
/* setup defaults and reset pins to U8X8_PIN_NONE */
|
|
u8x8_SetupDefaults(u8x8);
|
|
|
|
/* assign individual pin values (only for ARDUINO, if pin_list is available) */
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D0, d0);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D1, d1);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D2, d2);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D3, d3);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D4, d4);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D5, d5);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D6, d6);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_D7, d7);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_E, wr);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_CS, cs);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_DC, dc);
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset);
|
|
|
|
/* setup specific callbacks */
|
|
u8x8->display_cb = display_cb;
|
|
u8x8->cad_cb = u8x8_cad_001;
|
|
u8x8->byte_cb = u8x8_byte_8bit_8080mode;
|
|
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;
|
|
|
|
/* setup display info */
|
|
u8x8_SetupMemory(u8x8);
|
|
}
|
|
|