more update to newer chibios

This commit is contained in:
NIIBE Yutaka
2013-02-18 16:08:47 +09:00
parent daeac800d8
commit 605d8ef6c1
17 changed files with 137 additions and 48 deletions

View File

@@ -10,6 +10,11 @@
* src/configure, src/gnuk.ld.in: Add MEMORY_SIZE. * src/configure, src/gnuk.ld.in: Add MEMORY_SIZE.
* src/ec_p256.c: Fix call of bn256_add_uint. * src/ec_p256.c: Fix call of bn256_add_uint.
* boards/STM8S_DISCOVERY/*: Update for ChibiOS/RT 2.4.x. * boards/STM8S_DISCOVERY/*: Update for ChibiOS/RT 2.4.x.
* boards/CQ_STARM/*: Likewise.
* boards/FST_01_00/*: Likewise.
* boards/OLIMEX_STM32_H103/*: Likewise.
* boards/STBEE/*: Likewise.
* boards/STBEE_MINI/*: Likewise.
Merge ec_p256 branch. Merge ec_p256 branch.
* src/Makefile.in: Add ECC files. * src/Makefile.in: Add ECC files.
@@ -32,7 +37,7 @@
* boards/common/board-common.c: Rename from hwinit.c. * boards/common/board-common.c: Rename from hwinit.c.
* src/usb_stm32f103.c: Rename from usb_lld.c. * src/usb_stm32f103.c: Rename from usb_lld.c.
* src/neug.h, src/neug.h: Update NeuG 0.05. * src/neug.h, src/neug.c: Update NeuG 0.05.
* src/adc_stm32f103.c, src/adc.h: New from NeuG 0.05. * src/adc_stm32f103.c, src/adc.h: New from NeuG 0.05.
* src/random.c: Follow the change of NeuG 0.05. * src/random.c: Follow the change of NeuG 0.05.

View File

@@ -2,10 +2,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "../common/hwinit.c" /*
* Board-specific initialization code.
void */
hwinit1 (void) void boardInit(void)
{ {
hwinit1_common ();
} }

View File

@@ -150,4 +150,14 @@
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF #define VAL_GPIOEODR 0xFFFFFFFF
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@@ -7,8 +7,8 @@
#define STM32_PLLMUL_VALUE 9 #define STM32_PLLMUL_VALUE 9
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_ADCPRE STM32_ADCPRE_DIV6
#define STM32_MCO STM32_MCO_NOCLOCK #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
#include "mcuconf-common.h" #include "mcuconf-common.h"

View File

@@ -2,10 +2,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "../common/hwinit.c" /*
* Board-specific initialization code.
void */
hwinit1 (void) void boardInit(void)
{ {
hwinit1_common ();
} }

View File

@@ -37,6 +37,8 @@
#define GPIO_LED GPIOA_LED #define GPIO_LED GPIOA_LED
#define IOPORT_LED GPIOA #define IOPORT_LED GPIOA
/* NeuG settings for ADC2 is default. */
/* /*
* Board identifier. * Board identifier.
*/ */
@@ -54,7 +56,6 @@
* native STM32 HAL. * native STM32 HAL.
*/ */
#define STM32F10X_MD #define STM32F10X_MD
#define CPU_WITH_NO_GPIOE 1
/* /*
* IO pins assignments. * IO pins assignments.
@@ -88,6 +89,8 @@
/* /*
* Port A setup. * Port A setup.
* PA0 - Digital input with PullUp. AN0
* PA1 - Digital input with PullUp. AN1
* PA11 - input with pull-up (USBDM) * PA11 - input with pull-up (USBDM)
* PA12 - input with pull-up (USBDP) * PA12 - input with pull-up (USBDP)
* Everything input with pull-up except: * Everything input with pull-up except:
@@ -132,4 +135,14 @@
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF #define VAL_GPIOEODR 0xFFFFFFFF
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@@ -7,9 +7,8 @@
#define STM32_PLLMUL_VALUE 9 #define STM32_PLLMUL_VALUE 9
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_ADCPRE STM32_ADCPRE_DIV6
#define STM32_USBPRE STM32_USBPRE_DIV1P5 #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
#define STM32_MCO STM32_MCO_NOCLOCK
#include "mcuconf-common.h" #include "mcuconf-common.h"

View File

@@ -2,10 +2,9 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "../common/hwinit.c" /*
* Board-specific initialization code.
void */
hwinit1 (void) void boardInit(void)
{ {
hwinit1_common ();
} }

View File

@@ -37,6 +37,14 @@
#define GPIO_LED GPIOC_LED #define GPIO_LED GPIOC_LED
#define IOPORT_LED GPIOC #define IOPORT_LED GPIOC
/* NeuG settings for ADC2. */
#define NEUG_ADC_SETTING2_SMPR1 ADC_SMPR1_SMP_AN10(ADC_SAMPLE_1P5) \
| ADC_SMPR1_SMP_AN11(ADC_SAMPLE_1P5)
#define NEUG_ADC_SETTING2_SMPR2 0
#define NEUG_ADC_SETTING2_SQR3 ADC_SQR3_SQ1_N(ADC_CHANNEL_IN10) \
| ADC_SQR3_SQ2_N(ADC_CHANNEL_IN11)
#define NEUG_ADC_SETTING2_NUM_CHANNELS 2
/* /*
* Board identifier. * Board identifier.
*/ */
@@ -117,6 +125,8 @@
/* /*
* Port C setup. * Port C setup.
* PC0 - Digital input with PullUp. AN10 for NeuG
* PC1 - Digital input with PullUp. AN11 for NeuG
* Everything input with pull-up except: * Everything input with pull-up except:
* PC6 - Normal input because there is an external resistor. * PC6 - Normal input because there is an external resistor.
* PC7 - Normal input because there is an external resistor. * PC7 - Normal input because there is an external resistor.
@@ -145,4 +155,14 @@
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ #define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF #define VAL_GPIOEODR 0xFFFFFFFF
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@@ -7,8 +7,8 @@
#define STM32_PLLMUL_VALUE 9 #define STM32_PLLMUL_VALUE 9
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_ADCPRE STM32_ADCPRE_DIV6
#define STM32_MCO STM32_MCO_NOCLOCK #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
#include "mcuconf-common.h" #include "mcuconf-common.h"

View File

@@ -2,13 +2,11 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "../common/hwinit.c" /*
* Board-specific initialization code.
void */
hwinit1 (void) void boardInit(void)
{ {
hwinit1_common ();
#if defined(PINPAD_CIR_SUPPORT) #if defined(PINPAD_CIR_SUPPORT)
/* EXTI0 <= PB0 */ /* EXTI0 <= PB0 */
AFIO->EXTICR[0] = AFIO_EXTICR1_EXTI0_PB; AFIO->EXTICR[0] = AFIO_EXTICR1_EXTI0_PB;

View File

@@ -38,6 +38,14 @@
#define GPIO_LED GPIOD_LED1 #define GPIO_LED GPIOD_LED1
#define IOPORT_LED GPIOD #define IOPORT_LED GPIOD
/* NeuG settings for ADC2. */
#define NEUG_ADC_SETTING2_SMPR1 ADC_SMPR1_SMP_AN10(ADC_SAMPLE_1P5) \
| ADC_SMPR1_SMP_AN11(ADC_SAMPLE_1P5)
#define NEUG_ADC_SETTING2_SMPR2 0
#define NEUG_ADC_SETTING2_SQR3 ADC_SQR3_SQ1_N(ADC_CHANNEL_IN10) \
| ADC_SQR3_SQ2_N(ADC_CHANNEL_IN11)
#define NEUG_ADC_SETTING2_NUM_CHANNELS 2
/* /*
* Board identifier. * Board identifier.
*/ */
@@ -148,6 +156,8 @@
/* /*
* Port C setup. * Port C setup.
* PC0 - Digital input with PullUp. AN10 for NeuG
* PC1 - Digital input with PullUp. AN11 for NeuG
* Everything input with pull-up except: * Everything input with pull-up except:
*/ */
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ #define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
@@ -157,7 +167,7 @@
/* /*
* Port D setup. * Port D setup.
* Everything input with pull-up except: * Everything input with pull-up except:
* PD3 - Push pull output (USB ENABLE 1:DISABLE 0:ENABLE) 2MHz * PD3 - Push pull output (USB_DISC 1:USB-DISABLE 0:USB-ENABLE) 2MHz
* PD4 - Open Drain output 2MHz (LED1). * PD4 - Open Drain output 2MHz (LED1).
*/ */
#define VAL_GPIODCRL 0x88862888 /* PD7...PD0 */ #define VAL_GPIODCRL 0x88862888 /* PD7...PD0 */
@@ -187,4 +197,15 @@
#define VAL_GPIOGCRL 0x88888888 /* PG7...PG0 */ #define VAL_GPIOGCRL 0x88888888 /* PG7...PG0 */
#define VAL_GPIOGCRH 0x88888888 /* PG15...PG8 */ #define VAL_GPIOGCRH 0x88888888 /* PG15...PG8 */
#define VAL_GPIOGODR 0xFFFFFFFF #define VAL_GPIOGODR 0xFFFFFFFF
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@@ -7,8 +7,8 @@
#define STM32_PLLMUL_VALUE 6 #define STM32_PLLMUL_VALUE 6
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_ADCPRE STM32_ADCPRE_DIV6
#define STM32_MCO STM32_MCO_NOCLOCK #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
#include "mcuconf-common.h" #include "mcuconf-common.h"

View File

@@ -2,13 +2,11 @@
#include "ch.h" #include "ch.h"
#include "hal.h" #include "hal.h"
#include "../common/hwinit.c" /*
* Board-specific initialization code.
void */
hwinit1 (void) void boardInit(void)
{ {
hwinit1_common ();
#if !defined(DFU_SUPPORT) #if !defined(DFU_SUPPORT)
if (palReadPad (IOPORT3, GPIOC_BUTTON) == 0) if (palReadPad (IOPORT3, GPIOC_BUTTON) == 0)
/* /*

View File

@@ -38,12 +38,18 @@
#define GPIO_LED GPIOA_LED1 #define GPIO_LED GPIOA_LED1
#define IOPORT_LED GPIOA #define IOPORT_LED GPIOA
#define NEUG_ADC_SETTING2_SMPR1 0
#define NEUG_ADC_SETTING2_SMPR2 ADC_SMPR2_SMP_AN1(ADC_SAMPLE_1P5) \
| ADC_SMPR2_SMP_AN2(ADC_SAMPLE_1P5)
#define NEUG_ADC_SETTING2_SQR3 ADC_SQR3_SQ1_N(ADC_CHANNEL_IN1) \
| ADC_SQR3_SQ2_N(ADC_CHANNEL_IN2)
#define NEUG_ADC_SETTING2_NUM_CHANNELS 2
/* /*
* Board identifier. * Board identifier.
*/ */
#define BOARD_STBEE_MINI #define BOARD_STBEE_MINI
#define BOARD_NAME "STBee Mini" #define BOARD_NAME "STBee Mini"
#define CPU_WITH_NO_GPIOE 1
#if defined(PINPAD_CIR_SUPPORT) || defined(PINPAD_DIAL_SUPPORT) #if defined(PINPAD_CIR_SUPPORT) || defined(PINPAD_DIAL_SUPPORT)
#define HAVE_7SEGLED 1 #define HAVE_7SEGLED 1
@@ -101,6 +107,8 @@
#if defined(PINPAD_CIR_SUPPORT) || defined(PINPAD_DIAL_SUPPORT) #if defined(PINPAD_CIR_SUPPORT) || defined(PINPAD_DIAL_SUPPORT)
/* /*
* Port A setup. * Port A setup.
* PA1 - Digital input with PullUp. AN1 for NeuG
* PA2 - Digital input with PullUp. AN2 for NeuG
* PA6 - (TIM3_CH1) input with pull-up * PA6 - (TIM3_CH1) input with pull-up
* PA7 - (TIM3_CH2) input with pull-down * PA7 - (TIM3_CH2) input with pull-down
* PA11 - input with pull-up (USBDM) * PA11 - input with pull-up (USBDM)
@@ -135,6 +143,8 @@
#else #else
/* /*
* Port A setup. * Port A setup.
* PA1 - Digital input with PullUp. AN1 for NeuG
* PA2 - Digital input with PullUp. AN2 for NeuG
* PA11 - input with pull-up (USBDM) * PA11 - input with pull-up (USBDM)
* PA12 - input with pull-up (USBDP) * PA12 - input with pull-up (USBDP)
* Everything input with pull-up except: * Everything input with pull-up except:
@@ -174,4 +184,22 @@
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ #define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
#define VAL_GPIODODR 0xFFFFFFFF #define VAL_GPIODODR 0xFFFFFFFF
/*
* Port E setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */ #endif /* _BOARD_H_ */

View File

@@ -7,8 +7,8 @@
#define STM32_PLLMUL_VALUE 6 #define STM32_PLLMUL_VALUE 6
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV4 #define STM32_ADCPRE STM32_ADCPRE_DIV6
#define STM32_MCO STM32_MCO_NOCLOCK #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
#include "mcuconf-common.h" #include "mcuconf-common.h"

View File

@@ -54,8 +54,8 @@
#define ADC_CHANNEL_IN0 0 #define ADC_CHANNEL_IN0 0
#define ADC_CHANNEL_IN1 1 #define ADC_CHANNEL_IN1 1
#define ADC_CHANNEL_IN9 9
#define ADC_CHANNEL_IN2 2 #define ADC_CHANNEL_IN2 2
#define ADC_CHANNEL_IN9 9
#define ADC_CHANNEL_IN10 10 #define ADC_CHANNEL_IN10 10
#define ADC_CHANNEL_IN11 11 #define ADC_CHANNEL_IN11 11
#define ADC_CHANNEL_SENSOR 16 #define ADC_CHANNEL_SENSOR 16