ntr_bootrom/trunk/IrisSubp/include/private/IrisRtcDefine.h

105 lines
4.3 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//====================================================================
// IrisRtcDefine.h
// IRIS RTC定数
//
// Copyright (C) 2004 NINTENDO Co.,Ltd.
//====================================================================
#ifndef _IRIS_RTC_DEFINE_H
#define _IRIS_RTC_DEFINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <IrisSubpMacro.h>
//----------------------------------------------------------------------
// メモリ・マップ
//----------------------------------------------------------------------
#define REG_R1_CNT (REG_BASE + 0x138) // RTCコントロール
//----------------------------------------------------------------------
// RTCコントロール
//----------------------------------------------------------------------
#define R1_RTC_DATA_BIT 0x01 // データビット
#define R1_RTC_SCK 0x02 // シフトクロック
#define R1_RTC_CS 0x04 // チップセレクト
#define R1_RTC_DATA_BIT_IN 0x00 // データビット
#define R1_RTC_DATA_BIT_OUT 0x10
#define R1_RTC_SCK_IN 0x00 // シフトクロック
#define R1_RTC_SCK_OUT 0x20
#define R1_RTC_CS_IN 0x00 // チップセレクト
#define R1_RTC_CS_OUT 0x40
#define R1_RTC_DATA_DIR_IN ( R1_RTC_DATA_BIT_IN \
| R1_RTC_SCK_OUT \
| R1_RTC_CS_OUT) // データ入力
#define R1_RTC_DATA_DIR_OUT ( R1_RTC_DATA_BIT_OUT \
| R1_RTC_SCK_OUT \
| R1_RTC_CS_OUT) // データ出力
//----------------------------------------------------------------------
// RTCコマンド
//----------------------------------------------------------------------
#define RTCOP_FIX_BITS 0x60 // 上位ビット固定値
#define RTCOP_MASK 0x0e // コマンドマスク
#define RTCOP_STAT1 0x00 // ステータス1
#define RTCOP_STAT2 0x02 // ステータス2
#define RTCOP_YEAR 0x04 // 年
#define RTCOP_TIME 0x06 // 時
#define RTCOP_INT1 0x08 // 割り込み設定1
#define RTCOP_INT2 0x0a // 設定2
#define RTCOP_ADJUST_CLOCK 0x0c // クロック調整
#define RTCOP_FREE_REGISTER 0x0e // フリーレジスタ
#define RTCOP_WRITE 0x00 // 書き込み
#define RTCOP_READ 0x01 // 読み込み
//----------------------------------------------------------------------
// RTCステータス1
//----------------------------------------------------------------------
#define RTCSTAT1_RESET 0x01 // リセット
#define RTCSTAT1_SEL_12H 0x00 // 12時間表示 選択
#define RTCSTAT1_SEL_24H 0x02 // 24時間
#define RTCSTAT1_USR_BIT3 0x04 // ユーザビット3
#define RTCSTAT1_INTR1 0x10 // 割り込み1
#define RTCSTAT1_INTR2 0x20 // 割り込み2
#define RTCSTAT1_BATTERY_DOWN 0x40 // バッテリー ダウン
#define RTCSTAT1_RESET_REQUEST 0x80 // 電源投入時のリセット要求
//----------------------------------------------------------------------
// RTCステータス2
//----------------------------------------------------------------------
#define RTCSTAT2_NONE_INTR 0x00 // 割り込み無し
#define RTCSTAT2_SEL_FREQ_INTR 0x02 // 選択周波数定常割り込み
#define RTCSTAT2_MIN_EDGE_INTR 0x04 // 分単位エッジ割り込み
#define RTCSTAT2_MIN_CK1_INTR 0x06 // 分単位定常割り込み1
#define RTCSTAT2_ALERM_INTR 0x08 // アラーム割り込み
#define RTCSTAT2_MIN_CK2_INTR 0x0e // 分単位定常割り込み2
#define RTCSTAT2_USR_BIT4 0x10 // ユーザビット4
#define RTCSTAT2_USR_BIT5 0x20 //
#define RTCSTAT2_INTR2 0x40 // 割り込み2
#define RTCSTAT2_TEST 0x80 // テスト
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _IRIS_RTC_DEFINE_H