From 729f2a2c3ebfb2612d873caf453a1d7ca02180d9 Mon Sep 17 00:00:00 2001 From: dmlunar Date: Wed, 22 Jan 2025 16:47:21 +0200 Subject: varpa: initial public commit --- firmware/inc/peripheral/twi.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 firmware/inc/peripheral/twi.h (limited to 'firmware/inc/peripheral/twi.h') diff --git a/firmware/inc/peripheral/twi.h b/firmware/inc/peripheral/twi.h new file mode 100644 index 0000000..8f08777 --- /dev/null +++ b/firmware/inc/peripheral/twi.h @@ -0,0 +1,35 @@ +/** + * + * Author: Dylan Muller + * Copyright (c) 2025 + * All rights reserved. + * + * - Commercial/IP use prohibited. + * - Attribution required. + * See License.txt + * + */ + +#ifndef TWI_H_ +#define TWI_H_ + +#include +#include +#include + +#define TWI_ADDRESS_W(x) (((x) << 1) & ~0x01) +#define TWI_ADDRESS_R(x) (((x) << 1) | 0x01) + +void twi_init(void); + +bool twi_busy(void); + +void twi_flush(void); + +void twi_start( + uint8_t address, + uint8_t *data, + size_t len +); + +#endif -- cgit v1.2.3-70-g09d2