Author | Stef Mientki, Copyright (C) 2005 Stef Mientki |
Adapted-by | Joep Suijs. |
Compiler | >=2.4g |
Hardware implementation of I2C (single) master.
No dependency found
const _i2c_1mhz = (target_clock / (4 * 1000_000)) - 1
const _i2c_100khz = (target_clock / (4 * 100_000)) - 1
const _i2c_400khz = (target_clock / (4 * 400_000)) - 1
const _i2c_1mhz = (target_clock / (4 * 1000_000)) - 1
No documentation found
const _i2c_100khz = (target_clock / (4 * 100_000)) - 1
some constants needed for the baudrate generator
const _i2c_400khz = (target_clock / (4 * 400_000)) - 1
No documentation found
i2c_restart()
i2c_restart - Sends Restart bit and waits untill finished
i2c_initialize()
if the device has changed, change the speed if necessary
i2c_stop()
i2c_stop - Sends Stop bit and waits until finished
i2c_start()
i2c_start - Sends Start bit and waits untill finished
i2c_receive_byte(bit in ACK ) return byte
i2c_receive_byte - start receiving of a byte and waits till finished 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 -
sample | 16f877a_i2c_hw_l1.jal |