mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-16 00:34:12 +02:00
Small code updates to the new I2C driver.
This commit is contained in:
+19
-1
@@ -23,22 +23,40 @@
|
|||||||
#include "I2CPort.h"
|
#include "I2CPort.h"
|
||||||
|
|
||||||
CI2CPort::CI2CPort(uint8_t n) :
|
CI2CPort::CI2CPort(uint8_t n) :
|
||||||
|
m_n(n),
|
||||||
m_ok(false)
|
m_ok(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CI2CPort::init()
|
bool CI2CPort::init()
|
||||||
{
|
{
|
||||||
return false;
|
switch (m_n) {
|
||||||
|
case 1U:
|
||||||
|
break;
|
||||||
|
case 2U:
|
||||||
|
break;
|
||||||
|
case 3U:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return m_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CI2CPort::writeCommand(const uint8_t* data, uint8_t length)
|
uint8_t CI2CPort::writeCommand(const uint8_t* data, uint8_t length)
|
||||||
{
|
{
|
||||||
|
if (!m_ok)
|
||||||
|
return 6U;
|
||||||
|
|
||||||
return 6U;
|
return 6U;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CI2CPort::writeData(const uint8_t* data, uint8_t length)
|
uint8_t CI2CPort::writeData(const uint8_t* data, uint8_t length)
|
||||||
{
|
{
|
||||||
|
if (!m_ok)
|
||||||
|
return 6U;
|
||||||
|
|
||||||
return 6U;
|
return 6U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ public:
|
|||||||
uint8_t writeData(const uint8_t* data, uint8_t length);
|
uint8_t writeData(const uint8_t* data, uint8_t length);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_ok;
|
uint8_t m_n;
|
||||||
|
bool m_ok;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
Submodule STM32F4XX_Lib updated: bcd346f530...18aeb6ea3a
+1
-1
Submodule STM32F7XX_Lib updated: 2d5f4236fa...6241f7c05e
Reference in New Issue
Block a user