board: add Nitrokey Start
Signed-off-by: Mateusz Zalega <mateusz@nitrokey.com>
This commit is contained in:
committed by
NIIBE Yutaka
parent
6e7334dcff
commit
8650bde8a0
61
board/board-nitrokey-start.h
Normal file
61
board/board-nitrokey-start.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#define BOARD_NAME "NITROKEY-START"
|
||||||
|
#define BOARD_ID 0x4aa5b5e2
|
||||||
|
|
||||||
|
#define STM32F10X_MD /* Medium-density device */
|
||||||
|
|
||||||
|
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
|
||||||
|
#define STM32_PLLMUL_VALUE 6
|
||||||
|
#define STM32_HSECLK 12000000
|
||||||
|
|
||||||
|
#define GPIO_LED_BASE GPIOB_BASE
|
||||||
|
#define GPIO_LED_SET_TO_EMIT 0
|
||||||
|
#define GPIO_USB_BASE GPIOA_BASE
|
||||||
|
#define GPIO_USB_SET_TO_ENABLE 15
|
||||||
|
#undef GPIO_OTHER_BASE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Port A setup.
|
||||||
|
* PA0 - input with pull-up (TIM2_CH1): AN0 for NeuG
|
||||||
|
* PA1 - floating input
|
||||||
|
* PA2 - floating input
|
||||||
|
* PA3 - floating input
|
||||||
|
* PA4 - floating input
|
||||||
|
* PA5 - floating input
|
||||||
|
* PA6 - floating input
|
||||||
|
* PA7 - Push pull output (LED1 1:ON 0:OFF)
|
||||||
|
* PA8 - floating input (smartcard, SCDSA)
|
||||||
|
* PA9 - floating input
|
||||||
|
* PA10 - floating input
|
||||||
|
* PA11 - Push Pull output 10MHz 0 default (until USB enabled) (USBDM)
|
||||||
|
* PA12 - Push Pull output 10MHz 0 default (until USB enabled) (USBDP)
|
||||||
|
* PA15 - Push pull output (USB_EN 1:ON 0:OFF)
|
||||||
|
* ------------------------ Default
|
||||||
|
* PA8 - input with pull-up.
|
||||||
|
* PA9 - floating input.
|
||||||
|
* PA10 - floating input.
|
||||||
|
* PA13 - input with pull-up.
|
||||||
|
* PA14 - input with pull-up.
|
||||||
|
* PA15 - Push pull output (USB 1:ON 0:OFF)
|
||||||
|
*/
|
||||||
|
#define VAL_GPIO_USB_ODR 0xFFFFE7FD
|
||||||
|
#define VAL_GPIO_USB_CRL 0x34444448 /* PA7...PA0 */
|
||||||
|
#define VAL_GPIO_USB_CRH 0x38811444 /* PA15...PA8 */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Port B setup.
|
||||||
|
* PB0 - Push pull output (LED2 1:ON 0:OFF)
|
||||||
|
* PB1 - input with pull-up: AN9 for NeuG
|
||||||
|
* ------------------------ Default
|
||||||
|
* PBx - input with pull-up.
|
||||||
|
*/
|
||||||
|
#define VAL_GPIO_LED_ODR 0xFFFFFFFF
|
||||||
|
#define VAL_GPIO_LED_CRL 0x88888883 /* PA7...PA0 */
|
||||||
|
#define VAL_GPIO_LED_CRH 0x88888888 /* PA15...PA8 */
|
||||||
|
|
||||||
|
#define RCC_ENR_IOP_EN \
|
||||||
|
(RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_AFIOEN)
|
||||||
|
#define RCC_RSTR_IOP_RST \
|
||||||
|
(RCC_APB2RSTR_IOPARST | RCC_APB2RSTR_IOPBRST | RCC_APB2RSTR_AFIORST)
|
||||||
|
|
||||||
|
#define AFIO_MAPR_SWJ_CFG_JTAGDISABLE ((uint32_t)0x02000000)
|
||||||
|
#define AFIO_MAPR_SOMETHING AFIO_MAPR_SWJ_CFG_JTAGDISABLE
|
||||||
Reference in New Issue
Block a user