Add more include protection macros to give the user warnings when they try to manually include private driver header files, instead of the public driver headers.

pull/1469/head
Dean Camera 15 years ago
parent 3a2c1db675
commit d49cc0f783

@ -636,8 +636,7 @@ EXCLUDE_PATTERNS =
# wildcard * is used, a substring. Examples: ANamespace, AClass, # wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test # AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS = __* \ EXCLUDE_SYMBOLS = __*
INCLUDE_FROM_*
# The EXAMPLE_PATH tag can be used to specify one or more files or # The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see # directories that contain example code fragments that are included (see

@ -54,7 +54,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -46,7 +46,7 @@
// TODO: Add any required includes here // TODO: Add any required includes here
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -54,7 +54,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -53,7 +53,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -62,7 +62,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -64,7 +64,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -63,7 +63,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -63,7 +63,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -63,6 +63,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define __INCLUDE_FROM_BUTTONS_H
#define INCLUDE_FROM_BUTTONS_H #define INCLUDE_FROM_BUTTONS_H
#endif #endif

@ -62,6 +62,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define __INCLUDE_FROM_DATAFLASH_H
#define INCLUDE_FROM_DATAFLASH_H #define INCLUDE_FROM_DATAFLASH_H
#endif #endif

@ -68,7 +68,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -54,7 +54,7 @@
#include "AT45DB321C.h" #include "AT45DB321C.h"
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -62,6 +62,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define __INCLUDE_FROM_JOYSTICK_H
#define INCLUDE_FROM_JOYSTICK_H #define INCLUDE_FROM_JOYSTICK_H
#endif #endif

@ -70,6 +70,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define __INCLUDE_FROM_LEDS_H
#define INCLUDE_FROM_LEDS_H #define INCLUDE_FROM_LEDS_H
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -68,7 +68,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -54,7 +54,7 @@
#include "AT45DB321C.h" #include "AT45DB321C.h"
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -68,7 +68,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -54,7 +54,7 @@
#include "AT45DB642D.h" #include "AT45DB642D.h"
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -52,11 +52,6 @@
#ifndef __TEMPERATURE_H__ #ifndef __TEMPERATURE_H__
#define __TEMPERATURE_H__ #define __TEMPERATURE_H__
/* Macros: */
#if !defined(__DOXYGEN__)
#define INCLUDE_FROM_BOARD_DRIVER
#endif
/* Includes: */ /* Includes: */
#include <avr/pgmspace.h> #include <avr/pgmspace.h>

@ -62,7 +62,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_BUTTONS_H) #if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif #endif

@ -54,7 +54,7 @@
#include "AT45DB642D.h" #include "AT45DB642D.h"
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_JOYSTICK_H) #if !defined(__INCLUDE_FROM_JOYSTICK_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -54,7 +54,7 @@
#include "AT45DB642D.h" #include "AT45DB642D.h"
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_DATAFLASH_H) #if !defined(__INCLUDE_FROM_DATAFLASH_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/Dataflash.h instead.
#endif #endif

@ -61,7 +61,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_LEDS_H) #if !defined(__INCLUDE_FROM_LEDS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
#endif #endif

@ -54,8 +54,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define INCLUDE_FROM_ADC_H #define __INCLUDE_FROM_ADC_H
#define INCLUDE_FROM_CHIP_DRIVER
#endif #endif
/* Includes: */ /* Includes: */

@ -62,7 +62,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_ADC_H) #if !defined(__INCLUDE_FROM_ADC_H)
#error Do not include this file directly. Include LUFA/Drivers/Peripheral/ADC.h instead. #error Do not include this file directly. Include LUFA/Drivers/Peripheral/ADC.h instead.
#endif #endif

@ -63,7 +63,7 @@
#endif #endif
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(INCLUDE_FROM_TWI_H) #if !defined(__INCLUDE_FROM_TWI_H)
#error Do not include this file directly. Include LUFA/Drivers/Peripheral/TWI.h instead. #error Do not include this file directly. Include LUFA/Drivers/Peripheral/TWI.h instead.
#endif #endif

@ -28,7 +28,7 @@
this software. this software.
*/ */
#define INCLUDE_FROM_SERIALSTREAM_C #define __INCLUDE_FROM_SERIALSTREAM_C
#include "SerialStream.h" #include "SerialStream.h"
FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW); FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW);

@ -70,7 +70,7 @@
extern FILE USARTStream; extern FILE USARTStream;
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_SERIALSTREAM_C) #if defined(__INCLUDE_FROM_SERIALSTREAM_C)
static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2);
static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1); static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
#endif #endif

@ -53,8 +53,7 @@
/* Macros: */ /* Macros: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
#define INCLUDE_FROM_TWI_H #define __INCLUDE_FROM_TWI_H
#define INCLUDE_FROM_CHIP_DRIVER
#endif #endif
/* Includes: */ /* Includes: */

@ -49,6 +49,10 @@
#ifndef _AUDIO_CLASS_H_ #ifndef _AUDIO_CLASS_H_
#define _AUDIO_CLASS_H_ #define _AUDIO_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_AUDIO_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -50,6 +50,10 @@
#ifndef _CDC_CLASS_H_ #ifndef _CDC_CLASS_H_
#define _CDC_CLASS_H_ #define _CDC_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_CDC_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -51,6 +51,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/Audio.h instead.
#endif
/* Macros: */ /* Macros: */
#if !defined(AUDIO_TOTAL_SAMPLE_RATES) || defined(__DOXYGEN__) #if !defined(AUDIO_TOTAL_SAMPLE_RATES) || defined(__DOXYGEN__)
/** Total number of discrete audio sample rates supported by the device. This value can be overridden by defining this /** Total number of discrete audio sample rates supported by the device. This value can be overridden by defining this

@ -51,6 +51,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
#endif
/* Macros: */ /* Macros: */
/** CDC Class specific request to get the current virtual serial port configuration settings. */ /** CDC Class specific request to get the current virtual serial port configuration settings. */
#define REQ_GetLineEncoding 0x21 #define REQ_GetLineEncoding 0x21

@ -46,6 +46,11 @@
#include <string.h> #include <string.h>
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_HID_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
#endif
/* Macros: */ /* Macros: */
/** HID Class Specific Request to get the current HID report from the device. */ /** HID Class Specific Request to get the current HID report from the device. */
#define REQ_GetReport 0x01 #define REQ_GetReport 0x01

@ -41,6 +41,9 @@
#ifndef _MIDI_CLASS_COMMON_H_ #ifndef _MIDI_CLASS_COMMON_H_
#define _MIDI_CLASS_COMMON_H_ #define _MIDI_CLASS_COMMON_H_
/* Macros: */
#define __INCLUDE_FROM_AUDIO_DRIVER
/* Includes: */ /* Includes: */
#include "../../USB.h" #include "../../USB.h"
#include "Audio.h" #include "Audio.h"
@ -52,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
#endif
/* Macros: */ /* Macros: */
/** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */ /** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
#define DSUBTYPE_InputJack 0x02 #define DSUBTYPE_InputJack 0x02

@ -51,6 +51,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
#endif
/* Macros: */ /* Macros: */
/** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */ /** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
#define REQ_MassStorageReset 0xFF #define REQ_MassStorageReset 0xFF

@ -49,8 +49,13 @@
/* Enable C linkage for C++ Compilers: */ /* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
#endif
/* Macros: */ /* Macros: */
/** Port status mask for a printer device, indicating that an error has *not* occurred. */ /** Port status mask for a printer device, indicating that an error has *not* occurred. */
#define PRNT_PORTSTATUS_NOTERROR (1 << 3) #define PRNT_PORTSTATUS_NOTERROR (1 << 3)

@ -41,10 +41,13 @@
#ifndef _RNDIS_CLASS_COMMON_H_ #ifndef _RNDIS_CLASS_COMMON_H_
#define _RNDIS_CLASS_COMMON_H_ #define _RNDIS_CLASS_COMMON_H_
/* Macros: */
#define __INCLUDE_FROM_CDC_DRIVER
/* Includes: */ /* Includes: */
#include "../../USB.h" #include "../../USB.h"
#include "CDC.h"
#include "RNDISConstants.h" #include "RNDISConstants.h"
#include "CDC.h"
#include <string.h> #include <string.h>
@ -53,6 +56,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
#endif
/* Macros: */ /* Macros: */
/** Implemented RNDIS Version Major */ /** Implemented RNDIS Version Major */
#define REMOTE_NDIS_VERSION_MAJOR 0x01 #define REMOTE_NDIS_VERSION_MAJOR 0x01

@ -51,6 +51,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_SI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
#endif
/* Macros: */ /* Macros: */
/** Length in bytes of a given Unicode string's character length /** Length in bytes of a given Unicode string's character length
* *

@ -28,9 +28,11 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_AUDIO_DRIVER
#include "Audio.h" #include "Audio.h"
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/Audio.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made for each Audio interface /** Class state structure. An instance of this structure should be made for each Audio interface

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_CDC_CLASS_DEVICE_C #define __INCLUDE_FROM_CDC_CLASS_DEVICE_C
#define __INCLUDE_FROM_CDC_DRIVER
#include "CDC.h" #include "CDC.h"
void CDC_Device_Event_Stub(void) void CDC_Device_Event_Stub(void)

@ -73,6 +73,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made for each CDC interface /** Class state structure. An instance of this structure should be made for each CDC interface
@ -281,7 +286,7 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_CDC_CLASS_DEVICE_C) #if defined(__INCLUDE_FROM_CDC_CLASS_DEVICE_C)
static int CDC_Device_putchar(char c, FILE* Stream); static int CDC_Device_putchar(char c, FILE* Stream);
static int CDC_Device_getchar(FILE* Stream); static int CDC_Device_getchar(FILE* Stream);
static int CDC_Device_getchar_Blocking(FILE* Stream); static int CDC_Device_getchar_Blocking(FILE* Stream);

@ -28,9 +28,11 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_HID_DRIVER
#include "HID.h" #include "HID.h"
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo) void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_HID_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made for each HID interface /** Class state structure. An instance of this structure should be made for each HID interface

@ -28,9 +28,11 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_MIDI_DRIVER
#include "MIDI.h" #include "MIDI.h"
void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)

@ -47,7 +47,6 @@
/* Includes: */ /* Includes: */
#include "../../USB.h" #include "../../USB.h"
#include "../Common/MIDI.h" #include "../Common/MIDI.h"
#include "Audio.h"
#include <string.h> #include <string.h>
@ -56,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Define: */ /* Type Define: */
/** Class state structure. An instance of this structure should be made for each MIDI interface /** Class state structure. An instance of this structure should be made for each MIDI interface

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_MS_CLASS_DEVICE_C #define __INCLUDE_FROM_MS_CLASS_DEVICE_C
#define __INCLUDE_FROM_MS_DRIVER
#include "MassStorage.h" #include "MassStorage.h"
static volatile bool* CallbackIsResetSource; static volatile bool* CallbackIsResetSource;

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made for each Mass Storage interface /** Class state structure. An instance of this structure should be made for each Mass Storage interface
@ -134,7 +139,7 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_MS_CLASS_DEVICE_C) #if defined(__INCLUDE_FROM_MS_CLASS_DEVICE_C)
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void); static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_RNDIS_CLASS_DEVICE_C #define __INCLUDE_FROM_RNDIS_CLASS_DEVICE_C
#define __INCLUDE_FROM_RNDIS_DRIVER
#include "RNDIS.h" #include "RNDIS.h"
static const uint32_t PROGMEM AdapterSupportedOIDList[] = static const uint32_t PROGMEM AdapterSupportedOIDList[] =

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made for each RNDIS interface /** Class state structure. An instance of this structure should be made for each RNDIS interface
@ -131,7 +136,7 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_RNDIS_CLASS_DEVICE_C) #if defined(__INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
ATTR_NON_NULL_PTR_ARG(1); ATTR_NON_NULL_PTR_ARG(1);
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo, static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,

@ -51,6 +51,10 @@
#ifndef _HID_CLASS_H_ #ifndef _HID_CLASS_H_
#define _HID_CLASS_H_ #define _HID_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_HID_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_CDC_CLASS_HOST_C #define __INCLUDE_FROM_CDC_CLASS_HOST_C
#define __INCLUDE_FROM_CDC_DRIVER
#include "CDC.h" #include "CDC.h"
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -56,6 +56,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application, /** Class state structure. An instance of this structure should be made within the user application,
@ -286,7 +291,7 @@
#define CDC_FOUND_NOTIFICATION_IN (1 << 2) #define CDC_FOUND_NOTIFICATION_IN (1 << 2)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_CDC_CLASS_HOST_C) #if defined(__INCLUDE_FROM_CDC_CLASS_HOST_C)
static int CDC_Host_putchar(char c, FILE* Stream); static int CDC_Host_putchar(char c, FILE* Stream);
static int CDC_Host_getchar(FILE* Stream); static int CDC_Host_getchar(FILE* Stream);
static int CDC_Host_getchar_Blocking(FILE* Stream); static int CDC_Host_getchar_Blocking(FILE* Stream);

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_HID_CLASS_HOST_C #define __INCLUDE_FROM_HID_CLASS_HOST_C
#define __INCLUDE_FROM_HID_DRIVER
#include "HID.h" #include "HID.h"
uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_HID_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Error code for some HID Host functions, indicating a logical (and not hardware) error */ /** Error code for some HID Host functions, indicating a logical (and not hardware) error */
@ -275,7 +280,7 @@
#define HID_FOUND_DATAPIPE_OUT (1 << 1) #define HID_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_HID_CLASS_HOST_C) #if defined(__INCLUDE_FROM_HID_CLASS_HOST_C)
static uint8_t DComp_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_NextHID(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_NextHID(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);

@ -28,6 +28,7 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)

@ -57,6 +57,10 @@
#ifndef __HIDPARSER_H__ #ifndef __HIDPARSER_H__
#define __HIDPARSER_H__ #define __HIDPARSER_H__
/* Macros: */
#define __INCLUDE_FROM_USB_DRIVER
#define __INCLUDE_FROM_HID_DRIVER
/* Includes: */ /* Includes: */
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_MIDI_CLASS_HOST_C #define __INCLUDE_FROM_MIDI_CLASS_HOST_C
#define __INCLUDE_FROM_MIDI_DRIVER
#include "MIDI.h" #include "MIDI.h"
uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -53,6 +53,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application, /** Class state structure. An instance of this structure should be made within the user application,
@ -172,7 +177,7 @@
#define MIDI_FOUND_DATAPIPE_OUT (1 << 1) #define MIDI_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_MIDI_CLASS_HOST_C) #if defined(__INCLUDE_FROM_MIDI_CLASS_HOST_C)
static uint8_t DComp_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif #endif

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_MS_CLASS_HOST_C #define __INCLUDE_FROM_MS_CLASS_HOST_C
#define __INCLUDE_FROM_MS_DRIVER
#include "MassStorage.h" #include "MassStorage.h"
uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -53,6 +53,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error */ /** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error */
@ -296,7 +301,7 @@
#define MS_FOUND_DATAPIPE_OUT (1 << 1) #define MS_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_MS_CLASS_HOST_C) #if defined(__INCLUDE_FROM_MS_CLASS_HOST_C)
static uint8_t DComp_NextMSInterface(void* const CurrentDescriptor); static uint8_t DComp_NextMSInterface(void* const CurrentDescriptor);
static uint8_t DComp_NextMSInterfaceEndpoint(void* const CurrentDescriptor); static uint8_t DComp_NextMSInterfaceEndpoint(void* const CurrentDescriptor);

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_PRINTER_CLASS_HOST_C #define __INCLUDE_FROM_PRINTER_CLASS_HOST_C
#define __INCLUDE_FROM_PRINTER_DRIVER
#include "Printer.h" #include "Printer.h"
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -53,9 +53,12 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application, /** Class state structure. An instance of this structure should be made within the user application,
* and passed to each of the Printer class driver functions as the PRNTInterfaceInfo parameter. This * and passed to each of the Printer class driver functions as the PRNTInterfaceInfo parameter. This
@ -203,7 +206,7 @@
#define PRNT_FOUND_DATAPIPE_OUT (1 << 1) #define PRNT_FOUND_DATAPIPE_OUT (1 << 1)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_PRINTER_CLASS_HOST_C) #if defined(__INCLUDE_FROM_PRINTER_CLASS_HOST_C)
static uint8_t DComp_NextPRNTInterface(void* const CurrentDescriptor); static uint8_t DComp_NextPRNTInterface(void* const CurrentDescriptor);
static uint8_t DComp_NextPRNTInterfaceEndpoint(void* const CurrentDescriptor); static uint8_t DComp_NextPRNTInterfaceEndpoint(void* const CurrentDescriptor);
#endif #endif

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_RNDIS_CLASS_HOST_C #define __INCLUDE_FROM_RNDIS_CLASS_HOST_C
#define __INCLUDE_FROM_RNDIS_DRIVER
#include "RNDIS.h" #include "RNDIS.h"
uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -57,6 +57,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application, /** Class state structure. An instance of this structure should be made within the user application,
@ -245,7 +250,7 @@
#define RNDIS_FOUND_NOTIFICATION_IN (1 << 2) #define RNDIS_FOUND_NOTIFICATION_IN (1 << 2)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_RNDIS_CLASS_HOST_C) #if defined(__INCLUDE_FROM_RNDIS_CLASS_HOST_C)
static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,

@ -28,10 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h" #include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_SI_CLASS_HOST_C #define __INCLUDE_FROM_SI_CLASS_HOST_C
#define __INCLUDE_FROM_SI_DRIVER
#include "StillImage.h" #include "StillImage.h"
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize, uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize,

@ -53,6 +53,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_SI_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Error code for some Still Image Host functions, indicating a logical (and not hardware) error */ /** Error code for some Still Image Host functions, indicating a logical (and not hardware) error */
@ -287,7 +292,7 @@
#define COMMAND_DATA_TIMEOUT_MS 10000 #define COMMAND_DATA_TIMEOUT_MS 10000
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_SI_CLASS_HOST_C) #if defined(__INCLUDE_FROM_SI_CLASS_HOST_C)
static uint8_t DComp_SI_Host_NextSIInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_SI_Host_NextSIInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif #endif

@ -53,6 +53,10 @@
#ifndef _MIDI_CLASS_H_ #ifndef _MIDI_CLASS_H_
#define _MIDI_CLASS_H_ #define _MIDI_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_MIDI_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -50,6 +50,10 @@
#ifndef _MS_CLASS_H_ #ifndef _MS_CLASS_H_
#define _MS_CLASS_H_ #define _MS_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_MS_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -51,6 +51,10 @@
#ifndef _PRINTER_CLASS_H_ #ifndef _PRINTER_CLASS_H_
#define _PRINTER_CLASS_H_ #define _PRINTER_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_PRINTER_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -50,6 +50,10 @@
#ifndef _RNDIS_CLASS_H_ #ifndef _RNDIS_CLASS_H_
#define _RNDIS_CLASS_H_ #define _RNDIS_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_RNDIS_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -49,6 +49,10 @@
#ifndef _SI_CLASS_H_ #ifndef _SI_CLASS_H_
#define _SI_CLASS_H_ #define _SI_CLASS_H_
/* Macros: */
#define __INCLUDE_FROM_SI_DRIVER
#define __INCLUDE_FROM_USB_DRIVER
/* Includes: */ /* Includes: */
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -28,6 +28,7 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)

@ -59,6 +59,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared /** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared

@ -28,9 +28,8 @@
this software. this software.
*/ */
#include "USBMode.h" #define __INCLUDE_FROM_EVENTS_C
#define __INCLUDE_FROM_USB_DRIVER
#define INCLUDE_FROM_EVENTS_C
#include "Events.h" #include "Events.h"
void USB_Event_Stub(void) void USB_Event_Stub(void)

@ -60,9 +60,14 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Pseudo-Functions for Doxygen: */ /* Pseudo-Functions for Doxygen: */
#if !defined(INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__) #if !defined(__INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)
/** Event for USB stack initialization failure. This event fires when the USB interface fails to /** Event for USB stack initialization failure. This event fires when the USB interface fails to
* initialize correctly due to a hardware or software fault. * initialize correctly due to a hardware or software fault.
* *
@ -287,7 +292,7 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_EVENTS_C) #if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST; void USB_Event_Stub(void) ATTR_CONST;
#if defined(USB_CAN_BE_BOTH) #if defined(USB_CAN_BE_BOTH)

@ -58,6 +58,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors /** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors

@ -40,6 +40,11 @@
#ifndef __STDREQTYPE_H__ #ifndef __STDREQTYPE_H__
#define __STDREQTYPE_H__ #define __STDREQTYPE_H__
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Mask for the request type parameter, to indicate the direction of the request data (Host to Device /** Mask for the request type parameter, to indicate the direction of the request data (Host to Device

@ -41,6 +41,11 @@
#ifndef __STREAMCALLBACK_H__ #ifndef __STREAMCALLBACK_H__
#define __STREAMCALLBACK_H__ #define __STREAMCALLBACK_H__
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream

@ -28,6 +28,7 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "USBInterrupt.h" #include "USBInterrupt.h"
void USB_INT_DisableAllInterrupts(void) void USB_INT_DisableAllInterrupts(void)

@ -45,6 +45,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Macros: */ /* Macros: */

@ -43,6 +43,11 @@
#ifndef __USBMODE_H__ #ifndef __USBMODE_H__
#define __USBMODE_H__ #define __USBMODE_H__
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
#if defined(__DOXYGEN__) #if defined(__DOXYGEN__)
/** Indicates that the target AVR microcontroller belongs to the Series 2 USB controller /** Indicates that the target AVR microcontroller belongs to the Series 2 USB controller

@ -28,9 +28,8 @@
this software. this software.
*/ */
#include "USBMode.h" #define __INCLUDE_FROM_USBTASK_C
#define __INCLUDE_FROM_USB_DRIVER
#define INCLUDE_FROM_USBTASK_C
#include "USBTask.h" #include "USBTask.h"
volatile bool USB_IsInitialized; volatile bool USB_IsInitialized;

@ -54,6 +54,11 @@
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Global Variables: */ /* Global Variables: */
@ -164,7 +169,7 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_USBTASK_C) #if defined(__INCLUDE_FROM_USBTASK_C)
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
static void USB_HostTask(void); static void USB_HostTask(void);
#endif #endif

@ -28,11 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_DEVCHAPTER9_C #define __INCLUDE_FROM_DEVCHAPTER9_C
#include "DevChapter9.h" #include "DevChapter9.h"
uint8_t USB_ConfigurationNumber; uint8_t USB_ConfigurationNumber;

@ -48,6 +48,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
#if defined(USE_SINGLE_DEVICE_CONFIGURATION) #if defined(USE_SINGLE_DEVICE_CONFIGURATION)
@ -124,7 +129,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_DEVCHAPTER9_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);

@ -52,6 +52,10 @@
#if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)) #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
#error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive. #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
#endif #endif
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */

@ -28,11 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE) #if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_ENDPOINT_C #define __INCLUDE_FROM_ENDPOINT_C
#include "Endpoint.h" #include "Endpoint.h"
#if !defined(FIXED_CONTROL_ENDPOINT_SIZE) #if !defined(FIXED_CONTROL_ENDPOINT_SIZE)

@ -83,6 +83,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Endpoint data direction mask for \ref Endpoint_ConfigureEndpoint(). This indicates that the endpoint /** Endpoint data direction mask for \ref Endpoint_ConfigureEndpoint(). This indicates that the endpoint

@ -28,11 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_HOST_C #define __INCLUDE_FROM_HOST_C
#include "Host.h" #include "Host.h"
void USB_Host_ProcessNextHostState(void) void USB_Host_ProcessNextHostState(void)

@ -55,6 +55,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Indicates the fixed USB device address which any attached device is enumerated to when in /** Indicates the fixed USB device address which any attached device is enumerated to when in
@ -397,7 +402,7 @@
void USB_Host_ProcessNextHostState(void); void USB_Host_ProcessNextHostState(void);
uint8_t USB_Host_WaitMS(uint8_t MS); uint8_t USB_Host_WaitMS(uint8_t MS);
#if defined(INCLUDE_FROM_HOST_C) #if defined(__INCLUDE_FROM_HOST_C)
static void USB_Host_ResetDevice(void); static void USB_Host_ResetDevice(void);
#endif #endif
#endif #endif

@ -28,11 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_HOSTCHAPTER9_C #define __INCLUDE_FROM_HOSTCHAPTER9_C
#include "HostChapter9.h" #include "HostChapter9.h"
uint8_t USB_Host_SendControlRequest(void* BufferPtr) uint8_t USB_Host_SendControlRequest(void* BufferPtr)

@ -44,6 +44,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Enums: */ /* Enums: */
/** Enum for the \ref USB_Host_SendControlRequest() return code, indicating the reason for the error /** Enum for the \ref USB_Host_SendControlRequest() return code, indicating the reason for the error
@ -89,7 +94,7 @@
}; };
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_HOSTCHAPTER9_C) #if defined(__INCLUDE_FROM_HOSTCHAPTER9_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

@ -28,6 +28,7 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "LowLevel.h" #include "LowLevel.h"
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY)) #if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))

@ -70,6 +70,10 @@
#endif #endif
/* Preprocessor Checks and Defines: */ /* Preprocessor Checks and Defines: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
#if !defined(F_CLOCK) #if !defined(F_CLOCK)
#error F_CLOCK is not defined. You must define F_CLOCK to the frequency of the unprescaled input clock in your project makefile. #error F_CLOCK is not defined. You must define F_CLOCK to the frequency of the unprescaled input clock in your project makefile.
#endif #endif

@ -47,6 +47,11 @@
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Mask for the VBUS pulsing method of SRP, supported by some OTG devices. /** Mask for the VBUS pulsing method of SRP, supported by some OTG devices.

@ -28,11 +28,12 @@
this software. this software.
*/ */
#define __INCLUDE_FROM_USB_DRIVER
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST) #if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_PIPE_C #define __INCLUDE_FROM_PIPE_C
#include "Pipe.h" #include "Pipe.h"
uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE; uint8_t USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;

@ -91,6 +91,11 @@
extern "C" { extern "C" {
#endif #endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */ /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */

@ -350,6 +350,11 @@
#ifndef __USB_H__ #ifndef __USB_H__
#define __USB_H__ #define __USB_H__
/* Macros: */
#if !defined(__DOXYGEN__)
#define __INCLUDE_FROM_USB_DRIVER
#endif
/* Includes: */ /* Includes: */
#include "HighLevel/USBMode.h" #include "HighLevel/USBMode.h"

Loading…
Cancel
Save