aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian@gmail.com>2019-09-30 17:47:30 -0300
committerDiego Ismirlian <dismirlian@gmail.com>2019-10-02 17:03:43 -0300
commit77021bb6466f731a572985cebe65d139c212d88d (patch)
tree7bb8899e93003fb7cceb6f2bfd527253c5d03f39
parent0c260638da6dde3896a2fd6c4e3b39ee1a1b12e9 (diff)
downloadChibiOS-Contrib-77021bb6466f731a572985cebe65d139c212d88d.tar.gz
ChibiOS-Contrib-77021bb6466f731a572985cebe65d139c212d88d.tar.bz2
ChibiOS-Contrib-77021bb6466f731a572985cebe65d139c212d88d.zip
USBH: add helper macros to MSD, FTDI, AOA
-rw-r--r--os/hal/include/usbh/dev/aoa.h1
-rw-r--r--os/hal/include/usbh/dev/ftdi.h2
-rw-r--r--os/hal/include/usbh/dev/msd.h3
3 files changed, 4 insertions, 2 deletions
diff --git a/os/hal/include/usbh/dev/aoa.h b/os/hal/include/usbh/dev/aoa.h
index 8205dd5..1f36370 100644
--- a/os/hal/include/usbh/dev/aoa.h
+++ b/os/hal/include/usbh/dev/aoa.h
@@ -130,6 +130,7 @@ typedef bool (*usbhaoa_filter_callback_t)(usbh_device_t *dev, const uint8_t *des
#define usbhaoaGetState(aoap) ((aoap)->state)
#define usbhaoaGetChannelState(aoap) ((aoap)->channel.state)
+#define usbhaoaGetHost(aoap) ((aoap)->dev->host)
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/usbh/dev/ftdi.h b/os/hal/include/usbh/dev/ftdi.h
index 84ea4bc..fdd767d 100644
--- a/os/hal/include/usbh/dev/ftdi.h
+++ b/os/hal/include/usbh/dev/ftdi.h
@@ -127,7 +127,7 @@ struct USBHFTDIDriver {
/* Driver macros. */
/*===========================================================================*/
#define usbhftdipGetState(ftdipp) ((ftdipp)->state)
-
+#define usbhftdipGetHost(ftdipp) ((ftdipp)->ftdip->dev->host)
/*===========================================================================*/
/* External declarations. */
diff --git a/os/hal/include/usbh/dev/msd.h b/os/hal/include/usbh/dev/msd.h
index b245bfc..113f523 100644
--- a/os/hal/include/usbh/dev/msd.h
+++ b/os/hal/include/usbh/dev/msd.h
@@ -72,7 +72,6 @@ struct USBHMassStorageLUNDriver {
/* Driver macros. */
/*===========================================================================*/
-
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
@@ -95,6 +94,8 @@ extern "C" {
bool usbhmsdLUNGetInfo(USBHMassStorageLUNDriver *lunp, BlockDeviceInfo *bdip);
bool usbhmsdLUNIsInserted(USBHMassStorageLUNDriver *lunp);
bool usbhmsdLUNIsProtected(USBHMassStorageLUNDriver *lunp);
+
+ USBHDriver *usbhmsdLUNGetHost(const USBHMassStorageLUNDriver *lunp);
#ifdef __cplusplus
}
#endif