Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers onboard_modem_api.h Source File

onboard_modem_api.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2017 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef ONBOARD_MODEM_API_H_
00018 #define ONBOARD_MODEM_API_H_
00019 
00020 /** onboard_modem_api is a standardizing API for Modem type devices under mbed-os.
00021  * It provides a simple hardware abstraction layer on top of the modem drivers
00022  * written for mbed-os.
00023  *
00024  * It is required from the engineers porting any modem type device (e.g., Cellular)
00025  * to provide an implementation of this API in their respective target folder as well as
00026  * usage of standard PinNames (in PinNames.h) is required. For example,
00027  *
00028  *   MDMTXD = P0_15,    // Transmit Data
00029  *   MDMRXD = P0_16,    // Receive Data
00030  *   MDMCTS = P0_17,    // Clear to Send
00031  *   MDMDCD = P0_18,    // Data Carrier Detect
00032  *   MDMDSR = P0_19,    // Data Set Ready
00033  *   MDMDTR = P0_20,    // Data Terminal Ready (set high or use handshake)
00034  *   MDMRI  = P0_21,    // Ring Indicator
00035  *   MDMRTS = P0_22,    // Request to Send (set high or use handshake)
00036  *
00037  *   MDM_PIN_POLARITY must also be defined as 0 (active low) or 1 (active high).
00038  *
00039  *   NOTE: This API should only be used when the modem exists on-board, i.e., the modem is
00040  *         NOT a plugged-in component.
00041  */
00042 
00043 #if MODEM_ON_BOARD
00044 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048 
00049 /** Sets the modem up for powering on
00050  *  modem_init() will be equivalent to plugging in the device, i.e.,
00051  *  attaching power and serial port.
00052  */
00053 void onboard_modem_init(void);
00054 
00055 /** Sets the modem in unplugged state
00056  *  modem_deinit() will be equivalent to pulling the plug off of the device, i.e.,
00057  *  detaching power and serial port.
00058  *  This puts the modem in lowest power state.
00059  */
00060 void onboard_modem_deinit(void);
00061 
00062 /** Powers up the modem
00063  *  modem_power_up() will be equivalent to pressing the soft power button.
00064  *  The driver may repeat this if the modem is not responsive to AT commands.
00065 
00066  */
00067 void onboard_modem_power_up(void);
00068 
00069 /** Powers down the modem
00070  *  modem_power_down() will be equivalent to turning off the modem by button press.
00071  */
00072 void onboard_modem_power_down(void);
00073 
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 
00078 #endif /* MODEM_ON_BOARD*/
00079 #endif /* ONBOARD_MODEM_API_H_ */