Changes between Version 15 and Version 16 of library_mwmr
- Timestamp:
- Oct 30, 2015, 10:13:53 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_mwmr
v15 v16 10 10 This 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. 11 11 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 (u nsigned int).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 (uint32_t). 13 13 14 14 An '''mwmr_channel_t''' communication channel is therefore defined by two parameters: … … 31 31 32 32 33 == Communication Channel Initialisation==33 == __Communication Channel Initialisation__ == 34 34 35 === void '''mwmr_init'''( mwmr_channel_t* mwmr, u nsigned 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 ) === 36 36 This function initializes the MWMR channel descriptor (including the lock protecting exclusive access). 37 37 * '''mwmr''' : MWMR channel descriptor base address. … … 41 41 It must be called by one single task. 42 42 43 == Communication Channel Blocking Access==43 == __Communication Channel Blocking Access__ == 44 44 45 === void '''mwmr_write'''( mwmr_channel_t* mwmr, u nsigned int* buffer, unsigned int items ) ===45 === void '''mwmr_write'''( mwmr_channel_t* mwmr, uint32_t* buffer , uint32_t items ) === 46 46 This function transfer (nitems * width) 32 bits words from a task private buffer to the MWMR channel. 47 47 * '''mwmr''' : MWMR channel virtual base address. … … 50 50 It 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. 51 51 52 === void '''mwmr_read'''( mwmr_channel_t* mwmr, u nsigned int* buffer, unsigned int items ) ===52 === void '''mwmr_read'''( mwmr_channel_t* mwmr, uint32_t* buffer , uint32_t items ) === 53 53 This function transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer. 54 54 * '''mwmr''' : MWMR channel virtual base address. … … 58 58 59 59 60 == Communication Channel Non Blocking Access==60 == __Communication Channel Non Blocking Access__ == 61 61 62 === u nsigned int '''nb_mwmr_write'''( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned intitems ) ===62 === uint32_t '''nb_mwmr_write'''( mwmr_channel_t* mwmr , uint32_t* buffer , uint32_t items ) === 63 63 This function request to transfer (nitems * width) 32 bits words from a task private buffer tot he MWMR channel. 64 64 * '''mwmr''' : MWMR channel virtual base address. … … 67 67 It 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). 68 68 69 === u nsigned 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 ) === 70 70 This function request to transfer (nitems * width) 32 bits words from the MWMR channel to a task private buffer. 71 71 * '''mwmr''' : MWMR channel virtual base address. … … 74 74 It 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). 75 75 76 == Private Buffer Initialization==76 == __Private Buffer Initialization__ == 77 77 78 78 === void '''mwmr_bufio_init'''( mwmr_bufio_t* bufio , uint8_t* buffer , uint32_t size , uint32_t is_input , mwmr_channel_t* mwmr ) === … … 84 84 * '''mwmr''' : pointer on the associated MWMR channel descriptor. 85 85 86 == Private Input Buffer Access==86 == __Private Input Buffer Access__ == 87 87 88 88 === uint8_t '''mwmr_bufio_read_byte'''( mwmr_bufio_t* bufio ) === … … 98 98 This function discard <length> bytes from the MWMR channel associated to the <bufio> input buffer. 99 99 100 == Private Output Buffer Access==100 == __Private Output Buffer Access__ == 101 101 102 102 === void '''mwmr_bufio_write_byte'''( mwmr_bufio_t* bufio , uint8_t value ) ===