Mistake on this page?
Report an issue in GitHub or email us
1 /*
2  * Copyright (c) 2019, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
18 #ifndef QUECTEL_EC2X_H
19 #define QUECTEL_EC2X_H
21 #include <chrono>
22 #include "DigitalOut.h"
23 #include "AT_CellularDevice.h"
25 namespace mbed {
28 public:
30  /**
31  * Constructs the Quectel EC2X series driver. It is mandatory to provide
32  * a FileHandle object, the power pin and the polarity of the pin.
33  * Providing reset pin is optional.
34  */
35  QUECTEL_EC2X(FileHandle *fh, PinName pwr, bool active_high, PinName rst = NC);
37  virtual nsapi_error_t hard_power_on();
38  virtual nsapi_error_t hard_power_off();
39  virtual nsapi_error_t soft_power_on();
40  virtual nsapi_error_t soft_power_off();
42 private:
43  nsapi_error_t press_power_button(std::chrono::duration<uint32_t, std::milli> timeout);
44  bool _active_high;
45  DigitalOut _pwr_key;
46  DigitalOut _rst;
47 };
49 } // namespace mbed
51 #endif // QUECTEL_EC2X_H
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:140
Class FileHandle.
Definition: FileHandle.h:46
virtual nsapi_error_t soft_power_off()
Powers down the modem.
QUECTEL_EC2X(FileHandle *fh, PinName pwr, bool active_high, PinName rst=NC)
Constructs the Quectel EC2X series driver.
virtual nsapi_error_t soft_power_on()
Powers up the modem.
virtual nsapi_error_t hard_power_on()
Sets the modem up for powering on This is equivalent to plugging in the device, i.e., attaching power and serial port.
Class AT_CellularDevice.
A digital output, used for setting the state of a pin.
Definition: DigitalOut.h:49
virtual nsapi_error_t hard_power_off()
Sets the modem in unplugged state.
Definition: ATHandler.h:46
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.