Commit cad7d202 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

i2c: add function for probing if given device is connected to the bus

parent a0dd57c4
......@@ -98,6 +98,16 @@ void mi2c_init(uint8_t i2cif)
M_SDA_OUT(i2cif, 1);
uint8_t mi2c_devprobe(uint8_t i2cif, uint8_t i2c_addr)
uint8_t ret;
ret = !mi2c_put_byte(i2cif, i2c_addr<<1);
return ret;
//void mi2c_scan(uint8_t i2cif)
// int i;
......@@ -2,6 +2,7 @@
#define __I2C_H
uint8_t mi2c_devprobe(uint8_t i2cif, uint8_t i2c_addr);
void mi2c_init(uint8_t i2cif);
void mi2c_start(uint8_t i2cif);
void mi2c_repeat_start(uint8_t i2cif);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment