Sha256: 15871eb0730aed858862b2c1b2e6767b915adeeb5d0ab59b212aafbd9366ba30

Contents?: true

Size: 780 Bytes

Versions: 54

Compression:

Stored size: 780 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

54 entries across 39 versions & 1 rubygems

Version Path
ceedling-0.15.2 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.15.1 vendor/cmock/examples/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.15.1 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.15.0 vendor/cmock/examples/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.15.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.13.0 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.13.0 vendor/cmock/examples/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.13.0.rc1 examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c
ceedling-0.12.2 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.12.1 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.12.0 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.11.2 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.11.1 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.11.0 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.10.0 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.9.4 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.9.2 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.9.0 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.0.18 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c
ceedling-0.0.17 examples/temp_sensor/test/test_UsartBaudRateRegisterCalculator.c