Author | Sebastien Lelong, Copyright © 2008-2009, all rights reserved. |
Adapted-by | Joep Suijs, Albert Faber |
Compiler | >=2.4i |
Common and useful functions and procedure to implement an I2C slave
No dependency found
var byte tmpstat ; this contains the last sspstat value, on which the user functions are
No documentation found
i2c_hw_slave_init(byte in height_bits_icaddress)
setup an i2c slave, with low address (not high addresses coded with 10-bits) The passed address must be 8-bits long: it's a 7-bits address + the 8th R/W bit A global "i2c_enable_start_stop_interrupts" constant can be defined to so interrupts are generated on Start/Stop signals. /!\ careful: calling this procedure will enable interrupts (global, peripherals and i2c)
i2c_hw_slave_write_i2c(byte in what)
write a byte to i2c bus
i2c_hw_slave_read_i2c() return byte
read a byte from i2c buffer and returns it