aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h
diff options
context:
space:
mode:
authorFabien Poussin <fabien.poussin@gmail.com>2017-08-07 16:34:34 +0200
committerGitHub <noreply@github.com>2017-08-07 16:34:34 +0200
commitfa733674e6c0a0ac773121779882f16fe7e00bc1 (patch)
tree2bcd088deb6ab67b3b27c6ab54143ff8ce1dcff5 /testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h
parent4092650b1bc013a21c0eaf27f62c84dbf2aece42 (diff)
parent02585210d1f33b3d5dd52267faa15576d5f7f8b2 (diff)
downloadChibiOS-Contrib-fa733674e6c0a0ac773121779882f16fe7e00bc1.tar.gz
ChibiOS-Contrib-fa733674e6c0a0ac773121779882f16fe7e00bc1.tar.bz2
ChibiOS-Contrib-fa733674e6c0a0ac773121779882f16fe7e00bc1.zip
Merge pull request #122 from dismirlian/usbh_devel
USBH: Various improvo
Diffstat (limited to 'testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h')
-rw-r--r--testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h
new file mode 100644
index 0000000..3f00fe7
--- /dev/null
+++ b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h
@@ -0,0 +1,80 @@
+/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+ Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef USBH_CUSTOM_H_
+#define USBH_CUSTOM_H_
+
+#include "hal_usbh.h"
+
+#if HAL_USE_USBH && HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+#define USBH_CUSTOM_CLASS_MAX_INSTANCES 1
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+typedef enum {
+ USBHCUSTOM_STATE_UNINIT = 0,
+ USBHCUSTOM_STATE_STOP = 1,
+ USBHCUSTOM_STATE_ACTIVE = 2,
+ USBHCUSTOM_STATE_READY = 3
+} usbhcustom_state_t;
+
+typedef struct USBHCustomDriver USBHCustomDriver;
+
+struct USBHCustomDriver {
+ /* inherited from abstract class driver */
+ _usbh_base_classdriver_data
+
+ uint8_t ifnum;
+
+ usbhcustom_state_t state;
+};
+
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+extern USBHCustomDriver USBHCUSTOMD[USBH_CUSTOM_CLASS_MAX_INSTANCES];
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /* API goes here */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif /* USBH_CUSTOM_H_ */