Add Support for the DS3231 RTC and enable it for AR9X, refs #3531 (#3555)

* Add Support for the DS3231 RTC and enable it for AR9X, refs #3531

* fix compile for PCB=sky9x

* rtc ds3231: Add missing OpenTX headers
This commit is contained in:
reichi
2016-06-09 17:58:42 +02:00
committed by Bertrand Songis
parent 0c66f520a2
commit 8606e75f45
9 changed files with 1425 additions and 11 deletions
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#ifndef _I2C_DRIVER_H_
#define _I2C_DRIVER_H_
#include "stdint.h"
uint32_t fromBCD(uint8_t bcd_value);
uint8_t toBCD(uint32_t value);
bool i2cInit();
uint32_t i2cReadBuffer(uint8_t chip, uint8_t addr[3], uint8_t addr_len, uint8_t *buffer, uint32_t length);
uint32_t i2cWriteBuffer(uint8_t chip, uint8_t addr[3], uint8_t addr_len, uint8_t *buffer, uint32_t length);
#endif