ctr_mcu/flower_toriaezu1/i2c_mcu.h
n2232 44d462ce13 仕様1
・スリープ(蓋閉じ)中だけ電源長押しオフを効かなくする(全機種共通)
 else if( SW_pow_count == ( HOLD_THREASHOLD ) ) が無しのイメージ?
・スリープスイッチがスリープになってるときは、HOME+PWRの短押しで電源オン
 これは機種判定してFLOWERのときのみ。CTRでは、PWRオンリー
 ON_CHECK時の電源監視での短押し判定にSW_home_countあたりをアンドする?

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@514 013db118-44a6-b54f-8bf7-843cb86687b1
2013-02-21 00:19:25 +00:00

41 lines
967 B
C

#ifndef __ic2_mcu__
#define __ic2_mcu__
// ========================================================
typedef enum{
I2C_ERR_OK = 0,
I2C_ERR_NAK,
I2C_ERR_NOSLAVE,
I2C_ERR_TIMEOUT,
I2C_ERR_UNDEF = 0xFF
}i2c_err;
// ========================================================
extern volatile bit iic_mcu_busy;
extern bit iic_mcu_wo_dma;
extern i2c_err iic_mcu_result;
// ========================================================
i2c_err iic_mcu_read( u8 SLA, u8 adrs, u8 len, u8 * dest );
u8 iic_mcu_read_a_byte( u8 SLA, u8 adrs );
i2c_err iic_mcu_write( u8 SLA, u8 adrs, u8 len, void * src );
i2c_err iic_mcu_write_a_byte( u8 SLA, u8 adrs, u8 dat );
i2c_err iic_mcu_write_a_byte_codec( u8 adrs, u8 dat ); // codecバグ回避機能付き
// ↓その通信が完了したら解除されます。
#define iic_mcu_set_wo_dma() { while( iic_mcu_busy ){;} iic_mcu_wo_dma = true; }
void iic_mcu_start( );
void iic_mcu_stop( );
#endif