projekty/Source/example1/src/I2C.h File Reference

#include "./include/types.h"
#include "uart.h"

Go to the source code of this file.

Defines

#define I2C_DBG   0
#define I2C_IRQ   0
#define TEMPERATURE   0
#define I2C_FLAG_AA   (1<<2)
#define I2C_FLAG_SI   (1<<3)
#define I2C_FLAG_STO   (1<<4)
#define I2C_FLAG_STA   (1<<5)
#define I2C_FLAG_I2EN   (1<<6)
#define I2C_FLAG_STAC   (1<<5)
#define I2C_FLAG_SIC   (1<<3)
#define STA   0x20
#define SIC   0x08
#define SI   0x08
#define STO   0x10
#define STAC   0x20
#define AA   0x04

Functions

void __attribute__ ((interrupt("IRQ"))) I2C_interrupt(void)
short I2C_Initialize (void)
void I2C_off (void)
void I2C_SetSTA ()
void I2C_SetSlaveAdr (uint32_t)
void I2C_SetDataRegister (uint32_t)
void I2C_SendStartBit (void)
boolean I2C_Status (void)
unsigned char WriteOnI2C (unsigned char)
unsigned char ReadOnI2C (void)
void I2C_SetSTO (void)
short SendSlaveAdress (uint32_t Addr_S)

Variables

boolean Status_I2C
uint32_t I2CAddress
uint32_t I2CData


Define Documentation

#define AA   0x04

Definition at line 52 of file I2C.h.

Referenced by SendSlaveAdress().

#define I2C_DBG   0

Definition at line 34 of file I2C.h.

#define I2C_FLAG_AA   (1<<2)

Definition at line 38 of file I2C.h.

Referenced by AD7414_5Read().

#define I2C_FLAG_I2EN   (1<<6)

Definition at line 42 of file I2C.h.

#define I2C_FLAG_SI   (1<<3)

Definition at line 39 of file I2C.h.

Referenced by I2C_Initialize().

#define I2C_FLAG_SIC   (1<<3)

Definition at line 45 of file I2C.h.

#define I2C_FLAG_STA   (1<<5)

Definition at line 41 of file I2C.h.

Referenced by I2C_SetSTO().

#define I2C_FLAG_STAC   (1<<5)

Definition at line 44 of file I2C.h.

#define I2C_FLAG_STO   (1<<4)

Definition at line 40 of file I2C.h.

Referenced by I2C_SetSTA(), and I2C_SetSTO().

#define I2C_IRQ   0

Definition at line 35 of file I2C.h.

#define SI   0x08

Definition at line 49 of file I2C.h.

Referenced by SendSlaveAdress().

#define SIC   0x08

Definition at line 48 of file I2C.h.

Referenced by I2C_off(), ReadOnI2C(), and SendSlaveAdress().

#define STA   0x20

Definition at line 47 of file I2C.h.

Referenced by SendSlaveAdress().

#define STAC   0x20

Definition at line 51 of file I2C.h.

Referenced by SendSlaveAdress().

#define STO   0x10

Definition at line 50 of file I2C.h.

Referenced by I2C_off().

#define TEMPERATURE   0

Definition at line 36 of file I2C.h.


Function Documentation

void __attribute__ ( (interrupt("IRQ"))   ) 

short I2C_Initialize ( void   ) 

Definition at line 141 of file I2C.c.

References disableIRQ(), enableIRQ(), False, I2C_FLAG_SI, I2C_I2ADR, I2C_I2CONCLR, I2C_I2CONSET, I2C_I2DAT, I2C_I2SCLH, I2C_I2SCLL, I2C_I2STAT, PCB_PINSEL0, Status_I2C, True, UARTWriteStr(), and WD_Reset().

Referenced by Init().

void I2C_off ( void   ) 

Definition at line 120 of file I2C.c.

References False, GPIO0_IOCLR, GPIO0_IODIR, I2C_I2CONCLR, I2C_I2CONSET, PCB_PINSEL0, SIC, Status_I2C, STO, UARTWriteStr(), and WD_Reset().

Referenced by EINT1_interrupt().

void I2C_SendStartBit ( void   ) 

void I2C_SetDataRegister ( uint32_t   ) 

void I2C_SetSlaveAdr ( uint32_t   ) 

void I2C_SetSTA (  ) 

Definition at line 64 of file I2C.c.

References I2C_FLAG_STO, I2C_I2CONCLR, I2C_I2CONSET, and WD_Reset().

void I2C_SetSTO ( void   ) 

Definition at line 85 of file I2C.c.

References I2C_FLAG_STA, I2C_FLAG_STO, I2C_I2CONCLR, I2C_I2CONSET, UARTWriteStr(), and WD_Reset().

Referenced by AD5382_ControlRegister(), AD5382_SetGain(), AD5382_SetOffset(), AD5382_SoftClr(), AD5382_SoftPowerDown(), AD5382_SoftPowerUp(), AD5382_SoftReset(), AD5382Write(), AD5391_ControlRegisterRead(), AD5391_ControlRegisterWrite(), AD5391_Init(), AD5391_SetGain(), AD5391_SetOffset(), AD5391_SoftClr(), AD5391_SoftPowerDown(), AD5391_SoftPowerUp(), AD5391_SoftReset(), AD5391Write(), AD7414_5Read(), AD7997_ConfigRegister(), AD7997_Menu(), AD7997_ReadAnalogValue(), AD7997_SetCycleTimeRegister(), DO_H(), DO_L(), DO_MAX_Init(), Init(), RamtronInit(), RamtronReadByte(), and RamtronWriteByte().

boolean I2C_Status ( void   ) 

Definition at line 75 of file I2C.c.

References Status_I2C.

Referenced by AMenu(), I2CTranserByte(), ReadOnI2C(), SendSlaveAdress(), and WriteOnI2C().

unsigned char ReadOnI2C ( void   ) 

Definition at line 551 of file I2C.c.

References False, I2C_I2CONCLR, I2C_I2CONSET, I2C_I2DAT, I2C_I2STAT, I2C_Status(), itoa_16(), printf(), SIC, UARTWriteStr(), and WD_Reset().

Referenced by AD5391_ControlRegisterRead(), AD7414_5Read(), AD7997_Menu(), AD7997_ReadAnalogValue(), MStatistika(), and RamtronReadByte().

short SendSlaveAdress ( uint32_t  Addr_S  ) 

Definition at line 275 of file I2C.c.

References AA, False, I2C_I2CONCLR, I2C_I2CONSET, I2C_I2DAT, I2C_I2STAT, I2C_Status(), printf(), SI, SIC, STA, STAC, UARTWriteStr(), and WD_Reset().

Referenced by AD5382_ControlRegister(), AD5382_SetGain(), AD5382_SetOffset(), AD5382_SoftClr(), AD5382_SoftPowerDown(), AD5382_SoftPowerUp(), AD5382_SoftReset(), AD5382Write(), AD5391_ControlRegisterRead(), AD5391_ControlRegisterWrite(), AD5391_Init(), AD5391_SetGain(), AD5391_SetOffset(), AD5391_SoftClr(), AD5391_SoftPowerDown(), AD5391_SoftPowerUp(), AD5391_SoftReset(), AD5391Write(), AD7414_5Read(), AD7997_ConfigRegister(), AD7997_Menu(), AD7997_ReadAnalogValue(), AD_MAX_Init(), AD_MAX_Read(), DO_H(), DO_L(), DO_MAX_Init(), Init(), RamtronInit(), RamtronReadByte(), and RamtronWriteByte().

unsigned char WriteOnI2C ( unsigned  char  ) 

Definition at line 484 of file I2C.c.

References False, I2C_I2CONCLR, I2C_I2CONSET, I2C_I2DAT, I2C_I2STAT, I2C_Status(), printf(), UARTWriteStr(), and WD_Reset().

Referenced by AD5382_ControlRegister(), AD5382_SetGain(), AD5382_SetOffset(), AD5382_SoftClr(), AD5382_SoftPowerDown(), AD5382_SoftPowerUp(), AD5382_SoftReset(), AD5382Write(), AD5391_ControlRegisterRead(), AD5391_ControlRegisterWrite(), AD5391_SetGain(), AD5391_SetOffset(), AD5391_SoftClr(), AD5391_SoftPowerDown(), AD5391_SoftPowerUp(), AD5391_SoftReset(), AD5391Write(), AD7997_ConfigRegister(), AD7997_Menu(), AD7997_ReadAnalogValue(), AD7997_SetCycleTimeRegister(), AD_MAX_Init(), AD_MAX_Read(), DO_H(), DO_L(), DO_MAX_Init(), RamtronReadByte(), and RamtronWriteByte().


Variable Documentation

uint32_t I2CAddress

Definition at line 71 of file I2C.h.

Referenced by I2CTranserByte().

uint32_t I2CData

Definition at line 72 of file I2C.h.

Referenced by I2CTranserByte().

boolean Status_I2C

Definition at line 70 of file I2C.h.

Referenced by I2C_Initialize(), I2C_off(), and I2C_Status().


Generated on Fri Sep 21 13:41:55 2007 for example1 by  doxygen 1.4.7