Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
633
HID_Disable
Prototype
sub procedure HID_Disable()
Description Disables USB HID communication.
Parameters None.
Returns
Nothing.
Requires
USB HID needs to be enabled before using this function. See HID_Enable.
Example
HID_Disable()
Notes
None.
USB_Interrupt_Proc
Prototype
sub procedure USB_Interrupt_Proc()
Description This  routine  is  used  for  servicing  various  USB  bus  events.  Should  be  called  inside  USB  interrupt 
routine.
Parameters None.
Returns
Nothing.
Requires
Nothing.
Example
sub procedure USB1Interrupt() iv IVT_ADDR_USB1INTERRUPT
  USB_Interrupt_Proc()
end sub
Notes
Do not use this function with USB_Polling_Proc, only one should be used. To enable servicing through 
interrupt, 
USB_INTERRUPT
 constant should be set (it is set by default in descriptor file).
USB_Polling_Proc
Prototype
sub procedure USB_Polling_Proc()
Description This routine is used for servicing various USB bus events. It should be periodically, preferably every 
100 microseconds.
Parameters None.
Returns
Nothing.
Requires
Nothing.
Example
while TRUE
  USB_Polling_Proc()
  kk = HID_Read()
  if (kk <> 0) then
    for cnt = 0 to 63
      writebuff[cnt] = readbuff[cnt]
    next cnt
    HID_Write(@writebuff,64)
  end if
wend
Notes
Do not use this functions with USB_Interrupt_Proc. To enable servicing by polling, 
USB_INTERRUPT
 
constant should be set to 0 (it is located in descriptor file).