pinpad support

This commit is contained in:
NIIBE Yutaka
2010-12-20 17:00:23 +09:00
parent 2a3e49f4da
commit 466052dcd1
5 changed files with 51 additions and 10 deletions

View File

@@ -1,3 +1,11 @@
2010-12-20 NIIBE Yutaka <gniibe@fsij.org>
* src/openpgp.c (GPGthread): Added PINPAD_SUPPORT.
* boards/STBEE_MINI/mcuconf.h: Simplified.
* boards/STBEE_MINI/board.h: Include config.h.
(PINPAD_SUPPORT): Added.
* boards/STBEE_MINI/board.c (hwinit1): Added PINPAD_SUPPORT.
2010-12-15 NIIBE Yutaka <gniibe@fsij.org> 2010-12-15 NIIBE Yutaka <gniibe@fsij.org>
* src/configure (FLASH_SIZE): Without 'k'. * src/configure (FLASH_SIZE): Without 'k'.

View File

@@ -14,6 +14,13 @@ void
hwinit1 (void) hwinit1 (void)
{ {
hwinit1_common (); hwinit1_common ();
#if defined(PINPAD_SUPPORT)
palWritePort(IOPORT2, 0x7fff); /* Only clear GPIOB_7SEG_DP */
while (palReadPad (IOPORT2, GPIOB_BUTTON) != 0)
; /* Wait for JTAG debugger connection */
palWritePort(IOPORT2, 0xffff); /* All set */
#endif
/* /*
* Disable JTAG and SWD, done after hwinit1_common as HAL resets AFIO * Disable JTAG and SWD, done after hwinit1_common as HAL resets AFIO
*/ */

View File

@@ -27,6 +27,7 @@
#ifndef _BOARD_H_ #ifndef _BOARD_H_
#define _BOARD_H_ #define _BOARD_H_
#include "config.h"
/* /*
* Setup for the STBee Mini board. * Setup for the STBee Mini board.
*/ */
@@ -93,16 +94,33 @@
* PA15 - Open Drain output (LED2 0:ON 1:OFF) * PA15 - Open Drain output (LED2 0:ON 1:OFF)
*/ */
#define VAL_GPIOACRL 0x88888888 /* PA7...PA0 */ #define VAL_GPIOACRL 0x88888888 /* PA7...PA0 */
#define VAL_GPIOACRH 0x73788888 /* PA15...PA8 */ #define VAL_GPIOACRH 0x63688888 /* PA15...PA8 */
#define VAL_GPIOAODR 0xFFFFFFFF #define VAL_GPIOAODR 0xFFFFFFFF
/* /* Port B setup. */
* Port B setup. #if defined(PINPAD_SUPPORT)
* Everything input with pull-up except: #define GPIOB_BUTTON 2
*/ #define GPIOB_ROT_A 3
#define GPIOB_ROT_B 4
#define GPIOB_7SEG_DP 15
#define GPIOB_7SEG_A 14
#define GPIOB_7SEG_B 13
#define GPIOB_7SEG_C 12
#define GPIOB_7SEG_D 11
#define GPIOB_7SEG_E 10
#define GPIOB_7SEG_F 9
#define GPIOB_7SEG_G 8
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x66666666 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF
#else
/* Everything input with pull-up */
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ #define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */ #define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF #define VAL_GPIOBODR 0xFFFFFFFF
#endif
/* /*
* Port C setup. * Port C setup.

View File

@@ -54,7 +54,7 @@
/* /*
* ADC driver system settings. * ADC driver system settings.
*/ */
#define USE_STM32_ADC1 TRUE #define USE_STM32_ADC1 FALSE
#define STM32_ADC1_DMA_PRIORITY 3 #define STM32_ADC1_DMA_PRIORITY 3
#define STM32_ADC1_IRQ_PRIORITY 5 #define STM32_ADC1_IRQ_PRIORITY 5
#define STM32_ADC1_DMA_ERROR_HOOK() chSysHalt() #define STM32_ADC1_DMA_ERROR_HOOK() chSysHalt()
@@ -62,13 +62,13 @@
/* /*
* CAN driver system settings. * CAN driver system settings.
*/ */
#define USE_STM32_CAN1 TRUE #define USE_STM32_CAN1 FALSE
#define STM32_CAN1_IRQ_PRIORITY 11 #define STM32_CAN1_IRQ_PRIORITY 11
/* /*
* PWM driver system settings. * PWM driver system settings.
*/ */
#define USE_STM32_PWM1 TRUE #define USE_STM32_PWM1 FALSE
#define USE_STM32_PWM2 FALSE #define USE_STM32_PWM2 FALSE
#define USE_STM32_PWM3 FALSE #define USE_STM32_PWM3 FALSE
#define USE_STM32_PWM4 FALSE #define USE_STM32_PWM4 FALSE
@@ -81,7 +81,7 @@
* SERIAL driver system settings. * SERIAL driver system settings.
*/ */
#define USE_STM32_USART1 FALSE #define USE_STM32_USART1 FALSE
#define USE_STM32_USART2 TRUE #define USE_STM32_USART2 FALSE
#define USE_STM32_USART3 FALSE #define USE_STM32_USART3 FALSE
#if defined(STM32F10X_HD) || defined(STM32F10X_CL) #if defined(STM32F10X_HD) || defined(STM32F10X_CL)
#define USE_STM32_UART4 FALSE #define USE_STM32_UART4 FALSE
@@ -98,7 +98,7 @@
/* /*
* SPI driver system settings. * SPI driver system settings.
*/ */
#define USE_STM32_SPI1 TRUE #define USE_STM32_SPI1 FALSE
#define USE_STM32_SPI2 FALSE #define USE_STM32_SPI2 FALSE
#define STM32_SPI1_DMA_PRIORITY 2 #define STM32_SPI1_DMA_PRIORITY 2
#define STM32_SPI2_DMA_PRIORITY 2 #define STM32_SPI2_DMA_PRIORITY 2

View File

@@ -737,6 +737,14 @@ msg_t
GPGthread (void *arg) GPGthread (void *arg)
{ {
Thread *icc_thread = (Thread *)arg; Thread *icc_thread = (Thread *)arg;
#if defined(PINPAD_SUPPORT)
extern msg_t pindial_main (void *arg);
Thread *pindial_thread;
static WORKING_AREA(waPINthread, 128);
pindial_thread = chThdCreateStatic (waPINthread, sizeof(waPINthread),
NORMALPRIO, pindial_main, NULL);
#endif
gpg_init (); gpg_init ();