#include <avr/io.h>
#include <stdbool.h>
#include "../../../Common/Common.h"
#include "../LowLevel/LowLevel.h"
#include "../LowLevel/USBMode.h"
#include "Events.h"
#include "../LowLevel/LowLevel.h"
Defines | |
#define | ENDPOINT_PIPE_vect USB_COM_vect |
#define | USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE |
#define | USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE |
#define | USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE |
#define | USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false) |
#define | USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false) |
Functions | |
RAISES_EVENT (USB_Connect) | |
RAISES_EVENT (USB_Disconnect) | |
RAISES_EVENT (USB_VBUSChange) | |
RAISES_EVENT (USB_VBUSConnect) | |
RAISES_EVENT (USB_VBUSDisconnect) | |
RAISES_EVENT (USB_Suspend) | |
RAISES_EVENT (USB_WakeUp) | |
RAISES_EVENT (USB_Reset) | |
RAISES_EVENT (USB_HostError) | |
RAISES_EVENT (USB_DeviceUnattached) | |
RAISES_EVENT (USB_UIDChange) |
#define ENDPOINT_PIPE_vect USB_COM_vect |
Vector name for the common endpoint and pipe vector. This can be used to write an ISR handler for the endpoint and pipe events, to make certain USB functions interrupt rather than poll driven.
#define USB_INT_Clear | ( | int | ) | MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE |
Resets the given USB interrupt flag, so that the interrupt is re-primed for the next firing.
#define USB_INT_Disable | ( | int | ) | MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE |
#define USB_INT_Enable | ( | int | ) | MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE |
Enables the given USB interrupt vector (such as the ENDPOINT_INT_* and PIPE_INT_* vectors in Endpoint.h and Pipe.h).
#define USB_INT_HasOccurred | ( | int | ) | ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false) |
Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred, but the interrupt vector is not neccesarily enabled), otherwise returns false.
#define USB_INT_IsEnabled | ( | int | ) | ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false) |
Returns boolean false if the given USB interrupt is disabled, or true if the interrupt is currently enabled.
RAISES_EVENT | ( | USB_UIDChange | ) |
This module raises the UID Change event when the UID line changes in value on dual-role devices.
RAISES_EVENT | ( | USB_DeviceUnattached | ) |
This module raises the Device Unattached event when an attached device is removed from the AVR whilst running in host mode.
RAISES_EVENT | ( | USB_HostError | ) |
This module raises the Host Error event when the VBUS line voltage dips below the minimum threshold while running in host mode.
RAISES_EVENT | ( | USB_Reset | ) |
This module raises the USB Reset event when the host resets the USB interface of the AVR whilst running in device mode.
RAISES_EVENT | ( | USB_WakeUp | ) |
This module raises the Wake Up event when the host resumes the USB interface of the AVR whilst running in device mode.
RAISES_EVENT | ( | USB_Suspend | ) |
This module raises the Suspended event when the host suspends the USB interface of the AVR whilst running in device mode.
RAISES_EVENT | ( | USB_VBUSDisconnect | ) |
This module raises the VBUS Disconnect event when power is removed from the VBUS line.
RAISES_EVENT | ( | USB_VBUSConnect | ) |
This module raises the VBUS Connect event when the VBUS line is powered.
RAISES_EVENT | ( | USB_VBUSChange | ) |
This module raises the VBUS Change event when the current VBUS status (present or not present) has changed.
RAISES_EVENT | ( | USB_Disconnect | ) |
This module raises the USB Disconnected interrupt when the AVR is removed from a host while in device USB mode.
RAISES_EVENT | ( | USB_Connect | ) |
This module raises the USB Connected interrupt when the AVR is attached to a host while in device USB mode.