Renesas Single-Chip Microcomputer M38C89T-ADF Informações Técnicas Página 10

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 24
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 9
4.3. Renesas USB Function API (R_USBF)
This is an optional API layer that can be used by an application rather than calling the USB Stack functions directly. It provides a generic API
regardless of the USB class being used. The sample applications all use this API exclusively but as not all the functionality of the USB stack
is available through this API it is realised that some applications may need to access the USB stack directly.
Here are the functions that make up the R_USBF API.
Note that the description here is a generic one, each class has its own specific implementation.
Name Description
R_USBF_Open Open the device.
R_USBF_Close Close the device.
R_USBF_Read Perform a read operation.
R_USBF_Write Perform a write operation.
R_USBF_Control Perform any other operation not supported by any of the above functions.
This API is accessible via a pointer to a R_USBF_API structure which must be obtained by a call to function:-
R_USBF_API* Get_API_R_USBF(R_USBF_CLASS_TYPE type)
File ‘r_usbf.h’ contains the definition of the common parts of the R_USBF interface. A particular class will have a file called ‘r_usbf_xxx.h
which will contain any class specific extensions such as IOCTRL codes for the R_USBF_Control function. A particular class implementation
of the interface will be in file ‘r_usbf_xxx.c’.
4.4.Human Interface Device Class
The HID class as the name suggests is commonly used for things like keyboards, mice and joysticks where a human’s action is causing the
need for communication. However this does not need to be the case. The HID class is suitable for any device where the communication can
be achieved by sending data in ‘reports‘ of a predefined size where the data transfer rate is not critical.
The HID class has been supported by Microsoft Windows 98 onwards. Support is both at kernel level and user level. When a HID type device
is plugged into a Windows PC it will be automatically recognised and Windows will load its own drivers for it, so there is no need to develop
a custom Windows driver or even a Windows ‘inf’ file.
This implementation of the HID class supports a single IN report and a single OUT report. Both Interrupt IN and Control IN (via Get_Report)
transfers are supported for sending a report to the host. Reports from the host must use Control OUT (via Set_Report).
Here are the functions that make up the USBHID API.
Name Description
USBHID_Init Initialise the HID module. Register a callback functions to be called when a report is received from the host.
Provide the initial contents of a report to send to the host. Initialises the Core and HAL layers.
USBHID_ReportIN Send a report to the host using Interrupt IN transfer.
The HID module consists of the following files:-
usb_hid.c
usb_hid.h.
usb_descriptors.c
usb_descriptors.h
usb_common.h
8
Vista de página 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 23 24

Comentários a estes Manuais

Sem comentários