#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/sysinfo.h>
#include <time.h>
#include <unistd.h>
#include "ps_intf_ctrl_msg.h"

struct CacheInfo {
    char type[256];
    int size;
    int level;
};

typedef struct {
    char model[100];
    double clockSpeed;
    int cores;
    int cacheSizeKB;
    unsigned int features[8];  // Assume up to 256 bits (8 * 32 bits)
    unsigned int err_count;
} CpuInfo;


int8_t getTemperature(uint8_t *temp);
void printCpuPowerInfo();           //TC_GET_MCU_PWR
void getProcessorInfo(ps_get_chip_info_s *ps_get_chip_info);
void printCpuCoreInfo();             //TC_GET_MCU_CORE_AND_BUS_INFO
void parseCpuInfo(FILE *file, CpuInfo *cpuInfo);
void getCPUFeatures(ps_get_feature_s *ps_get_features) ;
void printCPUUptime(uint32_t *uptime);               //TC_GET_MCU_CLK_INFO
void printEpochTime(uint32_t *epoch_tm);               //TC_GET_MCU_CLK_INFO
//void printCpuInfo(ps_get_int_mem_s *ps_get_int_mem) ;
void  printMemoryInfo(ps_get_ext_mem_s *ps_get_ext_mem);
void extractCacheInfo(FILE *file, struct CacheInfo *cache);
void extractMemoryInfo(FILE *file, const char *target, long *value);
void  printMemoryInfo(ps_get_ext_mem_s *ps_get_ext_mem) ;
