Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Help with virtual com port with gnu

2006-05-20 by Bertrik Sikken

Erick Damasceno wrote:
> I'm new in this forum and i would like to know if anyone here have
> succed porting the keil virtual com port code for the gnu. I saw a
> post from bertrik saying that he made this happen, but i want de
> codes to understand everything. If anyone can help, thanks

A list of the required changes is in this message:
http://groups.yahoo.com/group/lpc2000/message/12327

Examples:
* struct packing (usb.h)
typedef struct _USB_SETUP_PACKET {
needs to be changed into
typedef struct __attribute__ ((packed)) _USB_SETUP_PACKET {
(the other structures should receive similar changes)
* interrupt attribute
Interrupt service routine should be declared as follows (usbhw.h)
extern void  USB_ISR        (void) __attribute__ ((interrupt));
* porting functions that us __packed on left-hand-side (usbhw.c)
in USB_ReadEP, use the following in the for-loop
	dw = RX_DATA;
	*pData++ = dw >> 0;
	*pData++ = dw >> 8;
	*pData++ = dw >> 16;
	*pData++ = dw >> 24;
in USB_WriteEP, use the following in the for-loop
	TX_DATA = (pData[3] << 24) | (pData[2] << 16) | (pData[1] << 8) | pData[0];
	pData += 4;

Regards,
Bertrik

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.