ctr_mcu/trunk/led.h
N2232 6bc39a3e62 0.14
音量が一時的に急に変わるのを修正
 ADCのチャンネル切り替え後、割り込みフラグをクリアするのを忘れていた
フルカラーお知らせランプの自動判別
 そのため、ポートの初期化順なども一部変更
同、パラメータの受信フォーマットの変更
8MHz動作しかしないので、4MHz動作の#ifdefを削除
I2C_TWL 反応遅延が激しいので逐次タスクの削除周り修正、割り込み禁止区間を細切れにしたり



git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@146 013db118-44a6-b54f-8bf7-843cb86687b1
2010-05-17 00:10:17 +00:00

152 lines
2.6 KiB
C
Raw 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.

#ifndef __led__
#define __led__
// ====================================
#ifdef _MODEL_CTR_NOTIFY_FULLCOLOR_
// LED_DUTY
#define LED_duty_pow_blu TDR05
#define LED_duty_WiFi TDR02
#define LED_duty_3d TDR01
#define LED_duty_notify_red TDR07
#define LED_duty_notify_grn TDR03
#define LED_duty_notify_blu TDR06
// これらはduty変えられません
#define LED_pow_red P7.5
#define LED_CAM P4.2
#else
// LED_DUTY
#define LED_duty_pow_L TDR07
#define LED_duty_pow_blu TDR06
#define LED_duty_WiFi TDR03
#define LED_duty_NOTIFY TDR05
#define LED_duty_CAM TDR02
#define LED_duty_3d TDR01
// wifi2はPWMできません。
#endif
#define NOTIFY_LED_TERM 32
#define LED_BRIGHT_MAX 0x0100
// ====================================
#ifdef _MCU_BSR_ // 電波送信パルス
#define WIFI_txLatch PIF21
#else
#define WIFI_txLatch PIF7
#endif
// ====================================
enum LED_ILUM_MODE
{
LED_POW_ILM_AUTO = 0,
LED_POW_ILM_ON,
LED_POW_ILM_HOTARU,
LED_POW_ILM_OFF,
LED_POW_ILM_ONLY_RED,
LED_POW_ILM_ONLY_BLUE
};
enum LED_MODE_TUNE
{
LED_TUNE_ILM_OFF = 0,
LED_TUNE_ILM_ON,
LED_TUNE_ILM_SVR
};
// VREG_C_WIFI_LED
enum
{
WIFI_LED_OFF = 0,
WIFI_LED_ON
};
// VREG_C_WIFI_NOTIFY
enum
{
NOTIFY_LED_OFF = 0,
NOTIFY_LED_ON,
NOTIFY_LED_PTN0,
NOTIFY_LED_PTN1,
NOTIFY_LED_PTN2
};
// VREG_C_CAM_LED
enum
{
CAM_LED_OFF = 0,
CAM_LED_BLINK,
CAM_LED_ON,
CAM_LED_BY_TWL,
CAM_LED_ON_PLUSE,
CAM_LED_OFF_PLUSE
};
// お知らせLED調光関係 //
typedef struct{
u8 term; // 1フレーム何チック
u8 fade_time; // 何チックで次のフレームの色に達するか
u8 last_loop; // 最終フレームを
u8 resv1;
u8 red[32];
u8 grn[32];
u8 blu[32];
}st_info_LED;
typedef union{
st_info_LED info_LED;
u8 bindata[ sizeof( st_info_LED ) ];
}uni_info_LED;
extern uni_info_LED info_LED;
// 赤LED 点滅向け //
typedef struct{
u8 dats[4];
}st_u8s4;
typedef union{
unsigned long bits;
st_u8s4 dats;
}uni_led_red_batt_empty;
extern uni_led_red_batt_empty led_red_batt_empty;
/*
お知らせLED
*/
typedef struct{
sx16 to;
sx16 delta;
sx16 now; // 小数点以下を覚えておかなくてはならないため
}st_LED_dim_status;
// ====================================
void LED_init( );
void LED_stop( );
extern void tsk_led_cam();
#endif