ctr_mcu/branches/SDK2.0_1NUP/led.h

154 lines
2.7 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.

#ifndef __led__
#define __led__
// ====================================
//#define LED_CHARGE P2.4 // PMで定義
// LED_DUTY
#define LED_duty_pow_blu TDR06
#define LED_duty_WiFi TDR03
#define LED_duty_3d TDR01
#define LED_duty_notify_red TDR07
#define LED_duty_notify_grn TDR05
#define LED_duty_notify_blu TDR02
// これらはduty変えられません
#define LED_pow_red P4.2
#define LED_CAM P7.5
// 旧仕様 /////////////////////////////
// LED_DUTY
//#define LED_duty_old_pow_blu TDR06 同じ
//#define LED_duty_old_WiFi TDR03 同じ
#define LED_duty_old_NOTIFY TDR05
//#define LED_duty_old_CAM TDR02
//#define LED_duty_old_3d TDR01 同じ
// wifi2はPWMできません。
#define LED_old_pow_red P1.5
#define LED_old_CAM P1.0
#define NOTIFY_LED_TERM 32
#define LED_BRIGHT_MAX 0x00FF
// ====================================
#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_SLEEP,
LED_POW_ILM_OFF,
LED_POW_ILM_ONLY_RED,
LED_POW_ILM_ONLY_BLUE,
LED_POW_ILM_FORCE_BT_EMPTY
};
enum LED_MODE_TUNE
{
LED_TUNE_ILM_OFF = 0,
LED_TUNE_ILM_ON
};
// VREG_C_WIFI_LED
enum WIFI_LED_MODE
{
WIFI_LED_OFF = 0,
WIFI_LED_ON
};
// VREG_C_WIFI_NOTIFY
enum NOTIFY_LED_MODE
{
NOTIFY_LED_OFF = 0,
NOTIFY_LED_ON,
NOTIFY_LED_PTN0,
NOTIFY_LED_PTN1,
NOTIFY_LED_PTN2
};
// VREG_C_CAM_LED
enum CAM_LED_MODE
{
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 _st_info_LED
{
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 _uni_info_LED
{
st_info_LED info_LED;
u8 bindata[ sizeof( st_info_LED ) ];
}uni_info_LED;
extern uni_info_LED info_LED;
// 赤LED 点滅向け //
typedef struct _st_led_red_batt_empty
{
u8 dats[4];
}st_led_red_batt_empty;
extern st_led_red_batt_empty led_red_batt_empty;
/*
お知らせLED
*/
typedef struct _st_LED_dim_status
{
sx16 to;
sx16 delta;
sx16 now; // 小数点以下を覚えておかなくてはならないため
}st_LED_dim_status;
// ====================================
void LED_init( );
void LED_stop( );
extern void tsk_led_cam();
#endif