MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / DVK_busControlMode

Function DVK_busControlMode

bsp/efm32/EFM32GG_DK3750/dvk.c:105–139  ·  view source on GitHub ↗

/ * @brief Configure Board Controller bus decode logic * @param[in] mode Mode of operation for decode logic *****************************************************************************/

Source from the content-addressed store, hash-verified

103 * @param[in] mode Mode of operation for decode logic
104 *****************************************************************************/
105void DVK_busControlMode(DVK_BusControl_TypeDef mode)
106{
107 /* Configure GPIO pins for Board Bus mode */
108 /* Note: Inverter on GPIO lines to BC, so signals are active low */
109 CMU_ClockEnable(cmuClock_GPIO, true);
110
111 switch (mode)
112 {
113 case DVK_BusControl_OFF:
114 /* Configure board for OFF mode on PB15 MCU_EBI_CONNECT */
115 GPIO_PinModeSet(gpioPortB, 15, gpioModePushPull, 1);
116 /* Configure board for OFF mode on PD13 MCU_SPI_CONNECT */
117 GPIO_PinModeSet(gpioPortD, 13, gpioModePushPull, 1);
118 break;
119 case DVK_BusControl_DIRECT:
120 /* Configure board for DIRECT on PB15 MCU_EBI_CONNECT */
121 GPIO_PinModeSet(gpioPortB, 15, gpioModePushPull, 0);
122 /* Configure board for DIRECT on PD13 MCU_SPI_CONNECT */
123 GPIO_PinModeSet(gpioPortD, 13, gpioModePushPull, 0);
124 break;
125 case DVK_BusControl_SPI:
126 /* Configure board for SPI mode on PB15 MCU_EBI_CONNECT */
127 GPIO_PinModeSet(gpioPortB, 15, gpioModePushPull, 1);
128 /* Configure board for SPI mode on PD13 MCU_SPI_CONNECT */
129 GPIO_PinModeSet(gpioPortD, 13, gpioModePushPull, 0);
130 break;
131 case DVK_BusControl_EBI:
132 default:
133 /* Configure board for EBI mode on PB15 MCU_EBI_CONNECT */
134 GPIO_PinModeSet(gpioPortB, 15, gpioModePushPull, 0);
135 /* Configure board for EBI mode on PD13 MCU_SPI_CONNECT */
136 GPIO_PinModeSet(gpioPortD, 13, gpioModePushPull, 1);
137 break;
138 }
139}
140
141
142/**************************************************************************//**

Callers 3

DVK_initFunction · 0.85
DVK_disableFunction · 0.85
DVK_SPI_initFunction · 0.85

Calls 2

CMU_ClockEnableFunction · 0.85
GPIO_PinModeSetFunction · 0.85

Tested by

no test coverage detected