Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. So this is pretty neat, and I'm feeling pretty good about it.

So this is pretty neat, and I'm feeling pretty good about it.

Scheduled Pinned Locked Moved The Lounge
designhardwarecomgraphicsiot
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    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

    A P 2 Replies Last reply
    0
    • H honey the codewitch

      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

      A Offline
      A Offline
      AndyChisholm
      wrote on last edited by
      #2

      It looks great. Well done. I love those cross realm (HW/SW/FW) types of things. Andy

      1 Reply Last reply
      0
      • H honey the codewitch

        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

        P Offline
        P Offline
        Ponytail Bob
        wrote on last edited by
        #3

        That's pretty cool! Love this kind of stuff!

        PonytailBob.com My Homegrown Z80 Computer Build

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups