So this is pretty neat, and I'm feeling pretty good about it.
-
the little screen that says hello world (image linked to below) is an emulated ST7789 display controller connected over a virtual SPI bus, running arduino code. The arduino code thinks it's talking to a real LCD screen, but its not. It's talking to my little DLL that acts like hardware.
void* hw_screen = hardware_load(LIB_SPI_SCREEN); // ".\\winduino_spi_screen.dll"
if(hw_screen==nullptr) {
Serial.println("Unable to load external SPI screen");
}
struct {
uint16_t width;
uint16_t height;
} screen_size = {240,135};
struct {
int16_t x;
int16_t y;
} screen_offsets = {40,53};
hardware_attach_log(hw_screen);
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_RESOLUTION,&screen_size,sizeof(screen_size))) {
Serial.println("Unable to configure hardware");
}
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_OFFSETS,&screen_offsets,sizeof(screen_offsets))) {
Serial.println("Unable to configure hardware");
}
hardware_set_pin(hw_screen,15, SPI_SCREEN_PIN_BKL);
hardware_set_pin(hw_screen,5, SPI_SCREEN_PIN_CS);
hardware_set_pin(hw_screen,2,SPI_SCREEN_PIN_DC);
hardware_set_pin(hw_screen,4,SPI_SCREEN_PIN_RST);It lives![^] From there you can communicate with it like a normal SPI device, where it listens for particular commands coming over the bus and updates the display accordingly like a real ILI9341 or ST7789 chip would do. I love writing emulators. :-D
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
the little screen that says hello world (image linked to below) is an emulated ST7789 display controller connected over a virtual SPI bus, running arduino code. The arduino code thinks it's talking to a real LCD screen, but its not. It's talking to my little DLL that acts like hardware.
void* hw_screen = hardware_load(LIB_SPI_SCREEN); // ".\\winduino_spi_screen.dll"
if(hw_screen==nullptr) {
Serial.println("Unable to load external SPI screen");
}
struct {
uint16_t width;
uint16_t height;
} screen_size = {240,135};
struct {
int16_t x;
int16_t y;
} screen_offsets = {40,53};
hardware_attach_log(hw_screen);
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_RESOLUTION,&screen_size,sizeof(screen_size))) {
Serial.println("Unable to configure hardware");
}
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_OFFSETS,&screen_offsets,sizeof(screen_offsets))) {
Serial.println("Unable to configure hardware");
}
hardware_set_pin(hw_screen,15, SPI_SCREEN_PIN_BKL);
hardware_set_pin(hw_screen,5, SPI_SCREEN_PIN_CS);
hardware_set_pin(hw_screen,2,SPI_SCREEN_PIN_DC);
hardware_set_pin(hw_screen,4,SPI_SCREEN_PIN_RST);It lives![^] From there you can communicate with it like a normal SPI device, where it listens for particular commands coming over the bus and updates the display accordingly like a real ILI9341 or ST7789 chip would do. I love writing emulators. :-D
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
It looks great. Well done. I love those cross realm (HW/SW/FW) types of things. Andy
-
the little screen that says hello world (image linked to below) is an emulated ST7789 display controller connected over a virtual SPI bus, running arduino code. The arduino code thinks it's talking to a real LCD screen, but its not. It's talking to my little DLL that acts like hardware.
void* hw_screen = hardware_load(LIB_SPI_SCREEN); // ".\\winduino_spi_screen.dll"
if(hw_screen==nullptr) {
Serial.println("Unable to load external SPI screen");
}
struct {
uint16_t width;
uint16_t height;
} screen_size = {240,135};
struct {
int16_t x;
int16_t y;
} screen_offsets = {40,53};
hardware_attach_log(hw_screen);
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_RESOLUTION,&screen_size,sizeof(screen_size))) {
Serial.println("Unable to configure hardware");
}
if(!hardware_configure(hw_screen,SPI_SCREEN_PROP_OFFSETS,&screen_offsets,sizeof(screen_offsets))) {
Serial.println("Unable to configure hardware");
}
hardware_set_pin(hw_screen,15, SPI_SCREEN_PIN_BKL);
hardware_set_pin(hw_screen,5, SPI_SCREEN_PIN_CS);
hardware_set_pin(hw_screen,2,SPI_SCREEN_PIN_DC);
hardware_set_pin(hw_screen,4,SPI_SCREEN_PIN_RST);It lives![^] From there you can communicate with it like a normal SPI device, where it listens for particular commands coming over the bus and updates the display accordingly like a real ILI9341 or ST7789 chip would do. I love writing emulators. :-D
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
That's pretty cool! Love this kind of stuff!