dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_stm32.h
Go to the documentation of this file.
1 
15 /*
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  * for more details.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  */
29 
30 #ifndef PIOS_STM32_H
31 #define PIOS_STM32_H
32 
33 struct stm32_irq {
34  void (*handler) (uint32_t);
35  uint32_t flags;
36  NVIC_InitTypeDef init;
37 };
38 
39 struct stm32_exti {
40  EXTI_InitTypeDef init;
41 };
42 
44 #if defined(STM32F2XX) || defined(STM32F4XX)
45  DMA_Stream_TypeDef *channel;
46 #else
47  DMA_Channel_TypeDef *channel;
48 #endif
49  DMA_InitTypeDef init;
50 };
51 
52 struct stm32_dma {
53  uint32_t ahb_clk; /* ignored on STM32F2XX */
54  struct stm32_irq irq;
57 };
58 
59 struct stm32_gpio {
60  GPIO_TypeDef *gpio;
61  GPIO_InitTypeDef init;
62  uint8_t pin_source;
63 };
64 
65 #if defined(STM32F40_41xxx) || defined(STM32F446xx) /* F4 */
66 #define PIOS_PERIPHERAL_APB1_COUNTER_CLOCK (PIOS_PERIPHERAL_APB1_CLOCK * 2)
67 #define PIOS_PERIPHERAL_APB2_COUNTER_CLOCK (PIOS_PERIPHERAL_APB2_CLOCK * 2)
68 #endif
69 
75 #endif /* PIOS_STM32_H */
GPIO_InitTypeDef init
Definition: pios_stm32.h:61
GPIO_TypeDef * gpio
Definition: pios_stm32.h:60
struct stm32_irq irq
Definition: pios_stm32.h:54
EXTI_InitTypeDef init
Definition: pios_stm32.h:40
DMA_InitTypeDef init
Definition: pios_stm32.h:49
NVIC_InitTypeDef init
Definition: pios_stm32.h:36
uint8_t pin_source
Definition: pios_stm32.h:62
DMA_Channel_TypeDef * channel
Definition: pios_stm32.h:47
uint32_t flags
Definition: pios_stm32.h:35
void(* handler)(uint32_t)
Definition: pios_stm32.h:34
uint32_t ahb_clk
Definition: pios_stm32.h:53
struct stm32_dma_chan tx
Definition: pios_stm32.h:56
struct stm32_dma_chan rx
Definition: pios_stm32.h:55