Commit 99d8a393 authored by Dean Camera's avatar Dean Camera
Browse files

Move and rename DevChaper9.c/.h and HostChapter9.c/.h to the HighLevel...

Move and rename DevChaper9.c/.h and HostChapter9.c/.h to the HighLevel directory, new named DeviceStandardReq.c/.h and HostStandardReq.c/.h.

Rename LowLevel.c/.h to USBController.c/.h.

Remove dependancies on the complete <avr/io.h> header in the HighLevel USB driver directory, to ensure less work is required in later (possible) ports.
parent 5f577854
This diff is collapsed.
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
#define __COMMON_H__ #define __COMMON_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <stdint.h>
#include <stdbool.h>
#include "Attributes.h" #include "Attributes.h"
#include "BoardTypes.h" #include "BoardTypes.h"
......
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
#define __CONFIGDESCRIPTOR_H__ #define __CONFIGDESCRIPTOR_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <stdint.h>
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBMode.h" #include "HostStandardReq.h"
#include "../LowLevel/HostChapter9.h" #include "USBMode.h"
#include "../HighLevel/StdDescriptors.h" #include "StdDescriptors.h"
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
*/ */
#define __INCLUDE_FROM_USB_DRIVER #define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_DEVCHAPTER9_C #define __INCLUDE_FROM_DEVICESTDREQ_C
#include "DevChapter9.h" #include "DeviceStandardReq.h"
uint8_t USB_ConfigurationNumber; uint8_t USB_ConfigurationNumber;
...@@ -138,7 +138,7 @@ static void USB_Device_SetAddress(void) ...@@ -138,7 +138,7 @@ static void USB_Device_SetAddress(void)
USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default;
UDADDR = ((1 << ADDEN) | DeviceAddress); USB_Device_SetDeviceAddress(DeviceAddress);
return; return;
} }
......
...@@ -38,21 +38,22 @@ ...@@ -38,21 +38,22 @@
* dispatch header located in LUFA/Drivers/USB/USB.h. * dispatch header located in LUFA/Drivers/USB/USB.h.
*/ */
#ifndef __DEVCHAPTER9_H__ #ifndef __DEVICESTDREQ_H__
#define __DEVCHAPTER9_H__ #define __DEVICESTDREQ_H__
/* Includes: */ /* Includes: */
#include <avr/io.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <avr/boot.h> #include <avr/boot.h>
#include <util/atomic.h> #include <util/atomic.h>
#include <stdint.h>
#include <stdbool.h>
#include "../HighLevel/StdDescriptors.h" #include "StdDescriptors.h"
#include "../HighLevel/Events.h" #include "Events.h"
#include "../HighLevel/StdRequestType.h" #include "StdRequestType.h"
#include "../HighLevel/USBTask.h" #include "USBTask.h"
#include "LowLevel.h" #include "../LowLevel/USBController.h"
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
...@@ -141,7 +142,7 @@ ...@@ -141,7 +142,7 @@
/* Function Prototypes: */ /* Function Prototypes: */
void USB_Device_ProcessControlRequest(void); void USB_Device_ProcessControlRequest(void);
#if defined(__INCLUDE_FROM_DEVCHAPTER9_C) #if defined(__INCLUDE_FROM_DEVICESTDREQ_C)
static void USB_Device_SetAddress(void); static void USB_Device_SetAddress(void);
static void USB_Device_SetConfiguration(void); static void USB_Device_SetConfiguration(void);
static void USB_Device_GetConfiguration(void); static void USB_Device_GetConfiguration(void);
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#define __USBEVENTS_H__ #define __USBEVENTS_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <stdint.h>
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "USBMode.h" #include "USBMode.h"
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
*/ */
#define __INCLUDE_FROM_USB_DRIVER #define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define __INCLUDE_FROM_HOSTCHAPTER9_C #define __INCLUDE_FROM_HOSTSTDREQ_C
#include "HostChapter9.h" #include "HostStandardReq.h"
uint8_t USB_Host_SendControlRequest(void* BufferPtr) uint8_t USB_Host_SendControlRequest(void* BufferPtr)
{ {
......
...@@ -38,17 +38,17 @@ ...@@ -38,17 +38,17 @@
* dispatch header located in LUFA/Drivers/USB/USB.h. * dispatch header located in LUFA/Drivers/USB/USB.h.
*/ */
#ifndef __HOSTCHAPTER9_H__ #ifndef __HOSTSTDREQ_H__
#define __HOSTCHAPTER9_H__ #define __HOSTSTDREQ_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "LowLevel.h" #include "USBMode.h"
#include "../HighLevel/USBMode.h" #include "StdRequestType.h"
#include "../HighLevel/StdRequestType.h" #include "../LowLevel/USBController.h"
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
}; };
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(__INCLUDE_FROM_HOSTCHAPTER9_C) #if defined(__INCLUDE_FROM_HOSTSTDREQ_C)
static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType); static uint8_t USB_Host_WaitForIOS(const uint8_t WaitType);
#endif #endif
#endif #endif
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
/* Includes: */ /* Includes: */
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
......
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
#ifndef __STDREQTYPE_H__ #ifndef __STDREQTYPE_H__
#define __STDREQTYPE_H__ #define __STDREQTYPE_H__
/* Includes: */
#include <stdint.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER) #if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
#ifndef __STREAMCALLBACK_H__ #ifndef __STREAMCALLBACK_H__
#define __STREAMCALLBACK_H__ #define __STREAMCALLBACK_H__
/* Includes: */
#include <stdint.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER) #if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
......
...@@ -42,22 +42,22 @@ ...@@ -42,22 +42,22 @@
#define __USBTASK_H__ #define __USBTASK_H__
/* Includes: */ /* Includes: */
#include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "../LowLevel/LowLevel.h" #include "../LowLevel/USBController.h"
#include "Events.h" #include "Events.h"
#include "StdRequestType.h" #include "StdRequestType.h"
#include "StdDescriptors.h" #include "StdDescriptors.h"
#include "USBMode.h" #include "USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#include "../LowLevel/DevChapter9.h" #include "DeviceStandardReq.h"
#endif #endif
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#include "../LowLevel/HostChapter9.h" #include "HostStandardReq.h"
#endif #endif
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
......
...@@ -191,8 +191,11 @@ ...@@ -191,8 +191,11 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Macros: */ /* Macros: */
#define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE #define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE
#define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE #define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE
#define USB_Device_SetDeviceAddress(addr) MACROS{ UDADDR = ((1 << ADDEN) | (addr & 0x7F)); }MACROE
#endif #endif
#endif #endif
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
#define __INCLUDE_FROM_USB_DRIVER #define __INCLUDE_FROM_USB_DRIVER
#include "LowLevel.h" #include "USBController.h"
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY)) #if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))
volatile uint8_t USB_CurrentMode = USB_MODE_NONE; volatile uint8_t USB_CurrentMode = USB_MODE_NONE;
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
* @{ * @{
*/ */
#ifndef __USBLOWLEVEL_H__ #ifndef __USBCONTROLLER_H__
#define __USBLOWLEVEL_H__ #define __USBCONTROLLER_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
...@@ -66,12 +66,13 @@ ...@@ -66,12 +66,13 @@
#include "Host.h" #include "Host.h"
#include "Pipe.h" #include "Pipe.h"
#include "OTG.h" #include "OTG.h"
#include "../HighLevel/HostStandardReq.h"
#endif #endif
#if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__) #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
#include "Device.h" #include "Device.h"
#include "Endpoint.h" #include "Endpoint.h"
#include "DevChapter9.h" #include "../HighLevel/DeviceStandardReq.h"
#endif #endif
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#include "../HighLevel/Events.h" #include "../HighLevel/Events.h"
#include "LowLevel.h" #include "USBController.h"
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
......
...@@ -41,16 +41,16 @@ ...@@ -41,16 +41,16 @@
* *
* \section Sec_Dependencies Module Source Dependencies * \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module: * The following files must be built with any user project that uses this module:
* - LUFA/Drivers/USB/LowLevel/DevChapter9.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/Device.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/LowLevel/Device.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/Endpoint.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/LowLevel/Endpoint.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/Host.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/LowLevel/Host.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/HostChapter9.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/LowLevel.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/Pipe.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/LowLevel/Pipe.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/USBController.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/LowLevel/USBInterrupt.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/LowLevel/USBInterrupt.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/HighLevel/Events.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/HighLevel/Events.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/HighLevel/HostStandardReq.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* - LUFA/Drivers/USB/HighLevel/USBTask.c <i>(Makefile source module name: LUFA_SRC_USB)</i> * - LUFA/Drivers/USB/HighLevel/USBTask.c <i>(Makefile source module name: LUFA_SRC_USB)</i>
* *
* \section Module Description * \section Module Description
...@@ -372,19 +372,19 @@ ...@@ -372,19 +372,19 @@
#include "HighLevel/StdDescriptors.h" #include "HighLevel/StdDescriptors.h"
#include "HighLevel/ConfigDescriptor.h" #include "HighLevel/ConfigDescriptor.h"
#include "LowLevel/LowLevel.h" #include "LowLevel/USBController.h"
#include "LowLevel/USBInterrupt.h" #include "LowLevel/USBInterrupt.h"
#if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__) #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)
#include "LowLevel/Host.h" #include "LowLevel/Host.h"
#include "LowLevel/HostChapter9.h"
#include "LowLevel/Pipe.h" #include "LowLevel/Pipe.h"
#include "HighLevel/HostStandardReq.h"
#endif #endif
#if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__) #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)
#include "LowLevel/Device.h" #include "LowLevel/Device.h"
#include "LowLevel/DevChapter9.h"
#include "LowLevel/Endpoint.h" #include "LowLevel/Endpoint.h"
#include "HighLevel/DeviceStandardReq.h"
#endif #endif
#if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__) #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
* <b>USB Core</b> * <b>USB Core</b>
* - A new USB driver source file, Drivers/USB/LowLevel/Device.c now exists. This source file should be added to all project * - A new USB driver source file, Drivers/USB/LowLevel/Device.c now exists. This source file should be added to all project
* makefiles using the USB driver of LUFA, or the makefile should be updated to use the new module source variables. * makefiles using the USB driver of LUFA, or the makefile should be updated to use the new module source variables.
* - The Drivers/USB/LowLevel/DevChapter9.c source file has moved to Drivers/USB/HighLevel/DeviceStandardReq.c - this should
* be updated in all project makefiles, or the makefile should be updated to use the new module source variables.
* - The Drivers/USB/LowLevel/HostChapter9.h source file has moved to Drivers/USB/HighLevel/HostStandardReq.c - this should
* be updated in all project makefiles, or the makefile should be updated to use the new module source variables.
* - The Drivers/USB/LowLevel/LowLevel.c source file has moved to Drivers/LowLevel/USBController.c - this should be updated
* in all project makefiles, or the makefile should be updated to use the new module source variables.
* *
* <b>Device Mode</b> * <b>Device Mode</b>
* - The USB_Device_IsRemoteWakeupSent() macro has been removed, as the remote wakeup request is now fully handled by the * - The USB_Device_IsRemoteWakeupSent() macro has been removed, as the remote wakeup request is now fully handled by the
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
#define __SCHEDULER_H__ #define __SCHEDULER_H__
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <util/atomic.h> #include <util/atomic.h>
......
...@@ -17,16 +17,16 @@ else ...@@ -17,16 +17,16 @@ else
endif endif
# Define module source file lists # Define module source file lists
LUFA_SRC_USB = $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/DevChapter9.c \ LUFA_SRC_USB = $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Device.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Device.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Endpoint.c \ $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Endpoint.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Host.c \ $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Host.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/HostChapter9.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/LowLevel.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Pipe.c \ $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Pipe.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/USBController.c \
$(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/USBInterrupt.c \ $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/USBInterrupt.c \
$(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/ConfigDescriptor.c \ $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/ConfigDescriptor.c \
$(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/DeviceStandardReq.c \
$(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/Events.c \ $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/Events.c \
$(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/HostStandardReq.c \
$(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/USBTask.c \ $(LUFA_ROOT_PATH)/Drivers/USB/HighLevel/USBTask.c \
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDParser.c $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDParser.c
LUFA_SRC_USBCLASS = $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/Audio.c \ LUFA_SRC_USBCLASS = $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/Audio.c \
......
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