📄 mod_regs_i2c.h
字号:
#ifndef CYGONCE_MOD_REGS_I2C_H
#define CYGONCE_MOD_REGS_I2C_H
//==========================================================================
//
// mod_regs_i2c.h
//
// I2C Bus 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-04
//
//####DESCRIPTIONEND####
//
//==========================================================================
//==========================================================================
// DOXYGEN FILE HEADER
/// \file mod_regs_i2cS.h
/// \brief Bus Controler Register definitions.
/// \author Uwe Kindler
/// \date 2004-11-02
//==========================================================================
//==========================================================================
// REGISTER ADDRESSES
//==========================================================================
//--------------------------------------------------------------------------
// Channel 0
//
#define CYGARC_ICCR0 0xFFFF78
#define CYGARC_ICSR0 0xFFFF79
#define CYGARC_ICDR0 0xFFFF7E
#define CYGARC_ICMR0 0xFFFF7F
#define CYGARC_SAR0 0xFFFF7F
#define CYGARC_SARX0 0xFFFF7E
//--------------------------------------------------------------------------
// Channel 1
//
#define CYGARC_ICCR1 0xFFFF80
#define CYGARC_ICSR1 0xFFFF81
#define CYGARC_ICDR1 0xFFFF86
#define CYGARC_ICMR1 0xFFFF87
#define CYGARC_SAR1 0xFFFF87
#define CYGARC_SARX1 0xFFFF86
//--------------------------------------------------------------------------
// Common
//
#define CYGARC_SCRX 0xFFFDB4
#define CYGARC_DDCSWR 0xFFFDB5
#ifndef __ASSEMBLER__
//==========================================================================
// REGISTER STRUCTURE
//==========================================================================
struct st_iic { // struct IIC
union { // ICCR
unsigned char BYTE; // Byte Access
struct { // Bit Access
unsigned char ICE :1; // ICE
unsigned char IEIC:1; // IEIC
unsigned char MST :1; // MST
unsigned char TRS :1; // TRS
unsigned char ACKE:1; // ACKE
unsigned char BBSY:1; // BBSY
unsigned char IRIC:1; // IRIC
unsigned char SCP :1; // SCP
} BIT; //
} ICCR; //
union { // ICSR
unsigned char BYTE; // Byte Access
struct { // Bit Access
unsigned char ESTP:1; // ESTP
unsigned char STOP:1; // STOP
unsigned char IRTR:1; // IRTR
unsigned char AASX:1; // AASX
unsigned char AL :1; // AL
unsigned char AAS :1; // AAS
unsigned char ADZ :1; // ADZ
unsigned char ACKB:1; // ACKB
} BIT; //
} ICSR; //
char wk[4]; //
union { //
struct { //
union { // SARX
unsigned char BYTE; // Byte Access
struct { // Bit Access
unsigned char SVAX:7; // SVAX
unsigned char FSX :1; // FSX
} BIT; //
} UN_SARX; //
union { // SAR
unsigned char BYTE; // Byte Access
struct { // Bit Access
unsigned char SVA:7; // SVA
unsigned char FS :1; // FS
} BIT; //
} UN_SAR; //
} ICE0; //
struct { //
unsigned char UN_ICDR; // ICDR
union { // ICMR
unsigned char BYTE; // Byte Access
struct { // Bit Access
unsigned char MLS :1; // MLS
unsigned char WAIT:1; // WAIT
unsigned char CKS :3; // CKS
unsigned char BC :3; // BC
} BIT; //
} UN_ICMR; //
} ICE1; //
} EQU; //
};
//==========================================================================
// STRUCTURED REGISTER ACCESS
//==========================================================================
#define HAL_H8S_REG_IIC0 (*(volatile struct st_iic *)0xFFFF78) // IIC0 Address
#define HAL_H8S_REG_IIC1 (*(volatile struct st_iic *)0xFFFF80) // IIC1 Address
#endif // #ifndef __ASSEMBLER__
//---------------------------------------------------------------------------
#endif // End of #define CYGONCE_MOD_REGS_I2C_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -