BA / SerialCom

Fork of OmniWheels by Gustav Atmel

Committer:
gustavatmel
Date:
Tue May 01 15:55:34 2018 +0000
Revision:
2:798925c9e4a8
Parent:
1:9c5af431a1f1
bluetooth

Who changed what in which revision?

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