1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef __SETTINGS_H
- #define __SETTINGS_H
-
- #include "stm32g4xx_hal.h"
- // общая структура настроек
- #pragma pack(push, 4)
- typedef struct
- {
- char fw_version[20];
- uint32_t motor_speed;
- uint32_t support_speed;
- uint32_t temperature_threshold;
-
- } settings_t;
- #pragma pack(pop)
- //
- void settings_crc_init(void);
- //
- void settings_load(void);
- //
- bool settings_save(void);
- //
- bool save_settings_attributes(uint16_t page);
- //
- bool settings_erase_page(uint16_t page);
- //
- uint32_t settings_get_bank(uint32_t addr);
- //
- void settings_set_def(void);
- //
- uint32_t settings_get_crc(void);
- //
- void settings_read_from_flash(uint8_t *data, uint32_t size);
- //
- void settings_test(void);
- extern settings_t settings;
- #endif /* #ifndef __SETTINGS_H */
|