This class provides APIs to all of the registers of the TI BQ27441 battery gauge, as used on the u-blox C030 board. The caller should instantiate an I2C interface and pass this to init(), which will initialise the chip and place it into its lowest power state. When battery gauging is enabled, the getRemainingCapacity()/getRemainingPercentage() API calls may be used; otherwise the chip will be maintained in its lowest power state until a voltage/current/temperature reading is requested.

Dependents:   example-battery-gauge-bq27441

Committer:
rob.meades@u-blox.com
Date:
Wed Jun 14 17:11:40 2017 +0100
Revision:
5:63b325f2c21a
Parent:
3:ebd56471d57c
Child:
6:998cc334f8f2
Add ability to enable/disable battery detection and make sure that it is switched off when the tests are run on the u-blox C030 platform (since the BIN pin is not connected).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rob.meades@u-blox.com 1:566163f17cde 1 /* mbed Microcontroller Library
rob.meades@u-blox.com 1:566163f17cde 2 * Copyright (c) 2017 u-blox
rob.meades@u-blox.com 1:566163f17cde 3 *
rob.meades@u-blox.com 1:566163f17cde 4 * Licensed under the Apache License, Version 2.0 (the "License");
rob.meades@u-blox.com 1:566163f17cde 5 * you may not use this file except in compliance with the License.
rob.meades@u-blox.com 1:566163f17cde 6 * You may obtain a copy of the License at
rob.meades@u-blox.com 1:566163f17cde 7 *
rob.meades@u-blox.com 1:566163f17cde 8 * http://www.apache.org/licenses/LICENSE-2.0
rob.meades@u-blox.com 1:566163f17cde 9 *
rob.meades@u-blox.com 1:566163f17cde 10 * Unless required by applicable law or agreed to in writing, software
rob.meades@u-blox.com 1:566163f17cde 11 * distributed under the License is distributed on an "AS IS" BASIS,
rob.meades@u-blox.com 1:566163f17cde 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rob.meades@u-blox.com 1:566163f17cde 13 * See the License for the specific language governing permissions and
rob.meades@u-blox.com 1:566163f17cde 14 * limitations under the License.
rob.meades@u-blox.com 1:566163f17cde 15 */
rob.meades@u-blox.com 1:566163f17cde 16
rob.meades@u-blox.com 1:566163f17cde 17 #ifndef BATTERY_GAUGE_BQ27441_H
rob.meades@u-blox.com 1:566163f17cde 18 #define BATTERY_GAUGE_BQ27441_H
rob.meades@u-blox.com 1:566163f17cde 19
rob.meades@u-blox.com 1:566163f17cde 20 /**
rob.meades@u-blox.com 1:566163f17cde 21 * @file battery_gauge_bq27441.h
rob.meades@u-blox.com 1:566163f17cde 22 * This file defines the API to the TI BQ27441 battery gauge chip.
rob.meades@u-blox.com 1:566163f17cde 23 */
rob.meades@u-blox.com 1:566163f17cde 24
RobMeades 2:93310a83401a 25 /* ----------------------------------------------------------------
RobMeades 2:93310a83401a 26 * COMPILE-TIME MACROS
RobMeades 2:93310a83401a 27 * -------------------------------------------------------------- */
rob.meades@u-blox.com 1:566163f17cde 28
RobMeades 2:93310a83401a 29 /** Device I2C address. */
rob.meades@u-blox.com 1:566163f17cde 30 #define BATTERY_GAUGE_BQ27441_ADDRESS 0x55
rob.meades@u-blox.com 1:566163f17cde 31
RobMeades 2:93310a83401a 32 /** The default seal code. */
rob.meades@u-blox.com 1:566163f17cde 33 #define SEAL_CODE_DEFAULT 0x8000
rob.meades@u-blox.com 1:566163f17cde 34
RobMeades 2:93310a83401a 35 /* ----------------------------------------------------------------
RobMeades 2:93310a83401a 36 * CLASSES
RobMeades 2:93310a83401a 37 * -------------------------------------------------------------- */
rob.meades@u-blox.com 1:566163f17cde 38
RobMeades 2:93310a83401a 39 /** BQ27441 battery gauge driver. */
rob.meades@u-blox.com 1:566163f17cde 40 class BatteryGaugeBq27441 {
rob.meades@u-blox.com 1:566163f17cde 41 public:
rob.meades@u-blox.com 1:566163f17cde 42
RobMeades 2:93310a83401a 43 /** Constructor. */
rob.meades@u-blox.com 1:566163f17cde 44 BatteryGaugeBq27441(void);
RobMeades 2:93310a83401a 45 /** Destructor. */
rob.meades@u-blox.com 1:566163f17cde 46 ~BatteryGaugeBq27441(void);
rob.meades@u-blox.com 1:566163f17cde 47
RobMeades 2:93310a83401a 48 /** Initialise the BQ27441 chip. Once initialised
RobMeades 2:93310a83401a 49 * the chip is put into its lowest power state. Any API call
RobMeades 2:93310a83401a 50 * will awaken the chip from this state and then return it once
RobMeades 2:93310a83401a 51 * more to the lowest possible power state.
RobMeades 2:93310a83401a 52 * @param pI2c a pointer to the I2C instance to use.
RobMeades 2:93310a83401a 53 * @param address 7-bit I2C address of the battery gauge chip.
RobMeades 2:93310a83401a 54 * @param sealCode the 16 bit seal code that will unseal the device if it is sealed.
RobMeades 2:93310a83401a 55 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 56 */
rob.meades@u-blox.com 1:566163f17cde 57 bool init (I2C * pI2c, uint8_t address = BATTERY_GAUGE_BQ27441_ADDRESS, uint16_t sealCode = SEAL_CODE_DEFAULT);
rob.meades@u-blox.com 1:566163f17cde 58
RobMeades 2:93310a83401a 59 /** Switch on the battery gauge. Battery gauging must be switched on
RobMeades 2:93310a83401a 60 * for the battery capacity and percentage readings to be valid. The
RobMeades 2:93310a83401a 61 * chip will consume more when battery gauging is switched on.
RobMeades 2:93310a83401a 62 * @param isSlow set this to true to save power if the battery current is not fluctuating very much.
RobMeades 2:93310a83401a 63 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 64 */
rob.meades@u-blox.com 1:566163f17cde 65 bool enableGauge (bool isSlow = false);
rob.meades@u-blox.com 1:566163f17cde 66
RobMeades 2:93310a83401a 67 /** Switch off the battery gauge.
RobMeades 2:93310a83401a 68 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 69 */
rob.meades@u-blox.com 1:566163f17cde 70 bool disableGauge (void);
rob.meades@u-blox.com 1:566163f17cde 71
rob.meades@u-blox.com 3:ebd56471d57c 72 /** Check whether battery gauging is enabled or not.
rob.meades@u-blox.com 3:ebd56471d57c 73 * @return true if battery gauging is enabled, otherwise false.
rob.meades@u-blox.com 3:ebd56471d57c 74 */
rob.meades@u-blox.com 3:ebd56471d57c 75 bool isGaugeEnabled(void);
rob.meades@u-blox.com 3:ebd56471d57c 76
rob.meades@u-blox.com 5:63b325f2c21a 77 /** Enable the battery detect pin of the chip.
rob.meades@u-blox.com 5:63b325f2c21a 78 * Default is enabled.
rob.meades@u-blox.com 5:63b325f2c21a 79 * @return true if successful, otherwise false.
rob.meades@u-blox.com 5:63b325f2c21a 80 */
rob.meades@u-blox.com 5:63b325f2c21a 81 bool enableBatteryDetect ();
rob.meades@u-blox.com 5:63b325f2c21a 82
rob.meades@u-blox.com 5:63b325f2c21a 83 /** Disable the battery detect pin of the chip and
rob.meades@u-blox.com 5:63b325f2c21a 84 * assume that the battery is ALWAYS connected.
rob.meades@u-blox.com 5:63b325f2c21a 85 * Default is that battery detect is enabled.
rob.meades@u-blox.com 5:63b325f2c21a 86 * @return true if successful, otherwise false.
rob.meades@u-blox.com 5:63b325f2c21a 87 */
rob.meades@u-blox.com 5:63b325f2c21a 88 bool disableBatteryDetect (void);
rob.meades@u-blox.com 5:63b325f2c21a 89
RobMeades 2:93310a83401a 90 /** Determine whether a battery has been detected or not.
rob.meades@u-blox.com 5:63b325f2c21a 91 * If battery detection is disabled, this function will always
rob.meades@u-blox.com 5:63b325f2c21a 92 * return true.
RobMeades 2:93310a83401a 93 * @return true if a battery has been detected, otherwise false.
RobMeades 2:93310a83401a 94 */
rob.meades@u-blox.com 1:566163f17cde 95 bool isBatteryDetected (void);
rob.meades@u-blox.com 1:566163f17cde 96
RobMeades 2:93310a83401a 97 /** Read the temperature of the BQ27441 chip.
RobMeades 2:93310a83401a 98 * If battery gauging is off this function will take ~1 second
RobMeades 2:93310a83401a 99 * to return while the ADCs are activated and the reading is taken.
RobMeades 2:93310a83401a 100 * If battery gauging is on, the last temperature reading taken
RobMeades 2:93310a83401a 101 * will be returned without delay.
RobMeades 2:93310a83401a 102 * @param pTemperatureC place to put the temperature reading.
RobMeades 2:93310a83401a 103 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 104 */
rob.meades@u-blox.com 1:566163f17cde 105 bool getTemperature (int32_t *pTemperatureC);
rob.meades@u-blox.com 1:566163f17cde 106
RobMeades 2:93310a83401a 107 /** Read the voltage of the battery.
RobMeades 2:93310a83401a 108 * If battery gauging is off this function will take ~1 second
RobMeades 2:93310a83401a 109 * to return while the ADCs are activated and the reading is taken.
RobMeades 2:93310a83401a 110 * If battery gauging is on, the last voltage reading taken
RobMeades 2:93310a83401a 111 * will be returned without delay.
RobMeades 2:93310a83401a 112 * @param pVoltageMV place to put the voltage reading.
RobMeades 2:93310a83401a 113 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 114 */
rob.meades@u-blox.com 1:566163f17cde 115 bool getVoltage (int32_t *pVoltageMV);
rob.meades@u-blox.com 1:566163f17cde 116
RobMeades 2:93310a83401a 117 /** Read the current flowing from the battery.
RobMeades 2:93310a83401a 118 * If battery gauging is off this function will take ~1 second
RobMeades 2:93310a83401a 119 * to return while the ADCs are activated and the reading is taken.
RobMeades 2:93310a83401a 120 * If battery gauging is on, the last current reading taken
RobMeades 2:93310a83401a 121 * will be returned without delay.
RobMeades 2:93310a83401a 122 * @param pCurrentMA place to put the current reading.
RobMeades 2:93310a83401a 123 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 124 */
rob.meades@u-blox.com 1:566163f17cde 125 bool getCurrent (int32_t *pCurrentMA);
rob.meades@u-blox.com 1:566163f17cde 126
RobMeades 2:93310a83401a 127 /** Read the remaining available battery energy.
RobMeades 2:93310a83401a 128 * The battery capacity reading will only be valid if
RobMeades 2:93310a83401a 129 * battery gauging is switched on.
RobMeades 2:93310a83401a 130 * @param pCapacityMAh place to put the capacity reading.
RobMeades 2:93310a83401a 131 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 132 */
rob.meades@u-blox.com 1:566163f17cde 133 bool getRemainingCapacity (int32_t *pCapacityMAh);
rob.meades@u-blox.com 1:566163f17cde 134
RobMeades 2:93310a83401a 135 /** Read the state of charge of the battery as a percentage.
RobMeades 2:93310a83401a 136 * The remaining percentage will only be valid if battery
RobMeades 2:93310a83401a 137 * gauging is switched on.
RobMeades 2:93310a83401a 138 * @param pBatteryPercent place to put the reading.
RobMeades 2:93310a83401a 139 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 140 */
rob.meades@u-blox.com 1:566163f17cde 141 bool getRemainingPercentage (int32_t *pBatteryPercent);
rob.meades@u-blox.com 1:566163f17cde 142
RobMeades 2:93310a83401a 143 /** An advanced function to read configuration data from the BQ27441 chip memory.
RobMeades 2:93310a83401a 144 * Please refer to the TI BQ27441 technical reference manual for details of classId,
RobMeades 2:93310a83401a 145 * offset, the meanings of the data structures and their lengths.
RobMeades 2:93310a83401a 146 * PLEASE READ THIS HEADER FILE DIRECTLY, DOXYGEN MANGLES THE NEXT BIT
RobMeades 2:93310a83401a 147 * Note: the chip handles the data for each sub-class in 32 byte blocks and the offset/
RobMeades 2:93310a83401a 148 * length combination used must respect this. For instance:
RobMeades 2:93310a83401a 149 *
RobMeades 2:93310a83401a 150 * Sub-class N (length 87 bytes)
RobMeades 2:93310a83401a 151 * bytes 0 to 31 bytes 32 to 63 bytes 64 to 86
RobMeades 2:93310a83401a 152 * -------------------------------- -------------------------------- -----------------------
RobMeades 2:93310a83401a 153 * | Data Block 0 || xx Data Block 1 yy ||zz Data Block 2 |
RobMeades 2:93310a83401a 154 * -------------------------------- -------------------------------- -----------------------
RobMeades 2:93310a83401a 155 *
RobMeades 2:93310a83401a 156 * To read item xx, 2 bytes long at offset 36, one would specify an offset of 36 and a length
RobMeades 2:93310a83401a 157 * of 2. To read both xx and yy at the same time (yy being 2 bytes long at offset 56),
RobMeades 2:93310a83401a 158 * one could specify an offset of 36 and a length of 21. However, one could not read xx, yy
RobMeades 2:93310a83401a 159 * and zz at the same time, or yy and zz at the same time, since they fall into different blocks;
RobMeades 2:93310a83401a 160 * two separate reads are required.
RobMeades 2:93310a83401a 161 * @param subClassId the sub-class ID of the block.
RobMeades 2:93310a83401a 162 * @param offset the offset of the data within the class.
RobMeades 2:93310a83401a 163 * @param length the amount of data to read.
RobMeades 2:93310a83401a 164 * @param pData a place to put the read data.
RobMeades 2:93310a83401a 165 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 166 */
rob.meades@u-blox.com 1:566163f17cde 167 bool advancedGetConfig(uint8_t subClassId, int32_t offset, int32_t length, char * pData);
rob.meades@u-blox.com 1:566163f17cde 168
RobMeades 2:93310a83401a 169 /** An advanced function to write configuration data to the BQ27441 chip memory.
RobMeades 2:93310a83401a 170 * Please refer to the TI BQ27441 technical reference manual for details of classId,
RobMeades 2:93310a83401a 171 * offset, the meanings of the data structures and their lengths. See also the note above
RobMeades 2:93310a83401a 172 * advancedGetConfig() about how to use offset and length. If this function is used to
RobMeades 2:93310a83401a 173 * change the seal code for the chip then init() should be called once more to
RobMeades 2:93310a83401a 174 * update the seal code used by this driver.
RobMeades 2:93310a83401a 175 * @param subClassId the sub-class ID of the block.
RobMeades 2:93310a83401a 176 * @param offset the offset of the data within the class.
RobMeades 2:93310a83401a 177 * @param length the length of the data to be written.
RobMeades 2:93310a83401a 178 * @param pData a pointer to the data to be written.
RobMeades 2:93310a83401a 179 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 180 */
rob.meades@u-blox.com 1:566163f17cde 181 bool advancedSetConfig(uint8_t subClassId, int32_t offset, int32_t length, const char * pData);
rob.meades@u-blox.com 1:566163f17cde 182
RobMeades 2:93310a83401a 183 /** Send a control word (see section 4.1 of the BQ27441 technical reference manual).
RobMeades 2:93310a83401a 184 * @param controlWord the control word to send.
RobMeades 2:93310a83401a 185 * @param pDataReturned a place to put the word of data that could be returned,
RobMeades 2:93310a83401a 186 * depending on which control word is used (may be NULL).
RobMeades 2:93310a83401a 187 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 188 */
rob.meades@u-blox.com 1:566163f17cde 189 bool advancedSendControlWord (uint16_t controlWord, uint16_t *pDataReturned);
rob.meades@u-blox.com 1:566163f17cde 190
RobMeades 2:93310a83401a 191 /** Read two bytes starting at a given address on the chip.
RobMeades 2:93310a83401a 192 * See sections 4.2 to 4.20 of the BQ27441 technical reference manual for the list
RobMeades 2:93310a83401a 193 * of addresses.
RobMeades 2:93310a83401a 194 * @param address the start address to read from. For instance, for temperature this is 0x02.
RobMeades 2:93310a83401a 195 * @param pDataReturned a place to put the word of data returned.
RobMeades 2:93310a83401a 196 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 197 */
rob.meades@u-blox.com 1:566163f17cde 198 bool advancedGet (uint8_t address, uint16_t *pDataReturned);
rob.meades@u-blox.com 1:566163f17cde 199
RobMeades 2:93310a83401a 200 /** Check if the chip is SEALED or UNSEALED.
RobMeades 2:93310a83401a 201 * @return true if it is SEALED, otherwise false.
RobMeades 2:93310a83401a 202 */
rob.meades@u-blox.com 1:566163f17cde 203 bool advancedIsSealed(void);
rob.meades@u-blox.com 1:566163f17cde 204
RobMeades 2:93310a83401a 205 /** Put the chip into SEALED mode. SEALED mode is
RobMeades 2:93310a83401a 206 * used to prevent accidental writes to the chip when it
RobMeades 2:93310a83401a 207 * is in a production device. All of the functions in this
RobMeades 2:93310a83401a 208 * class are able to work with a SEALED chip, provided the
RobMeades 2:93310a83401a 209 * correct seal code is provided to the init() function.
RobMeades 2:93310a83401a 210 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 211 */
rob.meades@u-blox.com 1:566163f17cde 212 bool advancedSeal(void);
rob.meades@u-blox.com 1:566163f17cde 213
RobMeades 2:93310a83401a 214 /** Send the seal code to the chip to unseal it.
RobMeades 2:93310a83401a 215 * @param sealCode the 16 bit seal code that will unseal the chip if it is sealed.
RobMeades 2:93310a83401a 216 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 217 */
rob.meades@u-blox.com 1:566163f17cde 218 bool advancedUnseal(uint16_t sealCode = SEAL_CODE_DEFAULT);
rob.meades@u-blox.com 1:566163f17cde 219
RobMeades 2:93310a83401a 220 /** Do a hard reset of the chip, reinitialising RAM data to defaults from ROM.
RobMeades 2:93310a83401a 221 * Note: the SEALED/UNSEALED status of the chip is unaffected.
RobMeades 2:93310a83401a 222 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 223 */
rob.meades@u-blox.com 1:566163f17cde 224 bool advancedReset(void);
rob.meades@u-blox.com 1:566163f17cde 225
rob.meades@u-blox.com 1:566163f17cde 226 protected:
RobMeades 2:93310a83401a 227 /** Pointer to the I2C interface. */
rob.meades@u-blox.com 1:566163f17cde 228 I2C * gpI2c;
RobMeades 2:93310a83401a 229 /** The address of the device. */
rob.meades@u-blox.com 1:566163f17cde 230 uint8_t gAddress;
RobMeades 2:93310a83401a 231 /** The seal code for the device. */
rob.meades@u-blox.com 1:566163f17cde 232 uint16_t gSealCode;
RobMeades 2:93310a83401a 233 /** Flag to indicate device is ready. */
rob.meades@u-blox.com 1:566163f17cde 234 bool gReady;
RobMeades 2:93310a83401a 235 /** Flag to indicate that monitor mode is active. */
rob.meades@u-blox.com 1:566163f17cde 236 bool gGaugeOn;
rob.meades@u-blox.com 1:566163f17cde 237
RobMeades 2:93310a83401a 238 /** Read two bytes starting at a given address.
RobMeades 2:93310a83401a 239 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 240 * @param registerAddress the register address to start reading from.
RobMeades 2:93310a83401a 241 * @param pBytes place to put the two bytes.
RobMeades 2:93310a83401a 242 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 243 */
rob.meades@u-blox.com 1:566163f17cde 244 bool getTwoBytes (uint8_t registerAddress, uint16_t *pBytes);
rob.meades@u-blox.com 1:566163f17cde 245
RobMeades 2:93310a83401a 246 /** Compute the checksum of a block of memory in the chip.
RobMeades 2:93310a83401a 247 * @param pData a pointer to the 32 byte data block.
RobMeades 2:93310a83401a 248 * @return the checksum value.
RobMeades 2:93310a83401a 249 */
rob.meades@u-blox.com 1:566163f17cde 250 uint8_t computeChecksum(const char * pData);
rob.meades@u-blox.com 1:566163f17cde 251
RobMeades 2:93310a83401a 252 /** Read data of a given length and class ID.
RobMeades 2:93310a83401a 253 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 254 * @param subClassId the sub-class ID of the block.
RobMeades 2:93310a83401a 255 * @param offset the offset of the data within the class.
RobMeades 2:93310a83401a 256 * @param pData a place to put the read data.
RobMeades 2:93310a83401a 257 * @param length the size of the place to put the data block.
RobMeades 2:93310a83401a 258 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 259 */
rob.meades@u-blox.com 1:566163f17cde 260 bool readExtendedData(uint8_t subClassId, int32_t offset, int32_t length, char * pData);
rob.meades@u-blox.com 1:566163f17cde 261
RobMeades 2:93310a83401a 262 /** Write an extended data block.
RobMeades 2:93310a83401a 263 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 264 * @param subClassId the sub-class ID of the block.
RobMeades 2:93310a83401a 265 * @param offset the offset of the data within the class.
RobMeades 2:93310a83401a 266 * @param pData a pointer to the data to be written.
RobMeades 2:93310a83401a 267 * @param length the size of the data to be written.
RobMeades 2:93310a83401a 268 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 269 */
rob.meades@u-blox.com 1:566163f17cde 270 bool writeExtendedData(uint8_t subClassId, int32_t offset, int32_t length, const char * pData);
rob.meades@u-blox.com 1:566163f17cde 271
RobMeades 2:93310a83401a 272 /** Check if the chip is SEALED or UNSEALED.
RobMeades 2:93310a83401a 273 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 274 * @return true if it is SEALED, otherwise false.
RobMeades 2:93310a83401a 275 */
rob.meades@u-blox.com 1:566163f17cde 276 bool isSealed(void);
rob.meades@u-blox.com 1:566163f17cde 277
RobMeades 2:93310a83401a 278 /** Put the chip into SEALED mode.
RobMeades 2:93310a83401a 279 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 280 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 281 */
rob.meades@u-blox.com 1:566163f17cde 282 bool seal(void);
rob.meades@u-blox.com 1:566163f17cde 283
RobMeades 2:93310a83401a 284 /** Unseal the chip.
RobMeades 2:93310a83401a 285 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 286 * @param sealCode the 16 bit seal code that will unseal the chip if it is sealed.
RobMeades 2:93310a83401a 287 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 288 */
rob.meades@u-blox.com 1:566163f17cde 289 bool unseal(uint16_t sealCode);
rob.meades@u-blox.com 1:566163f17cde 290
RobMeades 2:93310a83401a 291 /** Make sure that the chip is awake and has taken a reading.
RobMeades 2:93310a83401a 292 * Note: the function does its own locking of gpI2C so that it isn't
RobMeades 2:93310a83401a 293 * held for the entire time we wait for ADC readings to complete.
RobMeades 2:93310a83401a 294 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 295 */
rob.meades@u-blox.com 1:566163f17cde 296 bool makeAdcReading(void);
rob.meades@u-blox.com 1:566163f17cde 297
RobMeades 2:93310a83401a 298 /** Set Hibernate mode.
RobMeades 2:93310a83401a 299 * Note: gpI2c should be locked before this is called.
RobMeades 2:93310a83401a 300 * @return true if successful, otherwise false.
RobMeades 2:93310a83401a 301 */
rob.meades@u-blox.com 1:566163f17cde 302 bool setHibernate(void);
rob.meades@u-blox.com 1:566163f17cde 303 };
rob.meades@u-blox.com 1:566163f17cde 304
rob.meades@u-blox.com 1:566163f17cde 305 #endif
rob.meades@u-blox.com 1:566163f17cde 306
RobMeades 2:93310a83401a 307 /* End Of File */