ctr_mcu/trunk/led.h
N2232 a6e9474ebf CTTS対応(accero)
最大音量を-4db対応(adc)
お知らせLED対応(i2c_ctr)
I2C_mで、書き込みデータが化ける? 巻き戻し
GYROのCSが機能していなかった(PM5の設定忘れ)

todo:
現状、温度無視して充電させてます

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

155 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 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 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 red;
u8 grn;
u8 blu;
}st_info_LED_ptn;
typedef struct{
u8 term; // 1フレーム何チック
u8 fade_time; // 何チックで次のフレームの色に達するか
u8 last_loop; // 最終フレームを
u8 resv1;
st_info_LED_ptn ptn[ NOTIFY_LED_TERM ];
}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;
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