gsm module power button control

sr9wxz_new_configuration_for_ZZ06
Mateusz Lubecki 2022-05-06 14:53:21 +02:00
rodzic 1bf375b618
commit 206538f34c
5 zmienionych plików z 35 dodań i 10 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType">
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;RTC&quot;/&gt;&#10; &lt;peripheral name=&quot;ADC2&quot;/&gt;&#10; &lt;peripheral name=&quot;RCC&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;RTC&quot;/&gt;&#10; &lt;peripheral name=&quot;ADC2&quot;/&gt;&#10; &lt;peripheral name=&quot;RCC&quot;/&gt;&#10; &lt;peripheral name=&quot;GPIOB&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="true"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/>

Wyświetl plik

@ -115,6 +115,15 @@ inline void io___cntrl_vbat_r_disable(void) {
}
inline void io___cntrl_gprs_pwrkey_press() {
GPIOA->BSRR |= GPIO_BSRR_BS7;
}
inline void io___cntrl_gprs_pwrkey_release() {
GPIOA->BSRR |= GPIO_BSRR_BR7;
}
inline uint8_t io_get_cntrl_vbat_c(void) {
uint8_t out = 0;

Wyświetl plik

@ -8,7 +8,7 @@
#include "config_data.h"
#define SW_VER "EA05"
#define SW_DATE "24042022"
#define SW_DATE "04052022"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -43,6 +43,18 @@ void io_oc_init(void) {
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
#endif
#if defined(STM32L471xx)
// PA7 - GPRS power key
GPIO_InitTypeDef.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitTypeDef.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitTypeDef.Pin = LL_GPIO_PIN_7;
GPIO_InitTypeDef.Pull = LL_GPIO_PULL_NO;
GPIO_InitTypeDef.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;
GPIO_InitTypeDef.Alternate = LL_GPIO_AF_7;
LL_GPIO_Init(GPIOA, &GPIO_InitTypeDef);
#endif
}
void io_oc_output_low(void) {

Wyświetl plik

@ -577,7 +577,7 @@ int main(int argc, char* argv[]){
LL_GPIO_Init(GPIOA, &GPIO_InitTypeDef); // TX
// USART3 - GSM
GPIO_InitTypeDef.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitTypeDef.Mode = LL_GPIO_MODE_ALTERNATE; // LL_GPIO_MODE_ALTERNATE
GPIO_InitTypeDef.Pin = LL_GPIO_PIN_10;
GPIO_InitTypeDef.Pull = LL_GPIO_PULL_NO;
GPIO_InitTypeDef.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH;
@ -585,7 +585,7 @@ int main(int argc, char* argv[]){
GPIO_InitTypeDef.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
LL_GPIO_Init(GPIOB, &GPIO_InitTypeDef); // TX
GPIO_InitTypeDef.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitTypeDef.Mode = LL_GPIO_MODE_ALTERNATE; // LL_GPIO_MODE_ALTERNATE
GPIO_InitTypeDef.Pin = LL_GPIO_PIN_11;
GPIO_InitTypeDef.Pull = LL_GPIO_PULL_NO;
GPIO_InitTypeDef.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH;
@ -912,6 +912,8 @@ int main(int argc, char* argv[]){
led_control_led1_upper(true);
led_control_led2_bottom(false);
io___cntrl_gprs_pwrkey_press();
delay_fixed(1000);
led_control_led1_upper(false);
@ -927,6 +929,8 @@ int main(int argc, char* argv[]){
led_control_led1_upper(false);
led_control_led2_bottom(false);
io___cntrl_gprs_pwrkey_release();
#endif
// configuting system timers
@ -1246,15 +1250,15 @@ int main(int argc, char* argv[]){
#ifdef STM32L471xx
if (main_config_data_mode->gsm == 1) {
gsm_sim800_poolers_one_minute(main_gsm_srl_ctx_ptr, &main_gsm_state);
gsm_sim800_poolers_one_minute(main_gsm_srl_ctx_ptr, &main_gsm_state);
if (gsm_sim800_gprs_ready == 1) {
if (gsm_sim800_gprs_ready == 1) {
//api_send_json_status();
api_send_json_measuremenets();
// retval = http_client_async_get("http://pogoda.cc:8080/meteo_backend/status", strlen("http://pogoda.cc:8080/meteo_backend/status"), 0xFFF0, 0x1, 0);
}
//api_send_json_status();
api_send_json_measuremenets();
// retval = http_client_async_get("http://pogoda.cc:8080/meteo_backend/status", strlen("http://pogoda.cc:8080/meteo_backend/status"), 0xFFF0, 0x1, 0);
}
}
#endif