VSF Documented
vsf_usbh_ds4.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_USBH_DS4_H__
19#define __VSF_USBH_DS4_H__
20
21/*============================ INCLUDES ======================================*/
22
24
25#if VSF_USE_USB_HOST == ENABLED && VSF_USBH_USE_DS4 == ENABLED
26
28#if VSF_USE_INPUT == ENABLED && VSF_INPUT_USE_DS4 == ENABLED
30#endif
31
32#if defined(__VSF_USBH_DS4_CLASS_IMPLEMENT)
33# undef __VSF_USBH_DS4_CLASS_IMPLEMENT
34# define __VSF_CLASS_IMPLEMENT__
35#endif
36#include "utilities/ooc_class.h"
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/*============================ MACROS ========================================*/
43
44#if VSF_USBH_USE_HID != ENABLED
45# error "DS4 driver need VSF_USBH_USE_HID"
46#endif
47
48/*============================ MACROFIED FUNCTIONS ===========================*/
49/*============================ TYPES =========================================*/
50
51#if VSF_USE_INPUT == ENABLED && VSF_INPUT_USE_DS4 == ENABLED
52enum {
54};
55
56typedef struct vk_input_ds4u_t {
60#endif
61
63 implement(vk_usbh_hid_teda_t)
64#if VSF_USE_INPUT == ENABLED && VSF_INPUT_USE_DS4 == ENABLED
65 implement(vk_input_ds4u_t)
66#endif
67
68 private_member(
69 // gamepad_out_buf should be aligned
71 bool out_idle;
72 )
73};
74
75/*============================ GLOBAL VARIABLES ==============================*/
76
77#if VSF_USE_INPUT == ENABLED && VSF_INPUT_USE_DS4 == ENABLED
79#endif
80
82
83/*============================ PROTOTYPES ====================================*/
84
85#if VSF_USE_INPUT == ENABLED && VSF_INPUT_USE_DS4 == ENABLED
87extern void vk_ds4u_new_dev(vk_input_ds4u_t *dev);
88extern void vk_ds4u_free_dev(vk_input_ds4u_t *dev);
89#endif
90
92extern void vk_usbh_ds4_set_rumble(vk_usbh_ds4_t *ds4, uint8_t left, uint8_t right);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif // VSF_USE_USB_HOST && VSF_USBH_USE_DS4
100#endif // __VSF_USBH_DS4_H__
Definition vsf_usbh.h:268
Definition vsf_usbh_ds4.h:62
Definition vsf_usbh_HID.h:105
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_usbh_ds4.h:56
vsf_usb_ds4_gamepad_in_report_t data
Definition vsf_usbh_ds4.h:57
vk_input_timestamp_t timestamp
Definition vsf_usbh_ds4.h:58
Definition vsf_input.h:67
Definition vsf_usb_ds4.h:38
Definition vsf_usb_ds4.h:82
uint32_t vk_input_timestamp_t
Definition vsf_input.h:65
@ GAMEPAD_ID_NUM
Definition vsf_input_gamepad.h:99
#define VSF_INPUT_USER_TYPE
Definition vsf_input_get_type_1bit.h:103
void vk_ds4u_process_input(vk_input_ds4u_t *dev, vsf_usb_ds4_gamepad_in_report_t *data)
Definition vsf_usbh_ds4.c:163
void vk_usbh_ds4_set_rumble(vk_usbh_ds4_t *ds4, uint8_t left, uint8_t right)
Definition vsf_usbh_ds4.c:351
@ VSF_INPUT_TYPE_DS4
Definition vsf_usbh_ds4.h:53
const vk_usbh_class_drv_t vk_usbh_ds4_drv
Definition vsf_usbh_ds4.c:96
const vk_input_item_info_t vk_ds4u_gamepad_item_info[GAMEPAD_ID_NUM]
Definition vsf_usbh_ds4.c:73
void vk_ds4u_free_dev(vk_input_ds4u_t *dev)
Definition vsf_usbh_ds4.c:158
void vk_ds4u_new_dev(vk_input_ds4u_t *dev)
Definition vsf_usbh_ds4.c:152
void vk_usbh_ds4_set_led(vk_usbh_ds4_t *ds4, uint8_t r, uint8_t g, uint8_t b)
Definition vsf_usbh_ds4.c:359
bool vk_usbh_ds4_can_output(vk_usbh_ds4_t *ds4)
Definition vsf_usbh_ds4.c:340