Change Note 2024-05-29
Device and GPIO pad configuration via base configs, SPI driver with per-transaction configurations, updated example program.
Module UARTdev
GetBaseCfgto 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.
DeviceCfgnow covers all bits in configuration registerLCR_H.- Some identifier name changes in
DeviceCfg.
Module SPIdev
GetBaseCfgto 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),
txShiftvalue, 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
PutRunCfgandDeviceRunCfg.
- a basic configuration via
DeviceCfgis 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.DeviceRunCfgcontains the converted register value,MakeRunCfgis 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 registerCR0now (settingCR0does the per-transaction configuration). - Some utility procedures:
GetSclkRateRange: query the possible serial clock rate range afterConfigure.SclkRate: read current serial clock rate afterPutRunCfg.SCRvalue: calculate the value for bitfieldSCRin registerCR0for 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
UARTdevandTerminals. - Use base UART configuration, but enable the FIFO.
- Library module, and all modules
Mainfor specific examples. Hopefully correct this time.
Module GPIO
GetBasePadCfgto 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
-
Many SPI peripherals don’t care about this value, but some do, such as SD cards. ↩︎