正在加载图片...
Interconnectivity Page 9 of 22 Firmware Programming guide for PDIUSBD12 The isr communicates with the foreground Main Loop through event flags"EPPFLAGS"and data buffers "CONTROL XFER" typedef union_ epr struct ned char nsigned cha unsigned char remote wakeup 1 unsigned char in is unsigned char control state 2: unsigned char ep1 rxdone 1 char setup dm unsigned char dma state 2: signed short value: typedef struct device_ request signed short wvalue signed short wIndex, unsigned short lEngth 1DEVICE_ REQUEST: DEVICE REQUEST Device Request unsigned short lEngth unsigned char’pDaa unsigned char data Buffer[MAX CONTROLDATA SIZE the data. The isR will only inform Main Loop that data is ready for processing when it has collected egg n The task splitting between Main Loop and ISR is that ISr collects data from D12 and Main Loop will proces 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 spends the bit in EPPFLAGS and exit. llips Semiconductors-Asia Product Innovation Centre Visithttp://www.flerInterconnectivity Page 9 of 22 Firmware Programming Guide for PDIUSBD12 Philips Semiconductors - Asia Product Innovation Centre Visit http://www.flexiusb.com 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 : 1; unsigned char bus_reset : 1; unsigned char suspend : 1; unsigned char setup_packet : 1; unsigned char remote_wakeup : 1; unsigned char in_isr : 1; unsigned char control_state : 2; unsigned char configuration : 1; unsigned char verbose : 1; unsigned char ep1_rxdone : 1; unsigned char setup_dma : 1; unsigned char dma_state : 2; } 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
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有