1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards: adapt gpio config for remote-pa

This commit is contained in:
smlng 2017-08-21 15:38:10 +02:00
parent 46facf4ff7
commit f22172f2a8
2 changed files with 7 additions and 16 deletions

View File

@ -53,15 +53,7 @@ void board_init(void)
*/
static void rf_switch_init(void)
{
/* set pins to be controlled by software */
RF_SWITCH_PORT->AFSEL &= ~(1 << RF_SWITCH_PIN);
/* configure pins as output */
RF_SWITCH_PORT->DIR |= (1 << RF_SWITCH_PIN);
/* configure io-mux for used pins */
IOC_PXX_OVER[RF_SWITCH_PIN] = IOC_OVERRIDE_OE;
/* Set to default */
RF_SWITCH_INTERNAL;
/* Set RF 2.4GHz as default */
gpio_init(RF_SWITCH_GPIO, GPIO_OUT);
RF_SWITCH_2_4_GHZ;
}

View File

@ -70,11 +70,10 @@
* 2.4GHz RF switch controlled by SW
* @{
*/
#define RF_SWITCH_PORT GPIO_D
#define RF_SWITCH_PIN (4)
#define RF_SWITCH_EXTERNAL (RF_SWITCH_PORT->DATA |= (1 << RF_SWITCH_PIN))
#define RF_SWITCH_INTERNAL (RF_SWITCH_PORT->DATA &= ~(1 << RF_SWITCH_PIN))
#define RF_SWITCH_TOGGLE (RF_SWITCH_PORT->DATA ^= (1 << RF_SWITCH_PIN))
#define RF_SWITCH_GPIO GPIO_PIN(3, 4)
#define RF_SWITCH_SUB_GHZ gpio_set(RF_SWITCH_GPIO)
#define RF_SWITCH_2_4_GHZ gpio_clear(RF_SWITCH_GPIO)
#define RF_SWITCH_TOGGLE gpio_toggle(RF_SWITCH_GPIO)
/** @} */
/**