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

📄 hw.c

📁 ucOS_9263_Source ucOS-ii for 9263 port,from Micrium.com
💻 C
字号:
/*
*********************************************************************************************************
*                                     MICIRUM BOARD SUPPORT PACKAGE
*
*                              (c) Copyright 2007; Micrium, Inc.; Weston, FL
*
*                   All rights reserved.  Protected by international copyright laws.
*                   Knowledge of the source code may not be used to write a similar
*                   product.  This file may only be used in accordance with a license
*                   and should not be redistributed in any way.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                  BOOTLOADER HARDWARE INITIALIZATION
*
*                                           Atmel AT91SAM9263
*                                                on the
*                                     AT91SAM9263-EK Evaluation Board
*
* Filename      : hw.c
* Version       : V1.00
* Programmer(s) : Eric Shufro
*********************************************************************************************************
*/

#include <includes.h>

/*
*********************************************************************************************************
*                                               CONSTANTS
*********************************************************************************************************
*/

#define  SPI0_MISO           DEF_BIT_00                         /* Pin PA.0                                                 */
#define  SPI0_MOSI           DEF_BIT_01                         /* Pin PA.1                                                 */
#define  SPI0_SCK            DEF_BIT_02                         /* Pin PA.2                                                 */
#define  SPI0_NPSC0          DEF_BIT_05                         /* Pin PA.3 for NPSC0 dataflash chip / socket               */

/*
*********************************************************************************************************
*                                               GLOBLAS
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                               FUNCTION PROTOTYPES
*********************************************************************************************************
*/

static  void  matrix_init(void);

/*
*********************************************************************************************************
*                                          hw_init()
*
* Description : This function performs additional processor initialization.
*********************************************************************************************************
*/

void  hw_init (void)
{
    matrix_init();
}

/*
*********************************************************************************************************
*                                          matrix_init()
*
* Description : This function ininitializes the processor bus matrix
*********************************************************************************************************
*/

static  void  matrix_init (void)
{
                                                                        /* -------------- Initialize the Matrix ------------------- */
    AT91C_BASE_MATRIX->MATRIX_SCFG0    |=   AT91C_MATRIX_DEFMSTR_TYPE_FIXED_DEFMSTR |
                                            AT91C_MATRIX_FIXED_DEFMSTR0_ARM926D;

    AT91C_BASE_MATRIX->MATRIX_SCFG3    |=   AT91C_MATRIX_DEFMSTR_TYPE_FIXED_DEFMSTR |
                                            AT91C_MATRIX_FIXED_DEFMSTR0_ARM926D;
}

/*
*********************************************************************************************************
*                                          dataflash_init()
*
* Description : This function ininitializes the onboard dataflash
*********************************************************************************************************
*/

void  df_hw_init (void)
{
    AT91C_BASE_PIOA->PIO_BSR            =   SPI0_MISO                   /* Assign the following pins to Periph A                    */
                                        |   SPI0_MOSI
                                        |   SPI0_SCK
                                        |   SPI0_NPSC0;

    AT91C_BASE_PIOA->PIO_PDR            =   SPI0_MISO                   /* Enable peripheral control for pins:                      */
                                        |   SPI0_MOSI
                                        |   SPI0_SCK
                                        |   SPI0_NPSC0;
}

⌨️ 快捷键说明

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