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

Dependents:   HelloMQTT

Committer:
RobMeades
Date:
Fri Nov 03 13:01:23 2017 +0000
Revision:
6:304d3ba87a01
Parent:
0:19aa55d66228
Add comment concerning N2XX baud rate.

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 #ifndef AT24MAC_H
group-ublox 0:19aa55d66228 17 #define AT24MAC_H
group-ublox 0:19aa55d66228 18
group-ublox 0:19aa55d66228 19 #include "PinNames.h"
group-ublox 0:19aa55d66228 20 #include "I2C.h"
group-ublox 0:19aa55d66228 21 #include "drivers/DigitalInOut.h"
group-ublox 0:19aa55d66228 22 #include "platform/mbed_wait_api.h"
group-ublox 0:19aa55d66228 23
group-ublox 0:19aa55d66228 24 /*
group-ublox 0:19aa55d66228 25 * AT24MAC drivers.
group-ublox 0:19aa55d66228 26 *
group-ublox 0:19aa55d66228 27 * This is a EEPROM chip designed to contain factory programmed read-only EUI-64 or EUI-48,
group-ublox 0:19aa55d66228 28 * a 128bit serial number and some user programmable EEPROM.
group-ublox 0:19aa55d66228 29 *
group-ublox 0:19aa55d66228 30 * AT24MAC602 contains EUI-64, use read_eui64()
group-ublox 0:19aa55d66228 31 * AT24MAC402 contains EUI-64, use read_eui48()
group-ublox 0:19aa55d66228 32 *
group-ublox 0:19aa55d66228 33 * NOTE: You cannot use both EUI-64 and EUI-48. Chip contains only one of those.
group-ublox 0:19aa55d66228 34 */
group-ublox 0:19aa55d66228 35
group-ublox 0:19aa55d66228 36 class AT24Mac {
group-ublox 0:19aa55d66228 37 public:
group-ublox 0:19aa55d66228 38 AT24Mac(PinName sda, PinName scl);
group-ublox 0:19aa55d66228 39
group-ublox 0:19aa55d66228 40 /**
group-ublox 0:19aa55d66228 41 * Read unique serial number from chip.
group-ublox 0:19aa55d66228 42 * \param buf pointer to write serial number to. Must have space for 16 bytes.
group-ublox 0:19aa55d66228 43 * \return zero on success, negative number on failure
group-ublox 0:19aa55d66228 44 */
group-ublox 0:19aa55d66228 45 int read_serial(void *buf);
group-ublox 0:19aa55d66228 46
group-ublox 0:19aa55d66228 47 /**
group-ublox 0:19aa55d66228 48 * Read EUI-64 from chip.
group-ublox 0:19aa55d66228 49 * \param buf pointer to write EUI-64 to. Must have space for 8 bytes.
group-ublox 0:19aa55d66228 50 * \return zero on success, negative number on failure
group-ublox 0:19aa55d66228 51 */
group-ublox 0:19aa55d66228 52 int read_eui64(void *buf);
group-ublox 0:19aa55d66228 53
group-ublox 0:19aa55d66228 54 /**
group-ublox 0:19aa55d66228 55 * Read EUI-48 from chip.
group-ublox 0:19aa55d66228 56 * \param buf pointer to write EUI-48 to. Must have space for 6 bytes.
group-ublox 0:19aa55d66228 57 * \return zero on success, negative number on failure
group-ublox 0:19aa55d66228 58 */
group-ublox 0:19aa55d66228 59 int read_eui48(void *buf);
group-ublox 0:19aa55d66228 60
group-ublox 0:19aa55d66228 61 private:
group-ublox 0:19aa55d66228 62 /*
group-ublox 0:19aa55d66228 63 * Dummy class to allow us to reset I2C before the I2C constructor is called in
group-ublox 0:19aa55d66228 64 * the initializer list of AT24Mac's constructor
group-ublox 0:19aa55d66228 65 */
group-ublox 0:19aa55d66228 66 class I2CReset {
group-ublox 0:19aa55d66228 67 public:
group-ublox 0:19aa55d66228 68 I2CReset(PinName sda, PinName scl);
group-ublox 0:19aa55d66228 69 };
group-ublox 0:19aa55d66228 70 I2CReset i2c_reset;
group-ublox 0:19aa55d66228 71 mbed::I2C _i2c;
group-ublox 0:19aa55d66228 72 };
group-ublox 0:19aa55d66228 73
group-ublox 0:19aa55d66228 74 #endif /* AT24MAC_H */