ARMEBS4  revision-26.06.2015
bsp_envirobot_sc.c
1 /************************************************************************//**
2  * \file bsp.h
3  * \brief BSP for Envirobot Sensor Control
4  * \author marc dot pignat at hevs dot ch
5  ***************************************************************************/
6 
7 #if defined (BOARD_ENVIROBOT_SC)
8 #include "heivs/bsp.h"
9 
10 #include "stm32/stm32f4xx_fsmc.h"
11 #include "stm32/stm32f4xx_rcc.h"
12 #include "heivs/ram_test.h"
13 #include "heivs/time.h"
14 #include "heivs/delay.h"
15 #include "heivs/retarget.h"
16 
17 /**
18  * Pins used by the FSCM (SDRAM)
19  */
20 static const struct gpio_t fscm_pins[] =
21 {
22  // Addresses
23  GPIO_FSMC_A0_PF0,
24  GPIO_FSMC_A1_PF1,
25  GPIO_FSMC_A2_PF2,
26  GPIO_FSMC_A3_PF3,
27  GPIO_FSMC_A4_PF4,
28  GPIO_FSMC_A5_PF5,
29  GPIO_FSMC_A6_PF12,
30  GPIO_FSMC_A7_PF13,
31  GPIO_FSMC_A8_PF14,
32  GPIO_FSMC_A9_PF15,
33  GPIO_FSMC_A10_PG0,
34  GPIO_FSMC_A11_PG1,
35 
36  // Datas
37  GPIO_FSMC_D0_PD14,
38  GPIO_FSMC_D1_PD15,
39  GPIO_FSMC_D2_PD0,
40  GPIO_FSMC_D3_PD1,
41  GPIO_FSMC_D4_PE7,
42  GPIO_FSMC_D5_PE8,
43  GPIO_FSMC_D6_PE9,
44  GPIO_FSMC_D7_PE10,
45  GPIO_FSMC_D8_PE11,
46  GPIO_FSMC_D9_PE12,
47  GPIO_FSMC_D10_PE13,
48  GPIO_FSMC_D11_PE14,
49  GPIO_FSMC_D12_PE15,
50  GPIO_FSMC_D13_PD8,
51  GPIO_FSMC_D14_PD9,
52  GPIO_FSMC_D15_PD10,
53 
54  // Control
55 
56  // SDNWE
58 
59  // BA0-BA1
62 
63  // SDCLK
65 
66  // SDNCAS
68 
69  // SDNRAS
71 
72  // SDCKE1
74 
75  // SDNE1
77 
78  GPIO_FSMC_BLN1_PE1,
79  GPIO_FSMC_NBL0_PE0,
80 };
81 
82 /**
83  * @brief Flexible Memory Controller Bank5_6
84  */
85 
86 typedef struct
87 {
88  __IO uint32_t SDCR[2]; /*!< SDRAM Control registers , Address offset: 0x140-0x144 */
89  __IO uint32_t SDTR[2]; /*!< SDRAM Timing registers , Address offset: 0x148-0x14C */
90  __IO uint32_t SDCMR; /*!< SDRAM Command Mode register, Address offset: 0x150 */
91  __IO uint32_t SDRTR; /*!< SDRAM Refresh Timer register, Address offset: 0x154 */
92  __IO uint32_t SDSR; /*!< SDRAM Status register, Address offset: 0x158 */
93 } FMC_Bank5_6_TypeDef;
94 
95 #define FMC_R_BASE ((uint32_t)0xA0000000) /*!< FMC registers base address */
96 #define FMC_Bank5_6 ((FMC_Bank5_6_TypeDef *) FMC_Bank5_6_R_BASE)
97 #define FMC_Bank5_6_R_BASE (FMC_R_BASE + 0x0140)
98 
99 
100 /**
101  * @brief Setup the external memory controller.
102  * borrowed from stm32fcube v1.3
103  * @param None
104  * @retval None
105  */
106 static void SystemInit_ExtMemCtl(void)
107 {
108  uint32_t tmpreg = 0, timeout = 0xFFFF;
109 
110  /* Enable GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, and GPIOG interface
111  clock */
112  RCC->AHB1ENR |= 0x0000007E;
113 
114  /* Connect PBx pins to FMC Alternate function */
115  GPIOB->AFR[0] = 0x0CC00000;
116  GPIOB->AFR[1] = 0x00000000;
117  /* Configure PBx pins in Alternate function mode */
118  GPIOB->MODER = 0x00002A80;
119  /* Configure PBx pins speed to 50 MHz */
120  GPIOB->OSPEEDR = 0x000028C0;
121  /* Configure PBx pins Output type to push-pull */
122  GPIOB->OTYPER = 0x00000000;
123  /* No pull-up, pull-down for PBx pins */
124  GPIOB->PUPDR = 0x00000100;
125 
126  /* Connect PCx pins to FMC Alternate function */
127  GPIOC->AFR[0] = 0x0000000C;
128  GPIOC->AFR[1] = 0x00000000;
129  /* Configure PCx pins in Alternate function mode */
130  GPIOC->MODER = 0x00000002;
131  /* Configure PCx pins speed to 50 MHz */
132  GPIOC->OSPEEDR = 0x00000002;
133  /* Configure PCx pins Output type to push-pull */
134  GPIOC->OTYPER = 0x00000000;
135  /* No pull-up, pull-down for PCx pins */
136  GPIOC->PUPDR = 0x00000000;
137 
138  /* Connect PDx pins to FMC Alternate function */
139  GPIOD->AFR[0] = 0x000000CC;
140  GPIOD->AFR[1] = 0xCC000CCC;
141  /* Configure PDx pins in Alternate function mode */
142  GPIOD->MODER = 0xA02A000A;
143  /* Configure PDx pins speed to 50 MHz */
144  GPIOD->OSPEEDR = 0xA02A000A;
145  /* Configure PDx pins Output type to push-pull */
146  GPIOD->OTYPER = 0x00000000;
147  /* No pull-up, pull-down for PDx pins */
148  GPIOD->PUPDR = 0x00000000;
149 
150  /* Connect PEx pins to FMC Alternate function */
151  GPIOE->AFR[0] = 0xC00000CC;
152  GPIOE->AFR[1] = 0xCCCCCCCC;
153  /* Configure PEx pins in Alternate function mode */
154  GPIOE->MODER = 0xAAAA800A;
155  /* Configure PEx pins speed to 50 MHz */
156  GPIOE->OSPEEDR = 0xAAAA800A;
157  /* Configure PEx pins Output type to push-pull */
158  GPIOE->OTYPER = 0x00000000;
159  /* No pull-up, pull-down for PEx pins */
160  GPIOE->PUPDR = 0x00000000;
161 
162  /* Connect PFx pins to FMC Alternate function */
163  GPIOF->AFR[0] = 0x00CCCCCC;
164  GPIOF->AFR[1] = 0xCCCCC000;
165  /* Configure PFx pins in Alternate function mode */
166  GPIOF->MODER = 0xAA800AAA;
167  /* Configure PFx pins speed to 50 MHz */
168  GPIOF->OSPEEDR = 0xAA800AAA;
169  /* Configure PFx pins Output type to push-pull */
170  GPIOF->OTYPER = 0x00000000;
171  /* No pull-up, pull-down for PFx pins */
172  GPIOF->PUPDR = 0x00000000;
173 
174  /* Connect PGx pins to FMC Alternate function */
175  GPIOG->AFR[0] = 0x00CC00CC;
176  GPIOG->AFR[1] = 0xC000000C;
177  /* Configure PGx pins in Alternate function mode */
178  GPIOG->MODER = 0x80020A0A;
179  /* Configure PGx pins speed to 50 MHz */
180  GPIOG->OSPEEDR = 0x80020A0A;
181  /* Configure PGx pins Output type to push-pull */
182  GPIOG->OTYPER = 0x00000000;
183  /* No pull-up, pull-down for PGx pins */
184  GPIOG->PUPDR = 0x00000000;
185 
186 
187 /*-- FMC Configuration ------------------------------------------------------*/
188  /* Enable the FMC interface clock */
189  RCC->AHB3ENR |= 0x00000001;
190 
191  /* Configure and enable SDRAM bank2 */
192  FMC_Bank5_6->SDCR[0] = 0x00002800;
193  FMC_Bank5_6->SDCR[1] = 0x000001D4;
194  FMC_Bank5_6->SDTR[0] = 0x00106000;
195  FMC_Bank5_6->SDTR[1] = 0x00010361;
196 
197  /* SDRAM initialization sequence */
198  /* Clock enable command - BANK2 0x08, BANK1 0x10 */
199  FMC_Bank5_6->SDCMR = 0x08 | 0x01;
200  tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
201  while((tmpreg != 0) && (timeout-- > 0))
202  {
203  tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
204  }
205 
206  /* Delay */
207  delay_wait_ms(1);
208 
209  /* PALL command */
210  FMC_Bank5_6->SDCMR = 0x08 | 0x02;
211  timeout = 0xFFFF;
212  while((tmpreg != 0) && (timeout-- > 0))
213  {
214  tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
215  }
216 
217  /* Auto refresh command */
218  FMC_Bank5_6->SDCMR = 0x08 | 0x03 | 0x60;
219  timeout = 0xFFFF;
220  while((tmpreg != 0) && (timeout-- > 0))
221  {
222  tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
223  }
224 
225  /* MRD register program */
226  FMC_Bank5_6->SDCMR = 0x08 | 0x04 | 0x00046200;
227  timeout = 0xFFFF;
228  while((tmpreg != 0) && (timeout-- > 0))
229  {
230  tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
231  }
232 
233  /* Set refresh count */
234  tmpreg = FMC_Bank5_6->SDRTR; // 64 ms / 8192 rows = 7.81us
235  FMC_Bank5_6->SDRTR = (tmpreg | (683 << 1)); // (7.81us * 90 MHz) - 20 = 682.9
236 
237  /* Disable write protection */
238  tmpreg = FMC_Bank5_6->SDCR[1];
239  FMC_Bank5_6->SDCR[1] = (tmpreg & 0xFFFFFDFF);
240 }
241 
242 /**
243  * \brief init FSMC and related pins
244  *
245  * On this board the external SDRAM
246  */
247 static status_e bsp_init_FSMC(void)
248 {
249  // Setup gpios
250  gpio_setup_list(fscm_pins, ARRAY_SIZE(fscm_pins));
251 
252  SystemInit_ExtMemCtl();
253  return NO_ERROR;
254 }
255 
256 /**
257  * \brief Load .ext_ram_data and zero .ext_ram_bss
258  */
259 static void load_init_external_ram(void)
260 {
261  extern uint8_t __ext_ram_bss_start;
262  extern uint8_t __ext_ram_bss_end;
263 
264  extern uint8_t __ext_ram_dst_start;
265  extern uint8_t __ext_ram_dst_end;
266  extern uint8_t __ext_ram_src_start;
267 
268  memset(&__ext_ram_bss_start, 0x0, &__ext_ram_bss_end - &__ext_ram_bss_start);
269  memcpy(&__ext_ram_dst_start,&__ext_ram_src_start, &__ext_ram_dst_end - & __ext_ram_dst_start);
270 }
271 
272 static const struct gpio_t led0_pin = DEF_GPIOD(11, GPIO_PP | GPIO_OUTPUT_0);
273 static void bsp_pwm_leds_init(uint32_t frequency, uint32_t steps, uint32_t initial)
274 {
275  const struct gpio_t pins[] =
276  {
277  led0_pin,
278  GPIO_TIM4_CH1_PD12,
279  GPIO_TIM4_CH2_PD13,
280  };
281 
282  /* Pin setup */
283  gpio_setup_list(pins, ARRAY_SIZE(pins));
284 
285  /* Enable the timer clock */
286  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4, ENABLE);
287 
288  /* Reset the timer */
289  RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE);
290  RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE);
291 
292  TIM4->CCER =
294  | TIM_CCER_CC2E
295  ;
296 
297  /**
298  * Timer frequency = steps * input_frequency
299  */
300  TIM4->PSC = (((SystemClock.timer)/steps)/frequency) - 1;
301 
302  /**
303  * Count steps (from zero to steps - 1)
304  */
305  TIM4->ARR = steps - 1;
306 
307  /* Set the output value to 50 % */
308  TIM4->CCR1 = initial;
309  TIM4->CCR2 = initial;
310 
311  TIM4->CCMR1 =
314  ;
315 
316  /* Update registers now */
317  TIM4->EGR |= TIM_EGR_UG;
318 
319  /* Start the timer */
320  TIM4->CR1 = TIM_CR1_ARPE | TIM_CR1_CEN;
321 }
322 
323 void bsp_led_set_pwm(uint32_t nr, uint32_t value)
324 {
325  if (nr == 0)
326  {
327  gpio_set(&led0_pin, value);
328  return;
329  }
330 
331  nr--;
332  if (nr < 2)
333  {
334  volatile uint32_t *addr[] =
335  {
336  &TIM4->CCR1,
337  &TIM4->CCR2,
338  };
339 
340  *addr[nr] = lightness_to_pwm(value);
341  }
342 }
343 
344 void bsp_led_set(uint32_t nr, uint32_t value)
345 {
346  bsp_led_set_pwm(nr, value > 0 ? LIGHTNESS_PWM_STEP : 0);
347 }
348 
349 void bsp_led_toggle(uint32_t nr)
350 {
351  if (nr == 0)
352  {
353  gpio_toggle(&led0_pin);
354  return;
355  }
356  nr--;
357 
358  if (nr < 2)
359  {
360  volatile uint32_t *addr[] =
361  {
362  &TIM4->CCR1,
363  &TIM4->CCR2,
364  };
365 
366  if (*addr[nr])
367  {
368  *addr[nr] = 0;
369  }
370  else
371  {
372  *addr[nr] = LIGHTNESS_PWM_STEP;
373  }
374  }
375 }
376 /**
377  * \brief Buttons
378  */
379 static const struct gpio_t bsp_buttons[BSP_BUTTON_NR] =
380 {
383 };
384 
385 /**
386  * \brief initialize buttons
387  */
388 static status_e bsp_buttons_init(void)
389 {
390  gpio_setup_list(bsp_buttons, ARRAY_SIZE(bsp_buttons));
391 
392  return NO_ERROR;
393 }
394 
395 uint32_t bsp_button_get(uint32_t nr)
396 {
397  if (nr >= BSP_BUTTON_NR)
398  {
399  return 0;
400  }
401 
402  return !gpio_get(&bsp_buttons[nr]);
403 }
404 
405 const struct gpio_t *bsp_button_gpios(void)
406 {
407  return &bsp_buttons[0];
408 }
409 
410 /**
411  * \brief OTG VBUS not enable pin
412  */
413 const struct gpio_t gpio_vbus_not = PIN_VBUS_NOT;
414 
415 /**
416  * \brief Safe pin state
417  *
418  * Safe state defined in this order :
419  * * JTAG pins in JTAG mode
420  * * External devices in reset or shutdown mode
421  * * connected pins in input mode
422  * * unconnected pins in input with pull-up
423  */
424 static const struct gpio_t all_pins_safe_values[] =
425 {
426  /**
427  * FIXME
428  *
429  * Take the schematics, and fix this list.
430  */
431 #if 0
432  DEF_GPIOA( 0, GPIO_AN),
433  DEF_GPIOA( 1, GPIO_INPUT),
435  DEF_GPIOA( 3, GPIO_INPUT),
437  DEF_GPIOA( 5, GPIO_AN),
439  DEF_GPIOA( 7, GPIO_INPUT),
441  DEF_GPIOA( 9, GPIO_INPUT),
442  DEF_GPIOA(10, GPIO_INPUT),
445  // JTAG
446  GPIO_JTMS_SWDIO_PA13,
447  GPIO_JTCK_SWCLK_PA14,
448  GPIO_JTDI_PA15,
449 
453 
454  // JTAG
455  GPIO_JTDO_TRACESWO_PB3,
456  GPIO_NJTRST_PB4,
459  DEF_GPIOB( 7, GPIO_INPUT),
460  DEF_GPIOB( 8, GPIO_INPUT),
461  DEF_GPIOB( 9, GPIO_INPUT),
463  DEF_GPIOB(11, GPIO_INPUT),
468 
470  DEF_GPIOC( 1, GPIO_INPUT),
472  DEF_GPIOC( 3, GPIO_AN),
473  DEF_GPIOC( 4, GPIO_INPUT),
474  DEF_GPIOC( 5, GPIO_INPUT),
483  DEF_GPIOC(14, GPIO_INPUT),
484  DEF_GPIOC(15, GPIO_INPUT),
485 
502 
519 
530  PIN_VBUS_NOT,
536 
552  PIN_WD,
553 
554  DEF_GPIOH( 0, GPIO_INPUT),
555  DEF_GPIOH( 1, GPIO_INPUT),
556  PIN_RESET_NOT_CAMERA,
557  PIN_RESET_NOT_SCREEN,
560  PIN_RESET_NOT_ETHERNET,
570 
583 #endif
584 };
585 
586 status_e bsp_init(void)
587 {
588  status_e status;
589 
590  // Set all pins to safe values
591  gpio_setup_list(all_pins_safe_values, ARRAY_SIZE(all_pins_safe_values));
592 
593  // Set OTG VBUS to off
594  gpio_setup(&gpio_vbus_not);
595 
596  // Initialize time early, it is required by many other functions
597  time_init();
598 
599  // Initialize the LEDs
600  bsp_pwm_leds_init(10*1000, BSP_PWM_LED_STEPS, 0);
601  bsp_led_set_pwm(0, 50);
602  bsp_led_set_pwm(1, 50);
603  bsp_led_set_pwm(2, 50);
604 
605  // Initialize stdin/stdout
606  retarget_init();
607 
608  // Initialize buttons
609  status = bsp_buttons_init();
610  if (status != NO_ERROR)
611  {
612  return status;
613  }
614 
615  /**
616  * FIXME
617  *
618  * The SDRAM init code is not working, so there is no reason to run it
619  * and even less reason to prevent boot when it's not working.
620  **/
621 #if 0
622  // Initialize the external (address/data) bus
623  status = bsp_init_FSMC();
624  if (status != NO_ERROR)
625  {
626  return status;
627  }
628 
629  /* Quick test the external RAM */
630  status = ram_test_basic((uint32_t *)EXT_SDRAM_BASE, EXT_SDRAM_SIZE);
631  if (status != NO_ERROR)
632  {
633  return status;
634  }
635 
636  // Initialize external ram sections
637  load_init_external_ram();
638 #endif
639  return NO_ERROR;
640 
641 }
642 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
643 #include "stm32/usb/usb_core.h"
644 #include "heivs/delay.h"
645 
646 void USB_OTG_BSP_DriveVBUS(USB_OTG_CORE_HANDLE *pdev, uint8_t state)
647 {
648  (void)pdev;
649  const struct gpio_t gpio_vbus_not = PIN_VBUS_NOT;
650  gpio_set(&gpio_vbus_not, !state);
651 }
652 
653 void USB_OTG_BSP_ConfigVBUS(USB_OTG_CORE_HANDLE *pdev)
654 {
655  const struct gpio_t gpio_vbus_not = PIN_VBUS_NOT;
656  gpio_setup(&gpio_vbus_not);
657  USB_OTG_BSP_DriveVBUS (pdev, 0);
658 
659  delay_wait_ms(200);
660 }
661 #endif /* (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE) */
662 
663 #endif
This file contains all the functions prototypes for the RCC firmware library.
BSP - Board Support Package.
#define DEF_GPIOF(__PIN, __MODE)
same as DEF_GPIOA for port F
Definition: stm32_gpio.h:364
stdio redirection
uint8_t nr
Pin number (0 for GPIOx0, ... , 3 for GPIOx3, ...)
Definition: stm32_gpio.h:99
RAM test.
void delay_wait_ms(uint32_t ms)
Wait for at least that time.
Definition: delay.c:12
Output (default 1)
Definition: stm32_gpio.h:53
#define BSP_BUTTON_NR
Number of buttons.
Definition: bsp_armebs4.h:23
pull down
Definition: stm32_gpio.h:86
simple time abstraction
Output speed : 100 MHz.
Definition: stm32_gpio.h:77
void * memcpy(void *dest, const void *src, size_t n)
void * memset(void *dest, int n, size_t n)
#define DEF_GPIOB(__PIN, __MODE)
same as DEF_GPIOA for port B
Definition: stm32_gpio.h:360
#define TIM_CR1_CEN
Definition: stm32f4xx.h:6051
#define TIM_CCMR1_OC2M_2
Definition: stm32f4xx.h:6178
#define TIM_CCER_CC1E
Definition: stm32f4xx.h:6256
Alternate function.
Definition: stm32_gpio.h:56
uint8_t lightness_to_pwm(uint8_t percentage)
PWM value for driving a LED expressed as perceived percentage.
#define TIM_CCMR1_OC2PE
Definition: stm32f4xx.h:6173
#define DEF_GPIOD(__PIN, __MODE)
same as DEF_GPIOA for port D
Definition: stm32_gpio.h:362
static void gpio_set(const struct gpio_t *gpio, uint32_t value)
Set a gpio.
Definition: stm32_gpio.h:260
No pull up or down.
Definition: stm32_gpio.h:80
static uint32_t gpio_get(const struct gpio_t *gpio)
Get gpio level.
Definition: stm32_gpio.h:219
#define TIM_CCMR1_OC2M_1
Definition: stm32f4xx.h:6177
#define DEF_GPIOA(__PIN, __MODE)
Helper for defining a pin.
Definition: stm32_gpio.h:358
void bsp_led_set(uint32_t nr, uint32_t value)
Set a led (ON or OFF)
Definition: bsp_armebs4.c:244
#define DEF_GPIOG(__PIN, __MODE)
same as DEF_GPIOA for port G
Definition: stm32_gpio.h:365
void bsp_led_toggle(uint32_t nr)
toggle a led
Definition: bsp_armebs4.c:249
#define TIM_CCMR1_OC1M_2
Definition: stm32f4xx.h:6164
#define BSP_PWM_LED_STEPS
Lightness correction.
Definition: bsp_armebs4.h:21
#define TIM_CCMR1_OC1M_1
Definition: stm32f4xx.h:6163
GPIO control structure.
Definition: stm32_gpio.h:96
Input.
Definition: stm32_gpio.h:44
#define TIM_CCER_CC2E
Definition: stm32f4xx.h:6260
#define GPIO_AF_FSMC
AF 12 selection.
This file contains all the functions prototypes for the FSMC firmware library.
simple delays
#define TIM_CR1_ARPE
Definition: stm32f4xx.h:6061
#define LIGHTNESS_PWM_STEP
Number a step for a pwm using lightness_to_pwm.
#define TIM_EGR_UG
Definition: stm32f4xx.h:6144
#define DEF_GPIOC(__PIN, __MODE)
same as DEF_GPIOA for port C
Definition: stm32_gpio.h:361
status_e ram_test_basic(uint32_t *base, size_t size)
Quickly test a RAM region.
Definition: ram_test.c:8
struct system_clock_t SystemClock
#define DEF_GPIOH(__PIN, __MODE)
same as DEF_GPIOA for port H
Definition: stm32_gpio.h:366
#define DEF_GPIOE(__PIN, __MODE)
same as DEF_GPIOA for port E
Definition: stm32_gpio.h:363
Output type : Push-Pull.
Definition: stm32_gpio.h:62
Output (default 0)
Definition: stm32_gpio.h:50
status_e gpio_setup_list(const struct gpio_t gpio[], size_t len)
Setup an array of gpio.
Definition: stm32_gpio.c:47
Output speed : 2 MHz.
Definition: stm32_gpio.h:68
status_e gpio_setup(const struct gpio_t *gpio)
Setup a gpio.
Definition: stm32_gpio.c:9
status_e
Known errors.
Definition: error.h:21
#define ARRAY_SIZE(x)
Number of elements in the array.
Definition: utils.h:19
#define TIM_CCMR1_OC1PE
Definition: stm32f4xx.h:6159
static void gpio_toggle(const struct gpio_t *gpio)
Toggle a gpio line.
Definition: stm32_gpio.h:185
No error.
Definition: error.h:28
const struct gpio_t * bsp_button_gpios(void)
get buttons gpios
Definition: bsp_armebs4.c:350
#define DEF_GPIOI(__PIN, __MODE)
same as DEF_GPIOA for port I
Definition: stm32_gpio.h:367
Pull up.
Definition: stm32_gpio.h:83
Analog.
Definition: stm32_gpio.h:59
status_e bsp_init(void)
Initialize the whole board.
Definition: bsp_armebs4.c:525
uint32_t bsp_button_get(uint32_t nr)
Get a button.
Definition: bsp_armebs4.c:340