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

📄 lib_m42800.c

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 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           : lib_m42800.c
//* Object              : AT91M42800 Descriptor File.
//*
//* 1.0 25/05/00  PFi   : Creation
//* 1.1 18/02/02  PFi   : System Timer Descriptor has been added
//* 1.2 21/02/02  PFi   : Modification in Timer Descriptor TC3_DESC, TC4_DESC, TC5_DESC.
//*                     : PIOA_DESC has been changed by PIOB_DESC
//*--------------------------------------------------------------------------------------

#include    "lib_m42800.h"

/*-----------------*/
/* PIO Controllers */
/*-----------------*/

/* Instantiate PIO Controllers Pointers */
const StructPIO *Pioa   = PIOA_BASE ;
const StructPIO *Piob   = PIOB_BASE ;

/* PIO Controller A Descriptor */
const PioCtrlDesc PIOA_DESC =
{
    PIOA_BASE,
    PIOA_ID,
    NB_PIOA
} ;

/* PIO Controller B Descriptor */
const PioCtrlDesc PIOB_DESC =
{
    PIOB_BASE,
    PIOB_ID,
    NB_PIOB
} ;

/*-------------------------------*/
/* Advanced Interrupt Controller */
/*-------------------------------*/

/* IRQ0 Descriptor */
const ExtIrqDesc    IRQ0_DESC =
{
    &PIOA_DESC,
    IRQ0_ID,
    PIOIRQ0
} ;

/* IRQ1 Descriptor */
const ExtIrqDesc    IRQ1_DESC =
{
    &PIOA_DESC,
    IRQ1_ID,
    PIOIRQ1
} ;

/* IRQ2 Descriptor */
const ExtIrqDesc    IRQ2_DESC =
{
    &PIOA_DESC,
    IRQ2_ID,
    PIOIRQ2
} ;

/* IRQ3 Descriptor */
const ExtIrqDesc    IRQ3_DESC =
{
    &PIOA_DESC,
    IRQ3_ID,
    PIOIRQ3
} ;

/* FIQ Descriptor */
const ExtIrqDesc    FIQ_DESC =
{
    &PIOA_DESC,
    FIQ_ID,
    PIOFIQ,
} ;

/*-------*/
/* USART */
/*-------*/

/* Usart 0 Descriptor */
const UsartDesc USART0_DESC =
{
    USART0_BASE,
    &PIOA_DESC,
    PIORXD0,
    PIOTXD0,
    PIOSCK0,
    US0_ID ,
} ;

/* Usart 1 Descriptor */
const UsartDesc USART1_DESC =
{
    USART1_BASE ,
    &PIOA_DESC,
    PIORXD1,
    PIOTXD1,
    PIOSCK1,
    US1_ID ,
} ;


/*------------------------*/
/* Timer Counter Channels */
/*------------------------*/

/* Timer Counter Channel 0 Descriptor */
const TCDesc TC0_DESC =
{
    &(TCB0_BASE->TC[0]),
    &PIOB_DESC,
    TC0_ID,
    PIOTIOA0,
    PIOTIOB0,
    PIOTCLK0
} ;

/* Timer Counter Channel 1 Descriptor */
const TCDesc TC1_DESC =
{
    &TCB0_BASE->TC[1],
    &PIOB_DESC,
    TC1_ID,
    PIOTIOA1,
    PIOTIOB1,
    PIOTCLK1
} ;

/* Timer Counter Channel 2 Descriptor */
const TCDesc TC2_DESC =
{
    &TCB0_BASE->TC[2],
    &PIOB_DESC,
    TC2_ID,
    PIOTIOA2,
    PIOTIOB2,
    PIOTCLK2
} ;

/* Timer Counter Channel 3 Descriptor */
const TCDesc TC3_DESC =
{
    &TCB1_BASE->TC[0],
    &PIOB_DESC,
    TC3_ID,
    PIOTIOA3,
    PIOTIOB3,
    PIOTCLK3
} ;

/* Timer Counter Channel 4 Descriptor */
const TCDesc TC4_DESC =
{
    &TCB1_BASE->TC[1],
    &PIOB_DESC,
    TC4_ID,
    PIOTIOA4,
    PIOTIOB4,
    PIOTCLK4
} ;

/* Timer Counter Channel 5 Descriptor */
const TCDesc TC5_DESC =
{
    &TCB1_BASE->TC[2],
    &PIOB_DESC,
    TC5_ID,
    PIOTIOA5,
    PIOTIOB5,
    PIOTCLK5
} ;

/* Timer Counter Block 0 Descriptor */
const TCBlockDesc TCB0_DESC =
{
    &TC0_DESC,
    &TC1_DESC,
    &TC2_DESC,
} ;

/* Timer Counter Block 1 Descriptor */
const TCBlockDesc TCB1_DESC =
{
    &TC3_DESC,
    &TC4_DESC,
    &TC5_DESC,
} ;

/*-----*/
/* SPI */
/*-----*/

const SpiDesc SPIA_DESC =
{
    SPIA_BASE,
    &PIOA_DESC,
    SPIA_ID,
    PIOSPCKA,
    PIOMISOA,
    PIOMOSIA,
    {
        PIONPCSA0,
        PIONPCSA1,
        PIONPCSA2,
        PIONPCSA3
    }
} ;

const SpiDesc SPIB_DESC =
{
    SPIB_BASE,
    &PIOA_DESC,
    SPIB_ID,
    PIOSPCKB,
    PIOMISOB,
    PIOMOSIB,
    {
        PIONPCSB0,
        PIONPCSB1,
        PIONPCSB2,
        PIONPCSB3
    }
} ;

/*---------------*/
/* System Timer  */
/*---------------*/
const STDesc ST_DESC ;

⌨️ 快捷键说明

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