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

📄 rtciic.h

📁 这是DM642(EVM开发板)的IO控制原代码,用CCS3.3可以打开,调试通过.
💻 H
字号:
/*
 *  Copyright 2004 by SEED.
 *  All rights reserved. Property of SEED.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* August 2005 */
/**************************************************************************/
/* seed_rtciic.h file */
/**************************************************************************/
#ifndef _RTCIIC_H  
#define _RTCIIC_H

#include <std.h>
#include <csl_stdinc.h>
#include <csl_i2c.h>

#ifdef __cplusplus
extern "C" {
#endif

/* RTC definitions */
/*Alarm0*/
#define RTC_X1226_SCA0  0x0
#define RTC_X1226_MNA0  0x1
#define RTC_X1226_HRA0  0x2
#define RTC_X1226_DTA0  0x3
#define RTC_X1226_MOA0  0x4
#define RTC_X1226_YRA0  0x5
#define RTC_X1226_DWA0  0x6
#define RTC_X1226_Y2K0  0x7
/*Alarm1*/
#define RTC_X1226_SCA1  0x8
#define RTC_X1226_MNA1  0x9
#define RTC_X1226_HRA1  0xa
#define RTC_X1226_DTA1  0xb
#define RTC_X1226_MOA1  0xc
#define RTC_X1226_YRA1  0xd
#define RTC_X1226_DWA1  0xe
#define RTC_X1226_Y2K1  0xf
/*control*/
#define RTC_X1226_BL    0x10
#define RTC_X1226_INT   0x11
#define RTC_X1226_ATR   0x12
#define RTC_X1226_DTR   0x13
/*rtc*/
#define RTC_X1226_SC    0x30
#define RTC_X1226_MN    0x31
#define RTC_X1226_HR    0x32
#define RTC_X1226_DT    0x33
#define RTC_X1226_MO    0x34
#define RTC_X1226_YR    0x35
#define RTC_X1226_DW    0x36
#define RTC_X1226_Y2K   0x37
#define RTC_X1226_SR    0x3F
/*time mode*/
#define RTC_X1226_24    0x80
#define RTC_X1226_A/PM  0x00

typedef struct DM642_RTC_Config {
    Uint32 year;
    Uint32 month;
    Uint32 day;
    Uint32 hour;
    Uint32 minutes;
    Uint32 seconds;
    Uint32 week;
} DM642_RTC_Config;

//write Enable
void RTC_write_enable(I2C_Handle hI2C);
//write the rtc register by IIC bus
void RTC_write(I2C_Handle hI2C, Uint32  subAddress, Uint8 *data);

//read the rtc register by IIC bus
void RTC_read( I2C_Handle hI2C,Uint32  subAddress,Uint8 *data);
              
#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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