#ifndef __FACTORS_H
#define __FACTORS_H

#include "io.h"
#include <stdbool.h>


typedef struct
{
    float factor_k[AI_COMMON_NUMBER];
    float factor_b[AI_COMMON_NUMBER];
    uint32_t control_word;
    
} factors_t;


//
void factors_load(factors_t *factors);

//
void factros_set_default(factors_t *factors);

//
bool factors_save(factors_t *factors);

//
bool factors_write_to_flash(uint8_t *data, uint32_t size);

//
void factors_read_from_flash(uint8_t *data, uint32_t size);

//
uint32_t factors_get_crc(factors_t *factors);

//
void factors_sector_clear(void);


extern factors_t ai_factors;


#endif  // __FACTORS_H

