From 7ec382c7d5dfdc868ab52501bebf02eb23a416a0 Mon Sep 17 00:00:00 2001 From: Ken Sarkies Date: Wed, 5 Dec 2012 15:36:44 +1030 Subject: STM32: Moved SPI code into the common area. Updated the documentation so that it appears in all families Also added it to the L1 area, but is untested. An addition to the memorymap allows commonality and a #ifdef added to the spi_common_all code to exclude the case of SPI3 for L1 and F0 as SPI3 doesn't exist in those. An rcc dispatch header was added to remove same code from the spi header. --- include/libopencm3/stm32/f2/spi.h | 43 ++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 23 deletions(-) (limited to 'include/libopencm3/stm32/f2/spi.h') diff --git a/include/libopencm3/stm32/f2/spi.h b/include/libopencm3/stm32/f2/spi.h index df5021c..b4d99d4 100644 --- a/include/libopencm3/stm32/f2/spi.h +++ b/include/libopencm3/stm32/f2/spi.h @@ -1,8 +1,21 @@ +/** @defgroup spi_defines SPI Defines + +@brief Defined Constants and Types for the STM32F2xx SPI + +@ingroup STM32F2xx_defines + +@version 1.0.0 + +@author @htmlonly © @endhtmlonly 2012 Ken Sarkies + +@date 5 December 2012 + +LGPL License Terms @ref lgpl_license + */ + /* * This file is part of the libopencm3 project. * - * Copyright (C) 2011 Fergus Noble - * * 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 @@ -17,27 +30,11 @@ * along with this library. If not, see . */ -#ifndef LIBOPENCM3_SPI_F2_H -#define LIBOPENCM3_SPI_F2_H +#ifndef LIBOPENCM3_SPI_H +#define LIBOPENCM3_SPI_H -#include - -/* - * This file extends the common STM32 version with definitions only - * applicable to the STM32F2 series of devices. - */ - -/* --- SPI_CR2 values ------------------------------------------------------ */ - -/* FRF: Frame format */ -/* Note: Not used in I2S mode. */ -#define SPI_CR2_FRF (1 << 4) -#define SPI_CR2_FRF_MOTOROLA_MODE (0 << 4) -#define SPI_CR2_FRF_TI_MODE (1 << 4) - -/* --- SPI_SR values ------------------------------------------------------- */ - -/* TIFRFE: TI frame format error */ -#define SPI_SR_TIFRFE (1 << 8) +#include +#include #endif + -- cgit v1.2.3 From 85308f562a05db14a89a0335016a44634de072b0 Mon Sep 17 00:00:00 2001 From: Ken Sarkies Date: Thu, 6 Dec 2012 03:32:52 +1030 Subject: Minor cleanup to use dispatch memorymap.h --- include/libopencm3/stm32/f1/dac.h | 2 +- include/libopencm3/stm32/f1/gpio.h | 2 +- include/libopencm3/stm32/f1/spi.h | 2 +- include/libopencm3/stm32/f1/usart.h | 2 +- include/libopencm3/stm32/f2/dac.h | 2 +- include/libopencm3/stm32/f2/gpio.h | 2 +- include/libopencm3/stm32/f2/spi.h | 2 +- include/libopencm3/stm32/f2/usart.h | 2 +- include/libopencm3/stm32/f4/dac.h | 2 +- include/libopencm3/stm32/f4/gpio.h | 2 +- include/libopencm3/stm32/f4/spi.h | 2 +- include/libopencm3/stm32/f4/usart.h | 2 +- include/libopencm3/stm32/l1/dac.h | 2 +- include/libopencm3/stm32/l1/spi.h | 2 +- include/libopencm3/stm32/l1/usart.h | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) (limited to 'include/libopencm3/stm32/f2/spi.h') diff --git a/include/libopencm3/stm32/f1/dac.h b/include/libopencm3/stm32/f1/dac.h index a4e07aa..1e6ecfa 100644 --- a/include/libopencm3/stm32/f1/dac.h +++ b/include/libopencm3/stm32/f1/dac.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_DAC_H #define LIBOPENCM3_DAC_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f1/gpio.h b/include/libopencm3/stm32/f1/gpio.h index 7fb93c1..580c501 100644 --- a/include/libopencm3/stm32/f1/gpio.h +++ b/include/libopencm3/stm32/f1/gpio.h @@ -40,7 +40,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_GPIO_H #define LIBOPENCM3_GPIO_H -#include +#include #include /* --- Convenience macros -------------------------------------------------- */ diff --git a/include/libopencm3/stm32/f1/spi.h b/include/libopencm3/stm32/f1/spi.h index 81cdddd..eb434a1 100644 --- a/include/libopencm3/stm32/f1/spi.h +++ b/include/libopencm3/stm32/f1/spi.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_SPI_H #define LIBOPENCM3_SPI_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f1/usart.h b/include/libopencm3/stm32/f1/usart.h index ba6762d..24a8137 100644 --- a/include/libopencm3/stm32/f1/usart.h +++ b/include/libopencm3/stm32/f1/usart.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_USART_H #define LIBOPENCM3_USART_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f2/dac.h b/include/libopencm3/stm32/f2/dac.h index 87bd456..f6e16e7 100644 --- a/include/libopencm3/stm32/f2/dac.h +++ b/include/libopencm3/stm32/f2/dac.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_DAC_H #define LIBOPENCM3_DAC_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f2/gpio.h b/include/libopencm3/stm32/f2/gpio.h index 3ff2ba6..099fb38 100644 --- a/include/libopencm3/stm32/f2/gpio.h +++ b/include/libopencm3/stm32/f2/gpio.h @@ -35,7 +35,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_GPIO_H #define LIBOPENCM3_GPIO_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f2/spi.h b/include/libopencm3/stm32/f2/spi.h index b4d99d4..c1a5f45 100644 --- a/include/libopencm3/stm32/f2/spi.h +++ b/include/libopencm3/stm32/f2/spi.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_SPI_H #define LIBOPENCM3_SPI_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f2/usart.h b/include/libopencm3/stm32/f2/usart.h index 135b493..31314bc 100644 --- a/include/libopencm3/stm32/f2/usart.h +++ b/include/libopencm3/stm32/f2/usart.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_USART_H #define LIBOPENCM3_USART_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f4/dac.h b/include/libopencm3/stm32/f4/dac.h index 4c6b43f..0961c30 100644 --- a/include/libopencm3/stm32/f4/dac.h +++ b/include/libopencm3/stm32/f4/dac.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_DAC_H #define LIBOPENCM3_DAC_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f4/gpio.h b/include/libopencm3/stm32/f4/gpio.h index 9e0685f..4eedc6e 100644 --- a/include/libopencm3/stm32/f4/gpio.h +++ b/include/libopencm3/stm32/f4/gpio.h @@ -35,7 +35,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_GPIO_H #define LIBOPENCM3_GPIO_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f4/spi.h b/include/libopencm3/stm32/f4/spi.h index e4b0cd0..6589290 100644 --- a/include/libopencm3/stm32/f4/spi.h +++ b/include/libopencm3/stm32/f4/spi.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_SPI_H #define LIBOPENCM3_SPI_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/f4/usart.h b/include/libopencm3/stm32/f4/usart.h index 461db50..740f0a8 100644 --- a/include/libopencm3/stm32/f4/usart.h +++ b/include/libopencm3/stm32/f4/usart.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_USART_H #define LIBOPENCM3_USART_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/l1/dac.h b/include/libopencm3/stm32/l1/dac.h index 9ec57ea..7f7ea52 100644 --- a/include/libopencm3/stm32/l1/dac.h +++ b/include/libopencm3/stm32/l1/dac.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_DAC_H #define LIBOPENCM3_DAC_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/l1/spi.h b/include/libopencm3/stm32/l1/spi.h index 97cfaa7..0484956 100644 --- a/include/libopencm3/stm32/l1/spi.h +++ b/include/libopencm3/stm32/l1/spi.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_SPI_H #define LIBOPENCM3_SPI_H -#include +#include #include #endif diff --git a/include/libopencm3/stm32/l1/usart.h b/include/libopencm3/stm32/l1/usart.h index e6124ad..5b67a5a 100644 --- a/include/libopencm3/stm32/l1/usart.h +++ b/include/libopencm3/stm32/l1/usart.h @@ -33,7 +33,7 @@ LGPL License Terms @ref lgpl_license #ifndef LIBOPENCM3_USART_H #define LIBOPENCM3_USART_H -#include +#include #include #endif -- cgit v1.2.3