From 5a349d3ab6762e19ece874551fa2a6cbfdc485c3 Mon Sep 17 00:00:00 2001 From: Guillaume Revaillot Date: Mon, 21 Jan 2019 15:36:56 +0100 Subject: [PATCH] stm32g0: add i2c. Regular i2c peripheral. Partially tested as i had no i2c slave on hand, but i can see i2c on my scope.. --- include/libopencm3/stm32/g0/i2c.h | 34 +++++++++++++++++++++++++++++++ include/libopencm3/stm32/i2c.h | 2 ++ lib/stm32/g0/Makefile | 1 + 3 files changed, 37 insertions(+) create mode 100644 include/libopencm3/stm32/g0/i2c.h diff --git a/include/libopencm3/stm32/g0/i2c.h b/include/libopencm3/stm32/g0/i2c.h new file mode 100644 index 00000000..d91cc779 --- /dev/null +++ b/include/libopencm3/stm32/g0/i2c.h @@ -0,0 +1,34 @@ +/** @defgroup i2c_defines I2C Defines + * + * @ingroup STM32G0xx_defines + * + * @brief Defined Constants and Types for the STM32G0xx I2C + * + * @version 1.0.0 + * + * LGPL License Terms @ref lgpl_license + * */ +/* + * This file is part of the libopencm3 project. + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library. If not, see . + */ + +#ifndef LIBOPENCM3_I2C_H +#define LIBOPENCM3_I2C_H + +#include + +#endif + diff --git a/include/libopencm3/stm32/i2c.h b/include/libopencm3/stm32/i2c.h index 112ece2c..880ca49e 100644 --- a/include/libopencm3/stm32/i2c.h +++ b/include/libopencm3/stm32/i2c.h @@ -38,6 +38,8 @@ # include #elif defined(STM32L4) # include +#elif defined(STM32G0) +# include #else # error "stm32 family not defined." #endif diff --git a/lib/stm32/g0/Makefile b/lib/stm32/g0/Makefile index d7964259..db3b8912 100644 --- a/lib/stm32/g0/Makefile +++ b/lib/stm32/g0/Makefile @@ -42,6 +42,7 @@ OBJS += rcc.o rcc_common_all.o OBJS += iwdg_common_all.o OBJS += usart_common_all.o usart_common_v2.o OBJS += spi_common_all.o spi_common_v1_frf.o +OBJS += i2c_common_v2.o VPATH +=../:../../cm3:../common