17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Functional Overview<br />

Relevant Interrupts:<br />

#int_usb<br />

A USB event has happened, and requires application intervention. The<br />

USB library that <strong>CCS</strong> provides handles this interrupt automatically.<br />

Relevant Include<br />

files:<br />

pic_usb.h<br />

pic18_usb.h<br />

usbn960x.h<br />

usb.h<br />

usb.c<br />

usb_cdc.h<br />

Hardware layer driver for the PIC16C765 family PICmicro controllers<br />

with an internal USB peripheral.<br />

Hardware layer driver for the PIC18F4550 family PICmicro controllers<br />

with an internal USB peripheral.<br />

Hardware layer driver for the National USBN9603/USBN9604 external<br />

USB peripheral. You can use this external peripheral to add USB to any<br />

microcontroller.<br />

Common definitions and prototypes used by the USB driver<br />

The USB stack, which handles the USB interrupt and USB Setup<br />

Requests on Endpoint 0.<br />

A driver that takes the previous include files to make a CDC USB<br />

device, which emulates an RS232 legacy device and shows up as a<br />

COM port in the MS Windows device manager.<br />

Relevant getenv() Parameters:<br />

USB<br />

Returns TRUE if the PICmicro controller has an integrated internal USB<br />

peripheral.<br />

Example Code:<br />

Due to the complexity of USB example code will not fit here. But you can find the following<br />

examples installed with your <strong>CCS</strong> C <strong>Compiler</strong>:<br />

ex_usb_hid.c<br />

ex_usb_mouse.c<br />

ex_usb_kbmouse.c<br />

ex_usb_kbmouse2.c<br />

ex_usb_scope.c<br />

A simple HID device<br />

A HID Mouse, when connected to your PC the mouse cursor will go in<br />

circles.<br />

An example of how to create a USB device with multiple interfaces by<br />

creating a keyboard and mouse in one device.<br />

An example of how to use multiple HID report Ids to transmit more than<br />

one type of HID packet, as demonstrated by a keyboard and mouse on<br />

one device.<br />

A vendor-specific class using bulk transfers is demonstrated.<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!