Mikroelektronika MIKROE-350 Data Sheet

Page of 526
Library Routines
- Soft_I2C_Init 
- Soft_I2C_Start 
- Soft_I2C_Read 
- Soft_I2C_Write 
- Soft_I2C_Stop 
- Soft_I2C_Break 
Soft_I2C_Init
339
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6
Prototype
sub procedure Soft_I2C_Init()
Returns
Nothing.
Description
Configures the software I2C module.
Requires
Global variables : 
Soft_I2C_Scl_Output:
Soft I2C clock output line 
Soft_I2C_Sda_Output:
Soft I2C data output line 
Soft_I2C_Scl_Input:
Soft I2C clock input line 
Soft_I2C_Sda_Input:
Soft I2C data input line 
Soft_I2C_Scl_Pin_Direction:
Direction of the Soft I2C clock pin 
Soft_I2C_Sda_Pin_Direction:
Direction of the Soft I2C data pin 
must be defined before using this function. 
Example
'Soft_I2C pinout definition
dim Soft_I2C_Scl_Output        as sbit at PORTC.B0     
dim Soft_I2C_Sda_Output        as sbit at PORTC.B1      
dim Soft_I2C_Scl_Input         as sbit at PINC.B0        
dim Soft_I2C_Sda_Input         as sbit at PINC.B1        
dim Soft_I2C_Scl_Pin_Direction as sbit at DDRC.B0
dim Soft_I2C_Sda_Pin_Direction as sbit at DDRC.B1
'End of Soft_I2C pinout definition
...
Soft_I2C_Init()