aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/battery/eeprom.h
blob: 79ae505b654ee1af7c95e8f663d8b1f09107bdca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* USRP E310 Firmware EEPROM driver
 * Copyright (C) 2014 Ettus Research
 * This file is part of the USRP E310 Firmware
 * The USRP E310 Firmware is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 * The USRP E310 Firmware is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with the USRP E310 Firmware. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * \file eeprom.h
 * \brief AVR EEPROM driver
 */

#ifndef EEPROM_H
#define EEPROM_H

#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>

/**
 * \brief Get the value for the autoboot flag set in the EEPROM
 *
 */
bool eeprom_get_autoboot(void);

/**
 * \brief Set the value for the autoboot flag set in the EEPROM
 *
 * \param[in] on value to write to EEPROM. Use 'true' to turn on autoboot.
 *
 */
void eeprom_set_autoboot(bool on);

/**
 * \brief Get last full charge from the EEPROM
 *
 */
uint16_t eeprom_get_last_full(void);

/**
 * \brief Set last full charge in the EEPROM
 *
 * \param[in] charge value to write to EEPROM.
 */
void eeprom_set_last_full_charge(uint16_t charge);

#endif /* EEPROM_H */