Bus Reset And Suspend Change - Philips PDIUSBD12 Firmware Programming Manual

Hide thumbs Also See for PDIUSBD12:
Table of Contents

Advertisement

Interconnectivity
Firmware Programming Guide for PDIUSBD12
The ISR communicates with the foreground Main Loop through event flags "EPPFLAGS" and data buffers
"CONTROL_XFER".
typedef union _epp_flags
{
struct _flags
{
unsigned char timer
unsigned char bus_reset
unsigned char suspend
unsigned char setup_packet
unsigned char remote_wakeup : 1;
unsigned char in_isr
unsigned char control_state
unsigned char configuration
unsigned char verbose
unsigned char ep1_rxdone
unsigned char setup_dma
unsigned char dma_state
} bits;
unsigned short value;
} EPPFLAGS;
typedef struct _device_request
{
unsigned char bmRequestType;
unsigned char bRequest;
unsigned short wValue;
unsigned short wIndex;
unsigned short wLength;
} DEVICE_REQUEST;
typedef struct _control_xfer
{
DEVICE_REQUEST DeviceRequest;
unsigned short wLength;
unsigned short wCount;
unsigned char * pData;
unsigned char dataBuffer[MAX_CONTROLDATA_SIZE];
} CONTROL_XFER;
The task splitting between Main Loop and ISR is that ISR collects data from D12 and Main Loop will process
the data. The ISR will only inform Main Loop that data is ready for processing when it has collected enough
data. For example, in the case of setup packet with OUT data phase, the ISR will store both setup packet and
OUT data to buffer "CONTROL_XFER" before it signals "setup_packet" flag to Main Loop. This will reduce
unnecessary Main Loop servicing time and also simply Main Loop programming.

5.1 Bus Reset and Suspend Change

Bus reset and suspend does not require special processing within ISR. ISR either sets the bus_reset flag or
suspends the bit in EPPFLAGS and exit.
: 1;
: 1;
: 1;
: 1;
: 1;
: 2;
: 1;
: 1;
: 1;
: 1;
: 2;
Philips Semiconductors - Asia Product Innovation Centre
Visit
http://www.flexiusb.com
Page 9 of 22

Advertisement

Table of Contents
loading

Table of Contents