SPI Driver "spi_driver_s" contains the SPI Device "spi_dev_s" ... That we need for testing the SPI Interface! But the SPI Device is private and hidden from apps 🙁

github.com/lupyuen/incubator-n

Show thread

Instead we copy an existing SPI Device Driver to test the SPI Interface ... We pick the simplest smallest SPI Device Driver: dat-31r5-sp

docs.google.com/spreadsheets/d

Show thread

Every Device Driver defines the File Operations for the device ... Here are the open(), close(), read(), write() and ioctl() operations for our SPI Test Driver

github.com/lupyuen/incubator-n

Show thread

In the write() operation for our SPI Test Driver, we 1️⃣ Lock the SPI Bus 2️⃣ Config the SPI Interface 3️⃣ Select the SPI Device 4️⃣ Transfer SPI Data 5️⃣ Deselect and Unlock

github.com/lupyuen/incubator-n

Show thread

's SPI Pins match the Reference Manual: MOSI = GPIO 1, MISO = GPIO 0 ... But we're about to witness a BL602 SPI Quirk

github.com/bouffalolab/bl_docs

Show thread
Show more

@lupyuen -- If I'm understanding this code correctly, then it is very clean and straight forward. Good job!!! 👍

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

An inclusive free speech instance.
All cultures and opinions welcome.
Explicit hate speech and harassment strictly forbidden.
We federate with all servers: we don't block any servers.