# i2c_level1

i2c_hardware

Author | Joep Suijs, Copyright © 2008 Joep Suijs
Adapted-by |
Compiler | >=2.4g

Description

    Level1 implementation of I2C (single) master.

Dependencies

No dependency found

## Summary

### Global variables/contants

### Procedures

### Functions

- `i2c_receive_byteaddr(byte in i2c_address, byte in addr, byte in i2c_rx_count) return bit`
- `i2c_send_receive(byte in i2c_address, byte in i2c_tx_count, byte in i2c_rx_count) return bit`
- `i2c_receive_wordaddr(byte in i2c_address, word in addr, byte in i2c_rx_count) return bit`

## API details

### Global variables/contants

### Procedures

### Functions

- `i2c_receive_byteaddr(byte in i2c_address, byte in addr, byte in i2c_rx_count) return bit`

      i2c_receive_byteaddr - send a byte address and receive a string from an i2c slave

- `i2c_send_receive(byte in i2c_address, byte in i2c_tx_count, byte in i2c_rx_count) return bit`

      i2c_send_receive - send a string to an i2c slave and receive bytes back

      This funtion uses two global i2c buffers, one for transmit (tx) and one for
      receive (rx). The address of the slave (higher 7 bits), number of bytes to
      transmit and number of bytes to receive are parameters.
      returns true if all went well.

- `i2c_receive_wordaddr(byte in i2c_address, word in addr, byte in i2c_rx_count) return bit`

      i2c_receive_wordaddr - send a word address and receive a string from an i2c slave

## Related samples

Here are the list of samples which use this library:

16f648a | 16f648a_i2c_sw_master_echo.jal
16f648a | 16f648a_i2c_sw_master_check_bus.jal
16f648a | 16f648a_i2c_sw_l1.jal
16f723 | 16f723_i2c_sw_master_echo.jal
16f723 | 16f723_i2c_sw_master_check_bus.jal
16f723 | 16f723_i2c_sw_l1.jal
16f73 | 16f73_i2c_sw_master_check_bus.jal
16f73 | 16f73_i2c_sw_master_echo.jal
16f73 | 16f73_i2c_sw_l1.jal
16f877 | 16f877_i2c_sw_l1.jal
16f877 | 16f877_i2c_sw_master_echo.jal
16f877 | 16f877_i2c_sw_master_check_bus.jal
16f877 | 16f877_i2c_hw_l1.jal
16f877a | 16f877a_i2c_sw_l1.jal
16f877a | 16f877a_i2c_sw_master_check_bus.jal
16f877a | 16f877a_i2c_hw_l1.jal
16f877a | 16f877a_i2c_sw_master_echo.jal
16f88 | 16f88_i2c_sw_master_check_bus.jal
16f88 | 16f88_i2c_sw_l1.jal
16f88 | 16f88_i2c_sw_master_echo.jal
18f14k50 | 18f14k50_i2c_hw_l1.jal
18f14k50 | 18f14k50_i2c_sw_master_echo.jal
18f14k50 | 18f14k50_i2c_sw_master_check_bus.jal
18f14k50 | 18f14k50_i2c_sw_l1.jal
18f2450 | 18f2450_i2c_sw_l1.jal
18f2450 | 18f2450_i2c_sw_master_check_bus.jal
18f2450 | 18f2450_i2c_sw_master_echo.jal
18f2520 | 18f2520_i2c_sw_master_check_bus.jal
18f2520 | 18f2520_i2c_sw_master_echo.jal
18f2520 | 18f2520_i2c_sw_l1.jal
18f2520 | 18f2520_i2c_hw_l1.jal
18f2550 | 18f2550_i2c_sw_master_check_bus.jal
18f2550 | 18f2550_i2c_sw_master_echo.jal
18f2550 | 18f2550_i2c_hw_l1.jal
18f2550 | 18f2550_i2c_sw_l1.jal
18f25k22 | 18f25k22_i2c_hw_master_echo.jal
18f2620 | 18f2620_i2c_sw_master_check_bus.jal
18f2620 | 18f2620_i2c_sw_master_echo.jal
18f2620 | 18f2620_i2c_sw_l1.jal
18f2620 | 18f2620_i2c_hw_l1.jal
18f452 | 18f452_i2c_hw_l1.jal
18f452 | 18f452_i2c_sw_master_echo.jal
18f452 | 18f452_i2c_sw_master_check_bus.jal
18f452 | 18f452_i2c_sw_l1.jal
18f4550 | 18f4550_i2c_sw_master_check_bus.jal
18f4550 | 18f4550_i2c_sw_master_echo.jal
18f4550 | 18f4550_i2c_hw_l1.jal
18f4550 | 18f4550_i2c_sw_l1.jal
18f4620 | 18f4620_i2c_sw_master_echo.jal
18f4620 | 18f4620_i2c_sw_l1.jal
18f4620 | 18f4620_i2c_hw_l1.jal
18f4620 | 18f4620_i2c_sw_master_check_bus.jal
18f67j50 | 18f67j50_i2c_sw_master_check_bus.jal
18f67j50 | 18f67j50_i2c_hw_l1.jal
18f67j50 | 18f67j50_i2c_sw_master_echo.jal
18f67j50 | 18f67j50_i2c_sw_l1.jal