Clicker2-STM32: Add definitions for remaining mikroBUS pins.

This commit is contained in:
Gregory Nutt 2017-03-22 13:28:16 -06:00
parent 7f2c4c4274
commit 4c6646ad5d
2 changed files with 93 additions and 5 deletions

View File

@ -261,7 +261,16 @@
#define BUTTON_T3_BIT (1 << BUTTON_T3) #define BUTTON_T3_BIT (1 << BUTTON_T3)
/* Alternate function pin selections ************************************************/ /* Alternate function pin selections ************************************************/
/* UART3: Assuming RS-232 connverted connected on mikroMB2 */ /* U[S]ARTs
*
* USART2 - mikroBUS1
* USART3 - mikroBUS2
*
* Assuming RS-232 connverted connected on mikroMB1/12
*/
#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */
#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */
#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ #define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */
#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 / #define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 /
@ -280,6 +289,33 @@
#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 /* PB14 */ #define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 /* PB14 */
#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 /* PB13 */ #define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 /* PB13 */
/* I2C
*
* I2C2 - mikroBUS2
* I2C3 - mikroBUS1
*/
#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */
#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */
#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 /* PA8 */
#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 /* PC9 */
/* Analog
*
* mikroBUS1 ADC: PA2-MB1_AN
* mikroBUS1 ADC: PA3-MB2_AN
*/
/* PWM
*
* mikroBUS1 ADC: PE9-MB1-PWM (TIM1, channel 1)
* mikroBUS1 ADC: PD12-MB2-PWM (TIM4, channel 1)
*/
#define GPIO_TIM1_CH1OUT GPIO_TIM1_CH1OUT_2 /* PE9 */
#define GPIO_TIM4_CH1OUT GPIO_TIM4_CH1OUT_2 /* PD12 */
/* DMA Channl/Stream Selections *****************************************************/ /* DMA Channl/Stream Selections *****************************************************/
/* Stream selections are arbitrary for now but might become important in the future /* Stream selections are arbitrary for now but might become important in the future
* if we set aside more DMA channels/streams. * if we set aside more DMA channels/streams.

View File

@ -132,8 +132,8 @@
* *
* T2 - PE0, Low sensed when pressed * T2 - PE0, Low sensed when pressed
* T3 - PA10, Low sensed when pressed * T3 - PA10, Low sensed when pressed
* *
* NOTE that all have EXTI interrupts configured * NOTE that all have EXTI interrupts configured
*/ */
#define GPIO_BTN_T2 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTE|GPIO_PIN0) #define GPIO_BTN_T2 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTE|GPIO_PIN0)
@ -165,16 +165,68 @@
#define GPIO_PWR_FAULT (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN6) #define GPIO_PWR_FAULT (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN6)
#define GPIO_PWR_BATSTAT (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN4) #define GPIO_PWR_BATSTAT (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN4)
/* mikroBUS *************************************************************************/
/* U[S]ARTs
*
* USART2 - mikroBUS1
* USART3 - mikroBUS2
*/
/* SPI Chip Selects /* SPI Chip Selects
* *
* mikroBUS1 Chipselect: SPI3 PE8 * mikroBUS1 Chipselect: PE8-MB1_CS (SPI3)
* mikroBUS2 Chipselect: SPI2 PE11 * mikroBUS2 Chipselect: PE11-MB2_CS (SPI2)
*/ */
#define GPIO_MB1_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ #define GPIO_MB1_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN8) GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN8)
#define GPIO_MB2_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ #define GPIO_MB2_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN11) GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN11)
/* I2C
*
* mikroBUS1 I2C: PA8-I2C3_SCL, PC9-I2C3_SDA (I2C3)
* mikroBUS2 I2C: PB10-I2C2_SCL, PB11-I2C2_SDA ()
*/
/* Analog
*
* mikroBUS1 ADC: PA2-MB1_AN
* mikroBUS1 ADC: PA3-MB2_AN
*/
/* PWM
*
* mikroBUS1 ADC: PE9-MB1-PWM (TIM1, channel 1)
* mikroBUS1 ADC: PD12-MB2-PWM (TIM4, channel 1)
*/
/* Reset
*
* mikroBUS1 Interrupt: PE7-MB1_RST
* mikroBUS2 Interrupt: PE13-MB2_RST
*
* I assume that the interrupt lines are active low. The initial state holds the
* device in reset.
*/
#define GPIO_MB1_RST (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN7)
#define GPIO_MB1_RST (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13)
/* Interrupts
*
* mikroBUS1 Interrupt: PE10-MB1_INT
* mikroBUS2 Interrupt: PE14-MB2_INT
*
* I assume that the interrupt lines are active low. No pull-ups are provided on
* board so pull-ups ar provided in the pin configurations.
*/
#define GPIO_MB1_INT (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTE|GPIO_PIN10)
#define GPIO_MB2_INT (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTE|GPIO_PIN14)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/************************************************************************************ /************************************************************************************