Follow these steps to configure the Peripheral I/F channel(s) to receive data:
- Configure RX and frame size:
- ICSSG_PRU0_ED_CHm_CFG0_REG[27-16] PRU0_ED_RX_FRAME_SIZEm (where n = 0 or 1 and m = 0 to 2)
- Configure start bit polarity:
- ICSSG_PRU0_ED_RX_CFG_REG[3] RX_SB_POL (PRU0 or PRU1)
- For the non-auto arm use case, set r30[26, 25, 24] = 1 (rx_en<m>)
- For the auto arm use case, rx_en<m> will be automatically enabled at the end of a TX operation when ICSSG_PRU0_ED_CHm_CFG1_REG[31-16] PRU0_ED_RX_EN_COUNTERm > 0 (where n = 0 or 1 and m = 0 to 2)
- RX FIFO will start filling on the first start bit (PERIF<m>_IN = 1). The data will be captured on the positive edge of the PERIF<m>_CLK and shifted into the LSB position of the 8-bit shadow register.
- Poll for r31[26, 25, 24] (val<m>) assertion. The valid flag will be asserted when n bits of data (determined by ICSSG_PRU0_ED_RX_CFG_REG[2-0] PRU0_ED_RX_SAMPLE_SIZE) have been collected.
- Fetch data by reading r31[23-16, 15-8, 7-0] (rx_data_out<m>). The data will remain constant for one data frame, and PRU must read data and clear valid flag within this time. Otherwise, an overflow will occur – r31[29, 28, 27] (ovf<m>) = 1 - indicating that val<m> has been continuously asserted for longer than one data frame.
- The clock will be stopped based on the r30[20-19] (clk_mode) configured before the start of the RX operation.
- Clear r30[26, 25, 24] (rx_en<m>) to disable RX mode. All counters and flags will be reset.