@@ -154,6 +154,7 @@ struct modem_cellular_config {
154
154
const struct device * uart ;
155
155
struct gpio_dt_spec power_gpio ;
156
156
struct gpio_dt_spec reset_gpio ;
157
+ struct gpio_dt_spec wake_gpio ;
157
158
uint16_t power_pulse_duration_ms ;
158
159
uint16_t reset_pulse_duration_ms ;
159
160
uint16_t startup_time_ms ;
@@ -599,6 +600,10 @@ static int modem_cellular_on_idle_state_enter(struct modem_cellular_data *data)
599
600
const struct modem_cellular_config * config =
600
601
(const struct modem_cellular_config * )data -> dev -> config ;
601
602
603
+ if (modem_cellular_gpio_is_enabled (& config -> wake_gpio )) {
604
+ gpio_pin_set_dt (& config -> wake_gpio , 0 );
605
+ }
606
+
602
607
if (modem_cellular_gpio_is_enabled (& config -> reset_gpio )) {
603
608
gpio_pin_set_dt (& config -> reset_gpio , 1 );
604
609
}
@@ -662,6 +667,10 @@ static int modem_cellular_on_idle_state_leave(struct modem_cellular_data *data)
662
667
gpio_pin_set_dt (& config -> reset_gpio , 0 );
663
668
}
664
669
670
+ if (modem_cellular_gpio_is_enabled (& config -> wake_gpio )) {
671
+ gpio_pin_set_dt (& config -> wake_gpio , 1 );
672
+ }
673
+
665
674
return 0 ;
666
675
}
667
676
@@ -670,6 +679,10 @@ static int modem_cellular_on_reset_pulse_state_enter(struct modem_cellular_data
670
679
const struct modem_cellular_config * config =
671
680
(const struct modem_cellular_config * )data -> dev -> config ;
672
681
682
+ if (modem_cellular_gpio_is_enabled (& config -> wake_gpio )) {
683
+ gpio_pin_set_dt (& config -> wake_gpio , 0 );
684
+ }
685
+
673
686
gpio_pin_set_dt (& config -> reset_gpio , 1 );
674
687
modem_cellular_start_timer (data , K_MSEC (config -> reset_pulse_duration_ms ));
675
688
return 0 ;
@@ -698,6 +711,11 @@ static int modem_cellular_on_reset_pulse_state_leave(struct modem_cellular_data
698
711
(const struct modem_cellular_config * )data -> dev -> config ;
699
712
700
713
gpio_pin_set_dt (& config -> reset_gpio , 0 );
714
+
715
+ if (modem_cellular_gpio_is_enabled (& config -> wake_gpio )) {
716
+ gpio_pin_set_dt (& config -> wake_gpio , 1 );
717
+ }
718
+
701
719
modem_cellular_stop_timer (data );
702
720
return 0 ;
703
721
}
@@ -1715,6 +1733,10 @@ static int modem_cellular_init(const struct device *dev)
1715
1733
1716
1734
k_sem_init (& data -> suspended_sem , 0 , 1 );
1717
1735
1736
+ if (modem_cellular_gpio_is_enabled (& config -> wake_gpio )) {
1737
+ gpio_pin_configure_dt (& config -> wake_gpio , GPIO_OUTPUT_INACTIVE );
1738
+ }
1739
+
1718
1740
if (modem_cellular_gpio_is_enabled (& config -> power_gpio )) {
1719
1741
gpio_pin_configure_dt (& config -> power_gpio , GPIO_OUTPUT_INACTIVE );
1720
1742
}
@@ -2127,10 +2149,16 @@ MODEM_CHAT_SCRIPT_DEFINE(u_blox_lara_r6_periodic_chat_script,
2127
2149
2128
2150
#if DT_HAS_COMPAT_STATUS_OKAY (swir_hl7800 )
2129
2151
MODEM_CHAT_SCRIPT_CMDS_DEFINE (swir_hl7800_init_chat_script_cmds ,
2130
- MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 100 ),
2131
- MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 100 ),
2132
- MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 100 ),
2133
- MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 100 ),
2152
+ MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 1000 ),
2153
+ MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 1000 ),
2154
+ MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 1000 ),
2155
+ MODEM_CHAT_SCRIPT_CMD_RESP_NONE ("AT" , 1000 ),
2156
+ /* Turn off sleep mode */
2157
+ MODEM_CHAT_SCRIPT_CMD_RESP ("AT+KSLEEP=2" , ok_match ),
2158
+ /* Turn off PSM */
2159
+ MODEM_CHAT_SCRIPT_CMD_RESP ("AT+CPSMS=0" , ok_match ),
2160
+ /* Turn off eDRX */
2161
+ MODEM_CHAT_SCRIPT_CMD_RESP ("AT+CEDRXS=0" , ok_match ),
2134
2162
MODEM_CHAT_SCRIPT_CMD_RESP ("ATE0" , ok_match ),
2135
2163
MODEM_CHAT_SCRIPT_CMD_RESP ("AT+CFUN=1" , ok_match ),
2136
2164
MODEM_CHAT_SCRIPT_CMD_RESP_MULT ("AT+CGACT=0" , allow_match ),
@@ -2388,6 +2416,7 @@ MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script,
2388
2416
.uart = DEVICE_DT_GET(DT_INST_BUS(inst)), \
2389
2417
.power_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_power_gpios, {}), \
2390
2418
.reset_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_reset_gpios, {}), \
2419
+ .wake_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, mdm_wake_gpios, {}), \
2391
2420
.power_pulse_duration_ms = (power_ms), \
2392
2421
.reset_pulse_duration_ms = (reset_ms), \
2393
2422
.startup_time_ms = (startup_ms), \
0 commit comments