libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
spi_common_v1_frf.h
Go to the documentation of this file.
1/** @addtogroup spi_defines
2
3@author @htmlonly &copy; @endhtmlonly 2011 Fergus Noble <fergusnoble@gmail.com>
4
5*/
6/*
7 * This file is part of the libopencm3 project.
8 *
9 * Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
10 *
11 * This library is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this library. If not, see <http://www.gnu.org/licenses/>.
23 */
24
25/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA SPI.H
26The order of header inclusion is important. spi.h includes the device
27specific memorymap.h header before including this header file.*/
28
29/** @cond */
30#ifdef LIBOPENCM3_SPI_H
31/** @endcond */
32#pragma once
33
34/**@{*/
35
37
38/* --- SPI_CR2 values ------------------------------------------------------ */
39
40/* FRF: Frame format */
41/* Note: Not used in I2S mode. */
42#define SPI_CR2_FRF (1 << 4)
43#define SPI_CR2_FRF_MOTOROLA_MODE (0 << 4)
44#define SPI_CR2_FRF_TI_MODE (1 << 4)
45
46/* --- SPI_SR values ------------------------------------------------------- */
47
48/* FRE / TIFRFE: TI frame format error */
49#define SPI_SR_TIFRFE (1 << 8) //F2
50#define SPI_SR_FRE (1 << 8) //others
51
52/* --- Function prototypes ------------------------------------------------- */
53
55
56void spi_set_frf_ti(uint32_t spi);
57void spi_set_frf_motorola(uint32_t spi);
58
60
61/** @cond */
62#else
63#warning "spi_common_v1_frf.h should not be included explicitly, only via spi.h"
64#endif
65/** @endcond */
66/**@}*/
67
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void spi_set_frf_ti(uint32_t spi)
SPI Set Frame Format to TI.
void spi_set_frf_motorola(uint32_t spi)
SPI Set Frame Format to Motorola.