Sha256: d145bb5327de851b9dbc6a31e318a8469aa6eb0b350b3379e53a71146b060f47

Contents?: true

Size: 411 Bytes

Versions: 54

Compression:

Stored size: 411 Bytes

Contents

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

uint8 UsartModel_CalculateBaudRateRegisterSetting(uint32 masterClock, uint32 baudRate)
{
  uint32 registerSetting = ((masterClock * 10) / (baudRate * 16));

  if ((registerSetting % 10) >= 5)
  {
    registerSetting = (registerSetting / 10) + 1;
  }
  else
  {
    registerSetting /= 10;
  }

  return (uint8)registerSetting;
}

Version data entries

54 entries across 39 versions & 1 rubygems

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