Author | Stef Mientki, Copyright © 2005..2024, all rights reserved. |
Adapted-by | Joep Suijs, Albert Faber, Rob Jansen |
Compiler | 2.5r8 |
Hardware implementation of I2C (single) master. . Define i2c pins like: alias i2c_scl is pin_c3 -- optional alias i2c_scl_direction is pin_c3_direction alias i2c_sda is pin_c4 -- optional alias i2c_sda_direction is pin_c4_direction - -- const word _i2c_bus_speed = 1 -- 100kHz const bit _i2c_level = true -- i2c levels (not SMB)
No dependency found
const _i2c_100khz = target_clock / 100_000 / 4 - 1
const _i2c_slowest = 127
const _i2c_1mhz = target_clock / 1_000_000 / 4 - 1
const _i2c_400khz = target_clock / 400_000 / 4 - 1
const _i2c_100khz = target_clock / 100_000 / 4 - 1
No documentation found
const _i2c_slowest = 127
some constants needed for the baudrate generator
const _i2c_1mhz = target_clock / 1_000_000 / 4 - 1
No documentation found
const _i2c_400khz = target_clock / 400_000 / 4 - 1
No documentation found
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)
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)
16f1823 | 16f1823_i2c_hw_eeprom_serial.jal |
16f1825 | 16f1825_rda5807m.jal |
16f1825 | 16f1825_rtc_ds3231.jal |
16f877 | 16f877_i2c_hw_l0.jal |
16f877 | 16f877_i2c_hw_l1.jal |
16f877a | 16f877a_i2c_hw_l0.jal |
16f877a | 16f877a_rtc_pcf8563.jal |
16f877a | 16f877a_ds1307_hw.jal |
16f877a | 16f877a_i2c_hw_l1.jal |
18f14k50 | 18f14k50_i2c_hw_l1.jal |
18f14k50 | 18f14k50_i2c_hw_l0.jal |
18f2520 | 18f2520_i2c_hw_l0.jal |
18f2520 | 18f2520_i2c_hw_l1.jal |
18f2550 | 18f2550_i2c_hw_l0.jal |
18f2550 | 18f2550_i2c_hw_l1.jal |
18f25k22 | 18f25k22_i2c_hw_master_echo.jal |
18f2620 | 18f2620_i2c_hw_l0.jal |
18f2620 | 18f2620_i2c_hw_l1.jal |
18f452 | 18f452_i2c_hw_l1.jal |
18f452 | 18f452_i2c_hw_l0.jal |
18f4550 | 18f4550_i2c_hw_l1.jal |
18f4550 | 18f4550_i2c_hw_l0.jal |
18f4620 | 18f4620_i2c_hw_l0.jal |
18f4620 | 18f4620_i2c_hw_l1.jal |
18f67j50 | 18f67j50_i2c_hw_l1.jal |
18f67j50 | 18f67j50_i2c_hw_l0.jal |
18f67k22 | 18f67k22_co2_i2c.jal |