drivers/usb/at90usb/at90usb_internal.h File Reference

AT90USB driver: Internal functions and definitions. More...

#include <slist.h>
#include <bitops.h>
#include <stdint.h>
#include <workqueue.h>
#include <usb/udc.h>
#include <usb/request.h>
#include <chip/regs.h>
#include "at90usb_regs.h"

Go to the source code of this file.

Data Structures

struct  at90usb_udc_ep
struct  at90usb_udc
struct  at90usb_host
struct  at90usb_controller

Enumerations

enum  ep0_state {
  EP0_STATE_SETUP = 0, EP0_STATE_DATA_IN, EP0_STATE_DATA_ZLP, EP0_STATE_DATA_OUT,
  EP0_STATE_STATUS_IN, EP0_STATE_STATUS_OUT
}
enum  at90usb_ep_flag {
  AT90USB_EP_ALLOCATED, AT90USB_EP_ACTIVE_XFER, AT90USB_EP_ENABLED, AT90USB_EP_IS_IN,
  AT90USB_EP_WEDGE
}

Functions

static bool at90usb_udc_is_enabled (struct at90usb_udc *udc90)
 Check if the AT90USB UDC controller is enabled.
static void at90usb_udc_enable (struct at90usb_udc *udc90)
 Enable the AT90USB UDC controller.
static void at90usb_udc_disable (struct at90usb_udc *udc90)
 Disable the AT90USB UDC controller.
void at90usb_udc_vbus_off (struct at90usb_udc *udc90)
 Signal that a low Vbus level has been detected.
void at90usb_udc_vbus_on (struct at90usb_udc *udc90)
 Signal that a high Vbus level has been detected.
struct at90usb_udcat90usb_udc_init (void)
 Initialize the device part of the AT90USB controller.
void at90usb_udc_shutdown (struct at90usb_udc *udc90)
 Shut down the device part of the AT90USB controller.
static bool at90usb_host_is_enabled (struct at90usb_host *host90)
 Check if the AT90USB host controller is enabled.

Detailed Description

AT90USB driver: Internal functions and definitions.

This header is for internal use only. There is lots of ugly preprocessor stuff in here so that the rest of the code can be reasonably clean and efficient.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file at90usb_internal.h.


Enumeration Type Documentation

Endpoint states.

Enumerator:
AT90USB_EP_ALLOCATED 

Endpoint is allocated

AT90USB_EP_ACTIVE_XFER 

Endpoint is active with a transfer

AT90USB_EP_ENABLED 

Endpoint is enabled

AT90USB_EP_IS_IN 

Endpoint is in IN mode

AT90USB_EP_WEDGE 

Endpoint is in wedge state

Definition at line 74 of file at90usb_internal.h.

enum ep0_state

Control endpoint state.

Enumerator:
EP0_STATE_SETUP 

Waiting for SETUP

EP0_STATE_DATA_IN 

IN data being sent

EP0_STATE_DATA_ZLP 

Zero-Length Packet being sent

EP0_STATE_DATA_OUT 

Waiting for OUT data

EP0_STATE_STATUS_IN 

IN status sent

EP0_STATE_STATUS_OUT 

Waiting for OUT status

Definition at line 62 of file at90usb_internal.h.


Function Documentation

static bool at90usb_host_is_enabled ( struct at90usb_host host90  )  [inline, static]

Check if the AT90USB host controller is enabled.

For internal use only.

Parameters:
host90 The host controller.
Returns:
True if host mode is enabled, false otherwise.

Definition at line 202 of file at90usb_internal.h.

References test_bit.

Referenced by at90usb_enter_device_mode(), at90usb_enter_host_mode(), at90usb_ep_interrupt(), and at90usb_generic_interrupt().

static void at90usb_udc_disable ( struct at90usb_udc udc90  )  [inline, static]

Disable the AT90USB UDC controller.

For internal use only.

Parameters:
udc90 The UDC controller.

Definition at line 170 of file at90usb_internal.h.

References udc::flags, at90usb_udc::udc, and UDC_AUTOATTACH.

Referenced by at90usb_enter_host_mode().

static void at90usb_udc_enable ( struct at90usb_udc udc90  )  [inline, static]

Enable the AT90USB UDC controller.

For internal use only.

Parameters:
udc90 The UDC controller.

Definition at line 152 of file at90usb_internal.h.

References udc::flags, at90usb_udc::udc, UDC_AUTOATTACH, and UDC_IS_ENABLED.

Referenced by at90usb_enter_device_mode().

static bool at90usb_udc_is_enabled ( struct at90usb_udc udc90  )  [inline, static]

Check if the AT90USB UDC controller is enabled.

For internal use only.

Parameters:
udc90 The UDC controller.
Returns:
True if UDC mode is enabled, false otherwise.

Definition at line 135 of file at90usb_internal.h.

References udc::flags, test_bit, at90usb_udc::udc, and UDC_IS_ENABLED.

Referenced by at90usb_enter_device_mode(), at90usb_enter_host_mode(), at90usb_ep_interrupt(), at90usb_generic_interrupt(), and at90usb_udc_maybe_attach().

Generated on Thu Apr 29 14:10:34 2010 for xplain-bc by  doxygen 1.6.3