Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers QUECTEL_EC2X.h Source File

QUECTEL_EC2X.h

00001 /*
00002  * Copyright (c) 2019, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef QUECTEL_EC2X_H
00019 #define QUECTEL_EC2X_H
00020 
00021 #include "DigitalOut.h"
00022 #include "AT_CellularDevice.h"
00023 
00024 namespace mbed {
00025 
00026 class QUECTEL_EC2X : public AT_CellularDevice {
00027 public:
00028 
00029     /**
00030      * Constructs the Quectel EC2X series driver. It is mandatory to provide
00031      * a FileHandle object, the power pin and the polarity of the pin.
00032      * Providing reset pin is optional.
00033      */
00034     QUECTEL_EC2X(FileHandle *fh, PinName pwr, bool active_high, PinName rst = NC);
00035 
00036     virtual nsapi_error_t hard_power_on();
00037     virtual nsapi_error_t hard_power_off();
00038     virtual nsapi_error_t soft_power_on();
00039     virtual nsapi_error_t soft_power_off();
00040 
00041 private:
00042     nsapi_error_t press_power_button(uint32_t timeout);
00043     bool _active_high;
00044     DigitalOut _pwr_key;
00045     DigitalOut _rst;
00046 };
00047 
00048 } // namespace mbed
00049 
00050 #endif // QUECTEL_EC2X_H