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

📄 seeddm642_rtc.h

📁 DSP DM642 eeprom检测程序
💻 H
字号:
/*
 *  Copyright 2003 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */
 
/*
 *  ======== evmdm642_rtc.h ========
 *
 *  Interface for the CAT24WC256 I2C EEPROM on the EVMDM642 board
 */
#ifndef SEEDDM642_RTC_
#define SEEDDM642_RTC_

#ifdef __cplusplus
extern "C" {
#endif

#include <csl.h>

/* 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 SEEDDM642_RTC_Config {
    Uint32 year;
    Uint32 month;
    Uint32 day;
    Uint32 hour;
    Uint32 minutes;
    Uint32 seconds;
    Uint32 week;
} SEEDDM642_RTC_Config;

 
/* Read data from a range in the EEPROM */
void SEEDDM642_RTC_regwrite( I2C_Handle hI2C,
						  Uint32 src, 
						  Uint32 dst, 
						  Uint32 length);

/* Write data to a data range in the EEPROM */
void SEEDDM642_RTC_read(  I2C_Handle hI2C,
						  Uint32 src, 
						  Uint32 dst, 
						  Uint32 length);

/*write a value to a rtc's register*/						  
void SEEDDM642_RTC_write( I2C_Handle hI2C,
						  Uint32 src, 
						  Uint32 dst, 
						  Uint32 length);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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