Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Library Routines
- Soft_I2C_Init 
- Soft_I2C_Start 
- Soft_I2C_Read 
- Soft_I2C_Write 
- Soft_I2C_Stop 
- Soft_I2C_Break
Soft_I2C_Init
352
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure Soft_I2C_Init();
Returns
Nothing.
Description
Configures the software I
2
C module.
Requires
Global variables : 
Soft_I2C_Scl_Output
: Soft I
2
C clock output line 
Soft_I2C_Sda_Output
: Soft I
2
C data output line 
Soft_I2C_Scl_Input
: Soft I
2
C clock input line 
Soft_I2C_Sda_Input
: Soft I
2
C data input line 
Soft_I2C_Scl_Pin_Direction
: Direction of the Soft I
2
C clock pin 
Soft_I2C_Sda_Pin_Direction
: Direction of the Soft I
2
C data pin 
must be defined before using this function. 
Example
// Soft_I2C pinout definition
var Soft_I2C_Scl_Output        : sbit at PORTC.B0;     
var Soft_I2C_Sda_Output        : sbit at PORTC.B1;      
var Soft_I2C_Scl_Input         : sbit at PINC.B0;        
var Soft_I2C_Sda_Input         : sbit at PINC.B1;        
var Soft_I2C_Scl_Pin_Direction : sbit at DDRC.B0;
var Soft_I2C_Sda_Pin_Direction : sbit at DDRC.B1;
// End of Soft_I2C pinout definition
...
Soft_I2C_Init();