
S3C9654/C9658/P9658
APPENDIX
19-23
9.
Interrupt source.
9.1. Data_End flag : "1"
→ "0".
9.2. Sent_Stall
: "0"
→ "1".
9.3. In_Pkt_Rdy
: "1"
→ "0".
9.4 Out_PKt_Rdy
: "0"
→ "1".
10. Possible value of ep0csr when you get interrupt and appropriate action.
The first two flag (Clr_Setup_End, Clr_Out_Pkt_Rdy) are always "0" value when you read so I will
explain just low 6 bits.
If the MCU did not clear Sent_Stall flag then this value remain "1" until cleared. So Sent_Stall can be
set to any combination with below.
10.1. "000001" : Set Out_Pkt_Rdy.
If you get this value then you should check your state variable. If the state is in OUT control
transfer then this interrupt notice the receiving of OUT data transfer. So you should download the
FIFO data and clear this flag and do a appropriate action. If the state is in IDLE then this interrupt
means that the controller receive new setup transaction so download the FIFO data and should
decode and do a appropriate action.
10.2. "000100" : Set Sent_Stall.
If the controller sent stall to upstream then this value be set by SIE. This flag is for just monitoring.
So just clearing this flag is enough action.
10.3. "001000" : Set Data_End flag.
Actually this flag does not a generate interrupt condition. When you set In_Pkt_Rdy and Data_End
flag at the same time and the controller receive IN transaction and send data and receive ACK
packet then only In_Pkt_Rdy flag is cleared and generate interrupt. In this case you can get this
value set but there is no meaning so just leave these alone is enough action.
10.4. "010000" : Set Setup_End.
If the former control transfer is terminated by abnormally then this flag is set by hardware.
So if MCU got this value then should clear this flag and initialize some variable and should prepare
future control transfer.
10.5. "010001" : Set Setup_End and Out_Pkt_Rdy.
If the former transfer is terminated by new SETUP transaction then MCU can get this value.
If the MCU get this value then should initialize variable and reset the status variable according to
new command.
10.6. "000000" : Nothing is set.
This value can get in two case. If the former control transfer is terminated with Data_End setting.
The other case is happen in data stage of IN control transfer. In IN control transfer if you load data
to endpoint 0 FIFO and set In_Pkt_Rdy and the controller receive IN token and send data and
receive ACK packet then the SIE clear In_Pkt_Rdy and generate interrupt.