Files
system76-embedded-controller/src/board/arduino/uno/i2c.c
Tim Crawford e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00

13 lines
220 B
C

// SPDX-License-Identifier: GPL-3.0-only
#include <avr/io.h>
#include <board/cpu.h>
#include <board/i2c.h>
void i2c_init(uint32_t baud) {
TWAR = 0;
TWBR = (uint8_t)(((F_CPU / baud) - 16) / 2);
TWCR = 0;
}