|
| 1 | +driver: ssd1327 |
| 2 | +driver_class: WS_OLED_128X128_I2C |
| 3 | +i2c_address: 0x3C |
| 4 | + |
| 5 | +# I2C config for hardware tests (STeaMi board - STM32WB55) |
| 6 | +# The display uses SPI on hardware, but i2c config is required by the bridge. |
| 7 | +i2c: |
| 8 | + id: 1 |
| 9 | + |
| 10 | +# Custom hardware init (STeaMi display is on SPI, not I2C) |
| 11 | +hardware_init: | |
| 12 | + from ssd1327.device import WS_OLED_128X128_SPI |
| 13 | + from machine import SPI, Pin |
| 14 | + spi = SPI(1) |
| 15 | + dc = Pin("DATA_COMMAND_DISPLAY") |
| 16 | + res = Pin("RST_DISPLAY") |
| 17 | + cs = Pin("CS_DISPLAY") |
| 18 | + dev = WS_OLED_128X128_SPI(spi, dc, res, cs) |
| 19 | +
|
| 20 | +tests: |
| 21 | + - name: "Fill black does not crash" |
| 22 | + action: call |
| 23 | + method: fill |
| 24 | + args: [0] |
| 25 | + mode: [mock] |
| 26 | + |
| 27 | + - name: "Fill white does not crash" |
| 28 | + action: call |
| 29 | + method: fill |
| 30 | + args: [15] |
| 31 | + mode: [mock] |
| 32 | + |
| 33 | + - name: "Text rendering does not crash" |
| 34 | + action: call |
| 35 | + method: text |
| 36 | + args: ["Test", 0, 0, 15] |
| 37 | + mode: [mock] |
| 38 | + |
| 39 | + - name: "Show does not crash" |
| 40 | + action: call |
| 41 | + method: show |
| 42 | + mode: [mock] |
| 43 | + |
| 44 | + - name: "Display white screen" |
| 45 | + action: hardware_script |
| 46 | + script: | |
| 47 | + dev.fill(15) |
| 48 | + dev.show() |
| 49 | + result = True |
| 50 | + expect_true: true |
| 51 | + mode: [hardware] |
| 52 | + |
| 53 | + - name: "Screen is white" |
| 54 | + action: manual |
| 55 | + prompt: "L'écran affiche-t-il un fond blanc uniforme ?" |
| 56 | + expect_true: true |
| 57 | + mode: [hardware] |
| 58 | + |
| 59 | + - name: "Display text" |
| 60 | + action: hardware_script |
| 61 | + script: | |
| 62 | + dev.fill(0) |
| 63 | + dev.text("STeaMi", 35, 56, 15) |
| 64 | + dev.text("Test OK", 32, 68, 15) |
| 65 | + dev.show() |
| 66 | + result = True |
| 67 | + expect_true: true |
| 68 | + mode: [hardware] |
| 69 | + |
| 70 | + - name: "Text is visible" |
| 71 | + action: manual |
| 72 | + prompt: "L'écran affiche-t-il 'STeaMi' et 'Test OK' sur fond noir ?" |
| 73 | + expect_true: true |
| 74 | + mode: [hardware] |
| 75 | + |
| 76 | + - name: "Display grayscale gradient" |
| 77 | + action: hardware_script |
| 78 | + script: | |
| 79 | + dev.fill(0) |
| 80 | + w = 128 // 16 |
| 81 | + for level in range(16): |
| 82 | + x = level * w |
| 83 | + for row in range(128): |
| 84 | + for col in range(x, x + w): |
| 85 | + dev.pixel(col, row, level) |
| 86 | + dev.show() |
| 87 | + result = True |
| 88 | + expect_true: true |
| 89 | + mode: [hardware] |
| 90 | + |
| 91 | + - name: "Grayscale gradient is visible" |
| 92 | + action: manual |
| 93 | + prompt: "L'écran affiche-t-il 16 bandes verticales du noir au blanc ?" |
| 94 | + expect_true: true |
| 95 | + mode: [hardware] |
| 96 | + |
| 97 | + - name: "Scrolling animation" |
| 98 | + action: hardware_script |
| 99 | + script: | |
| 100 | + from time import sleep_ms |
| 101 | + dev.fill(0) |
| 102 | + dev.text("STeaMi", 35, 60, 15) |
| 103 | + dev.show() |
| 104 | + for i in range(128): |
| 105 | + dev.scroll(1, 0) |
| 106 | + dev.show() |
| 107 | + sleep_ms(20) |
| 108 | + result = True |
| 109 | + expect_true: true |
| 110 | + mode: [hardware] |
| 111 | + |
| 112 | + - name: "Animation was smooth" |
| 113 | + action: manual |
| 114 | + prompt: "Le texte 'STeaMi' a-t-il defile horizontalement de maniere fluide ?" |
| 115 | + expect_true: true |
| 116 | + mode: [hardware] |
0 commit comments