i2c_hardware

i2c_hardware

Author Stef Mientki, Copyright © 2005..2024, all rights reserved.
Adapted-by Joep Suijs, Albert Faber, Rob Jansen
Compiler 2.5r8

Description

Hardware implementation of I2C (single) master.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • i2c_restart()

    i2c_restart - Sends Restart bit and waits until finished or timeout (if defined)
    
    

  • i2c_initialize()

    if the device has changed, change the speed if necessary
    
    

  • i2c_stop()

    i2c_stop - Sends Stop bit and waits until finished or timeout (if defined)
    
    

  • i2c_start()

    i2c_start - Sends Start bit and waits until finished or timeout (if defined)
    
    

Functions

  • i2c_receive_byte(bit in ACK ) return byte

    i2c_receive_byte -
    
    start receiving of a byte and waits till finished or timeout (if defined)
    if param ACK is true, the byte is acknowledged and next bytes can be received.
    if param ACK is false, the byte is nacked and a stop *should be* sent.
    note: this behavior is inverted from the line level and orignal library, but
    consistent with the i2c_software library.
    
    

  • i2c_transmit_byte(byte in data) return bit

    i2c_transmit_byte. Returns TRUE when OK and FALSE in case of an error or  
    when a timeout occurs (if defined)
    
    
    


Related samples

Here are the list of samples which use this library:

16f182316f1823_i2c_hw_eeprom_serial.jal
16f182516f1825_as5600l.jal
16f182516f1825_mcp23008.jal
16f182516f1825_rda5807m.jal
16f182516f1825_bmp180.jal
16f182516f1825_rtc_ds3231.jal
16f87716f877_i2c_hw_l0.jal
16f87716f877_i2c_hw_l1.jal
16f877a16f877a_i2c_hw_l0.jal
16f877a16f877a_rtc_pcf8563.jal
16f877a16f877a_ds1307_hw.jal
16f877a16f877a_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f252018f2520_i2c_hw_l0.jal
18f252018f2520_i2c_hw_l1.jal
18f255018f2550_i2c_hw_l0.jal
18f255018f2550_i2c_hw_l1.jal
18f25k2218f25k22_i2c_hw_master_echo.jal
18f262018f2620_i2c_hw_l0.jal
18f262018f2620_i2c_hw_l1.jal
18f45218f452_i2c_hw_l1.jal
18f45218f452_i2c_hw_l0.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal
18f462018f4620_i2c_hw_l0.jal
18f462018f4620_i2c_hw_l1.jal
18f67j5018f67j50_i2c_hw_l1.jal
18f67j5018f67j50_i2c_hw_l0.jal
18f67k2218f67k22_co2_i2c.jal