Conflicted merge from develop
This commit is contained in:
@@ -7,6 +7,8 @@ UNRELEASED
|
|||||||
* CHANGED: Define ADAT_RX renamed to XUA_ADAT_RX_EN
|
* CHANGED: Define ADAT_RX renamed to XUA_ADAT_RX_EN
|
||||||
* CHANGED: Define ADAT_TX renamed to XUA_ADAT_TX_EN
|
* CHANGED: Define ADAT_TX renamed to XUA_ADAT_TX_EN
|
||||||
* CHANGED: Define SPDIF_RX renamed to XUA_SPDIF_RX_EN
|
* CHANGED: Define SPDIF_RX renamed to XUA_SPDIF_RX_EN
|
||||||
|
* CHANGED: Define SELF_POWERED changed to XUA_POWERMODE and associated
|
||||||
|
defines
|
||||||
* CHANGED: Drive strength of I2S clock lines upped to 8mA on xCORE.ai
|
* CHANGED: Drive strength of I2S clock lines upped to 8mA on xCORE.ai
|
||||||
* CHANGED: ADC datalines sampled on falling edge of clock in TDM mode
|
* CHANGED: ADC datalines sampled on falling edge of clock in TDM mode
|
||||||
* CHANGED: Improved startup behaviour of TDM clocks
|
* CHANGED: Improved startup behaviour of TDM clocks
|
||||||
|
|||||||
@@ -957,43 +957,32 @@
|
|||||||
|
|
||||||
/* Power */
|
/* Power */
|
||||||
|
|
||||||
|
#define XUA_POWERMODE_SELF (0)
|
||||||
|
#define XUA_POWERMODE_BUS (1)
|
||||||
/**
|
/**
|
||||||
* @brief Report as self to the host when enabled, else reports as bus-powered. This affects descriptors
|
* @brief Report as self or bus powered device. This affects descriptors
|
||||||
* and XUD usage.
|
* and XUD usage and is important for USB compliance
|
||||||
*
|
*
|
||||||
* Default: 0 (Disabled)
|
* Default: XUA_POWERMODE_BUS
|
||||||
*/
|
*/
|
||||||
#ifndef SELF_POWERED
|
#ifndef XUA_POWERMODE
|
||||||
#define SELF_POWERED (0)
|
#define XUA_POWERMODE XUA_POWERMODE_BUS
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Tidy-up historical ifndef usage */
|
|
||||||
#if defined(SELF_POWERED) && (SELF_POWERED==0)
|
|
||||||
#undef SELF_POWERED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Power drawn from the host (in mA x 2)
|
* @brief Power drawn from the host (in mA x 2)
|
||||||
*
|
*
|
||||||
* Default: 0 when SELF_POWERED enabled else 250 (500mA)
|
* Default: 0 when self-powered, else 250 (500mA)
|
||||||
*/
|
*/
|
||||||
#ifdef SELF_POWERED
|
#if (XUA_POWERMODE == XUA_POWERMODE_SELF)
|
||||||
/* Default to taking no power from the bus in self-powered mode */
|
/* Default to taking no power from the bus in self-powered mode */
|
||||||
#ifndef BMAX_POWER
|
#ifndef _XUA_BMAX_POWER
|
||||||
#define BMAX_POWER 0
|
#define _XUA_BMAX_POWER (0)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* Default to taking 500mA from the bus in bus-powered mode */
|
/* Default to taking 500mA from the bus in bus-powered mode */
|
||||||
#ifndef BMAX_POWER
|
#ifndef _XUA_BMAX_POWER
|
||||||
#define BMAX_POWER 250
|
#define _XUA_BMAX_POWER (250)
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef XUD_PWR_CFG
|
|
||||||
#ifdef SELF_POWERED
|
|
||||||
#define XUD_PWR_CFG XUD_PWR_SELF
|
|
||||||
#else
|
|
||||||
#define XUD_PWR_CFG XUD_PWR_BUS
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -806,12 +806,12 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
|||||||
.bNumInterfaces = INTERFACE_COUNT,
|
.bNumInterfaces = INTERFACE_COUNT,
|
||||||
.bConfigurationValue = 0x01,
|
.bConfigurationValue = 0x01,
|
||||||
.iConfiguration = 0x00,
|
.iConfiguration = 0x00,
|
||||||
#ifdef SELF_POWERED
|
#if (XUA_POWERMODE == XUA_POWERMODE_SELF)
|
||||||
.bmAttributes = 192,
|
.bmAttributes = 192,
|
||||||
#else
|
#else
|
||||||
.bmAttributes = 128,
|
.bmAttributes = 128,
|
||||||
#endif
|
#endif
|
||||||
.bMaxPower = BMAX_POWER,
|
.bMaxPower = _XUA_BMAX_POWER,
|
||||||
},
|
},
|
||||||
|
|
||||||
.Audio_InterfaceAssociation =
|
.Audio_InterfaceAssociation =
|
||||||
@@ -2239,12 +2239,12 @@ unsigned char cfgDesc_Null[] =
|
|||||||
0x01, /* 4 bNumInterface: Number of interfaces*/
|
0x01, /* 4 bNumInterface: Number of interfaces*/
|
||||||
0x01, /* 5 bConfigurationValue */
|
0x01, /* 5 bConfigurationValue */
|
||||||
0x00, /* 6 iConfiguration */
|
0x00, /* 6 iConfiguration */
|
||||||
#ifdef SELF_POWERED
|
#if (XUA_POWERMODE == XUA_POWERMODE_SELF)
|
||||||
192, /* 7 bmAttributes */
|
192, /* 7 bmAttributes */
|
||||||
#else
|
#else
|
||||||
128,
|
128,
|
||||||
#endif
|
#endif
|
||||||
BMAX_POWER, /* 8 bMaxPower */
|
_XUA_BMAX_POWER, /* 8 bMaxPower */
|
||||||
|
|
||||||
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||||
0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */
|
0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */
|
||||||
@@ -2399,12 +2399,12 @@ unsigned char cfgDesc_Audio1[] =
|
|||||||
NUM_INTERFACES_A1, /* numInterfaces - we dont support MIDI in audio 1.0 mode*/
|
NUM_INTERFACES_A1, /* numInterfaces - we dont support MIDI in audio 1.0 mode*/
|
||||||
0x01, /* ID of this configuration */
|
0x01, /* ID of this configuration */
|
||||||
0x00, /* Unused */
|
0x00, /* Unused */
|
||||||
#ifdef SELF_POWERED
|
#if (XUA_POWERMODE == XUA_POWERMODE_SELF)
|
||||||
192, /* 7 bmAttributes */
|
192, /* 7 bmAttributes */
|
||||||
#else
|
#else
|
||||||
128, /* 7 bmAttributes */
|
128, /* 7 bmAttributes */
|
||||||
#endif
|
#endif
|
||||||
BMAX_POWER, /* 8 bMaxPower */
|
_XUA_BMAX_POWER, /* 8 bMaxPower */
|
||||||
|
|
||||||
/* Standard AC interface descriptor */
|
/* Standard AC interface descriptor */
|
||||||
0x09,
|
0x09,
|
||||||
|
|||||||
@@ -310,9 +310,11 @@ VENDOR_REQUESTS_PARAMS_DEC_
|
|||||||
/* Run UAC2.0 at high-speed, UAC1.0 at full-speed */
|
/* Run UAC2.0 at high-speed, UAC1.0 at full-speed */
|
||||||
unsigned usbSpeed = (AUDIO_CLASS == 2) ? XUD_SPEED_HS : XUD_SPEED_FS;
|
unsigned usbSpeed = (AUDIO_CLASS == 2) ? XUD_SPEED_HS : XUD_SPEED_FS;
|
||||||
|
|
||||||
|
unsigned xudPwrCfg = (XUA_POWERMODE == XUA_POWERMODE_SELF) ? XUD_PWR_SELF : XUD_PWR_BUS;
|
||||||
|
|
||||||
/* USB interface core */
|
/* USB interface core */
|
||||||
XUD_Main(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
XUD_Main(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
|
||||||
c_sof, epTypeTableOut, epTypeTableIn, usbSpeed, XUD_PWR_CFG);
|
c_sof, epTypeTableOut, epTypeTableIn, usbSpeed, xudPwrCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user