google / cyanobyte

Machine-readable datasheets
https://cyanobyte.dev
Apache License 2.0
79 stars 31 forks source link

Support SPI #209

Open Fleker opened 4 years ago

Fleker commented 4 years ago

Implement a basic SPI mode that can use a mix of registers or serialized message buffers. If it uses registers and supports multiple transport layers, how do we separate I2C and SPI?

This format is already supported in several platforms including Arduino and Android Things and uses transactions.

We should update the JSON schema at the same time to perform proper validation.

Example spec:

spi:
  # These two params combined make up AThings SPI modes 0-3 in a quadrant
  clockPolarity: LOW | HIGH
  clockPhase: LEADING | TRAILING # clock edge
  frequency: 16000 # 16KHz
  endianness: # Same as in I2C (make this a separate type we reference?)
  word: 8 # bits
  format: REGISTER | SERIALIZATION # Depends on whether we use registers or we use serialized message buffers