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. You win some, you lose some.

You win some, you lose some.

Scheduled Pinned Locked Moved The Lounge
wpftutorial
5 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.
  • honey the codewitchH Offline
    honey the codewitchH Offline
    honey the codewitch
    wrote on last edited by
    #1

    I'm not sure how I feel about this. I made some new video drivers that are decoupled from the bus type they use. This is because for example, an ILI9341 display may come in serial (SPI) or parallel (8-bit) bus styles. An SSD1306 display comes in serial SPI or serial I2C buses. So I made such that you have 3 different types of busses - a parallel 8-bit bus, an SPI serial bus, and an I2C serial bus. You can plug those into the display driver for your device like the SSD1306, the ST7789 or the ILI9341 That way you can select the display type independently of the style of connection it uses. So for I2C for example, you declare a tft_i2c bus:

    using bus_type = tft_i2c<LCD_PORT,0x3C,PIN_NUM_SDA,PIN_NUM_SCL,0x0,0x40,400000>;

    And then you can feed that to your driver declaration:

    using lcd_type = ssd1306<LCD_WIDTH,LCD_HEIGHT,bus_type,LCD_VDC_3_3,PIN_NUM_DC,PIN_NUM_RST,true>;
    // declare it
    lcd_type lcd;

    I wrote the SSD1306 and the I2C bus first. It's still not working. But when I simply swapped out the I2C bus for an SPI bus it worked with my SSD1306 SPI device on the first try. But it still gives me a shrunken display port and dropped scanlines on I2C. Amazing that I wrote the non working code first, and plugged it into my SPI bus and it worked right off though. my SSD1306 driver was developed entirely blind.

    Real programmers use butterflies

    J D 2 Replies Last reply
    0
    • honey the codewitchH honey the codewitch

      I'm not sure how I feel about this. I made some new video drivers that are decoupled from the bus type they use. This is because for example, an ILI9341 display may come in serial (SPI) or parallel (8-bit) bus styles. An SSD1306 display comes in serial SPI or serial I2C buses. So I made such that you have 3 different types of busses - a parallel 8-bit bus, an SPI serial bus, and an I2C serial bus. You can plug those into the display driver for your device like the SSD1306, the ST7789 or the ILI9341 That way you can select the display type independently of the style of connection it uses. So for I2C for example, you declare a tft_i2c bus:

      using bus_type = tft_i2c<LCD_PORT,0x3C,PIN_NUM_SDA,PIN_NUM_SCL,0x0,0x40,400000>;

      And then you can feed that to your driver declaration:

      using lcd_type = ssd1306<LCD_WIDTH,LCD_HEIGHT,bus_type,LCD_VDC_3_3,PIN_NUM_DC,PIN_NUM_RST,true>;
      // declare it
      lcd_type lcd;

      I wrote the SSD1306 and the I2C bus first. It's still not working. But when I simply swapped out the I2C bus for an SPI bus it worked with my SSD1306 SPI device on the first try. But it still gives me a shrunken display port and dropped scanlines on I2C. Amazing that I wrote the non working code first, and plugged it into my SPI bus and it worked right off though. my SSD1306 driver was developed entirely blind.

      Real programmers use butterflies

      J Offline
      J Offline
      jmaida
      wrote on last edited by
      #2

      you are amazing :) -- old guy programmer

      honey the codewitchH 1 Reply Last reply
      0
      • J jmaida

        you are amazing :) -- old guy programmer

        honey the codewitchH Offline
        honey the codewitchH Offline
        honey the codewitch
        wrote on last edited by
        #3

        Thanks! I'll maybe feel amazing when my code works. :-D *bangs on it some more* At least some of it does.

        Real programmers use butterflies

        1 Reply Last reply
        0
        • honey the codewitchH honey the codewitch

          I'm not sure how I feel about this. I made some new video drivers that are decoupled from the bus type they use. This is because for example, an ILI9341 display may come in serial (SPI) or parallel (8-bit) bus styles. An SSD1306 display comes in serial SPI or serial I2C buses. So I made such that you have 3 different types of busses - a parallel 8-bit bus, an SPI serial bus, and an I2C serial bus. You can plug those into the display driver for your device like the SSD1306, the ST7789 or the ILI9341 That way you can select the display type independently of the style of connection it uses. So for I2C for example, you declare a tft_i2c bus:

          using bus_type = tft_i2c<LCD_PORT,0x3C,PIN_NUM_SDA,PIN_NUM_SCL,0x0,0x40,400000>;

          And then you can feed that to your driver declaration:

          using lcd_type = ssd1306<LCD_WIDTH,LCD_HEIGHT,bus_type,LCD_VDC_3_3,PIN_NUM_DC,PIN_NUM_RST,true>;
          // declare it
          lcd_type lcd;

          I wrote the SSD1306 and the I2C bus first. It's still not working. But when I simply swapped out the I2C bus for an SPI bus it worked with my SSD1306 SPI device on the first try. But it still gives me a shrunken display port and dropped scanlines on I2C. Amazing that I wrote the non working code first, and plugged it into my SPI bus and it worked right off though. my SSD1306 driver was developed entirely blind.

          Real programmers use butterflies

          D Offline
          D Offline
          Daniel Pfeffer
          wrote on last edited by
          #4

          It's this sort of problem that makes software engineers such well-adjusted people who spread joy wherever they go... :) /s

          Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

          honey the codewitchH 1 Reply Last reply
          0
          • D Daniel Pfeffer

            It's this sort of problem that makes software engineers such well-adjusted people who spread joy wherever they go... :) /s

            Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

            honey the codewitchH Offline
            honey the codewitchH Offline
            honey the codewitch
            wrote on last edited by
            #5

            :laugh: Well I solved the last of it today. I was making a simple mistake, easily corrected once I found it. It was almost luck that I found it though.

            Real programmers use butterflies

            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