3 #include "libpropeller/i2c/i2c.h" 4 #include "libpropeller/max17048/max17048.h" 9 const int kPIN_I2C_SCL = 0;
10 const int kPIN_I2C_SDA = 1;
15 static void setUp(
void) {
17 bus->
Init(kPIN_I2C_SCL, kPIN_I2C_SDA);
22 static void tearDown(
void) {
27 static void test_GetStatus(
void) {
31 static void test_GetVersion(
void) {
32 TEST_ASSERT_EQUAL_HEX32(0x0011, sut->
GetVersion());
35 static void test_GetVoltage(
void) {
38 "Note: Must be manually checked. Fully charged should be about 4200.");
41 static void test_GetStateOfCharge(
void) {
44 "Note: Must be manually checked. Fully charged should be about 100.");
47 static void test_GetChargeRate(
void) {
50 "Note: Must be manually checked. Fully charged should be about 0.");
void Init(const int scl=28, const int sda=29, const int frequency=400000)