i2c.c File Reference

#include "i2c.h"
#include "pic_serial.h"
Include dependency graph for i2c.c:

Go to the source code of this file.

Defines

#define DELAY_AMOUNT   10

Functions

void i2c_ack_polling (uns8 device_address)
uns8 i2c_read_eeprom (uns8 device_address, uns8 mem_address)
 Read an 8 bit byte over I2C buss.
uns16 i2c_read_eeprom_16bit (uns8 device_address, uns8 mem_address)
 Read 16 bits of data over I2C buss.
uns8 i2c_receive_byte (void)
 Receive byte from I2C buss.
void i2c_send_ack (void)
 Send an ACK.
void i2c_send_byte (uns8 data)
 Send a byte to I2C buss.
void i2c_setup_io ()
 Setup ports and pins for I2C communication.
void i2c_start (void)
 Send start signal to I2C buss.
void i2c_stop (void)
 Send stop signal to I2C buss.
void i2c_write_eeprom (uns8 device_address, uns8 mem_address, uns8 data)
 Write an 8 bit byte ove I2C buss.
void i2c_write_eeprom_16bit (uns8 device_address, uns8 mem_address, uns16 data)
 Write a 16 bit value over I2C buss.

Define Documentation

#define DELAY_AMOUNT   10

Function Documentation

void i2c_ack_polling ( uns8  device_address  ) 

Definition at line 41 of file i2c.c.

References i2c_send_byte(), i2c_start(), i2c_stop(), and test_pin.

Here is the call graph for this function:

uns8 i2c_read_eeprom ( uns8  device_address,
uns8  mem_address 
)

Read an 8 bit byte from the specified device at the memory address

Definition at line 76 of file i2c.c.

References clear_pin, DELAY_AMOUNT, i2c_receive_byte(), i2c_send_byte(), i2c_start(), i2c_stop(), i2c_write_sda, set_pin, and uns8.

Referenced by ds1631_get_config(), lm75_get_config(), rtc_get_config(), rtc_get_date(), rtc_get_day(), rtc_get_dow(), rtc_get_hours(), rtc_get_minutes(), rtc_get_month(), rtc_get_register(), rtc_get_seconds(), rtc_get_year(), rtc_set_hours(), rtc_set_seconds(), rtc_start_clock(), and rtc_stop_clock().

Here is the call graph for this function:

Here is the caller graph for this function:

uns16 i2c_read_eeprom_16bit ( uns8  device_address,
uns8  mem_address 
)

Read a 16 bit chunk of data from the given device and memory address

Definition at line 103 of file i2c.c.

References clear_pin, DELAY_AMOUNT, i2c_receive_byte(), i2c_send_byte(), i2c_start(), i2c_stop(), i2c_write_sda, set_pin, and uns16.

Referenced by ar1000_read_register(), ar1000_seek(), ar1000_seek_more(), ar1000_test(), ar1000_tune(), ds1631_get_temp(), and lm75_get_temp().

Here is the call graph for this function:

Here is the caller graph for this function:

uns8 i2c_receive_byte (  ) 

Clock in a byte over I2C lines. Note that an acknowledge is not sent/received

Definition at line 186 of file i2c.c.

References clear_pin, DELAY_AMOUNT, i2c_read_sda, set_pin, test_pin, and uns8.

Referenced by hmc6352_get_data(), hmc6352_read_eeprom(), hmc6352_read_ram(), i2c_read_eeprom(), i2c_read_eeprom_16bit(), tmp75_read(), and tmp75_read_16bit().

Here is the caller graph for this function:

void i2c_send_ack ( void   ) 

Sends an I2C acknowledge (bit)

Definition at line 140 of file i2c.c.

References clear_pin, DELAY_AMOUNT, i2c_write_sda, and set_pin.

Referenced by hmc6352_get_data(), hmc6352_read_eeprom(), hmc6352_read_ram(), and tmp75_read_16bit().

Here is the caller graph for this function:

void i2c_send_byte ( uns8  data  ) 
void i2c_setup_io (  ) 

Setup ports and pins for i2c output.

Set port and pins correctly for I2C communication

Definition at line 231 of file i2c.c.

References make_input, and make_output.

Referenced by hmc6352_setup_io(), and rtc_setup_io().

Here is the caller graph for this function:

void i2c_start ( void   ) 
void i2c_stop ( void   ) 
void i2c_write_eeprom ( uns8  device_address,
uns8  mem_address,
uns8  data 
)

Write a byte to a given device address at the memory address

Definition at line 51 of file i2c.c.

References i2c_send_byte(), i2c_start(), and i2c_stop().

Referenced by ds1631_set_config(), lm75_set_config(), rtc_set_config(), rtc_set_date(), rtc_set_day(), rtc_set_hours(), rtc_set_minutes(), rtc_set_month(), rtc_set_register(), rtc_set_seconds(), rtc_set_year(), rtc_start_clock(), and rtc_stop_clock().

Here is the call graph for this function:

Here is the caller graph for this function:

void i2c_write_eeprom_16bit ( uns8  device_address,
uns8  mem_address,
uns16  data 
)

Write a byte to a given device address at the memory address

Definition at line 63 of file i2c.c.

References i2c_send_byte(), i2c_start(), and i2c_stop().

Referenced by ar1000_init(), ar1000_seek(), ar1000_test(), ar1000_tune(), and ar1000_write_register().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Dec 8 13:47:14 2010 for Pic Pack by  doxygen 1.6.1