User manual
633
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
Gen_Enable
Prototype
procedure Gen_Enable(readbuff : ^byte; writebuff : ^byte);
Description Initialize the USB module of the MCU.
Parameters - readbuff: Read Buffer.
- writebuff: Write Buffer.
Returns Nothing.
Requires USB needs to be enabled before using this function. See HID_Enable.
Example
Gen_Enable(@readbuff,@writebuff);
Notes None.
Gen_Read
Prototype
function Gen_Read(readbuff : ^byte; length : byte; ep : byte) : byte;
Description Generic routine that receives the specied data from the specied 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) do
;
Notes None.
Gen_Write
Prototype
function Gen_Write(writebuff : ^byte; length : byte; ep : byte) : byte;
Description Sends the specied data to the specied 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) do
;
Notes None.