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.

This commit is contained in:
Dean Camera 2010-02-11 04:05:02 +00:00
parent 3a2c1db675
commit d49cc0f783
111 changed files with 341 additions and 85 deletions

View File

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

View File

@ -54,7 +54,7 @@
#endif
/* 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.
#endif

View File

@ -46,7 +46,7 @@
// TODO: Add any required includes here
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#endif
/* 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.
#endif

View File

@ -53,7 +53,7 @@
#endif
/* 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.
#endif

View File

@ -62,7 +62,7 @@
#endif
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -64,7 +64,7 @@
#endif
/* 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.
#endif

View File

@ -63,7 +63,7 @@
#endif
/* 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.
#endif

View File

@ -63,7 +63,7 @@
#endif
/* 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.
#endif

View File

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

View File

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

View File

@ -68,7 +68,7 @@
#endif
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#include "AT45DB321C.h"
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

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

View File

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

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -68,7 +68,7 @@
#endif
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#include "AT45DB321C.h"
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -68,7 +68,7 @@
#endif
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#include "AT45DB642D.h"
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

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

View File

@ -62,7 +62,7 @@
#endif
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#include "AT45DB642D.h"
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

@ -54,7 +54,7 @@
#include "AT45DB642D.h"
/* 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.
#endif

View File

@ -61,7 +61,7 @@
#endif
/* 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.
#endif

View File

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

View File

@ -62,7 +62,7 @@
#endif
/* 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.
#endif

View File

@ -63,7 +63,7 @@
#endif
/* 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.
#endif

View File

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

View File

@ -70,7 +70,7 @@
extern FILE USARTStream;
/* 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_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1);
#endif

View File

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

View File

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

View File

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

View File

@ -51,6 +51,11 @@
extern "C" {
#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: */
#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

View File

@ -51,6 +51,11 @@
extern "C" {
#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: */
/** CDC Class specific request to get the current virtual serial port configuration settings. */
#define REQ_GetLineEncoding 0x21

View File

@ -46,6 +46,11 @@
#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: */
/** HID Class Specific Request to get the current HID report from the device. */
#define REQ_GetReport 0x01

View File

@ -41,6 +41,9 @@
#ifndef _MIDI_CLASS_COMMON_H_
#define _MIDI_CLASS_COMMON_H_
/* Macros: */
#define __INCLUDE_FROM_AUDIO_DRIVER
/* Includes: */
#include "../../USB.h"
#include "Audio.h"
@ -52,6 +55,11 @@
extern "C" {
#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: */
/** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
#define DSUBTYPE_InputJack 0x02

View File

@ -51,6 +51,11 @@
extern "C" {
#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: */
/** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
#define REQ_MassStorageReset 0xFF

View File

@ -51,6 +51,11 @@
extern "C" {
#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: */
/** Port status mask for a printer device, indicating that an error has *not* occurred. */
#define PRNT_PORTSTATUS_NOTERROR (1 << 3)

View File

@ -41,10 +41,13 @@
#ifndef _RNDIS_CLASS_COMMON_H_
#define _RNDIS_CLASS_COMMON_H_
/* Macros: */
#define __INCLUDE_FROM_CDC_DRIVER
/* Includes: */
#include "../../USB.h"
#include "CDC.h"
#include "RNDISConstants.h"
#include "CDC.h"
#include <string.h>
@ -53,6 +56,11 @@
extern "C" {
#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: */
/** Implemented RNDIS Version Major */
#define REMOTE_NDIS_VERSION_MAJOR 0x01

View File

@ -51,6 +51,11 @@
extern "C" {
#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: */
/** Length in bytes of a given Unicode string's character length
*

View File

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

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each Audio interface

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
void CDC_Device_Event_Stub(void)

View File

@ -73,6 +73,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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: */
#if !defined(__DOXYGEN__)
/* 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_getchar(FILE* Stream);
static int CDC_Device_getchar_Blocking(FILE* Stream);

View File

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

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** Class state structure. An instance of this structure should be made for each HID interface

View File

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

View File

@ -47,7 +47,6 @@
/* Includes: */
#include "../../USB.h"
#include "../Common/MIDI.h"
#include "Audio.h"
#include <string.h>
@ -56,6 +55,11 @@
extern "C" {
#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: */
/* Type Define: */
/** Class state structure. An instance of this structure should be made for each MIDI interface

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
static volatile bool* CallbackIsResetSource;

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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: */
#if !defined(__DOXYGEN__)
/* 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 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);

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
static const uint32_t PROGMEM AdapterSupportedOIDList[] =

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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: */
#if !defined(__DOXYGEN__)
/* 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)
ATTR_NON_NULL_PTR_ARG(1);
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,

View File

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

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -56,6 +56,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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)
/* 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_getchar(FILE* Stream);
static int CDC_Host_getchar_Blocking(FILE* Stream);

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Macros: */
/** 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)
/* 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_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);

View File

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

View File

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

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -53,6 +53,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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)
/* 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_NextMIDIStreamingDataEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -53,6 +53,11 @@
extern "C" {
#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: */
/* Macros: */
/** 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)
/* 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_NextMSInterfaceEndpoint(void* const CurrentDescriptor);

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -53,9 +53,12 @@
extern "C" {
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/* 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: */
/* Type Defines: */
/** 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
@ -203,7 +206,7 @@
#define PRNT_FOUND_DATAPIPE_OUT (1 << 1)
/* 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_NextPRNTInterfaceEndpoint(void* const CurrentDescriptor);
#endif

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -57,6 +57,11 @@
extern "C" {
#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: */
/* Type Defines: */
/** 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)
/* 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,
void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,

View File

@ -28,10 +28,12 @@
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../../HighLevel/USBMode.h"
#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"
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize,

View File

@ -53,6 +53,11 @@
extern "C" {
#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: */
/* Macros: */
/** 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
/* 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_NextSIInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -59,6 +59,11 @@
extern "C" {
#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: */
/* Macros: */
/** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared

View File

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

View File

@ -60,9 +60,14 @@
extern "C" {
#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: */
/* 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
* initialize correctly due to a hardware or software fault.
*
@ -287,7 +292,7 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(INCLUDE_FROM_EVENTS_C)
#if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST;
#if defined(USB_CAN_BE_BOTH)

View File

@ -58,6 +58,11 @@
extern "C" {
#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: */
/* Macros: */
/** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors

View File

@ -40,6 +40,11 @@
#ifndef __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: */
/* Macros: */
/** Mask for the request type parameter, to indicate the direction of the request data (Host to Device

View File

@ -41,6 +41,11 @@
#ifndef __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: */
/* Macros: */
/** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream

View File

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

View File

@ -45,6 +45,11 @@
extern "C" {
#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: */
#if !defined(__DOXYGEN__)
/* Macros: */

View File

@ -43,6 +43,11 @@
#ifndef __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: */
#if defined(__DOXYGEN__)
/** Indicates that the target AVR microcontroller belongs to the Series 2 USB controller

View File

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

View File

@ -55,6 +55,11 @@
extern "C" {
#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: */
/* Global Variables: */
/** Indicates if the USB interface is currently initialized but not necessarily connected to a host
@ -164,7 +169,7 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(INCLUDE_FROM_USBTASK_C)
#if defined(__INCLUDE_FROM_USBTASK_C)
#if defined(USB_CAN_BE_HOST)
static void USB_HostTask(void);
#endif

View File

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

View File

@ -48,6 +48,11 @@
extern "C" {
#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: */
/* Macros: */
#if defined(USE_SINGLE_DEVICE_CONFIGURATION)
@ -124,7 +129,7 @@
/* Function Prototypes: */
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_SetConfiguration(void);
static void USB_Device_GetConfiguration(void);

View File

@ -53,6 +53,10 @@
#error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
#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: */
/* Macros: */
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__)

View File

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

Some files were not shown because too many files have changed in this diff Show More