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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dt_log.h Source File

dt_log.h

00001 /*
00002  * mbed Application program for the mbed LPC1114FN28
00003  * Data Logging 
00004  *
00005  * Copyright (c) 2013,'14,'20 Kenji Arai / JH1PJL
00006  *  http://www7b.biglobe.ne.jp/~kenjia/
00007  *  https://os.mbed.com/users/kenjiArai/
00008  *      Created: June      16th, 2013
00009  *      Revised: August     8th, 2020
00010  */
00011 
00012 #ifndef _DT_LOG_H_
00013 #define _DT_LOG_H_
00014 
00015 //  Definition  ----------------------------------------------------------------
00016 // Buffer size
00017 #define EEP_SIZE    128 * 1024  // 1Mbits = 128 KBytes
00018 #define PKT_SIZE    16          // Packet size
00019 #define BLK_NO      8192        // 128KB/16 = 8192
00020 #define ALL_SIZE    (PKT_SIZE) * (BLK_NO)
00021 #if ALL_SIZ > EEP_SIZE
00022 #error "Data size in EEPROM is too big!"
00023 #endif
00024 #define PTR_SIZE    16
00025 
00026 // Buffer control
00027 #define RING_TOP    1
00028 #define RING_TAIL   (BLK_NO - RING_TOP -1)
00029 #define BLK_SIZE    16
00030 
00031 //  Function prototypes --------------------------------------------------------
00032 void dtlog_data_pack(void);
00033 void dtlog_one_write(void);
00034 uint16_t dtlog_buf_occupation(void);
00035 
00036 #endif  // _DT_LOG_H_