This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS Driver Model

I am looking into using a CMSIS standard driver model for a microcontroller peripherals. I am working with CMSIS-SP-00300-r4p3-00rel0.zip. It seems that the ARM Driver model does not support the channels for the peripherals. Even if the channels are explicitly instantiated using, for example - the ARM_DRIVER_I2C structure - there is no way to identify the device context when the drivers functions are called. It would be useful if the Driver will allow a handle to a device context that linked to a channel and mode of operation. I'd like to know if anybody came across this problem in their development.

Parents
  • Hi Tanya,

    Your request is not fully clear to us. What exactly do you mean by “device context”?

    Just in case that you refer to the fact that we serve one fixed channel per driver struct, this was deliberately implemented in this way as:

    • Middleware typically uses a fixed I/O channel, i.e. a file system connects a SD card via SPI1.
    • Frequently channels have different configurations, SPI1 using DMA, SPI2 only used for transmission, etc.
    • The current model allows use-case optimization, i.e. SPI1 can be optimized for high data throughput for SD card, SPI2 for sending just a few bytes to a peripheral.
    • Future operating systems may need secure communication channels. I/O functions that only connect to a specific channel remove the need for additional run-time checks for security.

    For real-world implementations that sever more than one I/O channel, you may take a look to the CMSIS software pack. It contains reference implementations in the folder CMSIS\4.3.0\CMSIS\Pack\Example\CMSIS_Driver. The I2C_LPC18xx.c file handles for example two I2C channels.

    I hope this helps.

    Reinhard

Reply
  • Hi Tanya,

    Your request is not fully clear to us. What exactly do you mean by “device context”?

    Just in case that you refer to the fact that we serve one fixed channel per driver struct, this was deliberately implemented in this way as:

    • Middleware typically uses a fixed I/O channel, i.e. a file system connects a SD card via SPI1.
    • Frequently channels have different configurations, SPI1 using DMA, SPI2 only used for transmission, etc.
    • The current model allows use-case optimization, i.e. SPI1 can be optimized for high data throughput for SD card, SPI2 for sending just a few bytes to a peripheral.
    • Future operating systems may need secure communication channels. I/O functions that only connect to a specific channel remove the need for additional run-time checks for security.

    For real-world implementations that sever more than one I/O channel, you may take a look to the CMSIS software pack. It contains reference implementations in the folder CMSIS\4.3.0\CMSIS\Pack\Example\CMSIS_Driver. The I2C_LPC18xx.c file handles for example two I2C channels.

    I hope this helps.

    Reinhard

Children
No data