USB_Constants_Define_H.#1
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:3k
- //-----------------------------------------------------------------------------
- // USB_Constants_Define_H.h
- //-----------------------------------------------------------------------------
- // Copyright 2007 Vson Technology, Inc.
- // http://www.usbmcu.com
- //
- // Program Description:
- //
- //
- //
- //
- //
- // MCU: C8051F347
- // Tool chain: Keil C51 7.50 / Keil EVAL C51
- // Silicon Laboratories IDE version 2.6
- // Command Line:
- // Project Name: TR1000
- //
- //
- // Release 1.0
- // -All changes by Brian
- // -24 JUL 2007
- //
- #ifndef _USB_Constants_Define_H_
- #define _USB_Constants_Define_H_
- //-----------------------------------------------------------------------------
- // Function Prototypes
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // Global Constants
- //-----------------------------------------------------------------------------
- #define SYSCLK 23560000 // SYSCLK frequency in Hz
- #define SAMPLERATE 100000 // ADC0 Sample Rate
- // USB clock selections (SFR CLKSEL)
- #define USB_4X_CLOCK 0
- #define USB_INT_OSC_DIV_2 0x10
- #define USB_EXT_OSC 0x20
- #define USB_EXT_OSC_DIV_2 0x30
- #define USB_EXT_OSC_DIV_3 0x40
- #define USB_EXT_OSC_DIV_4 0x50
- // System clock selections (SFR CLKSEL)
- #define SYS_INT_OSC 0
- #define SYS_EXT_OSC 0x01
- #define SYS_4X_DIV_2 0x02
- // USB device speed settings
- #define FULL_SPEED 0x20
- #define LOW_SPEED 0x00
- // ADC0 AMUX settings
- #define AMX_TEMP_SENSE 0x1E // Temperature sensor
- #define AMX_P1_7 0x07 // P1.7 (potentiometer)
- #define AMX_GND 0x1F // Ground
- // Define endpoint status values
- #define EP_IDLE 0
- #define EP_TX 1
- #define EP_ERROR 2
- #define EP_HALTED 3
- #define EP_RX 4
- // Define device states
- #define DEV_DEFAULT 0
- #define DEV_ADDRESS 1
- #define DEV_CONFIG 2
- #define EP_MASK_DIR 0x80
- // Endpoint addresses
- #define EP1_IN 0x81
- #define EP1_OUT 0x01
- #define EP2_IN 0x82
- #define EP2_OUT 0x02
- #define EP3_IN 0x83
- #define EP3_OUT 0x03
-
- #endif
- //-----------------------------------------------------------------------------
- // End Of File
- //-----------------------------------------------------------------------------