1 /*
2  * Copyright (c) 2012 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #ifndef __TARGET_GPIOCONFIG_H
9 #define __TARGET_GPIOCONFIG_H
10 
11 #include <platform/gpio.h>
12 #include <platform/stm32.h>
13 
14 #define GPIO_LED_ON GPIO_PIN_RESET
15 #define GPIO_LED_OFF GPIO_PIN_SET
16 
17 #define GPIO_USART3_TX GPIO(GPIO_PORT_B, 10)
18 #define GPIO_USART3_RX GPIO(GPIO_PORT_B, 11)
19 
20 #define GPIO_LED108 GPIO(GPIO_PORT_E, 3)
21 #define GPIO_LED109 GPIO(GPIO_PORT_E, 4)
22 #define GPIO_LED110 GPIO(GPIO_PORT_E, 5)
23 #define GPIO_LED111 GPIO(GPIO_PORT_E, 6)
24 
25 #define GPIO_LED112 GPIO(GPIO_PORT_D, 6)
26 #define GPIO_LED113 GPIO(GPIO_PORT_D, 7)
27 #define GPIO_LED114 GPIO(GPIO_PORT_J, 10)
28 #define GPIO_LED115 GPIO(GPIO_PORT_J, 11)
29 
30 #define GPIO_SHIELD_D0 GPIO(GPIO_PORT_B, 11)
31 #define GPIO_SHIELD_D1 GPIO(GPIO_PORT_B, 10)
32 #define GPIO_SHIELD_D2 GPIO(GPIO_PORT_E, 3)
33 #define GPIO_SHIELD_D3 GPIO(GPIO_PORT_E, 4)
34 #define GPIO_SHIELD_D4 GPIO(GPIO_PORT_E, 5)
35 #define GPIO_SHIELD_D5 GPIO(GPIO_PORT_E, 6)
36 #define GPIO_SHIELD_D6 GPIO(GPIO_PORT_D, 6)
37 #define GPIO_SHIELD_D7 GPIO(GPIO_PORT_D, 7)
38 #define GPIO_SHIELD_D8 GPIO(GPIO_PORT_J, 10)
39 #define GPIO_SHIELD_D9 GPIO(GPIO_PORT_J, 11)
40 #define GPIO_SHIELD_D10 GPIO(GPIO_PORT_J, 12)
41 #define GPIO_SHIELD_D11 GPIO(GPIO_PORT_J, 13)
42 #define GPIO_SHIELD_D12 GPIO(GPIO_PORT_J, 14)
43 #define GPIO_SHIELD_D13 GPIO(GPIO_PORT_J, 15)
44 
45 #define GPIO_SHIELD_ADC0 GPIO(GPIO_PORT_F, 6)
46 #define GPIO_SHIELD_ADC1 GPIO(GPIO_PORT_F, 10)
47 #define GPIO_SHIELD_ADC2 GPIO(GPIO_PORT_A, 3)
48 #define GPIO_SHIELD_ADC3 GPIO(GPIO_PORT_A, 5)
49 #define GPIO_SHIELD_ADC4 GPIO(GPIO_PORT_A, 6)
50 #define GPIO_SHIELD_ADC5 GPIO(GPIO_PORT_B, 0)
51 
52 #define GPIO_SW100 GPIO(GPIO_PORT_J, 12)
53 #define GPIO_SW101 GPIO(GPIO_PORT_J, 13)
54 #define GPIO_SW102 GPIO(GPIO_PORT_J, 14)
55 #define GPIO_SW103 GPIO(GPIO_PORT_J, 15)
56 
57 /**
58  *  Definitions for sensor bus signals. Includes
59  *   nrf51, accelerometer, and gyroscope
60  */
61 
62 #define __HAL_SENSOR_BUS_GPIO_CLK_ENABLE() \
63             __HAL_RCC_GPIOK_CLK_ENABLE(); \
64             __HAL_RCC_GPIOF_CLK_ENABLE()
65 
66 #define GPIO_NRF_CS         GPIO(GPIO_PORT_K, 0)
67 #define GPIO_NRF_INT        GPIO(GPIO_PORT_K, 1)
68 #define GPIO_GYRO_nCS       GPIO(GPIO_PORT_K, 4)
69 #define GPIO_GYRO_INT       GPIO(GPIO_PORT_K, 5)
70 #define GPIO_ACC_nCS        GPIO(GPIO_PORT_K, 2)
71 #define GPIO_ACC_INT        GPIO(GPIO_PORT_K, 3)
72 #define GPIO_SPI5_SCK       GPIO(GPIO_PORT_F, 7)
73 #define GPIO_SPI5_MISO      GPIO(GPIO_PORT_F, 8)
74 #define GPIO_SPI5_MOSI      GPIO(GPIO_PORT_F, 9)
75 
76 
77 
78 #endif
79