📄 usb_main.h
字号:
//-----------------------------------------------------------------------------
// USB_Main.h
//-----------------------------------------------------------------------------
#ifndef USB_MAIN_H
#define USB_MAIN_H
//-----------------------------------------------------------------------------
// Global Constants
//-----------------------------------------------------------------------------
#if defined C8051F320_H
// USB clock selections (SFR CLKSEL)
#define USB_4X_CLOCK 0x00 // Select 4x clock multiplier,
// for USB Full Speed
#define USB_INT_OSC_DIV_2 0x10 // See Oscillators in Datasheet
#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 0x00 // Select to use internal osc.
#define SYS_EXT_OSC 0x01 // Select to use external osc.
#define SYS_4X_DIV_2 0x02
#endif // C8051F320_H
#if defined C8051F326_H
// USB clock selections (SFR CLKSEL)
#define USB_4X_CLOCK 0x00 // Select 4x clock multiplier,
// for USB Full Speed
#define USB_INT_OSC_DIV_2 0x10 // See Oscillators in Datasheet
#define USB_EXT_OSC 0x20
#define USB_CLOCK_OFF 0x30
// System clock selections (SFR CLKSEL)
#define SYS_INT_OSC 0x00 // Select to use internal osc.
#define SYS_EXT_OSC 0x01 // Select to use external osc.
#define SYS_4X_DIV_2 0x02
#define SYS_LOW_FREQ_OSC 0x03 // Low frequency OSC
#endif // C8051F326_H
#if defined C8051F340_H
// USB clock selections (SFR CLKSEL)
#define USB_4X_CLOCK 0x00 // Select 4x clock multiplier,
// for USB Full Speed
#define USB_INT_OSC_DIV_2 0x10 // See Oscillators in Datasheet
#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 0x00 // Select to use internal osc.
#define SYS_EXT_OSC 0x01 // Select to use external osc.
#define SYS_4X_DIV_2 0x02
#define SYS_4X 0x03
#define SYS_LOW_FREQ_OSC 0x04 // Low frequency OSC
#endif // C8051F340_H
//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Prototypes
//-----------------------------------------------------------------------------
#endif /* USB_MAIN_H */
//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -