gateway/components/lmic-esp-idf-master/src/hal/hal.c
void hal_pin_rst (u1_t val) {
    gpio_config_t io_conf;
    io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
    io_conf.pin_bit_mask = (1<<lmic_pins.rst);
    io_conf.pull_down_en = 0;
    io_conf.pull_up_en = 0;

    if (lmic_pins.rst == LMIC_UNUSED_PIN)
        return;

    if(val == 0 || val == 1) { // drive pin
        io_conf.mode = GPIO_MODE_OUTPUT;
        gpio_config(&io_conf);
    } else { // keep pin floating
        io_conf.mode = GPIO_MODE_INPUT;
        gpio_config(&io_conf);
    }
}
// set radio RST pin to given value (or keep floating!)
set radio RST pin to given value (or keep floating!)
set radio RST pin to given value ( or keep floating! )
void hal_pin_rst (u1_t val) {
    gpio_config_t io_conf;
    io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
    io_conf.pin_bit_mask = (1<<lmic_pins.rst);
    io_conf.pull_down_en = 0;
    io_conf.pull_up_en = 0;
    if (lmic_pins.rst == LMIC_UNUSED_PIN)
        return;
    if(val == 0 || val == 1) { 
        io_conf.mode = GPIO_MODE_OUTPUT;
        gpio_config(&io_conf);
    } else { 
        io_conf.mode = GPIO_MODE_INPUT;
        gpio_config(&io_conf);
    }
}
void hal_pin_rst ( u1_t val ) { gpio_config_t io_conf ; io_conf . intr_type = GPIO_PIN_INTR_DISABLE ; io_conf . pin_bit_mask = ( 1 << lmic_pins . rst ) ; io_conf . pull_down_en = 0 ; io_conf . pull_up_en = 0 ; if ( lmic_pins . rst == LMIC_UNUSED_PIN ) return ; if ( val == 0 || val == 1 ) { io_conf . mode = GPIO_MODE_OUTPUT ; gpio_config ( & io_conf ) ; } else { io_conf . mode = GPIO_MODE_INPUT ; gpio_config ( & io_conf ) ; } }
set radio RST pin to given value (or keep floating!)
set radio RST pin to given value ( or keep floating! )
// drive pin // keep pin floating