mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
add
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@242 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
78993181c6
commit
379c8394ab
297
build/libraries/spi/ARM7/include/tp_reg.h
Normal file
297
build/libraries/spi/ARM7/include/tp_reg.h
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: CtrSDK - TP - include - tp
|
||||||
|
File: cdc_reg.h
|
||||||
|
|
||||||
|
Copyright 2006 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Log: $
|
||||||
|
$NoKeywords: $
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
#ifndef CTR_TP_TP_REG_H_
|
||||||
|
#define CTR_TP_TP_REG_H_
|
||||||
|
|
||||||
|
//#include <ctr/misc.h>
|
||||||
|
//#include <ctr/types.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// CODEC Page Register
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_PAGE_CTL_ADDR 0
|
||||||
|
#define REG_TP255_PAGE_CTL_ADDR 127
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// CODEC Version ..etc
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP0_VENDOR_ID_ADDR 2
|
||||||
|
#define REG_TP0_REV_ID_ADDR 3
|
||||||
|
#define TP0_REV_ID_MASK 0x70
|
||||||
|
#define TP0_REV_ID_SHIFT 4
|
||||||
|
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// TP Data
|
||||||
|
//================================================================================
|
||||||
|
#define TP_DATA_SAMPLE_DEPTH_MAX 8
|
||||||
|
#define TP_DATA_SAMPLE_DEPTH_DEFAULT 8 // 8だとmix問題は発生しない
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u16 xBuf[TP_DATA_SAMPLE_DEPTH_MAX * 2]; // ダブルバッファ
|
||||||
|
u16 yBuf[TP_DATA_SAMPLE_DEPTH_MAX * 2]; // ダブルバッファ
|
||||||
|
int tpIndex; // 有効データの先頭インデックス(ダブルバッファなので、0 か TP_DATA_SAMPLE_DEPTH_MAX)
|
||||||
|
|
||||||
|
u16 x; // page 3 での単発 read 時
|
||||||
|
u16 y; // page 3 での単発 rea d時
|
||||||
|
u16 in1;
|
||||||
|
u16 in2;
|
||||||
|
u16 in3;
|
||||||
|
|
||||||
|
int tpDepth; // タッチパネル・データ数
|
||||||
|
|
||||||
|
} tpData_t;
|
||||||
|
|
||||||
|
extern tpData_t tpData;
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Resolution / ADC Power
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_RESOLUTION 2
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_RESOLUTION_12 = 0x10,
|
||||||
|
TP_RESOLUTION_8 = 0x48,
|
||||||
|
TP_RESOLUTION_10 = 0x20
|
||||||
|
|
||||||
|
} TpResolution_t;
|
||||||
|
|
||||||
|
#define TP_RESOLUTION_MASK 0x78
|
||||||
|
#define TP_ADC_PWR_MASK 0x80
|
||||||
|
#define TP_ADC_PWRUP 0x00
|
||||||
|
#define TP_ADC_PWRDN 0x80
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Sampling Channel
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_CHANNEL 3
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_CHANNEL_NONE = 0x00,
|
||||||
|
TP_CHANNEL_XY = 0x87, // Self, /READREADY = ReadReady
|
||||||
|
TP_CHANNEL_XYZ = 0x8b,
|
||||||
|
TP_CHANNEL_X = 0x8f,
|
||||||
|
TP_CHANNEL_Y = 0x93,
|
||||||
|
TP_CHANNEL_Z = 0x97,
|
||||||
|
TP_CHANNEL_AUX3 = 0x19,
|
||||||
|
TP_CHANNEL_AUX2 = 0x1d,
|
||||||
|
TP_CHANNEL_AUX1 = 0x21,
|
||||||
|
TP_CHANNEL_AUTO_AUX = 0xa5,
|
||||||
|
TP_CHANNEL_AUX123 = 0x2d,
|
||||||
|
TP_CHANNEL_XP_XM = 0x35,
|
||||||
|
TP_CHANNEL_YP_YM = 0x39,
|
||||||
|
TP_CHANNEL_YP_XM = 0x3d
|
||||||
|
|
||||||
|
} TpChannel_t;
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Precharge / Sense / Stability time
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_PRECHARGE 4
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_SETUP_TIME_0_1US = 0,
|
||||||
|
TP_SETUP_TIME_1US,
|
||||||
|
TP_SETUP_TIME_3US,
|
||||||
|
TP_SETUP_TIME_10US,
|
||||||
|
TP_SETUP_TIME_30US,
|
||||||
|
TP_SETUP_TIME_100US,
|
||||||
|
TP_SETUP_TIME_300US,
|
||||||
|
TP_SETUP_TIME_1MS
|
||||||
|
|
||||||
|
} TpSetupTime_t;
|
||||||
|
|
||||||
|
#define TP_PRECHARGE_SHIFT 4
|
||||||
|
#define TP_PRECHARGE_MASK 0x70
|
||||||
|
|
||||||
|
|
||||||
|
#define REG_TP_SENSE_TIME 4
|
||||||
|
#define TP_SENSE_TIME_SHIFT 0
|
||||||
|
#define TP_SENSE_TIME_MASK 0x07
|
||||||
|
|
||||||
|
|
||||||
|
#define REG_TP_STABILIZATION_TIME 5
|
||||||
|
#define TP_STABILIZATION_TIME_SHIFT 0
|
||||||
|
#define TP_STABILIZATION_TIME_MASK 0x07
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// IC Status
|
||||||
|
//================================================================================
|
||||||
|
/*
|
||||||
|
#define REG_TP_STATUS1 9
|
||||||
|
#define REG_TP_STATUS2 10
|
||||||
|
#define REG_TP_STATUS3 14
|
||||||
|
|
||||||
|
#define REG_TP_STATUS3_MASK 0x03
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
// reg 9
|
||||||
|
TP_CONVERTER_STATUS_TOUCH_DETECTED = 0x8000,
|
||||||
|
TP_CONVERTER_STATUS_ADC_NOT_BUSY = 0x4000,
|
||||||
|
TP_CONVERTER_STATUS_DATA_AVAILABLE = 0x2000,
|
||||||
|
TP_CONVERTER_STATUS_X_AVAILABLE = 0x0800,
|
||||||
|
TP_CONVERTER_STATUS_Y_AVAILABLE = 0x0400,
|
||||||
|
// reg 10
|
||||||
|
TP_CONVERTER_STATUS_AUX1_AVAILABLE = 0x0080,
|
||||||
|
TP_CONVERTER_STATUS_AUX2_AVAILABLE = 0x0040,
|
||||||
|
TP_CONVERTER_STATUS_AUX3_AVAILABLE = 0x0020,
|
||||||
|
// reg14
|
||||||
|
TP_CONVERTER_STATUS_TP_DATA_NOT_READY = 0x0002,
|
||||||
|
TP_CONVERTER_STATUS_FIFO_FLUSH_DONE = 0x0001
|
||||||
|
|
||||||
|
} tpConverterStatus_t;
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
// New Buffer Mode
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_NEW_BUFFER_MODE 14
|
||||||
|
#define TP_NEW_BUFFER_MODE_E 0x80
|
||||||
|
#define TP_NEW_BUFFER_MODE_D 0x00
|
||||||
|
#define TP_NEW_BUFFER_MODE_MASK 0x80
|
||||||
|
|
||||||
|
#define TP_CONVERSION_MODE_CONTINUOUS 0x00
|
||||||
|
#define TP_CONVERSION_MODE_SINGLESHOT 0x40
|
||||||
|
#define TP_CONVERSION_MODE_MASK 0x40
|
||||||
|
|
||||||
|
#define TP_HOLDOFF_ENABLE 0x04
|
||||||
|
#define TP_HOLDOFF_DISABLE 0x00
|
||||||
|
#define TP_HOLDOFF_MASK 0x04
|
||||||
|
|
||||||
|
#define REG_TP_DATA_DEPTH 14
|
||||||
|
#define TP_DATA_DEPTH_SHIFT 3
|
||||||
|
#define TP_DATA_DEPTH_MASK 0x38
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Interval
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_INTERVAL 15
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_INTERVAL_NONE = 0,
|
||||||
|
TP_AUX_INTERVAL_1_12M = 0x08,
|
||||||
|
TP_AUX_INTERVAL_3_36M,
|
||||||
|
TP_AUX_INTERVAL_5_59M,
|
||||||
|
TP_AUX_INTERVAL_7_83M,
|
||||||
|
TP_AUX_INTERVAL_10_01M,
|
||||||
|
TP_AUX_INTERVAL_12_30M,
|
||||||
|
TP_AUX_INTERVAL_14_54M,
|
||||||
|
TP_AUX_INTERVAL_16_78M,
|
||||||
|
TP_INTERVAL_8MS = 0x80,
|
||||||
|
TP_INTERVAL_1MS = 0x90,
|
||||||
|
TP_INTERVAL_2MS = 0xa0,
|
||||||
|
TP_INTERVAL_3MS = 0xb0,
|
||||||
|
TP_INTERVAL_4MS = 0xc0,
|
||||||
|
TP_INTERVAL_5MS = 0xd0,
|
||||||
|
TP_INTERVAL_6MS = 0xe0,
|
||||||
|
TP_INTERVAL_7MS = 0xf0
|
||||||
|
|
||||||
|
} tpInterval_t;
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Clock Source
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_INTERVAL_TIMER_SOURCE 16
|
||||||
|
#define TP_INTERVAL_TIMER_SOURCE_EXTERNAL 0x81
|
||||||
|
#define TP_INTERVAL_TIMER_SOURCE_INTERNAL 0x00
|
||||||
|
|
||||||
|
#define REG_TP_ADC_TIMER_SOURCE 17
|
||||||
|
#define TP_ADC_TIMER_SOURCE_EXTERNAL 0x81
|
||||||
|
#define TP_ADC_TIMER_SOURCE_INTERNAL 0x00
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Debounce
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_DEBOUNCE 18
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_DEBOUNCE_0US = 0,
|
||||||
|
TP_DEBOUNCE_16US, // ADC Timer Source が External なら、8/12.19倍の期間になる
|
||||||
|
TP_DEBOUNCE_32US,
|
||||||
|
TP_DEBOUNCE_64US,
|
||||||
|
TP_DEBOUNCE_128US,
|
||||||
|
TP_DEBOUNCE_256US,
|
||||||
|
TP_DEBOUNCE_512US,
|
||||||
|
TP_DEBOUNCE_1024US
|
||||||
|
|
||||||
|
} tpDebounce_t;
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// AUX Channel
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_ENABLED_AUX_CHANNEL 19
|
||||||
|
#define TP_ENABLED_AUX_CHANNEL_SHIFT 5
|
||||||
|
#define TP_ENABLED_AUX_CHANNEL_MASK 0xe0
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_ENABLED_AUX_CHANNEL_NONE = 0,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN3,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN2,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN2_IN3,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN1,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN1_IN3,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN1_IN2,
|
||||||
|
TP_ENABLED_AUX_CHANNEL_IN1_IN2_IN3
|
||||||
|
|
||||||
|
} tpEnabledAuxChannel_t;
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Sampling Data Read
|
||||||
|
//================================================================================
|
||||||
|
#define REG_TP_SAMPLING_DATA_X 42
|
||||||
|
#define REG_TP_SAMPLING_DATA_Y 44
|
||||||
|
#define REG_TP_SAMPLING_DATA_IN1 54
|
||||||
|
#define REG_TP_SAMPLING_DATA_IN2 56
|
||||||
|
#define REG_TP_SAMPLING_DATA_IN3 58
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TP_SAMPLING_DATA_X = 42,
|
||||||
|
TP_SAMPLING_DATA_Y = 44,
|
||||||
|
TP_SAMPLING_DATA_IN1 = 54,
|
||||||
|
TP_SAMPLING_DATA_IN2 = 56,
|
||||||
|
TP_SAMPLING_DATA_IN3 = 58
|
||||||
|
|
||||||
|
} tpSamplingDataChannel_t;
|
||||||
|
|
||||||
|
#define REG_TP_BUFFER 1
|
||||||
|
#define TP_READ_BUFFER_TIMEOUT 16
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
// Sampling Data Format
|
||||||
|
//================================================================================
|
||||||
|
#define TP_NOT_TOUCH_MASK 0xf000
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* CTR_TP_TP_REG_H_ */
|
||||||
|
#endif
|
||||||
221
build/libraries/spi/ARM7/include/tp_sp.h
Normal file
221
build/libraries/spi/ARM7/include/tp_sp.h
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: NitroSDK - libraries - spi
|
||||||
|
File: tp_sp.h
|
||||||
|
|
||||||
|
Copyright 2003-2006 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Log: tp_sp.h,v $
|
||||||
|
Revision 1.7 2006/01/18 02:12:27 kitase_hirotake
|
||||||
|
do-indent
|
||||||
|
|
||||||
|
Revision 1.6 2005/02/28 05:26:27 yosizaki
|
||||||
|
do-indent.
|
||||||
|
|
||||||
|
Revision 1.5 2004/12/29 02:03:59 takano_makoto
|
||||||
|
SetStability関数のretryパラメータを廃止, rangeの自動調整スイッチを有効に変更
|
||||||
|
|
||||||
|
Revision 1.4 2004/12/20 00:40:55 takano_makoto
|
||||||
|
自動サンプリング時のVAlarmのdelayを設定
|
||||||
|
|
||||||
|
Revision 1.3 2004/12/15 09:12:40 takano_makoto
|
||||||
|
rangeの自動調整を追加。SDK_TP_AUTO_ADJUST_RANGEによって有効になる。
|
||||||
|
|
||||||
|
Revision 1.2 2004/11/05 05:47:24 terui
|
||||||
|
SPIコマンドについての制約事項をコメントに追加。
|
||||||
|
|
||||||
|
Revision 1.1 2004/09/06 12:54:18 terui
|
||||||
|
libraries/spi/includeからlibraries/spi/ARM7/includeに移動。
|
||||||
|
SPI処理予約方式の実装に伴う修正。
|
||||||
|
|
||||||
|
Revision 1.9 2004/08/09 13:23:25 takano_makoto
|
||||||
|
MIC自動サンプリングの合間にTPの1回サンプリングが実行できるように修正
|
||||||
|
|
||||||
|
Revision 1.8 2004/07/31 08:06:45 terui
|
||||||
|
サンプリングコマンドをターゲットHWにより振り分ける仕様を追加
|
||||||
|
|
||||||
|
Revision 1.7 2004/06/17 11:07:43 terui
|
||||||
|
接触判定コマンド定義を変更。0x94 -> 0x84
|
||||||
|
|
||||||
|
Revision 1.6 2004/05/25 00:58:01 terui
|
||||||
|
SPI各デバイス用ライブラリ細分化に伴う修正
|
||||||
|
|
||||||
|
Revision 1.5 2004/05/14 04:50:36 yosiokat
|
||||||
|
TEGとTSの両方に対応するよう変更
|
||||||
|
|
||||||
|
Revision 1.4 2004/04/29 10:25:59 terui
|
||||||
|
関数定義の引数削除に伴う変更
|
||||||
|
|
||||||
|
Revision 1.3 2004/04/14 06:26:46 terui
|
||||||
|
SPIライブラリのソース整理に伴う更新
|
||||||
|
|
||||||
|
Revision 1.2 2004/04/05 04:47:05 terui
|
||||||
|
Change composition.
|
||||||
|
|
||||||
|
$NoKeywords: $
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef LIBRARIES_TP_SP_H_
|
||||||
|
#define LIBRARIES_TP_SP_H_
|
||||||
|
|
||||||
|
#include <nitro/types.h>
|
||||||
|
#include "spi_sp.h"
|
||||||
|
/////////////////////////////// TWL
|
||||||
|
#include "tp_reg.h"
|
||||||
|
///////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
定数定義
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
/* 2004/11/04 照井
|
||||||
|
*
|
||||||
|
* 新規別デバイスのために、以下のコマンド以外は予約とします。
|
||||||
|
* ARM7がTPコントローラにこれら以外のコマンドを発行する必要がある場合は
|
||||||
|
* 予約されていることを考慮して注意して使用して下さい。
|
||||||
|
*
|
||||||
|
* 0x0000 ダミー命令
|
||||||
|
* 0x0084 接触判定
|
||||||
|
* 0x0091 Y方向サンプリング
|
||||||
|
* 0x0093 Y方向サンプリング(旧バージョン)
|
||||||
|
* 0x00D1 X方向サンプリング
|
||||||
|
* 0x00D3 X方向サンプリング(旧バージョン)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifdef SDK_TEG
|
||||||
|
// 内部リファレンスを使用
|
||||||
|
#define TP_COMMAND_SAMPLING_X 0x00D3 // X方向サンプリング命令
|
||||||
|
#define TP_COMMAND_SAMPLING_Y 0x0093 // Y方向サンプリング命令
|
||||||
|
#else // SDK_TS
|
||||||
|
#if ( SDK_TS_VERSION >= 100 ) // 青箱Ver.D以降
|
||||||
|
// 外部リファレンスを使用
|
||||||
|
#define TP_COMMAND_SAMPLING_X 0x00D1 // X方向サンプリング命令
|
||||||
|
#define TP_COMMAND_SAMPLING_Y 0x0091 // Y方向サンプリング命令
|
||||||
|
#else // 青箱Ver.D未満
|
||||||
|
// 内部リファレンスを使用
|
||||||
|
#define TP_COMMAND_SAMPLING_X 0x00D3 // X方向サンプリング命令
|
||||||
|
#define TP_COMMAND_SAMPLING_Y 0x0093 // Y方向サンプリング命令
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TP_COMMAND_DETECT_TOUCH 0x0084 // 接触判定命令
|
||||||
|
|
||||||
|
#define TP_VALID_BIT_MASK 0x7ff8 // 有効データビット
|
||||||
|
#define TP_VALID_BIT_SHIFT 3 // xooooooo oooooxxx
|
||||||
|
|
||||||
|
#define TP_VALARM_DELAY_MAX 10
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
構造体定義
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
// タッチパネルに関する内部的な状態
|
||||||
|
typedef enum TPStatus
|
||||||
|
{
|
||||||
|
TP_STATUS_READY = 0, // 通常操作待ち状態
|
||||||
|
TP_STATUS_AUTO_START, // 自動サンプリング開始待ち状態
|
||||||
|
TP_STATUS_AUTO_SAMPLING, // 自動サンプリング中
|
||||||
|
TP_STATUS_AUTO_WAIT_END // 自動サンプリング停止待ち状態
|
||||||
|
}
|
||||||
|
TPStatus;
|
||||||
|
|
||||||
|
// タッチパネル用ワーク構造体
|
||||||
|
typedef struct TPWork
|
||||||
|
{
|
||||||
|
u16 command[SPI_PXI_CONTINUOUS_PACKET_MAX];
|
||||||
|
TPStatus status; // タッチパネル内部状態管理変数
|
||||||
|
s32 range; // 安定判定時の許容する振れ幅のデフォルト値
|
||||||
|
s32 rangeMin; // 安定判定時の許容する振れ幅の最小値(range自動調整で使用)
|
||||||
|
OSVAlarm vAlarm[SPI_TP_SAMPLING_FREQUENCY_MAX]; // タッチパネル用Vアラーム
|
||||||
|
u16 vCount[SPI_TP_SAMPLING_FREQUENCY_MAX]; // タッチパネル用Vカウント退避エリア
|
||||||
|
|
||||||
|
}
|
||||||
|
TPWork;
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
関数定義
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
void TP_Init(void);
|
||||||
|
void TP_AnalyzeCommand(u32 data);
|
||||||
|
void TP_ExecuteProcess(SPIEntry * entry);
|
||||||
|
|
||||||
|
//////////////////////////// TWL
|
||||||
|
void TWL_TP_Init(void);
|
||||||
|
//void TWL_TP_AnalyzeCommand(u32 data);
|
||||||
|
//void TWL_TP_ExecuteProcess(SPIEntry * entry);
|
||||||
|
|
||||||
|
void TWL_TP_SetStabilizationTime( TpSetupTime_t time );
|
||||||
|
void TWL_TP_SetPrechargeTime( TpSetupTime_t time );
|
||||||
|
void TWL_TP_SetSenseTime( TpSetupTime_t time );
|
||||||
|
void TWL_TP_SetResolution( TpResolution_t res );
|
||||||
|
void TWL_TP_GetResolution( TpResolution_t *res );
|
||||||
|
void TWL_TP_SetTouchPanelDataDepth(u8 depth);
|
||||||
|
void TWL_TP_SetConvertChannel( TpChannel_t ch );
|
||||||
|
void TWL_TP_SetInterval( tpInterval_t interval );
|
||||||
|
void TWL_TP_EnableNewBufferMode( void );
|
||||||
|
void TWL_TP_DisableNewBufferMode( void );
|
||||||
|
BOOL TWL_TP_ReadBuffer( SPITpData *data );
|
||||||
|
////////////////////////////
|
||||||
|
|
||||||
|
#define SDK_TP_AUTO_ADJUST_RANGE // range自動調整スイッチ
|
||||||
|
|
||||||
|
#ifdef SDK_TP_AUTO_ADJUST_RANGE // range自動調整スイッチ
|
||||||
|
void TP_ExecSampling(SPITpData *data, s32 range, u16 *density);
|
||||||
|
#else
|
||||||
|
void TP_ExecSampling(SPITpData *data, s32 range);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
インライン関数定義
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: TP_SPIChangeMode
|
||||||
|
|
||||||
|
Description: SPIコントロールレジスタを編集してタッチパネル用コマンド転送準備を
|
||||||
|
整える。この時同時に、SPI連続クロック発振モードを切り替える。
|
||||||
|
|
||||||
|
CODECの制限により、
|
||||||
|
DSモードではSPIクロックは2MHzが限度となるので注意。
|
||||||
|
TWLモードではSPIクロックは4MHzとなるため、
|
||||||
|
この関数ではなくCDCi_ChangeSpiModeを使用する。
|
||||||
|
|
||||||
|
Arguments: continuous - SPI連続クロック発振可否。'1'で1byte通信の都度CSを上げ
|
||||||
|
ないモード。ただし連続転送の最後の1バイトでは'0'にして
|
||||||
|
1byte転送モードにしないと永久にCSが上がらない。
|
||||||
|
|
||||||
|
Returns: None.
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
static inline void TP_SPIChangeMode(SPITransMode continuous)
|
||||||
|
{
|
||||||
|
reg_SPI_SPICNT = (u16)((0x0001 << REG_SPI_SPICNT_E_SHIFT) | (0x0000 << REG_SPI_SPICNT_I_SHIFT) | (SPI_COMMPARTNER_TP << REG_SPI_SPICNT_SEL_SHIFT) | // 吉岡変更
|
||||||
|
// ( SPI_COMMPARTNER_PMIC << REG_SPI_SPICNT_SEL_SHIFT ) | // 吉岡変更前
|
||||||
|
(continuous << REG_SPI_SPICNT_MODE_SHIFT) |
|
||||||
|
(0x0000 << REG_SPI_SPICNT_BUSY_SHIFT) |
|
||||||
|
(SPI_BAUDRATE_2MHZ << REG_SPI_SPICNT_BAUDRATE_SHIFT));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* LIBRARIES_TP_SP_H_ */
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
End of file
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
Loading…
Reference in New Issue
Block a user