Symbols
loading...
Files
loading...

seg_slave sample sample

seg_slave sample is a sample project defining the following symbols:

Most used functions

Name
Location
Summary
NOTE: Only if all the counters are in same size (here uint32_t), the calculation is safe (when the shared register overflows). NOTE: If Slave resets the counters, Master needs to reset its counter accordingly. NOTE: You can also implement your own synchronization method, BUT DO MIND the parallelled issue. To write the size of the TX buffer that is loaded to the hardware (DMA) This callback function will be called when each TX buffer is loaded to the DMA. - For Slave, ``s_tx_ready_buf_size`` is a counter of the loaded buffer size and will be written to the pre-negotiated shared register. - For Master, it also needs a counter for the size of buffers that have been received. - The difference between these 2 counters will be the number that Master can read, without concern of reading meaningless data. There are 3 conditions: 1. Master reads same length as Slave loaded size. 2. If Master reads longer than the Slave loaded size, the extra bits that Master reads from the bus would be meaningless. 3. If Master reads shorter than the Slave loaded size, Master should still increase its counter by the Slave loaded size (here ``event->trans->len``), because the extra bits that Slave sends to the bus would be missed by the Master.
To write the number of the RX buffers that are loaded to the hardware (DMA) This callback function will be called when each RX buffer is loaded to the DMA. - For Slave, ``s_rx_ready_buf_num`` is a counter for the loaded buffer and will be written to the pre-negotiated shared register - For Master, it also needs a counter for the number of buffers that have been sent out. - The difference between these 2 counters will be the number that Master can send.

Other commonly used symbols

Name
Location
Summary
Helper Macros for Master-Slave synchronization, each setting is 4-byte-width The address and value should be negotiated with Master beforehand

Dependencies

seg_slave sample depends on the following libraries: