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

📄 app_cfg.h

📁 uCOS-II 2.8和uC-TCP/IP在ATMEL AT91SAM9261上移植
💻 H
字号:
/*
*********************************************************************************************************
*                                    APPLICATION SPECIFIC RTOS SETUP
*
*                             (c) Copyright 2005, Micrium, Inc., Weston, FL
*                                          All Rights Reserved
*
*                                          CONFIGURATION FILE
*
* File : app_cfg.h
* By   : Eric Shufro
*********************************************************************************************************
*/

#ifndef  APP_CFG_H
#define  APP_CFG_H

/*
*********************************************************************************************************
*                                      APPLICATION CONFIGURATION
*
* Note(s) : (1) Configure the product's/application's desired product configuration values.
*********************************************************************************************************
*/

#define  OS_CPU_ARM_DCC_EN               DEF_ENABLED 

#define  BSP_EXT_MEM_INIT                    1                          /* Initialize the Ext. Memory Controller from BSP_Init()    */
                                                                        /* This is REQUIRED when using a first level boot loader    */

/*
*********************************************************************************************************
*                                           BOOT LOADER CONFIGURATION
*
* Notes : 1) START_ADDR is the address to jump to once the application has been copied into external RAM
*         2) BOOT_SIZE  is the number of bytes to copy from the specified source medium to external RAM.
*               This value must be greater than or equal to the size of the application being copied.
*         3) BOOT_FROM specifies the source medium to copy from. This must be defined as either 
*               DATAFLASH or NANDFLASH.
*         4) EXT_MEM_INIT must be defined > 0 to initialize the external memory controller. This step
*               is critical in order to copy the application from the specified medium to external RAM.
*********************************************************************************************************
*/

#define  BOOT_RETRIES                        3                          /* Specify number of boot attempts before giving up         */

#define  DATAFLASH                           0                          /* Boot media constant for Atmel Dataflash                  */
#define  NANDFLASH                           1                          /* Boot media constant for NAND flash                       */

#define  BOOT_FROM                   DATAFLASH                          /* Select boot medium. DATAFLASH or NANDFLASH               */

#define  COPY_TO_ADDR               0x23F00000                          /* Destination address in Ext. RAM to copy the app to       */

#define  IMG_SIZE                   0x00080000                          /* Copy size. Must be greater than or equal to app size     */

#if     (BOOT_FROM == DATAFLASH)
#define  IMG_ADDRESS                0x00008000                          /* Application image starts from addr 0x8000 in dataflash   */
#elif   (BOOT_FROM == NANDFLASH)
#define  IMG_ADDRESS                0x00020000                          /* Application address is NAND flash must be block aligned  */
#endif

/*
*********************************************************************************************************
*                                      DATAFLASH SETTINGS / MACROS
*********************************************************************************************************
*/

#define  AT91C_BASE_SPI	       AT91C_BASE_SPI0                          /* Choose which SPI port to use                             */
#define  AT91C_ID_SPI	         AT91C_ID_SPI0                          /* Set the Atmel peripheral ID for the SPI port             */

#define  AT91C_SPI_CLK               33000000L                          /* Set the desires SPI baud rate                            */

                                                                        /* Configure the SPI pin characteristics (polarity, timing) */
                                                                        /* DLYBS = tCSS= 250ns min and DLYBCT = tCSH = 250ns        */
#define  DATAFLASH_TCSS	          (0x1a << 16)	                        /* 250ns min (tCSS) <=> 12/48000000 = 250ns                 */
#define  DATAFLASH_TCHS	          (0x01 << 24)                          /* 250ns min (tCSH) <=> (64*1+SCBR)/(2*48000000) */

                                                                        /* Configure the chip select pin with the desired settings  */
#define  DF_CS_SETTINGS 		 (AT91C_SPI_NCPHA                     | \
                                 (AT91C_SPI_DLYBS  & DATAFLASH_TCSS)  | \
                                 (AT91C_SPI_DLYBCT & DATAFLASH_TCHS)  | \
                               (((BSP_MCK_Frq()   /  AT91C_SPI_CLK) + 1) << 8))

/*
*********************************************************************************************************
*                                      NAND FLASH SETTINGS / MACROS
*********************************************************************************************************
*/

#define  AT91C_SMARTMEDIA_BASE	0x40000000

#define  AT91_SMART_MEDIA_ALE    (1 << 22)	                            /* Board specific ALE is connected to AD22                  */
#define  AT91_SMART_MEDIA_CLE    (1 << 21)	                            /* Board specific CLE is connected to AD21                  */

/*
*********************************************************************************************************
*                                       APPLICATION CONSTANTS
*********************************************************************************************************
*/

#define  TRUE                                 1
#define  FALSE                                0

/*
*********************************************************************************************************
*                                            TASKS PRIORITIES
*********************************************************************************************************
*/

#define  APP_TASK_START_PRIO                   5
#define  APP_TASK_BOOTLOADER_PRIO              6
#define  OS_VIEW_TASK_PRIO                     7
#define  OS_VIEW_TASK_ID                       7
#define  OS_TASK_TMR_PRIO                     10

/*
*********************************************************************************************************
*                                              STACK SIZES
*                            Size of the task stacks (# of OS_STK entries)
*********************************************************************************************************
*/

#define  APP_TASK_START_STK_SIZE             512
#define  APP_TASK_BOOTLOADER_STK_SIZE        512
#define  OS_VIEW_TASK_STK_SIZE               128

/*
*********************************************************************************************************
*                                           uC/OS-View CONSTANTS
*********************************************************************************************************
*/

#define  OS_VIEW_PARSE_TASK                     1                       /* Parsing of received packets will be done by a task   */
#define  OS_VIEW_TMR_32_BITS                    0                       /* uC/OS-View timer is 32 bits                          */
#define  OS_VIEW_TIMER_SEL                      2                       /* Choose an internal timer to use for OSView 0, 1, 2   */

#define  DBGU                                   0                       /* Define numbers for each available Comm Port          */

#define  OS_VIEW_COMM_SEL                      DBGU                     /* Select a Comm Port to use with OSView                */

/*
*********************************************************************************************************
*                                     TRACE / DEBUG CONFIGURATION*                            
*********************************************************************************************************
*/

#define  TRACE_LEVEL_OFF                       0
#define  TRACE_LEVEL_INFO                      1
#define  TRACE_LEVEL_DEBUG                     2

#define  APP_TRACE_LEVEL                TRACE_LEVEL_DEBUG
#define  APP_TRACE                        printf

#define  APP_TRACE_INFO(x)            ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO)  ? (void)(APP_TRACE x) : (void)0)
#define  APP_TRACE_DEBUG(x)           ((APP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) ? (void)(APP_TRACE x) : (void)0)

/*
*********************************************************************************************************
*                                     ERROR CHECKING
*********************************************************************************************************
*/

#if ((BOOT_FROM !=  DATAFLASH) && (BOOT_FROM != NANDFLASH))
#error "BOOT_FROM must be defined as either DATAFLASH or NANDFLASH in app_cfg.h"
#endif

#if (BOOT_FROM == DATAFLASH)
#define CFG_DATAFLASH                                                   /* Compile the contents of Atmel's dataflash.c              */
#endif

#if (BOOT_FROM == NANDFLASH)
#define CFG_NANDFLASH                                                   /* Compile the contents of Atmel's nandflash.c              */
#endif

#endif                                                                  /* End of file                                              */

⌨️ 快捷键说明

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