belyalov / stm32-hal-libraries

Useful libraries for STM32 HAL
MIT License
85 stars 17 forks source link

LoRa deep sleep #13

Open krupis opened 11 months ago

krupis commented 11 months ago

Hello. I use your library to test SX1276 LoRa modules on STM32L031. It seems to be working fine, however I have got one question saving current consumption. For my particular application, when the sender sends a message, I want it to enter deep sleep. I use the following code for sending a message:

       uint8_t res2 = lora_send_packet(&lora, (uint8_t *)"test", 4);
       if (res2 != LORA_OK) {
            printf("send failed \n");
       }
       else{
           printf("send sucessfull \n");
           //enter sleep mode
       }

Is there a function that I need to call to put the SX1276 into low power mode or it goes to low power mode automatically after sending a message? I would very much appreciate clarification. Thanks in advance.