2016-07-28 19:02:54 +00:00
|
|
|
/*! \file stm32f4-discovery.h
|
|
|
|
* \author tkl
|
|
|
|
* \date Mai 7, 2012
|
|
|
|
* \brief Header file of the board definition for the STM32F4-Discovery board.
|
|
|
|
*/
|
|
|
|
#ifndef BSP_STM32F4_DISCOVERY_H_
|
|
|
|
#define BSP_STM32F4_DISCOVERY_H_
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2016-08-18 09:24:22 +00:00
|
|
|
|
2016-07-28 19:02:54 +00:00
|
|
|
#include "stm32f4xx.h"
|
2016-08-16 11:08:49 +00:00
|
|
|
|
2016-08-18 09:24:22 +00:00
|
|
|
#include "pwm.h"
|
|
|
|
#include "stm32f4_pwm.h"
|
|
|
|
|
2016-08-17 08:06:18 +00:00
|
|
|
#include "uart.h"
|
|
|
|
#include "stm32f4_uart.h"
|
|
|
|
#include "ringbuffer.h"
|
|
|
|
|
2016-08-16 11:08:49 +00:00
|
|
|
#include "timer.h"
|
|
|
|
#include "stm32_sys_tick.h"
|
|
|
|
#include "sys_tick.h"
|
|
|
|
|
2016-08-15 20:25:35 +00:00
|
|
|
#include "gpio.h"
|
2016-07-28 19:02:54 +00:00
|
|
|
#include "stm32f4_gpio.h"
|
2016-08-15 20:25:35 +00:00
|
|
|
#include "driver.h"
|
2016-07-28 19:02:54 +00:00
|
|
|
|
2016-08-18 19:33:09 +00:00
|
|
|
// GPIO_C0
|
|
|
|
static const GPIO_InitTypeDef port_cfg_c0 = {
|
|
|
|
.Pin = GPIO_PIN_0,
|
2016-08-15 20:25:35 +00:00
|
|
|
.Mode = GPIO_MODE_OUTPUT_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
};
|
2016-08-09 10:35:56 +00:00
|
|
|
|
2016-08-18 19:33:09 +00:00
|
|
|
static const struct stm32f4_gpio stm32_f4_gpio_c0 = {
|
|
|
|
.port = GPIOC,
|
|
|
|
.pin = &port_cfg_c0,
|
2016-08-15 20:25:35 +00:00
|
|
|
};
|
|
|
|
|
2016-08-18 19:33:09 +00:00
|
|
|
static const struct gpio __gpio_c0 = {
|
|
|
|
(void*)&stm32_f4_gpio_c0,
|
2016-08-15 20:25:35 +00:00
|
|
|
&gpio_fp
|
|
|
|
};
|
|
|
|
|
2016-08-18 19:33:09 +00:00
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver gpio_c0 = {
|
|
|
|
#else
|
|
|
|
const struct driver gpio_c0 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_GPIO,
|
|
|
|
&__gpio_c0,
|
|
|
|
};
|
|
|
|
|
|
|
|
// GPIO_C1
|
|
|
|
static const GPIO_InitTypeDef port_cfg_c1 = {
|
|
|
|
.Pin = GPIO_PIN_1,
|
|
|
|
.Mode = GPIO_MODE_OUTPUT_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_gpio stm32_f4_gpio_c1 = {
|
|
|
|
.port = GPIOC,
|
|
|
|
.pin = &port_cfg_c1,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct gpio __gpio_c1 = {
|
|
|
|
(void*)&stm32_f4_gpio_c1,
|
|
|
|
&gpio_fp
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver gpio_c1 = {
|
|
|
|
#else
|
|
|
|
const struct driver gpio_c1 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_GPIO,
|
|
|
|
&__gpio_c0,
|
|
|
|
};
|
|
|
|
|
|
|
|
// GPIO_C2
|
|
|
|
static const GPIO_InitTypeDef port_cfg_c2 = {
|
|
|
|
.Pin = GPIO_PIN_2,
|
|
|
|
.Mode = GPIO_MODE_OUTPUT_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_gpio stm32_f4_gpio_c2 = {
|
|
|
|
.port = GPIOC,
|
|
|
|
.pin = &port_cfg_c0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct gpio __gpio_c2 = {
|
|
|
|
(void*)&stm32_f4_gpio_c2,
|
|
|
|
&gpio_fp
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver gpio_c2 = {
|
|
|
|
#else
|
|
|
|
const struct driver gpio_c2 = {
|
|
|
|
#endif
|
2016-08-15 20:25:35 +00:00
|
|
|
DRIVER_TYPE_GPIO,
|
2016-08-18 19:33:09 +00:00
|
|
|
&__gpio_c2,
|
2016-08-15 20:25:35 +00:00
|
|
|
};
|
2016-08-18 19:33:09 +00:00
|
|
|
|
|
|
|
// GPIO_C3
|
|
|
|
static const GPIO_InitTypeDef port_cfg_c3 = {
|
|
|
|
.Pin = GPIO_PIN_3,
|
|
|
|
.Mode = GPIO_MODE_OUTPUT_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_gpio stm32_f4_gpio_c3 = {
|
|
|
|
.port = GPIOC,
|
|
|
|
.pin = &port_cfg_c3,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct gpio __gpio_c3 = {
|
|
|
|
(void*)&stm32_f4_gpio_c3,
|
|
|
|
&gpio_fp
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver gpio_c3 = {
|
|
|
|
#else
|
|
|
|
const struct driver gpio_c3 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
#endif
|
2016-08-18 19:33:09 +00:00
|
|
|
DRIVER_TYPE_GPIO,
|
|
|
|
&__gpio_c3,
|
|
|
|
};
|
2016-08-15 20:25:35 +00:00
|
|
|
|
2016-07-28 19:02:54 +00:00
|
|
|
// SYSTEM TICK
|
|
|
|
static const enum stm32_sys_tick_time_base stm23_sys_tick_time_base =
|
|
|
|
STM32_SYS_TICK_TIME_BASE_MS;
|
2016-08-16 11:08:49 +00:00
|
|
|
|
2016-07-28 19:02:54 +00:00
|
|
|
static const struct stm32_sys_tick stm32_sys_tick = {
|
2016-08-16 11:08:49 +00:00
|
|
|
.tick_time_base = &stm23_sys_tick_time_base,
|
|
|
|
.sys_tick_cb = NULL,
|
|
|
|
.sys_tick_cb_param = NULL,
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct loki_timer timer_1 = {
|
2016-08-16 11:08:49 +00:00
|
|
|
.arch_dep_device = (void*)&stm32_sys_tick,
|
|
|
|
.fp = &timer_fp
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
2016-08-16 11:08:49 +00:00
|
|
|
|
2016-08-09 10:35:56 +00:00
|
|
|
// PWM CHANNEL 4
|
|
|
|
/* apb1 clock = 84MHz */
|
|
|
|
/* period_reg = src_clk / presc / cnt_clk */
|
|
|
|
/* 4199 = 84MHZ / (0 + 1) / 20kHz - 1 */
|
2016-08-18 09:24:22 +00:00
|
|
|
static TIM_HandleTypeDef tim4_handle = {
|
|
|
|
.Instance = TIM4,
|
|
|
|
.Init.Prescaler = 0,
|
|
|
|
.Init.CounterMode = TIM_COUNTERMODE_UP,
|
|
|
|
.Init.Period = 4199,
|
|
|
|
.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1,
|
|
|
|
.Init.RepetitionCounter = 0,
|
2016-08-09 10:35:56 +00:00
|
|
|
};
|
|
|
|
|
2016-08-18 09:24:22 +00:00
|
|
|
static TIM_OC_InitTypeDef t4_output_compare_cfg = {
|
|
|
|
.OCMode = TIM_OCMODE_PWM1,
|
|
|
|
.Pulse = 0,
|
|
|
|
.OCPolarity = TIM_OCPOLARITY_HIGH,
|
|
|
|
.OCNPolarity = TIM_OCNPOLARITY_HIGH,
|
|
|
|
.OCFastMode = TIM_OCFAST_DISABLE,
|
|
|
|
.OCIdleState = TIM_OCIDLESTATE_SET,
|
|
|
|
.OCNIdleState = TIM_OCNIDLESTATE_SET
|
2016-08-09 10:35:56 +00:00
|
|
|
};
|
|
|
|
|
2016-08-10 09:31:49 +00:00
|
|
|
static const GPIO_InitTypeDef port_cfg_D15 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.Pin = GPIO_PIN_15,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Alternate = GPIO_AF2_TIM4,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_gpio t4c4_gpio = {
|
|
|
|
.port = GPIOD,
|
|
|
|
.pin = &port_cfg_D15,
|
2016-08-09 10:35:56 +00:00
|
|
|
};
|
|
|
|
|
2016-08-10 09:31:49 +00:00
|
|
|
static struct stm32f4_pwm str32f4_pwm_4 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.pwm_gpio = &t4c4_gpio,
|
|
|
|
.timer_handle = &tim4_handle,
|
2016-08-09 10:35:56 +00:00
|
|
|
.output_compare_cfg = &t4_output_compare_cfg,
|
2016-08-18 09:24:22 +00:00
|
|
|
.channel = TIM_CHANNEL_4,
|
2016-08-09 10:35:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct pwm pwm_ch4 = {
|
2016-08-10 09:31:49 +00:00
|
|
|
.arch_dep_device = &str32f4_pwm_4,
|
2016-08-09 10:35:56 +00:00
|
|
|
.fp = &stm32f4_pwm_fp,
|
|
|
|
};
|
|
|
|
|
2016-08-09 10:52:38 +00:00
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver pwm_4 = {
|
|
|
|
#else
|
|
|
|
const struct driver pwm_4 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_PWM,
|
|
|
|
&pwm_ch4,
|
|
|
|
};
|
2016-08-18 09:24:22 +00:00
|
|
|
|
2016-08-10 09:31:49 +00:00
|
|
|
// PWM Channel 3
|
|
|
|
static const GPIO_InitTypeDef port_cfg_D14 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.Pin = GPIO_PIN_14,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Alternate = GPIO_AF2_TIM4,
|
|
|
|
};
|
|
|
|
static const struct stm32f4_gpio stm32f4_pwm_t4c3_gpio = {
|
|
|
|
.port = GPIOD,
|
|
|
|
.pin = &port_cfg_D14,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stm32f4_pwm str32f4_pwm_3 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.pwm_gpio = &stm32f4_pwm_t4c3_gpio,
|
|
|
|
.timer_handle = &tim4_handle,
|
2016-08-10 09:31:49 +00:00
|
|
|
.output_compare_cfg = &t4_output_compare_cfg,
|
2016-08-18 09:24:22 +00:00
|
|
|
.channel = TIM_CHANNEL_3,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct pwm pwm_ch3 = {
|
|
|
|
.arch_dep_device = &str32f4_pwm_3,
|
|
|
|
.fp = &stm32f4_pwm_fp,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver pwm_3 = {
|
|
|
|
#else
|
|
|
|
const struct driver pwm_3 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_PWM,
|
|
|
|
&pwm_ch3,
|
|
|
|
};
|
2016-08-18 09:24:22 +00:00
|
|
|
|
2016-08-10 09:31:49 +00:00
|
|
|
// PWM Channel 2
|
|
|
|
static const GPIO_InitTypeDef port_cfg_D13 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.Pin = GPIO_PIN_13,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Alternate = GPIO_AF2_TIM4,
|
|
|
|
};
|
|
|
|
static const struct stm32f4_gpio stm32f4_pwm_t4c2_gpio = {
|
|
|
|
.port = GPIOD,
|
|
|
|
.pin = &port_cfg_D13,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stm32f4_pwm str32f4_pwm_2 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.pwm_gpio = &stm32f4_pwm_t4c2_gpio,
|
|
|
|
.timer_handle = &tim4_handle,
|
2016-08-10 09:31:49 +00:00
|
|
|
.output_compare_cfg = &t4_output_compare_cfg,
|
2016-08-18 09:24:22 +00:00
|
|
|
.channel = TIM_CHANNEL_2,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct pwm pwm_ch2 = {
|
|
|
|
.arch_dep_device = &str32f4_pwm_2,
|
|
|
|
.fp = &stm32f4_pwm_fp,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver pwm_2 = {
|
|
|
|
#else
|
|
|
|
const struct driver pwm_2 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_PWM,
|
|
|
|
&pwm_ch2,
|
|
|
|
};
|
2016-08-18 09:24:22 +00:00
|
|
|
|
2016-08-10 15:39:39 +00:00
|
|
|
// PWM Channel 1
|
2016-08-10 09:31:49 +00:00
|
|
|
static const GPIO_InitTypeDef port_cfg_D12 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.Pin = GPIO_PIN_12,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Alternate = GPIO_AF2_TIM4,
|
|
|
|
};
|
|
|
|
static const struct stm32f4_gpio stm32f4_pwm_t4c1_gpio = {
|
|
|
|
.port = GPIOD,
|
|
|
|
.pin = &port_cfg_D12,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stm32f4_pwm str32f4_pwm_1 = {
|
2016-08-18 09:24:22 +00:00
|
|
|
.pwm_gpio = &stm32f4_pwm_t4c1_gpio,
|
|
|
|
.timer_handle = &tim4_handle,
|
2016-08-10 09:31:49 +00:00
|
|
|
.output_compare_cfg = &t4_output_compare_cfg,
|
2016-08-18 09:24:22 +00:00
|
|
|
.channel = TIM_CHANNEL_1,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct pwm pwm_ch1 = {
|
|
|
|
.arch_dep_device = &str32f4_pwm_1,
|
|
|
|
.fp = &stm32f4_pwm_fp,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver pwm_1 = {
|
|
|
|
#else
|
|
|
|
const struct driver pwm_1 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_PWM,
|
2016-08-10 15:39:39 +00:00
|
|
|
&pwm_ch1,
|
2016-08-10 09:31:49 +00:00
|
|
|
};
|
2016-08-18 09:24:22 +00:00
|
|
|
|
2016-08-23 09:40:57 +00:00
|
|
|
// PWM5 CHANNEL 2
|
|
|
|
/* apb1 clock = 84MHz */
|
|
|
|
/* period_reg = src_clk / presc / cnt_clk */
|
|
|
|
/* 1679 = 84MHZ / 1000 / 50Hz - 1 */
|
|
|
|
static TIM_HandleTypeDef tim5_handle = {
|
|
|
|
.Instance = TIM5,
|
|
|
|
.Init.Prescaler = 1000,
|
|
|
|
.Init.CounterMode = TIM_COUNTERMODE_UP,
|
|
|
|
.Init.Period = 1679,
|
|
|
|
.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1,
|
|
|
|
.Init.RepetitionCounter = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static TIM_OC_InitTypeDef t5_output_compare_cfg = {
|
|
|
|
.OCMode = TIM_OCMODE_PWM1,
|
|
|
|
.Pulse = 840,
|
|
|
|
.OCPolarity = TIM_OCPOLARITY_HIGH,
|
|
|
|
.OCNPolarity = TIM_OCNPOLARITY_HIGH,
|
|
|
|
.OCFastMode = TIM_OCFAST_DISABLE,
|
|
|
|
.OCIdleState = TIM_OCIDLESTATE_SET,
|
|
|
|
.OCNIdleState = TIM_OCNIDLESTATE_SET
|
|
|
|
};
|
|
|
|
|
|
|
|
static const GPIO_InitTypeDef port_cfg_A1 = {
|
|
|
|
.Pin = GPIO_PIN_1,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Alternate = GPIO_AF2_TIM5,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_gpio t5c2_gpio = {
|
|
|
|
.port = GPIOA,
|
|
|
|
.pin = &port_cfg_A1,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct stm32f4_pwm str32f4_pwm5_c2 = {
|
|
|
|
.pwm_gpio = &t5c2_gpio,
|
|
|
|
.timer_handle = &tim5_handle,
|
|
|
|
.output_compare_cfg = &t5_output_compare_cfg,
|
|
|
|
.channel = TIM_CHANNEL_2,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct pwm pwm5_ch2 = {
|
|
|
|
.arch_dep_device = &str32f4_pwm5_c2,
|
|
|
|
.fp = &stm32f4_pwm_fp,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver pwm5_c2 = {
|
|
|
|
#else
|
|
|
|
const struct driver pwm5_c2 = {
|
|
|
|
#endif
|
|
|
|
DRIVER_TYPE_PWM,
|
|
|
|
&pwm5_ch2,
|
|
|
|
};
|
|
|
|
|
2016-08-09 10:35:56 +00:00
|
|
|
// UART 1
|
2016-08-17 08:06:18 +00:00
|
|
|
static const GPIO_InitTypeDef port_cfg_uart1 = {
|
|
|
|
.Pin = GPIO_PIN_6 | GPIO_PIN_7,
|
|
|
|
.Mode = GPIO_MODE_AF_PP,
|
|
|
|
.Pull = GPIO_PULLUP,
|
|
|
|
.Speed = GPIO_SPEED_FREQ_HIGH,
|
|
|
|
.Alternate = GPIO_AF7_USART1,
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
|
|
|
|
2016-08-17 08:06:18 +00:00
|
|
|
static const struct stm32f4_gpio stm32f4_uart1_gpio = {
|
|
|
|
.port = GPIOB,
|
|
|
|
.pin = &port_cfg_uart1,
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
|
|
|
|
2016-08-17 08:06:18 +00:00
|
|
|
static UART_HandleTypeDef stm32f4_discovery_uart1_handle = {
|
|
|
|
.Instance = USART1,
|
|
|
|
.Init.BaudRate = 115200,
|
|
|
|
.Init.WordLength = UART_WORDLENGTH_8B,
|
|
|
|
.Init.StopBits = UART_STOPBITS_1,
|
|
|
|
.Init.Parity = UART_PARITY_NONE,
|
|
|
|
.Init.Mode = UART_MODE_TX_RX,
|
|
|
|
.Init.HwFlowCtl = UART_HWCONTROL_NONE,
|
|
|
|
.Init.OverSampling = UART_OVERSAMPLING_16,
|
|
|
|
.pTxBuffPtr = NULL,
|
|
|
|
.TxXferSize = 0,
|
|
|
|
.TxXferCount = 0,
|
|
|
|
.pRxBuffPtr = NULL,
|
|
|
|
.RxXferSize = 0,
|
|
|
|
.RxXferCount = 0,
|
|
|
|
.hdmatx = NULL,
|
|
|
|
.hdmarx = NULL,
|
|
|
|
.Lock = HAL_UNLOCKED,
|
|
|
|
.gState = HAL_UART_STATE_RESET,
|
|
|
|
.ErrorCode = 0,
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct stm32f4_uart stm32f4_uart1 = {
|
2016-08-17 08:06:18 +00:00
|
|
|
.uart_gpio = &stm32f4_uart1_gpio,
|
|
|
|
.uart_handle = &stm32f4_discovery_uart1_handle,
|
|
|
|
};
|
2016-07-28 19:02:54 +00:00
|
|
|
|
2016-08-17 08:06:18 +00:00
|
|
|
static char console_linear_buffer[10];
|
|
|
|
static struct ringbuffer console_buffer = {
|
|
|
|
console_linear_buffer,
|
|
|
|
console_linear_buffer,
|
|
|
|
console_linear_buffer,
|
|
|
|
10,
|
|
|
|
0
|
2016-07-28 19:02:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct uart __uart_1 = {
|
|
|
|
&stm32f4_uart1,
|
|
|
|
&stm32f4_uart_fp,
|
|
|
|
&console_buffer,
|
|
|
|
};
|
|
|
|
|
2016-08-02 12:10:11 +00:00
|
|
|
#ifdef TEST_APP
|
|
|
|
static const struct driver uart_1 = {
|
|
|
|
#else
|
2016-07-28 19:02:54 +00:00
|
|
|
const struct driver uart_1 = {
|
2016-08-02 12:10:11 +00:00
|
|
|
#endif
|
2016-07-28 19:02:54 +00:00
|
|
|
DRIVER_TYPE_UART,
|
|
|
|
&__uart_1,
|
|
|
|
};
|
2016-08-17 08:06:18 +00:00
|
|
|
|
2016-07-28 19:02:54 +00:00
|
|
|
//! \brief Setup the hardware of the stm32f4-discovery board.
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
#endif /* BSP_STM32F4_DISCOVERY_H_ */
|