avr-fw-modules/usb/include/usb/usb_defs.h

46 lines
809 B
C

#pragma once
#include <usb/usb_spec.h>
struct __usb_pllcsr
{
uint32_t fcpu;
uint8_t pllcsr;
};
#ifdef __AVR_AT90USB1286__
#define __USB_PLLCSR { \
{ 8000000L, _BV(PLLP0) | _BV(PLLP1) }, \
{ 16000000L, _BV(PLLP0) | _BV(PLLP2) }, \
{} \
}
#define USB_CAN_DEVICE
#define USB_CAN_HOST
#endif
#ifdef __AVR_AT90USB646__
#define __USB_PLLCSR { \
{ 8000000L, _BV(PLLP0) | _BV(PLLP1) }, \
{ 16000000L, _BV(PLLP1) | _BV(PLLP2) }, \
{} \
}
#define USB_CAN_DEVICE
#define USB_CAN_HOST
#endif
#ifdef __AVR_ATmega32U4__
#define __USB_PLLCSR { \
{ 8000000L, 0 }, \
{ 16000000L, _BV(PINDIV) }, \
{} \
}
#define __USB_PLLFRQ (_BV(PLLUSB) | _BV(PDIV1) | _BV(PDIV3))
#define USB_CAN_DEVICE
#endif
#ifndef __USB_PLLCSR
#error "NO PLL Settings defined for this MCU"
#endif