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

📄 lib_at91.lst

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 LST
📖 第 1 页 / 共 5 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/EC++ Compiler V3.10A/W32              05/Nov/2001  15:50:56 #
# Copyright 1999-2001 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode     =  arm                                                     #
#    Code model   =  small                                                   #
#    Endian       =  little                                                  #
#    Source file  =  C:\At91\software\projects\bench\Source\lib_at91.c       #
#    Command line =  -I C:\Compil\EW23\ARM\INC\ -I ..\..\..\ -lC             #
#                    C:\At91\software\projects\bench\IAR\ARM_external\List\  #
#                    -lA C:\At91\software\projects\bench\IAR\ARM_external\Li #
#                    st\ -o C:\At91\software\projects\bench\IAR\ARM_external #
#                    \Obj\ -e -s9 --debug --cpu_mode arm --code_model small  #
#                    --endian little --cpu=arm7tdmi                          #
#                    C:\At91\software\projects\bench\Source\lib_at91.c       #
#    List file    =  C:\At91\software\projects\bench\IAR\ARM_external\List\l #
#                    ib_at91.lst                                             #
#    Object file  =  C:\At91\software\projects\bench\IAR\ARM_external\Obj\li #
#                    b_at91.r79                                              #
#                                                                            #
#                                                                            #
##############################################################################

C:\At91\software\projects\bench\Source\lib_at91.c
      1          //*----------------------------------------------------------------------------
      2          //*      ATMEL Microcontroller Software Support  -  ROUSSET  -
      3          //*----------------------------------------------------------------------------
      4          //* The software is delivered "AS IS" without warranty or condition of any
      5          //* kind, either express, implied or statutory. This includes without
      6          //* limitation any warranty or condition with respect to merchantability or
      7          //* fitness for any particular purpose, or against the infringements of
      8          //* intellectual property rights of others.
      9          //*----------------------------------------------------------------------------
     10          //* File Name           : lib_at91.c
     11          //* Object              : bench for the AT91EB01, use PIO in input and
     12          //*                       output libraries definition
     13          //*
     14          //* 1.0 03/09/01 JPP    : Creation
     15          //*----------------------------------------------------------------------------
     16          
     17          
     18          #include    "periph/pio/lib_pio.h"
     19          #include    "periph/power_saving/lib_power_save.h"
     20          #include    "periph/power_saving/ps40800.h"
     21          #include    "parts/m40800/lib_m40800.h"
     22          #include    "periph/usart/lib_usart.h"
     23          #include    "periph/power_saving/lib_power_save.h"
     24          #include    "periph/timer_counter/tc.h"
     25          #include    "periph/timer_counter/lib_tc.h"
     26          #include    "periph/power_saving/lib_power_save.h"
     27          #include    "periph/stdc/lib_err.h"
     28          
     29          
     30          /*-----------------*/
     31          /* PIO Controllers */
     32          /*-----------------*/
     33          
     34          /* Instantiate PIO Controllers Pointers */

   \                                 In segment HUGE_I, align 4, align-sorted
     35          const StructPIO *Pio   = PIO_BASE ;
   \                     Pio:
   \   00000000                              DS8 4
   \   00000004                              REQUIRE `?<Initializer for Pio>`
     36          
     37          /* PIO Controller Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
     38          const PioCtrlDesc PIO_DESC =
   \                     PIO_DESC:
   \   00000000   0000FFFF                   DC32 0FFFF0000H
   \   00000004   08                         DC8 8
   \   00000005   1F                         DC8 31
   \   00000006   0000                       DC8 0, 0
     39          {
     40              PIO_BASE,
     41              PIO_ID,
     42              NB_PIO
     43          } ;
     44          
     45          
     46          /*-------*/
     47          /* USART */
     48          /*-------*/
     49          
     50          /* Usart 0 Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
     51          const UsartDesc USART0_DESC =
   \                     USART0_DESC:
   \   00000000   0000FDFF                   DC32 0FFFD0000H
   \   00000004   ........                   DC32 PIO_DESC
   \   00000008   0F                         DC8 15
   \   00000009   0E                         DC8 14
   \   0000000A   0D                         DC8 13
   \   0000000B   02                         DC8 2
     52          {
     53              USART0_BASE,
     54              &PIO_DESC,
     55              PIORXD0,
     56              PIOTXD0,
     57              PIOSCK0,
     58              US0_ID ,
     59          } ;
     60          
     61          /* Usart 1 Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
     62          const UsartDesc USART1_DESC =
   \                     USART1_DESC:
   \   00000000   00C0FCFF                   DC32 0FFFCC000H
   \   00000004   ........                   DC32 PIO_DESC
   \   00000008   16                         DC8 22
   \   00000009   15                         DC8 21
   \   0000000A   14                         DC8 20
   \   0000000B   03                         DC8 3
     63          {
     64              USART1_BASE ,
     65              &PIO_DESC,
     66              PIORXD1,
     67              PIOTXD1,
     68              PIOSCK1,
     69              US1_ID ,
     70          } ;
     71          
     72          
     73          /*------------------------*/
     74          /* Timer Counter Channels */
     75          /*------------------------*/
     76          
     77          /* Timer Counter Channel 0 Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
     78          const TCDesc TC0_DESC =
   \                     TC0_DESC:
   \   00000000   0000FEFF                   DC32 0FFFE0000H
   \   00000004   ........                   DC32 PIO_DESC
   \   00000008   04                         DC8 4
   \   00000009   01                         DC8 1
   \   0000000A   02                         DC8 2
   \   0000000B   00                         DC8 0
     79          {
     80              TC0_BASE,
     81              &PIO_DESC,
     82              TC0_ID,
     83              PIOTIOA0,
     84              PIOTIOB0,
     85              PIOTCLK0
     86          } ;
     87          
     88          /* Timer Counter Channel 1 Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
     89          const TCDesc TC1_DESC =
   \                     TC1_DESC:
   \   00000000   4000FEFF                   DC32 0FFFE0040H
   \   00000004   ........                   DC32 PIO_DESC
   \   00000008   05                         DC8 5
   \   00000009   04                         DC8 4
   \   0000000A   05                         DC8 5
   \   0000000B   03                         DC8 3
     90          {
     91              TC1_BASE,
     92              &PIO_DESC,
     93              TC1_ID,
     94              PIOTIOA1,
     95              PIOTIOB1,
     96              PIOTCLK1
     97          } ;
     98          
     99          /* Timer Counter Channel 2 Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
    100          const TCDesc TC2_DESC =
   \                     TC2_DESC:
   \   00000000   8000FEFF                   DC32 0FFFE0080H
   \   00000004   ........                   DC32 PIO_DESC
   \   00000008   06                         DC8 6
   \   00000009   07                         DC8 7
   \   0000000A   08                         DC8 8
   \   0000000B   06                         DC8 6
    101          {
    102              TC2_BASE,
    103              &PIO_DESC,
    104              TC2_ID,
    105              PIOTIOA2,
    106              PIOTIOB2,
    107              PIOTCLK2
    108          } ;
    109          
    110          /* Timer Counter Block Descriptor */

   \                                 In segment HUGE_C, align 4, align-sorted
    111          const TCBlockDesc TCB_DESC =
   \                     TCB_DESC:
   \   00000000   ........                   DC32 TC0_DESC
   \   00000004   ........                   DC32 TC1_DESC
   \   00000008   ........                   DC32 TC2_DESC
    112          {
    113              &TC0_DESC,
    114              &TC1_DESC,
    115              &TC2_DESC,
    116          } ;
    117          
    118          
    119          
    120          //*----------------------------------------------------------------------------
    121          //* Function Name       : at91_pio_open
    122          //* Object              : Setup pins to be Parallel IOs, as managed by the PIO
    123          //* Input Parameters    : <pio_pt> = PIO Controller Descriptor
    124          //*                     : <mask>   = bit mask identifying the PIOs
    125          //*                     : <config> = mask identifying the PIOs configuration
    126          //* Output Parameters   : none
    127          //* Functions called    : none
    128          //*----------------------------------------------------------------------------

   \                                 In segment NEARFUNC_A, align 4, keep-with-next
   \   00000000                         CODE32   
    129          void at91_pio_open ( const PioCtrlDesc *pio_pt, u_int mask, u_int config )
    130          //* Begin
    131          {
    132              u_int x ;
                           ^
Warning[Pe550]: variable "x" was set but never used
    133              //* If PIOs required to be output
    134              if ((config & PIO_SENSE_BIT) != 0 )
   \                     at91_pio_open:
   \   00000000   FF3002E2              AND      R3,R2,#+0xFF       ;; Zero extend
   \   00000004   010013E3              TST      R3,#+0x1
   \   00000008   003090E5              LDR      R3,[R0, #+0]
    135              {
    136                  //* Defines the PIOs as output
    137                  pio_pt->pio_base->PIO_OER = mask ;
   \   0000000C   10108315              STRNE    R1,[R3, #+16]
    138              }
    139              //* Else
    140              else
    141              {
    142                  //* Defines the PIOs as inputmessage
    143                  pio_pt->pio_base->PIO_ODR = mask ;
   \   00000010   14108305              STREQ    R1,[R3, #+20]

⌨️ 快捷键说明

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