dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_spi_priv.h
Go to the documentation of this file.
1 
16 /*
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful, but
23  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25  * for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with this program; if not, see <http://www.gnu.org/licenses/>
29  */
30 
31 #ifndef PIOS_SPI_PRIV_H
32 #define PIOS_SPI_PRIV_H
33 
34 #include <pios.h>
35 #include <pios_stm32.h>
36 #include "pios_semaphore.h"
37 
38 struct pios_spi_dev {
39  const struct pios_spi_cfg *cfg;
41 };
42 
43 struct pios_spi_cfg {
44  SPI_TypeDef *regs;
45  uint32_t remap; /* GPIO_Remap_* or GPIO_AF_* */
46  SPI_InitTypeDef init;
47  struct stm32_gpio sclk;
48  struct stm32_gpio miso;
49  struct stm32_gpio mosi;
50  uint32_t slave_count;
51 #ifdef PIOS_INCLUDE_VIDEO
52  // XXX Hack: pios_video uses pios_spi's config structure and expects the
53  // DMA information to be filled in properly
54  struct stm32_dma dma;
55 #endif
56  struct stm32_gpio ssel[];
57 };
58 
59 #endif /* PIOS_SPI_PRIV_H */
60 
struct stm32_gpio mosi
Definition: pios_spi_priv.h:49
Types that are specific to the STM32 peripherals.
Main PiOS header to include all the compiled in PiOS options.
struct stm32_gpio ssel[]
Definition: pios_spi_priv.h:56
SPI_TypeDef * regs
Definition: pios_spi_priv.h:44
const struct pios_spi_cfg * cfg
Definition: pios_spi_priv.h:39
uint32_t slave_count
Definition: pios_spi_priv.h:50
struct stm32_gpio sclk
Definition: pios_spi_priv.h:47
uint32_t remap
Definition: pios_spi_priv.h:45
struct stm32_gpio miso
Definition: pios_spi_priv.h:48
SPI_InitTypeDef init
Definition: pios_spi_priv.h:46
struct pios_semaphore * busy
Definition: pios_spi_priv.h:40