Clean up hid_bootloader.h

This commit is contained in:
László Monda
2017-04-12 23:51:23 +02:00
parent 8920a208dd
commit fc2cecabf6

View File

@@ -1,37 +1,30 @@
#ifndef __USB_HID_MOUSE_H__
#define __USB_HID_MOUSE_H__ 1
#ifndef __USB_HID_BOOTLOADER_H__
#define __USB_HID_BOOTLOADER_H__
#include "fsl_rtos_abstraction.h"
#include "bootloader_hid_report_ids.h"
//! @brief Request parameters.
enum
{
enum { // Request parameters
kAppRequestParam_IdleRate = 0,
kAppRequestParam_Protocol,
kAppRequestParamCount
};
//! @brief State information for the USB HID packetizer.
typedef struct _usb_hid_packetizer_info
{
bool didReceiveFirstReport; //!< Whether the first report has been received.
bool didReceiveDataPhaseAbort; //!< Whether we received a data phase abort request.
bool isReceiveDataRequestRequired; //!< Whether an interrupt out pipe receive data request is required.
uint8_t appRequestParams[kAppRequestParamCount]; //!< Storage for request parameter values.
sync_object_t receiveSync; //!< Sync object used for reading packets.
sync_object_t sendSync; //!< Sync object used for sending packets.
uint32_t reportSize; //!< The size in bytes of a received report. May be greater than the packet contained within
//! the report plus the header, as the host can send up to the max report size bytes.
typedef struct _usb_hid_packetizer_info {
bool didReceiveFirstReport; // Whether the first report has been received.
bool didReceiveDataPhaseAbort; // Whether we received a data phase abort request.
bool isReceiveDataRequestRequired; // Whether an interrupt out pipe receive data request is required.
uint8_t appRequestParams[kAppRequestParamCount]; // Storage for request parameter values.
sync_object_t receiveSync; // Sync object used for reading packets.
sync_object_t sendSync; // Sync object used for sending packets.
uint32_t reportSize; // The size in bytes of a received report. May be greater than the packet contained
// within the report plus the header, as the host can send up to the max report size bytes.
bl_hid_report_t report; //!< Buffer used to hold HID reports for sending and receiving.
} usb_hid_packetizer_info_t;
typedef struct _usb_hid_generic_struct
{
typedef struct _usb_hid_generic_struct {
usb_device_handle device_handle;
class_handle_t hid_handle;
// uint32_t buffer[2][USB_HID_GENERIC_IN_BUFFER_LENGTH>>2];
// uint8_t buffer_index;
usb_hid_packetizer_info_t hid_packet;
uint8_t idle_rate;
uint8_t speed;