#include "conf_usb.h"
#include "board.h"
#include "usb_drv.h"
#include "gpio.h"
#include "joystick.h"
#include "usb_descriptors.h"
#include "usb_standard_request.h"
#include "device_generic_hid_task.h"
#include <string.h>
Macros | |
#define | RXBUF_SIZE 8 |
#define | TXBUF_SIZE 8 |
Functions | |
void | device_generic_hid_task (void) |
Entry point of the HID generic communication task This function manages IN/OUT report management. More... | |
void | device_generic_hid_task_init (void) |
This function initializes the hardware/software resources required for device generic HID task. More... | |
static void | hid_report_in (void) |
Send data report to Host. More... | |
static void | hid_report_out (void) |
Get data report from Host. More... | |
void | usb_sof_action (void) |
usb_sof_action More... | |
Variables | |
int | jump_bootloader |
int | last_joy = 0 |
char | rxbuf [RXBUF_SIZE] |
static uint16_t | sof_cnt |
char | txbuf [TXBUF_SIZE] |
#define RXBUF_SIZE 8 |
Referenced by hid_report_in(), and hid_report_out().
#define TXBUF_SIZE 8 |
void device_generic_hid_task | ( | void | ) |
Entry point of the HID generic communication task This function manages IN/OUT report management.
References hid_report_in(), hid_report_out(), and Is_device_enumerated.
Referenced by main().
void device_generic_hid_task_init | ( | void | ) |
This function initializes the hardware/software resources required for device generic HID task.
References Is_usb_device, sof_cnt, and Usb_enable_sof_interrupt.
Referenced by main().
|
static |
Send data report to Host.
Check for UP event
References data_to_transfer, EP_HID_GENERIC_IN, is_joystick_down(), is_joystick_left(), is_joystick_right(), is_joystick_up(), Is_usb_in_ready, Is_usb_write_enabled, last_joy, RXBUF_SIZE, txbuf, Usb_ack_in_ready_send, Usb_reset_endpoint_fifo_access, and usb_write_ep_txpacket().
Referenced by device_generic_hid_task().
|
static |
Get data report from Host.
References EP_HID_GENERIC_OUT, gpio_clr_gpio_pin(), gpio_set_gpio_pin(), Is_usb_out_received, jump_bootloader, LED0_GPIO, LED1_GPIO, LED2_GPIO, LED3_GPIO, rxbuf, RXBUF_SIZE, Usb_ack_out_received_free, Usb_detach, usb_read_ep_rxpacket(), and Usb_reset_endpoint_fifo_access.
Referenced by device_generic_hid_task().
int jump_bootloader |
Referenced by hid_report_out(), and usb_hid_set_report_feature().
int last_joy = 0 |
Referenced by hid_report_in().
char rxbuf[RXBUF_SIZE] |
Referenced by hid_report_out(), and usb_read_ep_rxpacket().
|
static |
Referenced by device_generic_hid_task_init(), and usb_sof_action().
char txbuf[TXBUF_SIZE] |
Referenced by hid_report_in(), and usb_write_ep_txpacket().