Merge pull request #660 from en4rab/St7586-driver

Add support for ST7586S display
This commit is contained in:
olikraus 2018-07-20 20:41:06 +02:00 committed by GitHub
commit d7a20ce5f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 818 additions and 0 deletions

View File

@ -8686,6 +8686,168 @@ class U8G2_ST7567_ENH_DG128064I_F_8080 : public U8G2 {
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_1_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_1_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_1(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_1_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_1_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_2_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_2_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_2(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_2_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_2_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_2(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_2_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_2_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_F_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_F_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_f(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_F_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_F_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_f(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_S028HN118A_F_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_S028HN118A_F_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_s028hn118a_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_1_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_1_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_1_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_1_3W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_ST7586S_ERC240160_1_6800 : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_6800(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_1_8080 : public U8G2 {
public: U8G2_ST7586S_ERC240160_1_8080(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_1(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_2_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_2_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_2_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_2_3W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_ST7586S_ERC240160_2_6800 : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_6800(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_2_8080 : public U8G2 {
public: U8G2_ST7586S_ERC240160_2_8080(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_2(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_F_4W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_F_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_F_2ND_4W_HW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_2ND_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_F_3W_SW_SPI : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_3W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8G2_ST7586S_ERC240160_F_6800 : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_6800(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7586S_ERC240160_F_8080 : public U8G2 {
public: U8G2_ST7586S_ERC240160_F_8080(const u8g2_cb_t *rotation, 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 = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7586s_erc240160_f(&u8g2, rotation, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8G2_ST7588_JLX12864_1_4W_SW_SPI : public U8G2 {
public: U8G2_ST7588_JLX12864_1_4W_SW_SPI(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7588_jlx12864_1(&u8g2, rotation, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);

View File

@ -3146,6 +3146,60 @@ class U8X8_ST7567_ENH_DG128064I_8080 : public U8X8 {
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_ST7586S_S028HN118A_4W_SW_SPI : public U8X8 {
public: U8X8_ST7586S_S028HN118A_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_s028hn118a, u8x8_cad_011, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8X8_ST7586S_S028HN118A_4W_HW_SPI : public U8X8 {
public: U8X8_ST7586S_S028HN118A_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_s028hn118a, u8x8_cad_011, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7586S_S028HN118A_2ND_4W_HW_SPI : public U8X8 {
public: U8X8_ST7586S_S028HN118A_2ND_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_s028hn118a, u8x8_cad_011, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7586S_ERC240160_4W_SW_SPI : public U8X8 {
public: U8X8_ST7586S_ERC240160_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_SW_SPI(getU8x8(), clock, data, cs, dc, reset);
}
};
class U8X8_ST7586S_ERC240160_4W_HW_SPI : public U8X8 {
public: U8X8_ST7586S_ERC240160_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_arduino_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7586S_ERC240160_2ND_4W_HW_SPI : public U8X8 {
public: U8X8_ST7586S_ERC240160_2ND_4W_HW_SPI(uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_arduino_2nd_hw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}
};
class U8X8_ST7586S_ERC240160_3W_SW_SPI : public U8X8 {
public: U8X8_ST7586S_ERC240160_3W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_arduino_3wire_sw_spi, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_3Wire_SW_SPI(getU8x8(), clock, data, cs, reset);
}
};
class U8X8_ST7586S_ERC240160_6800 : public U8X8 {
public: U8X8_ST7586S_ERC240160_6800(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 = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_8bit_6800mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_6800(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_ST7586S_ERC240160_8080 : public U8X8 {
public: U8X8_ST7586S_ERC240160_8080(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 = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7586s_erc240160, u8x8_cad_011, u8x8_byte_arduino_8bit_8080mode, u8x8_gpio_and_delay_arduino);
u8x8_SetPin_8Bit_8080(getU8x8(), d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc, reset);
}
};
class U8X8_ST7588_JLX12864_4W_SW_SPI : public U8X8 {
public: U8X8_ST7588_JLX12864_4W_SW_SPI(uint8_t clock, uint8_t data, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8X8() {
u8x8_Setup(getU8x8(), u8x8_d_st7588_jlx12864, u8x8_cad_001, u8x8_byte_arduino_4wire_sw_spi, u8x8_gpio_and_delay_arduino);

View File

@ -506,6 +506,9 @@ uint8_t *u8g2_m_17_4_f(uint8_t *page_cnt);
uint8_t *u8g2_m_17_8_1(uint8_t *page_cnt);
uint8_t *u8g2_m_17_8_2(uint8_t *page_cnt);
uint8_t *u8g2_m_17_8_f(uint8_t *page_cnt);
uint8_t *u8g2_m_48_17_1(uint8_t *page_cnt);
uint8_t *u8g2_m_48_17_2(uint8_t *page_cnt);
uint8_t *u8g2_m_48_17_f(uint8_t *page_cnt);
uint8_t *u8g2_m_32_16_1(uint8_t *page_cnt);
uint8_t *u8g2_m_32_16_2(uint8_t *page_cnt);
uint8_t *u8g2_m_32_16_f(uint8_t *page_cnt);
@ -856,6 +859,12 @@ void u8g2_Setup_st7567_enh_dg128064i_2(u8g2_t *u8g2, const u8g2_cb_t *rotation,
void u8g2_Setup_st7567_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7567_enh_dg128064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7567_enh_dg128064i_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_s028hn118a_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_erc240160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_erc240160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7586s_erc240160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7588_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7588_jlx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);
void u8g2_Setup_st7588_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb);

View File

@ -489,6 +489,24 @@ uint8_t *u8g2_m_17_8_f(uint8_t *page_cnt)
*page_cnt = 8;
return buf;
}
uint8_t *u8g2_m_48_17_1(uint8_t *page_cnt)
{
static uint8_t buf[384];
*page_cnt = 1;
return buf;
}
uint8_t *u8g2_m_48_17_2(uint8_t *page_cnt)
{
static uint8_t buf[768];
*page_cnt = 2;
return buf;
}
uint8_t *u8g2_m_48_17_f(uint8_t *page_cnt)
{
static uint8_t buf[6528];
*page_cnt = 17;
return buf;
}
uint8_t *u8g2_m_32_16_1(uint8_t *page_cnt)
{
static uint8_t buf[256];

View File

@ -2831,6 +2831,62 @@ void u8g2_Setup_st7567_enh_dg128064i_f(u8g2_t *u8g2, const u8g2_cb_t *rotation,
buf = u8g2_m_16_8_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
}
/* st7586s */
/* st7586s 1 */
void u8g2_Setup_st7586s_s028hn118a_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_48_17_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7586s 2 */
void u8g2_Setup_st7586s_s028hn118a_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_48_17_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7586s f */
void u8g2_Setup_st7586s_s028hn118a_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_48_17_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7586s */
/* st7586s 1 */
void u8g2_Setup_st7586s_erc240160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_30_20_1(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7586s 2 */
void u8g2_Setup_st7586s_erc240160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_30_20_2(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7586s f */
void u8g2_Setup_st7586s_erc240160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
{
uint8_t tile_buf_height;
uint8_t *buf;
u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb);
buf = u8g2_m_30_20_f(&tile_buf_height);
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation);
}
/* st7588 */
/* st7588 1 */
void u8g2_Setup_st7588_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)

View File

@ -826,6 +826,8 @@ uint8_t u8x8_d_st7567_pi_132x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
uint8_t u8x8_d_st7567_jlx12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7567_enh_dg128064(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7567_enh_dg128064i(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7586s_s028hn118a(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7586s_erc240160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st7588_jlx12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st75256_jlx256128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_st75256_jlx256160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);

View File

@ -0,0 +1,253 @@
/*
u8x8_d_st7586s_erc240160.c
Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
Copyright (c) 2018, olikraus@gmail.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "u8g2.h"
static const uint8_t u8x8_d_st7586s_sleep_on[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x010), /* set power save mode */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_sleep_off[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x011), //Sleep out
U8X8_DLY(50), /* delay 50 ms */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_erc240160_flip0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x036), /* Scan Direction Setting */
U8X8_A(0x0C8), /* COM159 -> COM0 SEG383 -> SEG0 */
U8X8_C(0x037), /* Start line 0 */
U8X8_A(0x000),
U8X8_C(0x02A), /* Column Address Setting */
U8X8_A(0x000), /* COL8 -> COL127 */
U8X8_A(0x008),
U8X8_A(0x000),
U8X8_A(0x07F), /* 120*3=240 pixels + 120 unused */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_erc240160_flip1_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x036), /* Scan Direction Setting */
U8X8_A(0x000), /* COM0 -> COM159 SEG0 -> SEG383 */
U8X8_C(0x037), /* Start line 0 */
U8X8_A(0x000),
U8X8_C(0x02A), /* Column Address Setting */
U8X8_A(0x000), /* COL0 -> COL119 */
U8X8_A(0x000),
U8X8_A(0x000),
U8X8_A(0x077), /* 120*3=240 pixels + 120 unused */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_erc240160_init_seq[] = {
U8X8_END_TRANSFER(),/* disable chip */
// U8G_ESC_RST(1), /* hardware reset */
U8X8_DLY(60), /* Delay 60 ms */
U8X8_START_TRANSFER(),/* enable chip */
U8X8_C(0x001), // Soft reset
U8X8_DLY(60), // Delay 120 ms
U8X8_C(0x011), // Sleep Out
U8X8_C(0x028), // Display OFF
U8X8_DLY(25), // Delay 50 ms
U8X8_CAA(0x0C0,0x036,0x01),// Vop = 136h data sheet suggested 0x0145 but this caused streaks
U8X8_CA(0x0C3,0x000), // BIAS = 1/14
U8X8_CA(0x0C4,0x007), // Booster = x8
U8X8_CA(0x0D0,0x01D), // Enable Analog Circuit
U8X8_CA(0x0B3,0x000), // Set FOSC divider
U8X8_CA(0x0B5,0x000), // N-Line = 0
U8X8_C(0x039), // 0x39 Monochrome mode. 0x38 - gray Mode
U8X8_C(0x03A), // Enable DDRAM Interface
U8X8_A(0x002), // monochrome and 4-level
U8X8_C(0x036), // Scan Direction Setting
U8X8_A(0x0C8), // COM:C159->C0 SEG: SEG383->SEG0
U8X8_C(0x0B1), // First output COM
U8X8_A(0x000), //
U8X8_C(0x0B0), // Duty Setting (num rows - 1)
U8X8_A(0x09F),
U8X8_C(0x020), // Display inversion off
U8X8_C(0x02A), // Column Address Setting
U8X8_A(0x000), // COL0 -> COL127
U8X8_A(0x008), //
U8X8_A(0x000), //
U8X8_A(0x07F), // 80*3=240 pixels
U8X8_C(0x02B), // Row Address Setting
U8X8_A(0x000), // ROW0 -> ROW159
U8X8_A(0x000), //
U8X8_A(0x000), //
U8X8_A(0x09F), // 160 pixels
U8X8_C(0x029), // Display ON
U8X8_END() /* end of sequence */
};
static const u8x8_display_info_t u8x8_st7586s_erc240160_display_info =
{
/* chip_enable_level = */ 0,
/* chip_disable_level = */ 1,
/* post_chip_enable_wait_ns = */ 5,
/* pre_chip_disable_wait_ns = */ 5,
/* reset_pulse_width_ms = */ 1,
/* post_reset_wait_ms = */ 6,
/* sda_setup_time_ns = */ 20,
/* sck_pulse_width_ns = */ 100, /* datasheet ST7586S */
/* sck_clock_hz = */ 8000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
/* ST7586+Atmega128RFA1 works with 8MHz */
/* spi_mode = */ 3, /* active high, rising edge */
/* i2c_bus_clock_100kHz = */ 4,
/* data_setup_time_ns = */ 20, /* datasheet suggests min 20 */
/* write_pulse_width_ns = */ 40,
/* tile_width = */ 30,
/* tile_height = */ 20,
/* default_x_offset = */ 0, /* abused as flag to know if we are flipped */
/* flipmode_x_offset = */ 1, /* as pixel order different for normal/flipped */
/* pixel_width = */ 240,
/* pixel_height = */ 160
};
/*******************************************************************************
* st7586s_erc240160 driver. ST7586 based display from buydisplay.com
******************************************************************************/
uint8_t u8x8_d_st7586s_erc240160(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {
uint8_t c;
uint8_t *ptr;
uint8_t i, byte;
uint32_t input;
uint8_t output[4];
switch (msg) {
case U8X8_MSG_DISPLAY_DRAW_TILE:
u8x8_cad_StartTransfer(u8x8); // OK Start transfer
u8x8_cad_SendCmd(u8x8, 0x02B); /* Row Address Setting */
u8x8_cad_SendArg(u8x8, 0x000);
u8x8_cad_SendArg(u8x8, 0x008 * ((u8x8_tile_t *)arg_ptr)->y_pos);
u8x8_cad_SendArg(u8x8, 0x000);
u8x8_cad_SendArg(u8x8, 0x09F); // should set end row based on display dimensions
u8x8_cad_SendCmd(u8x8, 0x02C); /* cmd write display data to ram */
c = ((u8x8_tile_t *) arg_ptr)->cnt; //
c *= 8;
ptr = ((u8x8_tile_t *) arg_ptr)->tile_ptr; //
// The ST7586S has an unusual 3 pixels per byte format the ERC240160 is even more annoying
// as it has every 3rd COM line disconnected for extra oddness so here we read in a byte
// (8 pixels) and pack that into 4 bytes of 2 pixels + 1 unused each. This has to be done
// in a different order for flipped, normal UUx11x22 flipped 11x22xUU
while (c > 0) {
input = ((uint8_t)ptr[0]);
for (i=0; i<4; i++)
{
byte = 0;
if (u8x8->x_offset ==0){
if (input & 0x80) // if bit 7
byte = byte | 0b00011000; //set pixel 1
if (input & 0x40) // if bit 6
byte = byte | 0b00000011; //set pixel 2
}
if (u8x8->x_offset ==1){
if (input & 0x80) // if bit 7
byte = byte | 0b11000000; //set pixel 1
if (input & 0x40) // if bit 6
byte = byte | 0b00011000; //set pixel 2
}
output[i] = byte;
input <<= 2;
}
u8x8_cad_SendData(u8x8, 4, output);
ptr += 1;
c -= 1;
}
u8x8_cad_EndTransfer(u8x8);
break;
case U8X8_MSG_DISPLAY_INIT:
u8x8_d_helper_display_init(u8x8);
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_erc240160_init_seq);
break;
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7586s_erc240160_display_info);
break;
case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
if ( arg_int == 0 )
{
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_erc240160_flip0_seq);
u8x8->x_offset = u8x8->display_info->default_x_offset;
}
else
{
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_erc240160_flip1_seq);
u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
}
break;
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
if (arg_int == 0)
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_sleep_off);
else
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_sleep_on);
break;
#ifdef U8X8_WITH_SET_CONTRAST
case U8X8_MSG_DISPLAY_SET_CONTRAST:
u8x8_cad_StartTransfer(u8x8);
u8x8_cad_SendCmd(u8x8, 0x0C0);
u8x8_cad_SendArg(u8x8, arg_int);
u8x8_cad_SendArg(u8x8, 1);
u8x8_cad_EndTransfer(u8x8);
break;
#endif
default:
return 0;
}
return 1;
}

View File

@ -0,0 +1,246 @@
/*
u8x8_d_st7586s_s028hn118a.c
Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
Copyright (c) 2018, olikraus@gmail.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "u8g2.h"
static const uint8_t u8x8_d_st7586s_sleep_on[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x010), /* set power save mode */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_sleep_off[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x011), //Sleep out
U8X8_DLY(50), /* delay 50 ms */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_s028hn118a_flip0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x036), /* Scan Direction Setting */
U8X8_A(0x000), /* COM0 -> COM159 SEG0 -> SEG384 */
U8X8_C(0x037), /* Start line 0 */
U8X8_A(0x000),
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static const uint8_t u8x8_d_st7586s_s028hn118a_flip1_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x036), /* Scan Direction Setting */
U8X8_A(0x0C8), /* COM159 -> COM0 SEG384 -> SEG0 */
U8X8_C(0x037), /* Start line 24 */
U8X8_A(0x018),
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};
static uint8_t u8x8_d_st7586s_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {
uint8_t c;
uint8_t *ptr;
uint8_t i, byte;
uint32_t input;
uint8_t output[8];
switch (msg) {
case U8X8_MSG_DISPLAY_DRAW_TILE:
u8x8_cad_StartTransfer(u8x8); // OK Start transfer
u8x8_cad_SendCmd(u8x8, 0x02B); /* Row Address Setting */
u8x8_cad_SendArg(u8x8, 0x000);
u8x8_cad_SendArg(u8x8, 0x008 * ((u8x8_tile_t *)arg_ptr)->y_pos);
u8x8_cad_SendArg(u8x8, 0x000);
u8x8_cad_SendArg(u8x8, u8x8->display_info->pixel_height - 1); /* should this be u8x8->display_info->pixel_height - 1 */
u8x8_cad_SendCmd(u8x8, 0x02C); /* cmd write display data to ram */
c = ((u8x8_tile_t *) arg_ptr)->cnt; //
c *= 8;
ptr = ((u8x8_tile_t *) arg_ptr)->tile_ptr; //
// The ST7586S has an unusual 3 pixels per byte format so here we read in 3 bytes (24 pixels) and
// pack that into 8 bytes of 3 pixels each
while (c > 0) {
input = (((uint32_t)ptr[0] << 16) | ((uint32_t)ptr[1] << 8) | (uint32_t)ptr[2]);
for (i=0; i<8; i++)
{
byte = 0;
if (input & 0x800000) // if bit 23
byte = byte | 0b11000000; //set pixel 1
if (input & 0x400000) // if bit 22
byte = byte | 0b00011000; //set pixel 2
if (input & 0x200000) // if bit 22
byte = byte | 0b00000011; //set pixel 3
output[i] = byte;
input <<= 3;
}
u8x8_cad_SendData(u8x8, 8, output);
ptr += 3;
c -= 3;
}
u8x8_cad_EndTransfer(u8x8);
break;
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
if (arg_int == 0)
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_sleep_off);
else
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_sleep_on);
break;
#ifdef U8X8_WITH_SET_CONTRAST
case U8X8_MSG_DISPLAY_SET_CONTRAST:
u8x8_cad_StartTransfer(u8x8);
u8x8_cad_SendCmd(u8x8, 0x0C0);
u8x8_cad_SendArg(u8x8, arg_int);
u8x8_cad_SendArg(u8x8, 0);
u8x8_cad_EndTransfer(u8x8);
break;
#endif
default:
return 0;
}
return 1;
}
static const uint8_t u8x8_d_st7586s_s028hn118a_init_seq[] = {
U8X8_END_TRANSFER(),/* disable chip */
// U8G_ESC_RST(15), /* hardware reset */
U8X8_DLY(60), /* Delay 60 ms */
U8X8_START_TRANSFER(),/* enable chip */
U8X8_C(0x001), // Soft reset
U8X8_DLY(60), // Delay 120 ms
U8X8_C(0x011), // Sleep Out
U8X8_C(0x028), // Display OFF
U8X8_DLY(25), // Delay 50 ms
U8X8_CAA(0x0C0,0x0E5,0x00),// Vop = F0h in trace a bit too dark
U8X8_CA(0x0C3,0x004), // BIAS = 1/10 0x04 in trace
U8X8_CA(0x0C4,0x005), // Booster = x6 0x05 in trace
U8X8_CA(0x0D0,0x01D), // Enable Analog Circuit
U8X8_CA(0x0B3,0x000), // Set FOSC divider
U8X8_CA(0x0B5,0x08B), // N-Line = 0
U8X8_C(0x039), // 0x39 Monochrome mode. 0x38 - gray Mode
U8X8_C(0x03A), // Enable DDRAM Interface
U8X8_A(0x002), // monochrome and 4-level
U8X8_C(0x036), // Scan Direction Setting
U8X8_A(0x000), // COM0 -> COM159 SEG0 -> SEG384
U8X8_C(0x0B0), // Duty Setting (num rows - 1)
U8X8_A(0x087), // should be 0x87 but caused flicker 0x9F
U8X8_C(0x020), // Display inversion off
U8X8_C(0x02A), // Column Address Setting
U8X8_A(0x000), // COL0 -> COL127
U8X8_A(0x000), //
U8X8_A(0x000), //
U8X8_A(0x07f), // 128*3=384 pixels
U8X8_C(0x02B), // Row Address Setting
U8X8_A(0x000), // ROW0 -> ROW135
U8X8_A(0x000), //
U8X8_A(0x000), //
U8X8_A(0x087), // 136 pixels
U8X8_C(0x0F1), // Frame rate monochrome
U8X8_A(0x00C), // The factory firmware set this to 49.0 Hz 0x07
U8X8_A(0x00C), // This caused a shimmer under 50Hz LED lights
U8X8_A(0x00C), // 69.0 Hz (0x0C) fixes this and should avoid the
U8X8_A(0x00C), // issue in the US too
U8X8_C(0x029), // Display ON
U8X8_END() /* end of sequence */
};
static const u8x8_display_info_t u8x8_st7586s_s028hn118a_display_info =
{
/* chip_enable_level = */ 0,
/* chip_disable_level = */ 1,
/* post_chip_enable_wait_ns = */ 5,
/* pre_chip_disable_wait_ns = */ 5,
/* reset_pulse_width_ms = */ 1,
/* post_reset_wait_ms = */ 6,
/* sda_setup_time_ns = */ 20,
/* sck_pulse_width_ns = */ 100, /* datasheet ST7586S */
/* sck_clock_hz = */ 8000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
/* ST7586+Atmega128RFA1 works with 8MHz */
/* spi_mode = */ 3, /* active high, rising edge */
/* i2c_bus_clock_100kHz = */ 4,
/* data_setup_time_ns = */ 20, /* datasheet suggests min 20 */
/* write_pulse_width_ns = */ 40,
/* tile_width = */ 48,
/* tile_height = */ 17,
/* default_x_offset = */ 0,
/* flipmode_x_offset = */ 0,
/* pixel_width = */ 384,
/* pixel_height = */ 136
};
/*******************************************************************************
* st7586s_s028hn118a driver. This is the display in the SMART Response XE. This requires 16 bit mode.
******************************************************************************/
uint8_t u8x8_d_st7586s_s028hn118a(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) {
if (u8x8_d_st7586s_common(u8x8, msg, arg_int, arg_ptr) != 0)
return 1;
switch (msg) {
case U8X8_MSG_DISPLAY_INIT:
u8x8_d_helper_display_init(u8x8);
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_s028hn118a_init_seq);
break;
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7586s_s028hn118a_display_info);
break;
case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
if ( arg_int == 0 )
{
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_s028hn118a_flip0_seq);
u8x8->x_offset = u8x8->display_info->default_x_offset;
}
else
{
u8x8_cad_SendSequence(u8x8, u8x8_d_st7586s_s028hn118a_flip1_seq);
u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
}
break;
default:
return 0;
}
return 1;
}

View File

@ -820,6 +820,24 @@ struct controller controller_list[] =
}
},
{
"st7586s", 48, 17, "u8g2_ll_hvline_horizontal_right_lsb", "u8x8_cad_011", "", COM_4WSPI,
"", /* is_generate_u8g2_class= */ 1,
{
{ "s028hn118a" },
{ NULL }
},
},
{
"st7586s", 30, 20, "u8g2_ll_hvline_horizontal_right_lsb", "u8x8_cad_011", "", COM_4WSPI|COM_3WSPI|COM_6800|COM_8080,
"", /* is_generate_u8g2_class= */ 1,
{
{ "erc240160" },
{ NULL }
},
},
{
"st7588", 16, 8, "u8g2_ll_hvline_vertical_top_lsb", "u8x8_cad_001", "", COM_4WSPI|COM_3WSPI|COM_6800|COM_8080,
"", /* is_generate_u8g2_class= */ 1,