forked from mirror/qmk_firmware
Move out common architecture-independent core definitions into the appropriate core dispatch header files.
This commit is contained in:
@@ -126,35 +126,6 @@
|
||||
*/
|
||||
void USB_Device_SendRemoteWakeup(void);
|
||||
|
||||
/* Type Defines: */
|
||||
enum USB_Device_States_t
|
||||
{
|
||||
DEVICE_STATE_Unattached = 0, /**< Internally implemented by the library. This state indicates
|
||||
* that the device is not currently connected to a host.
|
||||
*/
|
||||
DEVICE_STATE_Powered = 1, /**< Internally implemented by the library. This state indicates
|
||||
* that the device is connected to a host, but enumeration has not
|
||||
* yet begun.
|
||||
*/
|
||||
DEVICE_STATE_Default = 2, /**< Internally implemented by the library. This state indicates
|
||||
* that the device's USB bus has been reset by the host and it is
|
||||
* now waiting for the host to begin the enumeration process.
|
||||
*/
|
||||
DEVICE_STATE_Addressed = 3, /**< Internally implemented by the library. This state indicates
|
||||
* that the device has been addressed by the USB Host, but is not
|
||||
* yet configured.
|
||||
*/
|
||||
DEVICE_STATE_Configured = 4, /**< May be implemented by the user project. This state indicates
|
||||
* that the device has been enumerated by the host and is ready
|
||||
* for USB communications to begin.
|
||||
*/
|
||||
DEVICE_STATE_Suspended = 5, /**< May be implemented by the user project. This state indicates
|
||||
* that the USB bus has been suspended by the host, and the device
|
||||
* should power down to a minimal power level until the bus is
|
||||
* resumed.
|
||||
*/
|
||||
};
|
||||
|
||||
/* Inline Functions: */
|
||||
/** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
|
||||
* the frame number is incremented by one.
|
||||
|
||||
@@ -174,11 +174,6 @@
|
||||
*/
|
||||
#define ENDPOINT_BANK_DOUBLE (1 << EPBK0)
|
||||
//@}
|
||||
|
||||
/** Endpoint address for the default control endpoint, which always resides in address 0. This is
|
||||
* defined for convenience to give more readable code when used with the endpoint macros.
|
||||
*/
|
||||
#define ENDPOINT_CONTROLEP 0
|
||||
|
||||
#if (!defined(FIXED_CONTROL_ENDPOINT_SIZE) || defined(__DOXYGEN__))
|
||||
/** Default size of the default control endpoint's bank, until altered by the control endpoint bank size
|
||||
@@ -187,16 +182,6 @@
|
||||
#define ENDPOINT_CONTROLEP_DEFAULT_SIZE 8
|
||||
#endif
|
||||
|
||||
/** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
|
||||
* numerical address in the device.
|
||||
*/
|
||||
#define ENDPOINT_EPNUM_MASK 0x07
|
||||
|
||||
/** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
|
||||
* direction for comparing with the \c ENDPOINT_DESCRIPTOR_DIR_* masks.
|
||||
*/
|
||||
#define ENDPOINT_EPDIR_MASK 0x80
|
||||
|
||||
/** Retrives the maximum bank size in bytes of a given endpoint.
|
||||
*
|
||||
* \note This macro will only work correctly on endpoint indexes that are compile-time constants
|
||||
|
||||
@@ -97,109 +97,6 @@
|
||||
#define HOST_DEVICE_SETTLE_DELAY_MS 1000
|
||||
#endif
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for the various states of the USB Host state machine. Only some states are
|
||||
* implemented in the LUFA library - other states are left to the user to implement.
|
||||
*
|
||||
* For information on each possible USB host state, refer to the USB 2.0 specification.
|
||||
* Several of the USB host states are broken up further into multiple smaller sub-states,
|
||||
* so that they can be internally implemented inside the library in an efficient manner.
|
||||
*
|
||||
* \see \ref USB_HostState, which stores the current host state machine state.
|
||||
*/
|
||||
enum USB_Host_States_t
|
||||
{
|
||||
HOST_STATE_WaitForDeviceRemoval = 0, /**< Internally implemented by the library. This state can be
|
||||
* used by the library to wait until the attached device is
|
||||
* removed by the user - useful for when an error occurs or
|
||||
* further communication with the device is not needed. This
|
||||
* allows for other code to run while the state machine is
|
||||
* effectively disabled.
|
||||
*/
|
||||
HOST_STATE_WaitForDevice = 1, /**< Internally implemented by the library. This state indicates
|
||||
* that the stack is waiting for an interval to elapse before
|
||||
* continuing with the next step of the device enumeration
|
||||
* process.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Unattached = 2, /**< Internally implemented by the library. This state indicates
|
||||
* that the host state machine is waiting for a device to be
|
||||
* attached so that it can start the enumeration process.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Powered = 3, /**< Internally implemented by the library. This state indicates
|
||||
* that a device has been attached, and the library's internals
|
||||
* are being configured to begin the enumeration process.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Powered_WaitForDeviceSettle = 4, /**< Internally implemented by the library. This state indicates
|
||||
* that the stack is waiting for the initial settling period to
|
||||
* elapse before beginning the enumeration process.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Powered_WaitForConnect = 5, /**< Internally implemented by the library. This state indicates
|
||||
* that the stack is waiting for a connection event from the USB
|
||||
* controller to indicate a valid USB device has been attached to
|
||||
* the bus and is ready to be enumerated.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Powered_DoReset = 6, /**< Internally implemented by the library. This state indicates
|
||||
* that a valid USB device has been attached, and that it is
|
||||
* will now be reset to ensure it is ready for enumeration.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Powered_ConfigPipe = 7, /**< Internally implemented by the library. This state indicates
|
||||
* that the attached device is currently powered and reset, and
|
||||
* that the control pipe is now being configured by the stack.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Default = 8, /**< Internally implemented by the library. This state indicates
|
||||
* that the stack is currently retrieving the control endpoint's
|
||||
* size from the device, so that the control pipe can be altered
|
||||
* to match.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Default_PostReset = 9, /**< Internally implemented by the library. This state indicates that
|
||||
* the control pipe is being reconfigured to match the retrieved
|
||||
* control endpoint size from the device, and the device's USB bus
|
||||
* address is being set.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Default_PostAddressSet = 10, /**< Internally implemented by the library. This state indicates that
|
||||
* the device's address has now been set, and the stack is has now
|
||||
* completed the device enumeration process. This state causes the
|
||||
* stack to change the current USB device address to that set for
|
||||
* the connected device, before progressing to the user-implemented
|
||||
* \ref HOST_STATE_Addressed state for further communications.
|
||||
*
|
||||
* \note Do not manually change to this state in the user code.
|
||||
*/
|
||||
HOST_STATE_Addressed = 11, /**< May be implemented by the user project. This state should
|
||||
* set the device configuration before progressing to the
|
||||
* \ref HOST_STATE_Configured state. Other processing (such as the
|
||||
* retrieval and processing of the device descriptor) should also
|
||||
* be placed in this state.
|
||||
*/
|
||||
HOST_STATE_Configured = 12, /**< May be implemented by the user project. This state should implement the
|
||||
* actual work performed on the attached device and changed to the
|
||||
* \ref HOST_STATE_Suspended or \ref HOST_STATE_WaitForDeviceRemoval states as needed.
|
||||
*/
|
||||
HOST_STATE_Suspended = 15, /**< May be implemented by the user project. This state should be maintained
|
||||
* while the bus is suspended, and changed to either the \ref HOST_STATE_Configured
|
||||
* (after resuming the bus with the USB_Host_ResumeBus() macro) or the
|
||||
* \ref HOST_STATE_WaitForDeviceRemoval states as needed.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the error codes for the \ref EVENT_USB_Host_HostError() event.
|
||||
*
|
||||
* \see \ref Group_Events for more information on this event.
|
||||
|
||||
@@ -155,22 +155,12 @@
|
||||
*/
|
||||
#define PIPE_BANK_DOUBLE (1 << EPBK0)
|
||||
//@}
|
||||
|
||||
/** Pipe address for the default control pipe, which always resides in address 0. This is
|
||||
* defined for convenience to give more readable code when used with the pipe macros.
|
||||
*/
|
||||
#define PIPE_CONTROLPIPE 0
|
||||
|
||||
/** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
|
||||
* in the device descriptor of the attached device.
|
||||
*/
|
||||
#define PIPE_CONTROLPIPE_DEFAULT_SIZE 64
|
||||
|
||||
/** Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address
|
||||
* in the device.
|
||||
*/
|
||||
#define PIPE_PIPENUM_MASK 0x07
|
||||
|
||||
/** Total number of pipes (including the default control pipe at address 0) which may be used in
|
||||
* the device. Different USB AVR models support different amounts of pipes, this value reflects
|
||||
* the maximum number of pipes for the currently selected AVR model.
|
||||
@@ -184,16 +174,6 @@
|
||||
*/
|
||||
#define PIPE_MAX_SIZE 256
|
||||
|
||||
/** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
|
||||
* numerical address in the attached device.
|
||||
*/
|
||||
#define PIPE_EPNUM_MASK 0x0F
|
||||
|
||||
/** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
|
||||
* direction for comparing with the \c ENDPOINT_DESCRIPTOR_DIR_* masks.
|
||||
*/
|
||||
#define PIPE_EPDIR_MASK 0x80
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for the possible error return codes of the \ref Pipe_WaitUntilReady() function.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user