Barometer program : Data Logger function includes Barometer & temperature (BMP180), Humidity & temp. (RHT03), Sunshine (Cds), RTC(M41T62) data. : Logging data saves into EEPROM (AT24C1024) using ring buffer function.

Dependencies:   AT24C1024 RHT03 TextLCD BMP180 M41T62

Fork of mbed_blinky by Mbed

Please see https://mbed.org/users/kenjiArai/notebook/mbed-lpc1114fn28-barometer-with-data-logging/#

dt_log.h

Committer:
kenjiArai
Date:
11 months ago
Revision:
18:b3a27f681171
Parent:
16:f164f8912201

File content as of revision 18:b3a27f681171:

/*
 * mbed Application program for the mbed LPC1114FN28
 * Data Logging 
 *
 * Copyright (c) 2013,'14,'20 Kenji Arai / JH1PJL
 *  http://www7b.biglobe.ne.jp/~kenjia/
 *  https://os.mbed.com/users/kenjiArai/
 *      Created: June      16th, 2013
 *      Revised: August     8th, 2020
 */

#ifndef _DT_LOG_H_
#define _DT_LOG_H_

//  Definition  ----------------------------------------------------------------
// Buffer size
#define EEP_SIZE    128 * 1024  // 1Mbits = 128 KBytes
#define PKT_SIZE    16          // Packet size
#define BLK_NO      8192        // 128KB/16 = 8192
#define ALL_SIZE    (PKT_SIZE) * (BLK_NO)
#if ALL_SIZ > EEP_SIZE
#error "Data size in EEPROM is too big!"
#endif
#define PTR_SIZE    16

// Buffer control
#define RING_TOP    1
#define RING_TAIL   (BLK_NO - RING_TOP -1)
#define BLK_SIZE    16

//  Function prototypes --------------------------------------------------------
void dtlog_data_pack(void);
void dtlog_one_write(void);
uint16_t dtlog_buf_occupation(void);

#endif  // _DT_LOG_H_