Commit 492589e8 authored by Daniel Kampert's avatar Daniel Kampert 👷

HID_Common.h

	- Update documentation
	- Add 'USB_HID_Mouse_Button_t' object
Doxygen.h
	- Add group 'USB-HID-Keyboard' and 'USB-HID-Mouse'
USB_Types.h
	- Add extern variable '_DeviceState', '_Configuration' and 'USB_Events'
	- Add enum for USB state
USB_Controller.h
	- Remove extern variable '_DeviceState', '_Configuration' and 'USB_Events'
	- Remove enum for USB state
Endpoint.h
	- Update documentation
	- Add default address for control endpoint
USB.h
	- Update includes
parent 729a5301
......@@ -28,14 +28,13 @@
* This file contains the prototypes and definitions for Atmel AVR endpoints.
*
* @author Daniel Kampert
* @bug - Remove direction mask from Endpoint_GetCurrent result
* @bug No known bugs
*/
#ifndef ENDPOINT_H_
#define ENDPOINT_H_
#include "Arch/AVR8/AT90/USB/USB_Controller.h"
#include "Services/USB/USB_Types.h"
#include "Services/USB/Core/StandardRequest.h"
/** @brief Endpoint types.
......@@ -66,8 +65,8 @@
*/
typedef enum
{
ENDPOINT_DIRECTION_OUT = 0x00, /**< OUT endpoint */
ENDPOINT_DIRECTION_IN = 0x80, /**< IN endpoint */
ENDPOINT_DIRECTION_OUT = 0x00, /**< Endpoint direction OUT */
ENDPOINT_DIRECTION_IN = 0x80, /**< Endpoint direction IN */
} Endpoint_Direction_t;
/** @brief Control endpoint size in bytes.
......@@ -75,6 +74,12 @@
#if(!defined(ENDPOINT_CONTROL_SIZE))
#define ENDPOINT_CONTROL_SIZE ENDPOINT_CONTROL_DEFAULT_SIZE
#endif
/** @brief Control endpoint address.
*/
#if(!defined(ENDPOINT_CONTROL_ADDRESS))
#define ENDPOINT_CONTROL_ADDRESS ENDPOINT_CONTROL_DEFAULT_ADDRESS
#endif
/** @brief Select an endpoint.
* @param Address Endpoint address
......
......@@ -40,30 +40,6 @@
#include "Arch/AVR8/AT90/USB/USB_Device.h"
#include "Arch/AVR8/AT90/USB/USB_Interrupt.h"
/** @brief States for USB state machine.
*/
typedef enum
{
USB_STATE_UNATTACHED = 0x00, /**< Device unattached */
USB_STATE_POWERED = 0x01, /**< Device powered */
USB_STATE_SUSPEND = 0x02, /**< Device suspend */
USB_STATE_RESET = 0x03, /**< Reset state */
USB_STATE_ADDRESSED = 0x04, /**< Device addressed */
USB_STATE_CONFIGURED = 0x06, /**< Device configured */
} USB_State_t;
/** @brief USB controller device state.
*/
extern volatile USB_State_t _DeviceState;
/** @brief USB controller configuration.
*/
extern uint8_t _Configuration;
/** @brief USB bus event callback structure.
*/
extern USB_DeviceCallbacks_t _USBEvents;
/** @brief Enable the PLL for the USB module.
*/
static inline void USB_Controller_EnablePLL(void) __attribute__ ((always_inline));
......
......@@ -67,6 +67,17 @@
* USB HID class definitions.
* @{
*/
/** @defgroup USB-HID-Keyboard
* USB HID keyboard definitions
* @{
*/
/*@}*/
/** @defgroup USB-HID-Mouse
* USB HID mouse definitions
* @{
*/
/*@}*/
/*@}*/
/** @defgroup USB-MassStorage
......
This diff is collapsed.
......@@ -34,7 +34,7 @@
#ifndef USB_H_
#define USB_H_
#include "Common/Common.h"
#include "Common/Common.h"
#if(MCU_ARCH == MCU_ARCH_AVR8)
#if(MCU_NAME == MCU_NAME_AT90USB1287)
......@@ -48,10 +48,10 @@
#error "Unknown CPU architecture!"
#endif
#include "Services/USB/Class/Class.h"
#include "Services/USB/Core/USB_DeviceStream.h"
#include "Services/USB/Core/StandardDescriptor.h"
#include "Services/USB/Core/USB_DeviceStream.h"
#include "Services/USB/Core/USB_DeviceStdRequest.h"
#include "Services/USB/Class/Class.h"
/** @brief Initialize the USB service.
* @param Config Pointer to #USB_Config_t object
......
......@@ -39,7 +39,7 @@
/** @brief Control endpoint address for USB devices.
*/
#define ENDPOINT_CONTROL_ADDRESS 0x00
#define ENDPOINT_CONTROL_DEFAULT_ADDRESS 0x00
/** @brief Default size for control endpoint.
*/
......@@ -61,6 +61,18 @@
USB_SPEED_FULL = 0x01, /**< Full speed operation */
} USB_Speed_t;
/** @brief States for USB state machine.
*/
typedef enum
{
USB_STATE_UNATTACHED = 0x00, /**< Device unattached */
USB_STATE_POWERED = 0x01, /**< Device powered */
USB_STATE_SUSPEND = 0x02, /**< Device suspend */
USB_STATE_RESET = 0x03, /**< Reset state */
USB_STATE_ADDRESSED = 0x04, /**< Device addressed */
USB_STATE_CONFIGURED = 0x06, /**< Device configured */
} USB_State_t;
/** @brief USB bus event callback structure.
*/
typedef struct
......@@ -102,4 +114,16 @@
const USB_DeviceCallbacks_t* Callbacks; /**< Pointer to USB device callbacks */
} USB_Config_t;
/** @brief USB controller device state.
*/
extern volatile USB_State_t _DeviceState;
/** @brief USB controller configuration.
*/
extern uint8_t _Configuration;
/** @brief USB bus event callback structure.
*/
extern USB_DeviceCallbacks_t _USBEvents;
#endif /* USB_TYPES_H_ */
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment