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

📄 mod_regs_pwm.h

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

//==========================================================================
//
//      mod_regs_pwm.h
//
//      Motor Control PWM Timer 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_pwm.h
/// \brief   Motor Control PWM Timer Register definitions.
/// \author  Uwe Kindler
/// \date    2004-11-03
//==========================================================================


//==========================================================================
//                            REGISTER ADDRESSES
//==========================================================================

//--------------------------------------------------------------------------
// PWM Timer 1
//
#define CYGARC_PWCR1   0xFFFC00
#define CYGARC_PWOCR1  0xFFFC02
#define CYGARC_PWPR1   0xFFFC04
#define CYGARC_PWCYR1  0xFFFC06
#define CYGARC_PWBFR1A 0xFFFC08
#define CYGARC_PWBFR1C 0xFFFC0A
#define CYGARC_PWBFR1E 0xFFFC0C
#define CYGARC_PWBFR1G 0xFFFC0E

//--------------------------------------------------------------------------
// PWM Timer 2
//
#define CYGARC_PWCR2   0xFFFC10
#define CYGARC_PWOCR2  0xFFFC12
#define CYGARC_PWPR2   0xFFFC14
#define CYGARC_PWCYR2  0xFFFC16
#define CYGARC_PWBFR2A 0xFFFC18
#define CYGARC_PWBFR2C 0xFFFC1A
#define CYGARC_PWBFR2E 0xFFFC1C
#define CYGARC_PWBFR2G 0xFFFC1E


#ifndef __ASSEMBLER__
//==========================================================================
//                          REGISTER STRUCTURE
//==========================================================================
struct st_pwm1 {                                        // struct PWM1  
               union {                                  // PWCR         
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char    :2;        //              
                            unsigned char IE :1;        //    IE        
                            unsigned char CMF:1;        //    CMF       
                            unsigned char CST:1;        //    CST       
                            unsigned char CKS:3;        //    CKS       
                            }      BIT;                 //              
                     }          PWCR;                   //              
               char             wk1;                    //              
               union {                                  // PWOCR        
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char OEH:1;        //    OEH       
                            unsigned char OEG:1;        //    OEG       
                            unsigned char OEF:1;        //    OEF       
                            unsigned char OEE:1;        //    OEE       
                            unsigned char OED:1;        //    OED       
                            unsigned char OEC:1;        //    OEC       
                            unsigned char OEB:1;        //    OEB       
                            unsigned char OEA:1;        //    OEA       
                            }      BIT;                 //              
                     }          PWOCR;                  //              
               char             wk2;                    //              
               union {                                  // PWPR         
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char OPSH:1;       //    OPSH      
                            unsigned char OPSG:1;       //    OPSG      
                            unsigned char OPSF:1;       //    OPSF      
                            unsigned char OPSE:1;       //    OPSE      
                            unsigned char OPSD:1;       //    OPSD      
                            unsigned char OPSC:1;       //    OPSC      
                            unsigned char OPSB:1;       //    OPSB      
                            unsigned char OPSA:1;       //    OPSA      
                            }      BIT;                 //              
                     }          PWPR;                   //              
               char             wk3;                    //              
               unsigned int     PWCYR;                  // PWCYR        
               unsigned int     PWBFRA;                 // PWBFRA       
               unsigned int     PWBFRC;                 // PWBFRC       
               unsigned int     PWBFRE;                 // PWBFRE       
               unsigned int     PWBFRG;                 // PWBFRG       
};                                                      //              
struct st_pwm2 {                                        // struct PWM2  
               union {                                  // PWCR         
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char    :2;        //              
                            unsigned char IE :1;        //    IE        
                            unsigned char CMF:1;        //    CMF       
                            unsigned char CST:1;        //    CST       
                            unsigned char CKS:3;        //    CKS       
                            }      BIT;                 //              
                     }          PWCR;                   //              
               char             wk1;                    //              
               union {                                  // PWOCR        
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char OEH:1;        //    OEH       
                            unsigned char OEG:1;        //    OEG       
                            unsigned char OEF:1;        //    OEF       
                            unsigned char OEE:1;        //    OEE       
                            unsigned char OED:1;        //    OED       
                            unsigned char OEC:1;        //    OEC       
                            unsigned char OEB:1;        //    OEB       
                            unsigned char OEA:1;        //    OEA       
                            }      BIT;                 //              
                     }          PWOCR;                  //              
               char             wk2;                    //              
               union {                                  // PWPR         
                     unsigned char BYTE;                //  Byte Access 
                     struct {                           //  Bit  Access 
                            unsigned char OPSH:1;       //    OPSH      
                            unsigned char OPSG:1;       //    OPSG      
                            unsigned char OPSF:1;       //    OPSF      
                            unsigned char OPSE:1;       //    OPSE      
                            unsigned char OPSD:1;       //    OPSD      
                            unsigned char OPSC:1;       //    OPSC      
                            unsigned char OPSB:1;       //    OPSB      
                            unsigned char OPSA:1;       //    OPSA      
                            }      BIT;                 //              
                     }          PWPR;                   //              
               char             wk3;                    //              
               unsigned int     PWCYR;                  // PWCYR        
               unsigned int     PWBFRA;                 // PWBFRA       
               unsigned int     PWBFRB;                 // PWBFRB       
               unsigned int     PWBFRC;                 // PWBFRC       
               unsigned int     PWBFRD;                 // PWBFRD       
}; 


//==========================================================================
//                       STRUCTURED REGISTER ACCESS
//==========================================================================
#define HAL_H8S_REG_PWM1 (*(volatile struct st_pwm1  *)0xFFFC00) // PWM1  Address
#define HAL_H8S_REG_PWM2 (*(volatile struct st_pwm2  *)0xFFFC10) // PWM2  Address

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

⌨️ 快捷键说明

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