/*****************************************************************************
* file include/ca_db.h
* author YuLiang
* version 1.0.0
* date 29-Nov-2023
* brief This file provides all the headers of the database functions.
******************************************************************************
* Attention
*
*
© COPYRIGHT(c) 2023 LandPower
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of LandPower nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
#ifndef __CA_DB_H__
#define __CA_DB_H__
#ifdef CFG_DEV_TYPE_LAND_CA
/* Includes ------------------------------------------------------------------*/
/* Define --------------------------------------------------------------------*/
#define CA_DB_FILE "Cable.db"
/* Exported types ------------------------------------------------------------*/
/* 数据类型枚举 */
enum CA_DB_TYPE
{
CA_DB_T_NONE = 0, // 空
CA_DB_T_DATA, // 历史数据
CA_DB_T_CNT // 累计计数
};
/* Exported macro ------------------------------------------------------------*/
/* Extern global variables ---------------------------------------------------*/
/* Extern functions ----------------------------------------------------------*/
extern int32_t ca_db_init(void);
extern int32_t ca_db_init_after(void);
extern int32_t ca_db_write(uint32_t type, void *data);
extern void ca_db_show_data_by_index(uint16_t index, uint16_t num);
#endif
#endif
/************************ (C) COPYRIGHT LandPower ***** END OF FILE ****/