Data logger: Sensors -> Barometer & temperature (BMP180), Humidity & temp. (RHT03), Sunshine (Cds): Display -> 20 chracters x 4 lines: Strage -> EEPROM (AT24C1024): Special functions -> Enter sleep mode to save current, reading the logging data via serial line

Dependencies:   AT24C1024 BMP180 M41T62 RHT03 TextLCD WakeUp mbed

Fork of LPC1114_barometer_with_data_logging by Kenji Arai

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 Kenji Arai / JH1PJL
00006  *  http://www.page.sannet.ne.jp/kenjia/index.html
00007  *  http://mbed.org/users/kenjiArai/
00008  *      Created: June      16th, 2013
00009  *      Revised: July       3rd, 2014
00010  *
00011  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
00012  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00013  * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00014  * DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00015  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016  */
00017 
00018 #ifndef _DT_LOG_H_
00019 #define _DT_LOG_H_
00020 
00021 //  Definition  -----------------------------------------------------------------------------------
00022 // Buffer size
00023 #define EEP_SIZE    128 * 1024  // 1Mbits = 128 KBytes
00024 #define PKT_SIZE    16          // Packet size
00025 #define BLK_NO      8192        // 128KB/16 = 8192
00026 #define ALL_SIZE    (PKT_SIZE) * (BLK_NO)
00027 #if ALL_SIZ > EEP_SIZE
00028 #error "Data size in EEPROM is too big!"
00029 #endif
00030 #define PTR_SIZE    16
00031 
00032 // Buffer control
00033 #define RING_TOP    1
00034 #define RING_TAIL   (BLK_NO - RING_TOP -1)
00035 #define BLK_SIZE    16
00036 
00037 //  Function prototypes ---------------------------------------------------------------------------
00038 void dtlog_data_pack(void);
00039 void dtlog_one_write(void);
00040 uint16_t dtlog_buf_occupation(void);
00041 
00042 #endif  // _DT_LOG_H_