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.29.1 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.29.1 vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.29.0 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.29.0 vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.19.0 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.18.0 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.18.0 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.17.0 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.17.0 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.16.0 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.16.0 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.6 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.6 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.5 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.5 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.4 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.4 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.3 examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.3 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c
ceedling-0.15.2 vendor/cmock/examples/src/UsartBaudRateRegisterCalculator.c