aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h
diff options
context:
space:
mode:
authorMichael Walker <walkerstop@gmail.com>2018-05-02 03:37:31 -0700
committerMichael Walker <walkerstop@gmail.com>2018-05-02 03:37:31 -0700
commitcd7559268dcc2da5f2b1f3872e6baa1cff1d5476 (patch)
tree0cf31de069f9df06a13743eab4e1879f05ce9c12 /os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h
parent4d7ccdd1fce0c95c57129b80c81fab829daf9f99 (diff)
parent457afa6202fe9f8e6accb65411629172bb32c41b (diff)
downloadChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.tar.gz
ChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.tar.bz2
ChibiOS-Contrib-cd7559268dcc2da5f2b1f3872e6baa1cff1d5476.zip
Merge branch 'master' into mike
Diffstat (limited to 'os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h
index e8df749..fd7f4e0 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h
@@ -1,6 +1,6 @@
/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
- Copyright (C) 2015 Diego Ismirlian, TISA, (dismirlian (at) google's mail)
+ 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.
@@ -15,8 +15,8 @@
limitations under the License.
*/
-#ifndef USBH_LLD_H_
-#define USBH_LLD_H_
+#ifndef HAL_USBH_LLD_H
+#define HAL_USBH_LLD_H
#include "hal.h"
@@ -63,6 +63,8 @@ typedef struct stm32_hc_management {
#define _usbhdriver_ll_data \
stm32_otg_t *otg; \
+ /* low-speed port reset bug */ \
+ bool check_ls_activity; \
/* channels */ \
uint8_t channels_number; \
stm32_hc_management_t channels[STM32_OTG2_CHANNELS_NUMBER]; \
@@ -127,27 +129,37 @@ typedef struct stm32_hc_management {
"use USBH_DEFINE_BUFFER() to declare the IO buffers"); \
} while (0)
-
-
void usbh_lld_init(void);
void usbh_lld_start(USBHDriver *usbh);
void usbh_lld_ep_object_init(usbh_ep_t *ep);
void usbh_lld_ep_open(usbh_ep_t *ep);
void usbh_lld_ep_close(usbh_ep_t *ep);
+bool usbh_lld_ep_reset(usbh_ep_t *ep);
void usbh_lld_urb_submit(usbh_urb_t *urb);
bool usbh_lld_urb_abort(usbh_urb_t *urb, usbh_urbstatus_t status);
usbh_urbstatus_t usbh_lld_root_hub_request(USBHDriver *usbh, uint8_t bmRequestType, uint8_t bRequest,
uint16_t wvalue, uint16_t windex, uint16_t wlength, uint8_t *buf);
uint8_t usbh_lld_roothub_get_statuschange_bitmap(USBHDriver *usbh);
-#define usbh_lld_epreset(ep) do {(ep)->dt_mask = HCTSIZ_DPID_DATA0;} while (0);
-
#ifdef __IAR_SYSTEMS_ICC__
-#define USBH_LLD_DEFINE_BUFFER(type, name) type name
+#define USBH_LLD_DEFINE_BUFFER(var) _Pragma("data_alignment=4") var
+#define USBH_LLD_DECLARE_STRUCT_MEMBER_H1(x, y) x ## y
+#define USBH_LLD_DECLARE_STRUCT_MEMBER_H2(x, y) USBH_LLD_DECLARE_STRUCT_MEMBER_H1(x, y)
+#define USBH_LLD_DECLARE_STRUCT_MEMBER(member) unsigned int USBH_LLD_DECLARE_STRUCT_MEMBER_H2(dummy_align_, __COUNTER__); member
#else
-#define USBH_LLD_DEFINE_BUFFER(type, name) type name __attribute__((aligned(4)))
+#define USBH_LLD_DEFINE_BUFFER(var) var __attribute__((aligned(4)))
+#define USBH_LLD_DECLARE_STRUCT_MEMBER(member) member __attribute__((aligned(4)))
+#endif
+
+
+#if STM32_USBH_USE_OTG1
+extern USBHDriver USBHD1;
+#endif
+
+#if STM32_USBH_USE_OTG2
+extern USBHDriver USBHD2;
#endif
#endif
-#endif /* USBH_LLD_H_ */
+#endif /* HAL_USBH_LLD_H */