/**
 * @file test_i2c.cpp
 * @brief Unit tests for I2C wrapper component
 * @author Mahmoud Elmohtady
 * @company Nabd solutions - ASF
 * @copyright Copyright (c) 2025
 */

#include "unity.h"
#include "i2c.hpp"

extern "C" {

void setUp(void)
{
}

void tearDown(void)
{
}

/**
 * @brief Test I2C initialization
 */
void test_i2c_initialize(void)
{
    I2c i2c;
    I2cConfig config = {21, 22, 100000};
    bool result = i2c.initialize(I2cPort::PORT_0, config);
    TEST_ASSERT_TRUE(result);
}

/**
 * @brief Test I2C deinitialize
 */
void test_i2c_deinitialize(void)
{
    I2c i2c;
    I2cConfig config = {21, 22, 100000};
    i2c.initialize(I2cPort::PORT_0, config);
    
    bool result = i2c.deinitialize(I2cPort::PORT_0);
    TEST_ASSERT_TRUE(result);
}

} // extern "C"

