nucleo-f302r8: add qenco example configuration
This commit is contained in:
parent
736bcf035e
commit
610ac21240
@ -9,4 +9,12 @@ config NUCLEOF302R8_HIGHPRI
|
||||
bool "High priority interrupt test"
|
||||
default n
|
||||
|
||||
if SENSORS_QENCODER
|
||||
|
||||
config NUCLEO_F302R8_QETIMER
|
||||
int "Timer to use with QE encoder"
|
||||
default 2
|
||||
|
||||
endif # SENSORS_QENCODER
|
||||
|
||||
endif
|
||||
|
51
boards/arm/stm32/nucleo-f302r8/configs/qenco/defconfig
Normal file
51
boards/arm/stm32/nucleo-f302r8/configs/qenco/defconfig
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="nucleo-f302r8"
|
||||
CONFIG_ARCH_BOARD_NUCLEO_F302R8=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP="stm32"
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
CONFIG_ARCH_CHIP_STM32F302R8=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=1024
|
||||
CONFIG_ARCH_IRQPRIO=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=8499
|
||||
CONFIG_BOARD_STM32_COMMON=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_EXAMPLES_QENCODER=y
|
||||
CONFIG_EXAMPLES_QENCODER_HAVE_MAXPOS=y
|
||||
CONFIG_EXAMPLES_QENCODER_MAXPOS=8192
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_MQ_MAXMSGSIZE=5
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=16386
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SENSORS=y
|
||||
CONFIG_SENSORS_QENCODER=y
|
||||
CONFIG_START_DAY=14
|
||||
CONFIG_START_MONTH=10
|
||||
CONFIG_START_YEAR=2014
|
||||
CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
CONFIG_STM32_QENCODER_DISABLE_EXTEND16BTIMERS=y
|
||||
CONFIG_STM32_QENCODER_SAMPLE_FDTS_2=y
|
||||
CONFIG_STM32_TIM2=y
|
||||
CONFIG_STM32_TIM2_QE=y
|
||||
CONFIG_STM32_TIM2_QEPSC=0
|
||||
CONFIG_STM32_USART2=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_USART2_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
@ -193,6 +193,11 @@
|
||||
|
||||
/* Alternate function pin selections ****************************************/
|
||||
|
||||
/* TIM2 input ***************************************************************/
|
||||
|
||||
#define GPIO_TIM2_CH1IN (GPIO_TIM2_CH1IN_2 | GPIO_PULLUP) /* PA15 */
|
||||
#define GPIO_TIM2_CH2IN (GPIO_TIM2_CH2IN_2 | GPIO_PULLUP) /* PB3 */
|
||||
|
||||
/* USART */
|
||||
|
||||
/* By default the USART2 is connected to STLINK Virtual COM Port:
|
||||
|
@ -37,6 +37,10 @@
|
||||
# include <nuttx/input/buttons.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_QENCODER
|
||||
# include "board_qencoder.h"
|
||||
#endif
|
||||
|
||||
#include "nucleo-f302r8.h"
|
||||
|
||||
/****************************************************************************
|
||||
@ -127,6 +131,19 @@ int stm32_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_QENCODER
|
||||
/* Initialize and register the qencoder driver */
|
||||
|
||||
ret = board_qencoder_initialize(0, CONFIG_NUCLEO_F302R8_QETIMER);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the qencoder: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user