dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_spislave.h
Go to the documentation of this file.
1 
17 /*
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful, but
24  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26  * for more details.
27  *
28  * You should have received a copy of the GNU General Public License along
29  * with this program; if not, see <http://www.gnu.org/licenses/>
30  */
31 
32 #ifndef PIOS_SPISLAVE_PRIV_H
33 #define PIOS_SPISLAVE_PRIV_H
34 
35 #include <pios.h>
36 #include <pios_stm32.h>
37 #include "pios_semaphore.h"
38 
39 typedef struct pios_spislave_dev * spislave_t;
40 
42  SPI_TypeDef *regs;
43  uint32_t remap; /* GPIO_Remap_* or GPIO_AF_* */
44  SPI_InitTypeDef init;
45  struct stm32_gpio sclk, miso, mosi, ssel;
46 
47  struct stm32_dma_chan rx_dma, tx_dma;
48 
49  uint8_t max_rx_len;
50 
51  void (*process_message)(void *ctx, int len, int *resp_len);
52 
53  void *ctx;
54 };
55 
56 int32_t PIOS_SPISLAVE_Init(spislave_t *spislave_id,
57  const struct pios_spislave_cfg *cfg,
58  int initial_tx_size);
59 int32_t PIOS_SPISLAVE_PollSS(spislave_t spislave_dev);
60 
61 #endif /* PIOS_SPISLAVE_PRIV_H */
62 
Types that are specific to the STM32 peripherals.
int32_t PIOS_SPISLAVE_Init(spislave_t *spislave_id, const struct pios_spislave_cfg *cfg, int initial_tx_size)
int32_t PIOS_SPISLAVE_PollSS(spislave_t spislave_dev)
Main PiOS header to include all the compiled in PiOS options.
struct stm32_dma_chan rx_dma tx_dma
Definition: pios_spislave.h:47
SPI_InitTypeDef init
Definition: pios_spislave.h:44
void(* process_message)(void *ctx, int len, int *resp_len)
Definition: pios_spislave.h:51
struct stm32_gpio sclk miso mosi ssel
Definition: pios_spislave.h:45
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49
struct pios_spislave_dev * spislave_t
Definition: pios_spislave.h:39
SPI_TypeDef * regs
Definition: pios_spislave.h:42