Changes 2024-05-29

Module UARTdev

  • GetBaseCfg to read base configuration, then change local instance as required.
  • Base configuration is: 8 bits, 1 stop bit, no parity, FIFO off. This is the hardware reset configuration, with the exception of the 8 bits data width.
  • DeviceCfg now covers all bits in configuration register LCR_H.
  • Some identifier name changes in DeviceCfg.

Module SPIdev

  • GetBaseCfg to read base configuration, then change local instance as required.
  • An SPI device can talk to multiple connected peripherals, selected via CS (chip select), and to each peripheral using a different configuration regarding
    • serial clock rate,
    • serial clock polarity and phase (CPOL, CPHA),
    • data size (8 or 16 bits),
    • txShift value, ie. the “dummy” transmit data to receive data.1
  • SPIdev now allows for
    • a basic configuration via Configure,
    • a further run-time per-transaction (SPI tx and rx) configuration via PutRunCfg and DeviceRunCfg.
  • DeviceCfg is used to define a run-time configuration, via RECORD fields, but it would be wasteful to always convert the RECORD to the register value for each transaction. DeviceRunCfg contains the converted register value, MakeRunCfg is used to make the conversion.
  • Cf. example program SPIrtc, which has been updated (see below).
  • Some structural and identifier name changes in DeviceCfg, which strictly represents control register CR0 now (setting CR0 does the per-transaction configuration).
  • Some utility procedures:
    • GetSclkRateRange: query the possible serial clock rate range after Configure.
    • SclkRate: read current serial clock rate after PutRunCfg.
    • SCRvalue: calculate the value for bitfield SCR in register CR0 for a specific serial clock rate.
  • Note: consider this as an intermediate stage of the SPI interface. It will change with a forthcoming Change Note based on current work.

Module Terminals

  • Update for the changes in UARTdev (see above).

Module Main

  • Update for the changes in modules UARTdev and Terminals.
  • Use base UART configuration, but enable the FIFO.
  • Library module, and all modules Main for specific examples. Hopefully correct this time.

Module GPIO

  • GetBasePadCfg to read base pad configuration, then change local instance as required.

Example Program SPIrtc

  • Change to work with updated module SPIdev, as outlined above.
  • The SPI peripheral used, the Maxim DS3234 real-time clock, can be used with different run-time configuration. The example program uses four variants to test the new feature: different serial clock polarity, different serial clock frequencies, different transmit shift values.
  • See SPIrtc

  1. Many SPI peripherals don’t care about this value, but some do, such as SD cards. ↩︎