mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-06-18 16:45:33 -04:00

sreg,calltを積極的に使うよう、コンパイルオプション変更など 未使用変数削除 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@375 013db118-44a6-b54f-8bf7-843cb86687b1
143 lines
2.5 KiB
C
143 lines
2.5 KiB
C
#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変えられません
|
||
#ifndef _WIN32
|
||
#define LED_pow_red P4.2
|
||
#define LED_CAM P7.5
|
||
#else
|
||
#define LED_pow_red mcuRegP[ _P4_2 ]
|
||
#define LED_CAM mcuRegP[ _P7_5 ]
|
||
#endif
|
||
|
||
#define NOTIFY_LED_TERM 32
|
||
|
||
|
||
#define LED_BRIGHT_MAX 0x00FF
|
||
|
||
// ====================================
|
||
#define WIFI_txLatch PIF21 // 電波送信パルス
|
||
|
||
|
||
|
||
// ====================================
|
||
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_3D
|
||
{
|
||
LED_3D_ILM_OFF = 0,
|
||
LED_3D_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 bit ledInitialized;
|
||
extern bit info_led_override;
|
||
|
||
|
||
#endif
|