Skip to content

Commit

Permalink
faster soft spi and i2c
Browse files Browse the repository at this point in the history
  • Loading branch information
Paciente8159 committed Jun 20, 2024
1 parent d37800c commit f67c940
Show file tree
Hide file tree
Showing 7 changed files with 285 additions and 273 deletions.
2 changes: 1 addition & 1 deletion uCNC/src/modules/graphic_display/Arduino_uCNC_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Arduino_uCNC_SPI::Arduino_uCNC_SPI(softspi_port_t *spi = nullptr, uint8_t dc = 0
this->_is_shared_interface = is_shared_interface;
}

bool Arduino_uCNC_SPI::begin(int32_t speed = 1000000UL, int8_t dataMode = 0)
bool Arduino_uCNC_SPI::begin(int32_t speed = 20000000UL, int8_t dataMode = 0)
{
this->_speed = (uint32_t)speed;
this->_dataMode = (uint8_t)dataMode;
Expand Down
6 changes: 3 additions & 3 deletions uCNC/src/modules/graphic_display/graphic_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,12 @@ uint8_t system_menu_send_cmd(const char *__s)

DECL_MODULE(graphic_display)
{
// display_driver_t *display_driver = (display_driver_t *)&gd_ssd1306_128x64_i2c;
display_driver_t *display_driver = (display_driver_t *)&gd_ili9341_240x320_spi;
display_driver_t *display_driver = (display_driver_t *)&gd_ssd1306_128x64_i2c;
// display_driver_t *display_driver = (display_driver_t *)&gd_ili9341_240x320_spi;
gd_init(display_driver, graphic_display_port);
display_width = display_driver->width;
display_height = display_driver->height;
display_max_lines = (uint8_t)floor(display_driver->height / gd_line_height());
display_max_lines = gd_display_max_lines();
#ifdef DECL_SERIAL_STREAM
serial_stream_register(&graphic_stream);
#endif
Expand Down
3 changes: 2 additions & 1 deletion uCNC/src/modules/graphic_display/graphic_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C"
#define GRAPHIC_DISPLAY_HW_I2C 8

#ifndef GRAPHIC_DISPLAY_INTERFACE
#define GRAPHIC_DISPLAY_INTERFACE GRAPHIC_DISPLAY_HW_SPI
#define GRAPHIC_DISPLAY_INTERFACE GRAPHIC_DISPLAY_HW_I2C
#endif

#if (GRAPHIC_DISPLAY_INTERFACE == GRAPHIC_DISPLAY_SW_SPI)
Expand Down Expand Up @@ -88,6 +88,7 @@ extern "C"
int16_t gd_line_height(void);
int16_t gd_half_padding(void);
int16_t gd_get_line_top(int8_t line);
uint8_t gd_display_max_lines(void);

/**
* Expose existing display drivers
Expand Down
Loading

0 comments on commit f67c940

Please sign in to comment.