Skip to content

Commit

Permalink
it works
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGawron committed Dec 12, 2024
1 parent 771f349 commit b194497
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions Software/STM32F103RBTx/Application/Device/Src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

uint16_t hackBuff[300][300] = {0};

static const uint8_t U8G2_STATUS_OK = 1u;
static const uint8_t U8G2_STATUS_NOT_OK = 0u;

static const u8x8_display_info_t u8x8_st7735_128x128_display_info =
{
/* chip_enable_level = */ 0,
Expand Down Expand Up @@ -112,7 +115,7 @@ uint8_t my_u8x8_d_st7735(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_p
break;
}

return 1;
return U8G2_STATUS_OK;
}

void my_u8g2_Setup_st7735(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
Expand Down Expand Up @@ -145,36 +148,25 @@ void my_u8g2_Setup_st7735(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb b

uint8_t my_u8x8_byte_rtthread_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{

// printf("%s %d\n", __FILE__, __LINE__);
return 1;
// Not used. Required by the u8g2 library, but this action is handled by the St7735DisplayDriver class.
return U8G2_STATUS_OK;
}

uint8_t my_u8x8_gpio_and_delay_rtthread(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{

// printf("%s %d\n", __FILE__, __LINE__);
return 1;
// Not used. Required by the u8g2 library, but this action is handled by the St7735DisplayDriver class.
return U8G2_STATUS_OK;
}
namespace Device
{
Display::Display(Driver::IDisplayDriver &_displayDriver) : displayDriver(_displayDriver)
// Display::Display() /*: U8G2(U8G2_R0)*/
{
// u8x8_Setup(getU8x8(), my_u8x8_d_sh1108_128x160, u8x8_cad_001, my_u8x8_byte_arduino_4wire_sw_spi, my_u8x8_gpio_and_delay_arduino);

/*public: U8G2_st7735 _1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() {
u8g2_Setup_st7735 _1(&u8g2, rotation, u8x8_byte_rtthread_4wire_hw_spi, u8x8_gpio_and_delay_rtthread);
u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
*/

const u8g2_cb_t *rotation = U8G2_R0;
uint8_t cs;
uint8_t dc;
uint8_t reset = 0; // U8X8_PIN_NONE;
my_u8g2_Setup_st7735(&u8g2, rotation, my_u8x8_byte_rtthread_4wire_hw_spi, my_u8x8_gpio_and_delay_rtthread);
printf("%s %d\n", __FILE__, __LINE__);
// u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset);
}

void Display::check()
Expand Down

0 comments on commit b194497

Please sign in to comment.