i2c.h File Reference


Detailed Description

API for serial communication via I2C.

Software License
See the MBCSL for details.
Author:
Sven Schlender (kontakt at mobacon dot de)
Date:
2010-12-16

enum  I2CClockFrequencies_t { I2CFREQ_400K = 0, I2CFREQ_100K, I2CFREQ_COUNT }
 The supported clock frequencies in I2C master mode. More...
void I2CLoadConfig (void)
 Loads the I2C configuration from EEPROM.
void I2CInit (void)
 Initializes the I2C module with the requested frequency.
void I2CStopTask (void)
 On network errors or shut down events these function should be called to proper stop the I2C related tasks.
BOOL I2CCheckForStoppedTask (void)
 Before shutting down the application should poll for valid I2C task shutdown.
void I2CTask (BOOL DataInFIFO)
 Call this function periodically from main application to execute the I2C module task.
I2CClockFrequencies_t I2CGetFrequency (void)
 Delivers the currently used frequency of I2C master mode.
void I2CSetFrequency (I2CClockFrequencies_t Frequency)
 Sets the clock frequency in I2C master mode.
void I2CResetToFactory (void)
 This function restores the EEPROM content of the I2C module to a well known state (Default frequency is 100 kHz).
void I2CISR (void)
 The interrupt routine of the i2c module.


Enumeration Type Documentation

The supported clock frequencies in I2C master mode.

Enumerator:
I2CFREQ_400K  400 KHz.
I2CFREQ_100K  100 KHz.
I2CFREQ_COUNT  Dummy for getting the count of all supported frequencies.


Function Documentation

BOOL I2CCheckForStoppedTask ( void   ) 

Before shutting down the application should poll for valid I2C task shutdown.

Return values:
TRUE The task has successfully stopped.
FALSE Stopping the I2C task is pending.

I2CClockFrequencies_t I2CGetFrequency ( void   ) 

Delivers the currently used frequency of I2C master mode.

The frequency can be read indepently from the current active NetzerIO mode.

Returns:
The frequency as enumerated value.

void I2CInit ( void   ) 

Initializes the I2C module with the requested frequency.

Should be called once at startup (very early).

void I2CISR ( void   ) 

The interrupt routine of the i2c module.

Must be called if the module is active and a high priority interrupt has occured.

Important: Only call this function from interrupt context!

void I2CLoadConfig ( void   ) 

Loads the I2C configuration from EEPROM.

Must be called once at startup (very early).

void I2CResetToFactory ( void   ) 

This function restores the EEPROM content of the I2C module to a well known state (Default frequency is 100 kHz).

void I2CSetFrequency ( I2CClockFrequencies_t  Frequency  ) 

Sets the clock frequency in I2C master mode.

If in I2C master mode the change takes effect directly. The new mode is stored persistent in EEPROM.

Parameters:
Frequency The frequency as enumerated value.

void I2CStopTask ( void   ) 

On network errors or shut down events these function should be called to proper stop the I2C related tasks.

void I2CTask ( BOOL  DataInFIFO  ) 

Call this function periodically from main application to execute the I2C module task.

Parameters:
DataInFIFO TRUE if data is located in the TCP/IP receive FIFO buffer. FALSE if the TCP/IP receive FIFO buffer is empty.


Generated on Fri Mar 29 10:34:27 2013 for Netzer by  doxygen 1.5.5