You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
702 B
41 lines
702 B
5 months ago
|
#include "ssd1306_i2c.h"
|
||
|
#include "app_gpio_i2c.h"
|
||
|
|
||
|
int8_t TWI_MT_Start (void)
|
||
|
{
|
||
|
App_Gpio_I2C_Start();
|
||
|
return SUCCESS;
|
||
|
}
|
||
|
|
||
|
int8_t TWI_MT_Send_SLAW (uint8_t address)
|
||
|
{
|
||
|
bool bRet;
|
||
|
bRet = App_Gpio_I2C_WriteData(address << 1);
|
||
|
if(bRet == false)
|
||
|
return FAIL;
|
||
|
return SUCCESS;
|
||
|
}
|
||
|
|
||
|
int8_t TWI_MT_Send_Data (uint8_t data)
|
||
|
{
|
||
|
bool bRet;
|
||
|
bRet = App_Gpio_I2C_WriteData(data);
|
||
|
if(bRet == false)
|
||
|
return FAIL;
|
||
|
return SUCCESS;
|
||
|
}
|
||
|
|
||
|
int8_t TWI_MR_Send_SLAR (uint8_t address)
|
||
|
{
|
||
|
bool bRet;
|
||
|
bRet = App_Gpio_I2C_WriteData(((address << 1) | 0x01));
|
||
|
if(bRet == false)
|
||
|
return FAIL;
|
||
|
return SUCCESS;
|
||
|
}
|
||
|
|
||
|
void TWI_Stop (void)
|
||
|
{
|
||
|
App_Gpio_I2C_Stop();
|
||
|
}
|