Sha256: 729c0d4162bd09ac4514e2de1f70e1b0b4fb05ee125dcfb91314aa40986e8235

Contents?: true

Size: 759 Bytes

Versions: 27

Compression:

Stored size: 759 Bytes

Contents

#include "unity.h"
#include "Types.h"
#include "UsartBaudRateRegisterCalculator.h"

void setUp(void)
{
}

void tearDown(void)
{
}

void testCalculateBaudRateRegisterSettingShouldCalculateRegisterSettingAppropriately(void)
{
  // BaudRate = MCK / (CD x 16) - per datasheet section 30.6.1.2 "Baud Rate Calculation Example"
  TEST_ASSERT_EQUAL(26, UsartModel_CalculateBaudRateRegisterSetting(48000000, 115200));
  TEST_ASSERT_EQUAL(6,  UsartModel_CalculateBaudRateRegisterSetting(3686400,  38400));
  TEST_ASSERT_EQUAL(23, UsartModel_CalculateBaudRateRegisterSetting(14318180, 38400));
  TEST_ASSERT_EQUAL(20, UsartModel_CalculateBaudRateRegisterSetting(12000000, 38400));
  TEST_ASSERT_EQUAL(13, UsartModel_CalculateBaudRateRegisterSetting(12000000, 56800));
}

Version data entries

27 entries across 14 versions & 1 rubygems

Version Path
ceedling-0.31.1 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.31.1 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.31.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.31.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.30.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.30.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.3 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.3 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.2 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.2 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.1 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.28.1 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.27.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.27.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.25.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.25.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.24.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.24.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.22.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.22.0 vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c