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

78 lines
2.9 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.

//====================================================================
// IrisSpiDefine.h
// IRIS SPI定数
//
// Copyright (C) 2004 NINTENDO Co.,Ltd.
//====================================================================
#ifndef _IRIS_SPI_DEFINE_H
#define _IRIS_SPI_DEFINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <IrisSubpMacro.h>
//----------------------------------------------------------------------
// SPIはビジーか
//----------------------------------------------------------------------
#define IsSpiBusy() \
\
(*(vu32 *)REG_SPICNT & SPI_BUSY)
//・SPIがビジーかどうかを返します。
//----------------------------------------------------------------------
// SPI終了待ち
//----------------------------------------------------------------------
#define WaitSpi() \
{ \
while (IsSpiBusy()) ; \
}
//・SPIの終了を待ちます。
//----------------------------------------------------------------------
// フラッシュメモリ・サイズ
//----------------------------------------------------------------------
#define FLH_SIZE 0x20000 // フラッシュメモリ
#define FLH_PAGE_SIZE 256 // フラッシュメモリ・ページ
//----------------------------------------------------------------------
// フラッシュメモリ・コマンド
//----------------------------------------------------------------------
#define FLHOP_STAT 0x05 // ステータス
#define FLHOP_READ 0x03 // 通常読み込み
#define FLHOP_FAST_READ 0x0b // 高速読み込み
#define FLHOP_WRITE_ENABLE 0x06 // 書き込みイネーブル
#define FLHOP_WRITE_DISABLE 0x04 // 書き込みディセーブル
#define FLHOP_WRITE_PAGE 0x0A // ページ書き込み
#define FLHOP_PROGRAM_PAGE 0x02 // ページ・プログラム
#define FLHOP_ERASE_PAGE 0xdb // ページ消去
#define FLHOP_ERASE_SECTOR 0xd8 // セクター消去
#define FLHOP_POWER_DOWN 0xb9 // パワーダウン
#define FLHOP_RELEASE_POWER_DOWN 0xab // パワーダウン復帰
//----------------------------------------------------------------------
// フラッシュメモリ・ステータス
//----------------------------------------------------------------------
#define FLHSTAT_WRITING 0x01 // ライト中
#define FLHSTAT_WRITE_ENABLE_LATCH 0x02 // ライト・イネーブルラッチ
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _IRIS_SPI_DEFINE_H