Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
481 B
1
Indexable
Never
static SPIDevice spi_dev_priv = {
    .spi            = spi_master,
    .timer          = spi_timer,
    .polarity       = 1,
    .phase          = 1,
    .cycles_per_bit = CLK_FREQUENCY_HZ / 5000000, // 5 Mbit/sec
    .cycles_per_gap = CLK_FREQUENCY_HZ / 5000000  // 200 ns
};

SPIDevice *const spi_dev = &spi_dev_priv;

static OLED oled_priv = {
    .spi        = spi_dev,
    .address    = 0x80000002,
    .cycles_1ms = CLK_FREQUENCY_HZ / 1000
};

OLED *const oled = &oled_priv;