mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-06-19 09:05:48 -04:00

全ファイルをindentに通した ほか、たくさん修正 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@12 013db118-44a6-b54f-8bf7-843cb86687b1
36 lines
834 B
C
36 lines
834 B
C
#ifndef __ic2_mcu__
|
|
#define __ic2_mcu__
|
|
|
|
|
|
// ========================================================
|
|
#define ERR_OK 0
|
|
#define ERR_NAK 1
|
|
#define ERR_NOSLAVE 2
|
|
|
|
|
|
|
|
// ========================================================
|
|
extern volatile bit iic_mcu_busy;
|
|
extern bit iic_mcu_wo_dma;
|
|
|
|
extern u8 iic_mcu_bus_status;
|
|
|
|
|
|
|
|
// ========================================================
|
|
err iic_mcu_read( u8 SLA, u8 adrs, u8 len, u8 * dest );
|
|
u8 iic_mcu_read_a_byte( u8 SLA, u8 adrs );
|
|
|
|
err iic_mcu_write( u8 SLA, u8 adrs, u8 len, u8 * src );
|
|
err iic_mcu_write_a_byte( u8 SLA, u8 adrs, u8 dat );
|
|
|
|
// ↓その通信が完了したら解除されます。
|
|
#define iic_mcu_set_wo_dma() { while( iic_mcu_busy ){;} iic_mcu_wo_dma = 1; }
|
|
|
|
void iic2m_bus_reset( );
|
|
|
|
void iic_mcu_start( );
|
|
void iic_mcu_stop( );
|
|
|
|
#endif
|