#ifndef __ARM_INTERFACE_H__
#define __ARM_INTERFACE_H__

typedef int OSP_STATUS;

/********************** header files **********************/
#include "msg_transfer_layer.h"
#include "ospHeap.h"

typedef enum
{
    ZERO_FLAG = 0,      /*0标志*/
    TRUE_FLAG           /*1 标志*/
}clk_flag_e;

typedef enum
{
    CLK_DISABLE = 0,    /* clock unuseable status */
    CLK_WARM_UP = 1,    /* warm up status */
    CLK_TRACKING,       /* tracking status */
    CLK_HOLD_OVER       /* hold over status */
}clk_sync_state_e;

typedef struct
{
    uint32_t common_alarm;
    uint32_t hold_over_time;
    clk_sync_state_e status;
}clock_module_status_s;

/****************** Msg_transfer function *****************/
/*
name: msg_transfer_mem_init
para: null
brief: msg_transfer memory init(before call msg_transfer_init)
*/
void msg_transfer_mem_init(void);

/*
name: ucp_handshake
para: null
brief: handshake with host(after call msg_transfer_init)
*/
void ucp_handshake(void);

/*
name: rx_callback_oam
para: Input: buf: the address of the data
para: Input: payloadSize: the length of the data
brief: ape/rfm log receive callback
*/
uint32_t rx_callback_oam(const char* buf,uint32_t payloadSize);

/********************** Init function *********************/
/*
name: osp_init
para: null
brief: osp function init
*/
OSP_STATUS osp_init();

uint32_t read_stc_local_timer(void);

/*
name: drv_init
para: null
brief: drv function init
*/
int32_t drv_init(void);

/**********************************************************************************************/
/*                                     testmac interface                                      */

/********************** Init function *********************/
/*
name: osp_arm_log_proc
para: Input: pbuf: the log's address
para: Input: len: the log's length
para: Input: logid: the log's id
para: Input: msg_type: the log's type
brief: arm log output
*/
OSP_STATUS osp_arm_log_proc(char *pbuf, uint32_t len ,uint32_t logid, uint32_t msg_type);

/********************** Osp function *********************/
/*
name: osp_read_spe_cfg_file
para: Input: path: the config file's path
brief: load the spe config file by the path
*/
int32_t osp_read_spe_cfg_file(char* path);

/*
name: osp_get_cfg_file
para: Input: name: the config file's name
para: Output: paddr: the config file's address
para: Output: psize: the config file's size
brief: get a config file's address and size
*/
int32_t  osp_get_cfg_file(char* name, uint64_t *paddr, uint32_t *psize);

int32_t  get_clock_module_status(volatile clock_module_status_s* clk_module_status_ptr);
int32_t  set_clk_mode(clk_flag_e pseudo_flag);



#endif /* __ARM_INTERFACE_H__  */

