Datasheet
TWI LIBRARY
TWI full master MSSP module is available with a number of AVR MCU models. mikroC PRO for
AVR provides library which supports the master TWI mode.
Note: Examples for AVR MCUs with module on other ports can be found in your mikroC for AVR
installation folder, subfolder “Examples”.
Library Routines
- TWI_Init
- TWI_Busy
- TWI_Start
- TWI_Stop
- TWI_Read
- TWI_Write
- TWI_Status
- TWI_Close
TWI_Init
530
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void TWI_Init(unsigned long clock);
Returns Nothing.
Description
Initializes TWI with desired clock (refer to device data sheet for correct values in
respect with Fosc). Needs to be called before using other functions of TWI Library.
You don’t need to configure ports manually for using the module; library will take
care of the initialization.
Requires Library requires MSSP module on PORTB or PORTC.
Example
TWI_Init(100000);