Skip to content

Commit d968dab

Browse files
author
Chris Trowbridge
authored
Add default soft/hard power on/off sequences for ME910
1 parent 78b583d commit d968dab

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include "TELIT_ME910.h"
1919
#include "AT_CellularNetwork.h"
20+
#include "gpio_api.h"
21+
#include "platform/mbed_wait_api.h"
2022

2123
using namespace mbed;
2224
using namespace events;
@@ -78,3 +80,43 @@ CellularDevice *CellularDevice::get_default_instance()
7880
return &device;
7981
}
8082
#endif
83+
84+
nsapi_error_t TELIT_ME910::hard_power_on()
85+
{
86+
soft_power_on();
87+
88+
return NSAPI_ERROR_OK;
89+
}
90+
91+
nsapi_error_t TELIT_ME910::soft_power_on()
92+
{
93+
gpio_t gpio;
94+
95+
gpio_init_out_ex(&gpio, MDMPWRON, 1);
96+
wait_ms(500);
97+
gpio_write(&gpio, 0);
98+
wait_ms(5000);
99+
gpio_write(&gpio, 1);
100+
wait_ms(5000);
101+
102+
return NSAPI_ERROR_OK;
103+
}
104+
105+
nsapi_error_t TELIT_ME910::hard_power_off()
106+
{
107+
gpio_t gpio;
108+
109+
gpio_init_out_ex(&gpio, MDMPWRON, 0);
110+
/* keep the power line low for more than 10 seconds.
111+
* If 3G_ON_OFF pin is kept low for more than a second, a controlled disconnect and shutdown takes
112+
* place, Due to the network disconnect, shut-off can take up to 30 seconds. However, we wait for 10
113+
* seconds only */
114+
wait_ms(10 * 1000);
115+
116+
return NSAPI_ERROR_OK;
117+
}
118+
119+
nsapi_error_t TELIT_ME910::soft_power_off()
120+
{
121+
return AT_CellularDevice::soft_power_off();
122+
}

0 commit comments

Comments
 (0)