Add disable() to swi2c as well
This commit is contained in:
parent
abbf2a3927
commit
47e610a2c6
|
|
@ -44,6 +44,14 @@ void swi2c_init(void)
|
||||||
SET_OUTPUT(SWI2C_SDA); //finally make the SDA line an output since the bus is idle for sure.
|
SET_OUTPUT(SWI2C_SDA); //finally make the SDA line an output since the bus is idle for sure.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void swi2c_disable(void)
|
||||||
|
{
|
||||||
|
SET_INPUT(SWI2C_SDA);
|
||||||
|
WRITE(SWI2C_SDA, 0);
|
||||||
|
SET_INPUT(SWI2C_SCL);
|
||||||
|
WRITE(SWI2C_SCL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void __delay(void)
|
static void __delay(void)
|
||||||
{
|
{
|
||||||
_delay_us(1.5);
|
_delay_us(1.5);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ extern "C" {
|
||||||
//initialize
|
//initialize
|
||||||
extern void swi2c_init(void);
|
extern void swi2c_init(void);
|
||||||
|
|
||||||
|
//deinit pins
|
||||||
|
extern void swi2c_disable(void);
|
||||||
|
|
||||||
//check device address acknowledge
|
//check device address acknowledge
|
||||||
extern uint8_t swi2c_check(uint8_t dev_addr);
|
extern uint8_t swi2c_check(uint8_t dev_addr);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue