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

📄 mod_regs_ppg.h

📁 ecos移植到R8H系列的源码。源码包来自http://www.cetoni.de/develop/develop_ecosh8s_en.html
💻 H
字号:
#ifndef CYGONCE_MOD_REGS_PPG_H
#define CYGONCE_MOD_REGS_PPG_H

//==========================================================================
//
//      mod_regs_ppg.h
//
//      Programable Pulse Generator Register
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    Uwe Kindler
// Contributors: Uwe Kindler
// Date:         2004-11-03
//              
//####DESCRIPTIONEND####
//
//==========================================================================


//==========================================================================
//                            DOXYGEN FILE HEADER
/// \file    mod_regs_ppg.h
/// \brief   Programable Pulse Generator Register definitions.
/// \author  Uwe Kindler
/// \date    2004-11-03
//==========================================================================


//==========================================================================
//                         REGISTER ADDRESSES
//==========================================================================
#define CYGARC_PCR   0xFFFE26
#define CYGARC_PMR   0xFFFE27
#define CYGARC_NDERH 0xFFFE28
#define CYGARC_NDERL 0xFFFE29
#define CYGARC_PODRH 0xFFFE2A
#define CYGARC_PODRL 0xFFFE2B
#define CYGARC_NDRH1 0xFFFE2C
#define CYGARC_NDRL1 0xFFFE2D
#define CYGARC_NDRH2 0xFFFE2E
#define CYGARC_NDRL2 0xFFFE2F


#ifndef __ASSEMBLER__
//==========================================================================
//                         REGISTER STRUCTURE
//==========================================================================
struct st_ppg {                                         // struct PPG   
              union {                                   // PCR          
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char G3CMS:2;       //    G3CMS     
                           unsigned char G2CMS:2;       //    G2CMS     
                           }      BIT;                  //              
                    }           PCR;                    //              
              union {                                   // PMR          
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char G3INV:1;       //    G3INV     
                           unsigned char G2INV:1;       //    G2INV     
                           unsigned char      :2;       //              
                           unsigned char G3NOV:1;       //    G3NOV     
                           unsigned char G2NOV:1;       //    G2NOV     
                           }      BIT;                  //              
                    }           PMR;                    //              
              union {                                   // NDER         
                    unsigned int WORD;                  //  Word Access 
                    struct {                            //  Bit  Access 
                           unsigned char H;             //    NDERH     
                           unsigned char L;             //    NDERL     
                           }     BYTE;                  //              
                    struct {                            //  Bit  Access 
                           unsigned char B15:1;         //    NDER15    
                           unsigned char B14:1;         //    NDER14    
                           unsigned char B13:1;         //    NDER13    
                           unsigned char B12:1;         //    NDER12    
                           unsigned char B11:1;         //    NDER11    
                           unsigned char B10:1;         //    NDER10    
                           unsigned char B9 :1;         //    NDER9     
                           unsigned char B8 :1;         //    NDER8     
                           unsigned char B7 :1;         //    NDER7     
                           unsigned char B6 :1;         //    NDER6     
                           unsigned char B5 :1;         //    NDER5     
                           unsigned char B4 :1;         //    NDER4     
                           unsigned char B3 :1;         //    NDER3     
                           unsigned char B2 :1;         //    NDER2     
                           unsigned char B1 :1;         //    NDER1     
                           unsigned char B0 :1;         //    NDER0     
                           }      BIT;                  //              
                    }           NDER;                   //              
              union {                                   // PODR         
                    unsigned int WORD;                  //  Word Access 
                    struct {                            //  Bit  Access 
                           unsigned char H;             //    PODRH     
                           unsigned char L;             //    PODRL     
                           }     BYTE;                  //              
                    struct {                            //  Bit  Access 
                           unsigned char B15:1;         //    NDER15    
                           unsigned char B14:1;         //    NDER14    
                           unsigned char B13:1;         //    NDER13    
                           unsigned char B12:1;         //    NDER12    
                           unsigned char B11:1;         //    NDER11    
                           unsigned char B10:1;         //    NDER10    
                           unsigned char B9 :1;         //    NDER9     
                           unsigned char B8 :1;         //    NDER8     
                           unsigned char B7 :1;         //    NDER7     
                           unsigned char B6 :1;         //    NDER6     
                           unsigned char B5 :1;         //    NDER5     
                           unsigned char B4 :1;         //    NDER4     
                           unsigned char B3 :1;         //    NDER3     
                           unsigned char B2 :1;         //    NDER2     
                           unsigned char B1 :1;         //    NDER1     
                           unsigned char B0 :1;         //    NDER0     
                           }     BIT;                   //              
                    }           PODR;                   //              
              union {                                   // NDRH (H'2C)  
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char B15:1;         //    NDR15     
                           unsigned char B14:1;         //    NDR14     
                           unsigned char B13:1;         //    NDR13     
                           unsigned char B12:1;         //    NDR12     
                           unsigned char B11:1;         //    NDR11     
                           unsigned char B10:1;         //    NDR10     
                           unsigned char B9 :1;         //    NDR9      
                           unsigned char B8 :1;         //    NDR8      
                           }      BIT;                  //              
                    }           NDRH1;                  //              
              union {                                   // NDRL (H'2D)  
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char B7:1;          //    NDR7      
                           unsigned char B6:1;          //    NDR6      
                           unsigned char B5:1;          //    NDR5      
                           unsigned char B4:1;          //    NDR4      
                           unsigned char B3:1;          //    NDR3      
                           unsigned char B2:1;          //    NDR2      
                           unsigned char B1:1;          //    NDR1      
                           unsigned char B0:1;          //    NDR0      
                           }      BIT;                  //              
                    }           NDRL1;                  //              
              union {                                   // NDRH (H'2E)  
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char    :4;         //              
                           unsigned char B11:1;         //    NDR11     
                           unsigned char B10:1;         //    NDR10     
                           unsigned char B9 :1;         //    NDR9      
                           unsigned char B8 :1;         //    NDR8      
                           }      BIT;                  //              
                    }           NDRH2;                  //              
              union {                                   // NDRL (H'2F)  
                    unsigned char BYTE;                 //  Byte Access 
                    struct {                            //  Bit  Access 
                           unsigned char   :4;          //              
                           unsigned char B3:1;          //    NDR3      
                           unsigned char B2:1;          //    NDR2      
                           unsigned char B1:1;          //    NDR1      
                           unsigned char B0:1;          //    NDR0      
                           }      BIT;                  //              
                    }           NDRL2;                  //              
}; 

//==========================================================================
//                      STRUCTURED REGISTER ACCESS
//========================================================================== 
#define HAL_H8S_REG_PPG (*(volatile struct st_ppg   *)0xFFFE26) // PPG   Address

#endif // #ifndef __ASSEMBLER__
//--------------------------------------------------------------------------
#endif // End of #define CYGONCE_MOD_REGS_PPG_H

⌨️ 快捷键说明

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