USB get/putchar for USB CDC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB get/putchar for USB CDC

525 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pra18 on Tue Mar 25 04:22:38 MST 2014
Hi all,

Is there a getchar and putchar kind of functions  that transmit/ receive one byte over USB for USB CDC purpose on lpc435x.
Consider that we use the USB BD ROM libraries.

I find it is available for lpc11xx.

Thanks in advance,
pra18

Labels (1)
0 Kudos
Reply
2 Replies

448 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pra18 on Wed Aug 27 06:46:50 MST 2014
Hi,

Thanks for the reply
I went through the cdc_uart source but could not make out how it is done.

however I' ll  try to explain the scenario on my side as below .

I am trying to migrate from UART to the USB on this lpc chip and thereby use  UART style interfaces by making use of  USB ROM APIs .

I see that there is a reduced flexibility to use one's own implementation since this USBD is ROM'ed in lpc43xx and only header files are exposed and when one tries to use  the APIs provided by driver for e.g to read and write without little flexibility

in this case, for example to transmit / receive

Case 1 . a single a byte of data through the USB
Case 2  .a block of data through USB

what would be the correct approach. Can you give some examples?
how would one do it compared to the conventional UART on the lpc.

This becomes slightly complicated for someone who is trying to emulate this USB as a UART and
will try to use UART styed interface using  the USB ROM API.

it is  indeed good that USBD is located in ROM and reduces significant time in creating USB user apps.

Thansk in advance,





0 Kudos
Reply

448 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drs on Fri Apr 11 16:41:19 MST 2014
The getchar equivalent in the USB ROM drivers is  USBD_API->hw->ReadReqEP() and the putchar equivalent is USBD_API->hw->WriteEP. You can see how these functions are used in the cdc_uart example in LPCOpen Platform. These are called in the UART ISR in cdc_uart.c
0 Kudos
Reply