4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ONBOARD_MODEM_API_H_
18#define ONBOARD_MODEM_API_H_
19
20/** onboard_modem_api is a standardizing API for Modem type devices under Mbed OS.
21 * It provides a simple hardware abstraction layer on top of the modem drivers
22 * written for Mbed OS.
23 *
24 * It is required from the engineers porting any modem type device (e.g., Cellular)
25 * to provide an implementation of this API in their respective target folder as well as
26 * usage of standard PinNames (in PinNames.h) is required. For example,
27 *
28 * MDMTXD = P0_15, // Transmit Data
29 * MDMRXD = P0_16, // Receive Data
30 * MDMCTS = P0_17, // Clear to Send
31 * MDMDCD = P0_18, // Data Carrier Detect
32 * MDMDSR = P0_19, // Data Set Ready
33 * MDMDTR = P0_20, // Data Terminal Ready (set high or use handshake)
34 * MDMRI = P0_21, // Ring Indicator
35 * MDMRTS = P0_22, // Request to Send (set high or use handshake)
36 *
37 * MDM_PIN_POLARITY must also be defined as 0 (active low) or 1 (active high).
38 *
39 * NOTE: This API should only be used when the modem exists on-board, i.e., the modem is
40 * NOT a plugged-in component.
41 */
42
43#if MODEM_ON_BOARD
44
45#ifdef __cplusplus
46extern"C" {
47#endif
48
49/** Sets the modem up for powering on
50 * modem_init() will be equivalent to plugging in the device, i.e.,
51 * attaching power and serial port.
52 */
53void onboard_modem_init(void);
54
55/** Sets the modem in unplugged state
56 * modem_deinit() will be equivalent to pulling the plug off of the device, i.e.,
57 * detaching power and serial port.
58 * This puts the modem in lowest power state.
59 */
60void onboard_modem_deinit(void);
61
62/** Powers up the modem
63 * modem_power_up() will be equivalent to pressing the soft power button.
64 * The driver may repeat this if the modem is not responsive to AT commands.
65
66 */
67void onboard_modem_power_up(void);
68
69/** Powers down the modem
70 * modem_power_down() will be equivalent to turning off the modem by button press.
71 */
72void onboard_modem_power_down(void);
73
74#ifdef __cplusplus
75 }
76#endif
77
78#endif /* MODEM_ON_BOARD*/
79#endif /* ONBOARD_MODEM_API_H_ */
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.