Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Soft_I2C_Start
Soft_I2C_Read
353
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure Soft_I2C_Start();
Returns
Nothing.
Description Determines if the I
2
C bus is free and issues START signal.
Requires
Software I
2
C must be configured before using this function. See Soft_I2C_Init routine.
Example
// Issue START signal
Soft_I2C_Start();
Prototype
function Soft_I2C_Read(ack: word): byte;
Returns
One byte from the Slave.
Description
Reads one byte from the slave.
Parameters : 
ack
: acknowledge signal parameter. If the 
ack==0
not acknowledge signal will 
be sent after reading, otherwise the acknowledge signal will be sent. 
Requires
Soft I
2
C must be configured before using this function. See Soft_I2C_Init routine.
Also, START signal needs to be issued in order to use this function. See
Soft_I2C_Start routine.
Example
var take : word;
...
// Read data and send the not_acknowledge signal
take := Soft_I2C_Read(0);