User manual

Table Of Contents
604
mikoC PRO for PIC32
MikroElektronika
Gen_Read
Prototype
char Gen_Read(char *readbuff, char length, char ep);
Description Generic routine that receives the specied data from the specied endpoint.
Parameters - readbuff: Received data.
- length: The length of the data that you wish to receive.
- ep: Endpoint number you want to receive the data into.
Returns Returns the number of received bytes, otherwise 0.
Requires USB needs to be enabled before using this function. See HID_Enable.
Example
while(Gen_Read(readbuff,64,1)==0)
;
Notes None.
Gen_Write
Prototype
char Gen_Write(char* writebuff, char length, char ep);
Description Sends the specied data to the specied endpoint.
Parameters - writebuff: The data that you want to send.
- length: the length of the data that you wish to send.
- ep: Endpoint number you want to send the data into.
Returns Returns the number of transmitted bytes, otherwise 0.
Requires USB needs to be enabled before using this function. See HID_Enable.
Example
while(Gen_Write(writebuff,64,1)==0)
;
Notes None.