Changes between Version 15 and Version 16 of library_mwmr


Ignore:
Timestamp:
Oct 30, 2015, 10:13:53 AM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_mwmr

    v15 v16  
    1010This software FIFO can be directly accessed by an hardware coprocessor, thanks to the vci_mwmr_controller, but we only describe here the software API that can be used by a software applications.
    1111
    12 An MWMR transaction transfer an integer number of items between a thread private buffer and the MWMR communication channel. An item is the smallest quantity of data that can be atomically transfered. It is an integer number of 32 bits words (unsigned int).
     12An MWMR transaction transfer an integer number of items between a thread private buffer and the MWMR communication channel. An item is the smallest quantity of data that can be atomically transfered. It is an integer number of 32 bits words (uint32_t).
    1313
    1414An '''mwmr_channel_t''' communication channel is therefore defined by two parameters:
     
    3131
    3232
    33 == Communication Channel Initialisation ==
     33== __Communication Channel Initialisation__ ==
    3434
    35 === void '''mwmr_init'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int  width, unsigned int  items ) ===
     35=== void '''mwmr_init'''( mwmr_channel_t* mwmr, uint32_t* buffer , uint32_t  width , uint32_t  items ) ===
    3636This function initializes the MWMR channel descriptor (including the lock protecting exclusive access).
    3737 * '''mwmr''' : MWMR channel descriptor base address.
     
    4141It must be called by one single task.
    4242
    43 == Communication Channel Blocking Access ==
     43== __Communication Channel Blocking Access__ ==
    4444
    45 === void '''mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int  items ) ===
     45=== void '''mwmr_write'''( mwmr_channel_t* mwmr, uint32_t* buffer , uint32_t  items ) ===
    4646This function transfer (nitems * width) 32 bits words from a task private buffer to the MWMR channel.
    4747 * '''mwmr''' : MWMR channel virtual base address.
     
    5050It takes the lock for exclusive access before testing the channel state. If there is not enough space in mwmr channel to write nitems, it writes as many items as possible, releases the lock, does not return, but retry to take the lock to transfer the rest of the data... up to completion.
    5151
    52 === void '''mwmr_read'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int items ) ===
     52=== void '''mwmr_read'''( mwmr_channel_t* mwmr, uint32_t* buffer , uint32_t items ) ===
    5353This function transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer.
    5454 * '''mwmr''' : MWMR channel virtual base address.
     
    5858
    5959
    60 == Communication Channel Non Blocking Access  ==
     60== __Communication Channel Non Blocking Access__  ==
    6161
    62 === unsigned int '''nb_mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int items ) ===
     62=== uint32_t '''nb_mwmr_write'''( mwmr_channel_t* mwmr , uint32_t* buffer , uint32_t items ) ===
    6363This function request to transfer (nitems * width) 32 bits words from a task private buffer tot he MWMR channel.
    6464 * '''mwmr''' : MWMR channel virtual base address.
     
    6767It takes the lock for exclusive access before testing the channel state. If there is not enough free space in the channel, it transfer as many items as possible, releases the lock, and returns the number of actually transfered items (it can be 0).
    6868
    69 === unsigned int '''nb_mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int items ) ===
     69=== uint32_t '''nb_mwmr_write'''( mwmr_channel_t* mwmr , uint32_t* buffer , uint32_t items ) ===
    7070This function request to transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer.
    7171 * '''mwmr''' : MWMR channel virtual base address.
     
    7474It takes the lock for exclusive access before testing the channel state. If there is not enough data in the channel, it transfer as many items as possible, releases the lock, and returns the number of actually transfered items (it can be 0).
    7575
    76 == Private Buffer Initialization ==
     76== __Private Buffer Initialization__ ==
    7777
    7878=== void '''mwmr_bufio_init'''( mwmr_bufio_t* bufio , uint8_t* buffer , uint32_t size , uint32_t is_input , mwmr_channel_t* mwmr ) ===
     
    8484 * '''mwmr''' : pointer on the associated MWMR channel descriptor.
    8585 
    86 == Private Input Buffer Access ==
     86== __Private Input Buffer Access__ ==
    8787                   
    8888=== uint8_t '''mwmr_bufio_read_byte'''( mwmr_bufio_t* bufio ) ===
     
    9898This function discard <length> bytes from the MWMR channel associated to the <bufio> input buffer.
    9999
    100 == Private Output Buffer Access ==
     100== __Private Output Buffer Access__ ==
    101101
    102102=== void '''mwmr_bufio_write_byte'''( mwmr_bufio_t* bufio , uint8_t value ) ===