#include "config.h"
#include "usb_drv.h"
Go to the source code of this file.
Functions | |
| U8 | usb_config_ep (U8 config0, U8 config1) |
| usb_configure_endpoint. | |
| U8 | usb_select_enpoint_interrupt (void) |
| usb_select_endpoint_interrupt. | |
| U8 | usb_send_packet (U8 ep_num, U8 *tbuf, U8 data_length) |
| usb_send_packet. | |
| U8 | usb_read_packet (U8 ep_num, U8 *rbuf, U8 data_length) |
| usb_read_packet. | |
| U8 | usb_init_device (void) |
| usb_init_device. | |
| void | usb_generate_clock (void) |
| Usb_configure_clock. | |
Use of this program is subject to Atmel's End User License Agreement. Please read file license.txt for copyright notice.
This file contains the USB driver routines.
Definition in file usb_drv.c.
|
||||||||||||
|
usb_configure_endpoint. This function configures an endpoint with the selected type.
EXAMPLE: usb_configure_endpoint(EP_CONTROL,TYPE_CONTROL, DIRECTION_OUT, SIZE_64, ONE_BANK, NYET_DISABLED); NOTE: The endpoint 0 shall always be configured in CONTROL type. Definition at line 52 of file usb_drv.c. References MSK_EPEN, TRUE, U8, Usb_allocate_memory, Usb_enable_endpoint, Usb_set_cfg0, and Usb_set_cfg1.
|
|
|
usb_select_endpoint_interrupt. This function select the endpoint where an event occurs and returns the number of this endpoint. If no event occurs on the endpoints, this function returns 0.
Definition at line 74 of file usb_drv.c. References ep_num, U8, and Usb_interrupt_flags.
|
|
||||||||||||||||
|
usb_send_packet. This function moves the data pointed by tbuf to the selected endpoint fifo and sends it through the USB.
Note: tbuf is incremented of 'data_length'. Definition at line 118 of file usb_drv.c. References ep_num, Is_usb_write_enabled, U8, Usb_select_endpoint, Usb_send_control_in, and Usb_write_byte.
|
|
||||||||||||||||
|
usb_read_packet. This function moves the data stored in the selected endpoint fifo to the address specified by *rbuf.
Note: rbuf is incremented of 'data_length'. Definition at line 155 of file usb_drv.c. References ep_num, Is_usb_read_enabled, U8, Usb_read_byte, and Usb_select_endpoint. Referenced by usb_read_continuous().
|
|
|
usb_init_device. This function initializes the USB device controller and configures the Default Control Endpoint.
Definition at line 200 of file usb_drv.c. References DIRECTION_OUT, EP_CONTROL, NYET_DISABLED, ONE_BANK, SIZE_64, TRUE, TYPE_CONTROL, U8, and usb_configure_endpoint. Referenced by usb_start_device().
|
|
|
Usb_configure_clock. This function configure the PLL to generate the 48MHz clock required by the USB controller, considering the FOSC defined in the "config.h" file.
Definition at line 235 of file usb_drv.c. References MSK_SOFINT, MSK_T0X2, MSK_X2, PLL_12MHz, PLL_16MHz, PLL_18MHz, PLL_20MHz, PLL_24MHz, PLL_32MHz, PLL_3MHz, PLL_40MHz, PLL_4MHz, PLL_6MHz, PLL_8MHz, Pll_enable, Pll_set_div, Pll_stop, and Uchar. Referenced by usb_start_device().
|
1.3.7