Formalize SPI driver #406
Replies: 2 comments 3 replies
-
Hi @stickbreaker, I absolutely agree that the SPI bus interface needs to be abstracted. In fact, this is also true of the I2C bus interface. Your thoughts are generally consistent with mine. Are you proposing to merge your changes to the main repository? If so, we will need to discuss some of this further only because these are API level changes and those are the kind of changes I like to be very careful with. Here are a few things that need to be considered for a general purpose SPI (or I2C) bus interface in RomWBW:
The SD driver is indeed a big mess. I have long wanted to fix it, but have not found the time to do it. Since there are many SPI hardware interfaces currently supported in the SD driver, it will be necessary to create many new SPI drivers in order to abstract the SPI functionality. This is a fair amount of work. Thanks, Wayne |
Beta Was this translation helpful? Give feedback.
-
@wwarthen Wayne, I have a ADC for K-type transducers that uses SPI (ADS1118). and I am going to use this sensor from an App level code. I guess if an App tries to interleave an SPI call it should cause a Core Panic(Blue Screen). Currently I'm just using the SPI at below BDos level. Chuck. |
Beta Was this translation helpful? Give feedback.
-
@wwarthen Warren,
On my Z180 board I have added a circuit to support multiple SPI CS selections.
I am currently modifying 3.5 to change how the CS is handled. I have stripped out( ifdef'd) the existing code and replaced it with
and
I want to change the SD driver and possibly the RTC driver to use this model.
I think that the SD INIT code should accept a logical device ID instead of the internal bit manipulation code.
With my hardware I have expanded SPI to 32 devices and maintained compatibility with the current SD code.
I haven't started on the RTC code, I am planning on using a PFC2127 RTC.
When my hardware RESETS, it is compatible with 3.4
I am also working on encapsulating all of the ASI calls into a SPI driver.
I added hardware to support the bit order flipping.
My reason for all of these changes, is that I am adding multiple SPI devices (Flash, RTC, ADC, IO Expanders) and see no reason that each device driver needs to understand the SPI subsystem. Just their specific Device. I am planning on supporting Logical Slice File Device on multiple SPI devices (MT29F4G01 512MB NAND Flash, W25Q512 64MB Flash, SST25VF040B 512KB Flash, W25Q128 16MB Flash, 23AA04 512KB RAM ...)
Chuck.
Beta Was this translation helpful? Give feedback.
All reactions