Lora-net/LoRaMac-node

Why does the SX1276Reset( ) function change the NRESET pin to input mode when resetting?

Closed this issue · 1 comments

Hi. I have a question about the reset code.

void SX1276Reset( void )
{
     // Enables the TCXO if available on the board design
     SX1276SetBoardTcxo( true );

     // Set RESET pin to 0
     GpioInit( &SX1276.Reset, RADIO_RESET, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 0 );

     // Wait 1 ms
     DelayMs( 1 );

     // Configure RESET as input
     GpioInit( &SX1276.Reset, RADIO_RESET, PIN_INPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );

     // Wait 6 ms
     DelayMs( 6 );
}

If you look at the // Configure RESET as input code at the end of the reset function, the GPIO is set to input mode through the PIN_INPUT parameter. Isn't the NRESET pin supposed to be set as an output from the MCU's point of view? Is there any special reason to set it to Input mode?

The reason is because the radio datasheet says so.

The SX127x radios NRESET pin is kind of special as it needs to be in high impedance mode when the radio is operating.

image