⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constant.c

📁 at91rm9200 的rom程序
💻 C
字号:
//*----------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : constant.c
//* Object              :
//*
//* 1.0 Oct 11th  01 	: HI ODi : Creation
//* 1.2 Oct 07th  02 	: FB     : New Quartz : 4608000 in PLLB_SETUP array
//*----------------------------------------------------------------------------

// ===================================
// Constants defined for USB
// ===================================
#include "usb_enum.h"

const USBDfuModeDesc USB_DFU_DESC = {
	/* ============== DFU Mode Device Descriptor =========== */
	{
	0x12,   // bLength
	0x01,   // bDescriptorType
	0x0100, // bcdUSBL
	0xFE,   // bDeviceClass
	0x01,   // bDeviceSubclass
	0x00,   // bDeviceProtocol
	0x08,   // bMaxPacketSize0
	0x03EB, // idVendorL
	0x6120, // idProductL
	0x0001, // bcdDeviceL
	0x00,   // iManufacturer
	0x00,   // iProduct
	0x00,   // SerialNumber
	0x01    // bNumConfigs
	},

	/* ============== DFU Mode Configuration Descriptor =========== */
	{
	/* Configuration 1 descriptor */
	0x09,   // CbLength
	0x02,   // CbDescriptorType
	0x0019, // CwTotalLength 2 EP + Control
	0x01,   // CbNumInterfaces
	0x01,   // CbConfigurationValue
	0x00,   // CiConfiguration
	0xC0,   // CbmAttributes 0xA0
	0x00    // CMaxPower
	},

	/* ============== DFU Mode Interface Descriptor =========== */
	{
	0x09, // bLength
	0x04, // bDescriptorType
	0x00, // bInterfaceNumber
	0x00, // bAlternateSetting
	0x00, // bNumEndpoints
	0xFE, // bInterfaceClass
	0x01, // bInterfaceSubclass
	0x00, // bInterfaceProtocol
	0x00  // iInterface
	},

	/* ============== DFU Mode Functional Descriptor =========== */
	{
	0x07,   // bLength
	0x21,   // bDescriptorType
	0x01,   // bmAttributes
	0x0100, // wDetachTimeOut: Device will wait for 100 ms
	0xFFFF  // wTransferSize
	}
};

// ===================================
// Constants defined for USART
// ===================================
#define CLRSCREEN		"\033[2J"
const char USART_HEADER[]=
{
CLRSCREEN
"\n\r *** ATMEL AT91 UPLOADER ***\n\r"
"Copyright (C) 2001 ATMEL Corporations Version: 1.0\n\r"
};


// ===================================
// Constants defined for PLL
// ===================================
/* array to determine the PLLB setup for 48MHz USB clock 
	PLLB_OUTPUT = FREQ * (MUL+1)/DIV = 96 MHz
	USB_CLOCK = PLLB_OUTPUT/2; 
*/
const int PLLB_SETUP[][2] =
{
/*		Freq   DIV	   MUL	*/
	{ 3000000, 	1  + ((32 -1) << 16) },
	{ 3276800, 	3  + ((88 -1) << 16) },
	{ 3686400, 	1  + ((26 -1) << 16) },
	{ 3840000, 	1  + ((25 -1) << 16) },
	{ 4000000, 	1  + ((24 -1) << 16) },
	{ 4433619, 	3  + ((65 -1) << 16) },
	{ 4608000, 	5  + ((104 -1) << 16) },	// add on for "usb new bootrom" validation
	{ 4915200, 	2  + ((39 -1) << 16) },
	{ 5000000, 	5  + ((96 -1) << 16) },
	{ 5242880, 	3  + ((55 -1) << 16) },
	{ 6000000, 	1  + ((16 -1) << 16) },
	{ 6144000, 	5  + ((78 -1) << 16) },
	{ 6400000, 	1  + ((15 -1) << 16) },
	{ 6553600, 	3  + ((44 -1) << 16) },
	{ 7159090, 	5  + ((67 -1) << 16) },
	{ 7372800, 	1  + ((13 -1) << 16) },
	{ 7864320, 	5  + ((61 -1) << 16) },
	{ 8000000, 	1  + ((12 -1) << 16) },
	{ 9830400, 	9  + ((88 -1) << 16) },
	{ 10000000, 5  + ((48 -1) << 16) },
	{ 11059200, 3  + ((26 -1) << 16) },
	{ 12000000, 1  + (( 8 -1) << 16) },
	{ 12288000,	11 + ((86 -1) << 16) },
	{ 13560000,	13 + ((92 -1) << 16) },
	{ 14318180, 10 + ((67 -1) << 16) },
	{ 14745600, 2  + ((13 -1) << 16) },
	{ 16000000, 1  + (( 6 -1) << 16) },
	{ 17734470, 17 + ((92 -1) << 16) },
	{ 18432000, 14 + ((73 -1) << 16) },
	{ 20000000, 5  + ((24 -1) << 16) },
	{ 24000000, 1  + (( 4 -1) << 16) },
	{ 25000000, 25 + ((96 -1) << 16) },
	{ 28224000, 5  + ((17 -1) << 16) },
	{ 32000000, 1  + (( 3 -1) << 16) },
	{ 33000000, 11 + ((32 -1) << 16) },
	{ 0		  , 0				     },
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -