GPIF master: different sources for DR_ADDR problem | Cypress Semiconductor
GPIF master: different sources for DR_ADDR problem
I am trying to use FX3 in master mode to send/receive data to simple external bus. Bus has 8bit data (bidirectional), 7bit address (write-only from FX side) and WR/RD lines for simple toggle (also write-only from FX). FX will have 1 bulk endpoint for data writes, 1 bulk endpoint for data reads and 1 control endpoint for commands.
So I have created 2 START states, one for reading and another for writing (I plan to switch between them depending on command received). For writing I receive 2 bytes from PC via bulk endpoint in format <addr> <data> then put it to external bus using DR_ADDR (source: from thread socket), DR_DATA then toggle WR. For reading, after I receive command with address and number of bytes to read via control endpoint, I plan to manually program DATA_COUNT, then put desired address to bus using DR_ADDR (source: from register) then toggle RD then put received data to bulk endpoint via IN_DATA.
The problem is that when in read state I set DR_ADDR action to use register as a source, source in DR_ADDR action used in write state automatically changed too, but I need to use ThreadSocket as a source there. How can i solve this? Maybe I am on wrong way and different approach should be used? Thank you in advance.