• AVR Freaks

Hot!Harmony 3 SPI Transfers

Author
harrisondintellimon
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2017/04/18 05:35:13
  • Location: 0
  • Status: offline
2019/05/08 07:00:38 (permalink)
0

Harmony 3 SPI Transfers

Hello,
 
I've just started to implement harmony 3 with the SPI transfers and I have noticed that the transfer callback and context have now been changed to a client callback and context. Is there a reason behind this? I would have thought there would be more use in knowing what the SPI transfer is related to rather than the SPI client.
 
For example in Harmony V2 I was using something like this:
object->spiBufferHandle = DRV_SPI_BufferAddWrite2(object->drvHandle, &(queue->buffer[0]), ((numData*2) + 1), 
            &spiCallbackTxQueue, queue, &(object->spiBufferHandle));

 
But in Harmony 3 I can't pass the "&spiCallbackTxQueue, queue," (callback and context).
 
Am I miss interpreting the way the new libraries should be used?
 
Dan.
post edited by harrisondintellimon - 2019/05/13 02:26:12
#1

3 Replies Related Threads

    arpananand
    Super Member
    • Total Posts : 403
    • Reward points : 0
    • Joined: 2009/11/18 04:35:42
    • Location: 0
    • Status: offline
    Re: Harmony 3 SPI Transfers 2019/05/13 21:54:13 (permalink)
    0
    We have reduced the granularity of setting callback (and context) to client level in order to make transfer API simpler and consistent with other drivers. Also, we didn't encounter any use case where user must have those at transfer level. 
    do you have any specific use case in mind where its needed at transfer level?
    #2
    harrisondintellimon
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/04/18 05:35:13
    • Location: 0
    • Status: offline
    Re: Harmony 3 SPI Transfers 2019/05/14 02:12:49 (permalink)
    0
    The case where I have used it is in a driver for a display. I add SPI commands to a queue and the callback is used to remove the item from the queue. The queue is processed in the tasks.
     
    I have attached my display driver. It is incomplete so shouldn't be used for anything. This driver was written for V2.06.
     
    Feel free to let me know if you feel I am using the drivers in an incorrect way and you have a different way in mind.
     
    Line 416 is where the item is added to the queue, line 168 is the callback.
     
    I have also gone ahead and modified the Harmony v3 driver to include the callback and context as it is a minimal change.
    post edited by harrisondintellimon - 2019/05/14 02:14:17
    #3
    harrisondintellimon
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/04/18 05:35:13
    • Location: 0
    • Status: offline
    Re: Harmony 3 SPI Transfers 2019/06/03 05:56:47 (permalink)
    0
    I have also noticed that the transfer event DRV_SPI_TRANSFER_EVENT_PROCESSING has disappeared. Was this on purpose as well?
     
    I can no longer use my CS decoder (three pins to 8 CS') to select a number of devices. 
     
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5