factors.h 626 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __FACTORS_H
  2. #define __FACTORS_H
  3. #include "io.h"
  4. #include <stdbool.h>
  5. typedef struct
  6. {
  7. float factor_k[AI_COMMON_NUMBER];
  8. float factor_b[AI_COMMON_NUMBER];
  9. uint32_t control_word;
  10. } factors_t;
  11. //
  12. void factors_load(factors_t *factors);
  13. //
  14. void factros_set_default(factors_t *factors);
  15. //
  16. bool factors_save(factors_t *factors);
  17. //
  18. bool factors_write_to_flash(uint8_t *data, uint32_t size);
  19. //
  20. void factors_read_from_flash(uint8_t *data, uint32_t size);
  21. //
  22. uint32_t factors_get_crc(factors_t *factors);
  23. //
  24. void factors_sector_clear(void);
  25. extern factors_t ai_factors;
  26. #endif // __FACTORS_H