Version of easy-connect with the u-blox cellular platforms C027 and C030 added.

Dependents:   HelloMQTT

Committer:
group-ublox
Date:
Thu Aug 10 14:33:05 2017 +0000
Revision:
0:19aa55d66228
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-ublox 0:19aa55d66228 1 /*
group-ublox 0:19aa55d66228 2 * Copyright (c) 2014-2015 ARM Limited. All rights reserved.
group-ublox 0:19aa55d66228 3 * SPDX-License-Identifier: Apache-2.0
group-ublox 0:19aa55d66228 4 * Licensed under the Apache License, Version 2.0 (the License); you may
group-ublox 0:19aa55d66228 5 * not use this file except in compliance with the License.
group-ublox 0:19aa55d66228 6 * You may obtain a copy of the License at
group-ublox 0:19aa55d66228 7 *
group-ublox 0:19aa55d66228 8 * http://www.apache.org/licenses/LICENSE-2.0
group-ublox 0:19aa55d66228 9 *
group-ublox 0:19aa55d66228 10 * Unless required by applicable law or agreed to in writing, software
group-ublox 0:19aa55d66228 11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
group-ublox 0:19aa55d66228 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
group-ublox 0:19aa55d66228 13 * See the License for the specific language governing permissions and
group-ublox 0:19aa55d66228 14 * limitations under the License.
group-ublox 0:19aa55d66228 15 */
group-ublox 0:19aa55d66228 16
group-ublox 0:19aa55d66228 17 #ifndef NANOSTACK_PHY_MCR20A_H_
group-ublox 0:19aa55d66228 18 #define NANOSTACK_PHY_MCR20A_H_
group-ublox 0:19aa55d66228 19
group-ublox 0:19aa55d66228 20 #include "mbed.h"
group-ublox 0:19aa55d66228 21 #include "NanostackRfPhy.h"
group-ublox 0:19aa55d66228 22
group-ublox 0:19aa55d66228 23 // Arduino pin defaults for convenience
group-ublox 0:19aa55d66228 24 #if !defined(MCR20A_SPI_MOSI)
group-ublox 0:19aa55d66228 25 #define MCR20A_SPI_MOSI D11
group-ublox 0:19aa55d66228 26 #endif
group-ublox 0:19aa55d66228 27 #if !defined(MCR20A_SPI_MISO)
group-ublox 0:19aa55d66228 28 #define MCR20A_SPI_MISO D12
group-ublox 0:19aa55d66228 29 #endif
group-ublox 0:19aa55d66228 30 #if !defined(MCR20A_SPI_SCLK)
group-ublox 0:19aa55d66228 31 #define MCR20A_SPI_SCLK D13
group-ublox 0:19aa55d66228 32 #endif
group-ublox 0:19aa55d66228 33 #if !defined(MCR20A_SPI_CS)
group-ublox 0:19aa55d66228 34 #define MCR20A_SPI_CS D10
group-ublox 0:19aa55d66228 35 #endif
group-ublox 0:19aa55d66228 36 #if !defined(MCR20A_SPI_RST)
group-ublox 0:19aa55d66228 37 #define MCR20A_SPI_RST D5
group-ublox 0:19aa55d66228 38 #endif
group-ublox 0:19aa55d66228 39 #if !defined(MCR20A_SPI_IRQ)
group-ublox 0:19aa55d66228 40 #define MCR20A_SPI_IRQ D2
group-ublox 0:19aa55d66228 41 #endif
group-ublox 0:19aa55d66228 42
group-ublox 0:19aa55d66228 43 class NanostackRfPhyMcr20a : public NanostackRfPhy {
group-ublox 0:19aa55d66228 44 public:
group-ublox 0:19aa55d66228 45 NanostackRfPhyMcr20a(PinName spi_mosi, PinName spi_miso,
group-ublox 0:19aa55d66228 46 PinName spi_sclk, PinName spi_cs, PinName spi_rst,
group-ublox 0:19aa55d66228 47 PinName spi_irq);
group-ublox 0:19aa55d66228 48 virtual ~NanostackRfPhyMcr20a();
group-ublox 0:19aa55d66228 49 virtual int8_t rf_register();
group-ublox 0:19aa55d66228 50 virtual void rf_unregister();
group-ublox 0:19aa55d66228 51 virtual void get_mac_address(uint8_t *mac);
group-ublox 0:19aa55d66228 52 virtual void set_mac_address(uint8_t *mac);
group-ublox 0:19aa55d66228 53
group-ublox 0:19aa55d66228 54 private:
group-ublox 0:19aa55d66228 55 SPI _spi;
group-ublox 0:19aa55d66228 56 DigitalOut _rf_cs;
group-ublox 0:19aa55d66228 57 DigitalOut _rf_rst;
group-ublox 0:19aa55d66228 58 InterruptIn _rf_irq;
group-ublox 0:19aa55d66228 59 DigitalIn _rf_irq_pin;
group-ublox 0:19aa55d66228 60
group-ublox 0:19aa55d66228 61 void _pins_set();
group-ublox 0:19aa55d66228 62 void _pins_clear();
group-ublox 0:19aa55d66228 63 };
group-ublox 0:19aa55d66228 64
group-ublox 0:19aa55d66228 65 #endif /* NANOSTACK_PHY_MCR20A_H_ */