2021-04-29 21:27:48 +00:00
|
|
|
/*
|
|
|
|
* configuration_handler.h
|
|
|
|
*
|
|
|
|
* Created on: Apr 28, 2021
|
|
|
|
* Author: mateusz
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIGURATION_HANDLER_H_
|
|
|
|
#define CONFIGURATION_HANDLER_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2021-05-12 20:52:06 +00:00
|
|
|
typedef enum configuration_handler_region_t {
|
|
|
|
REGION_DEFAULT,
|
|
|
|
REGION_FIRST,
|
|
|
|
REGION_SECOND
|
|
|
|
} configuration_handler_region_t;
|
|
|
|
|
2022-09-08 20:43:30 +00:00
|
|
|
typedef enum configuration_erase_startup_t {
|
|
|
|
ERASE_STARTUP_IDLE = 0xAA,
|
|
|
|
ERASE_STARTUP_PENDING = 0xAB,
|
2022-09-17 05:50:35 +00:00
|
|
|
ERASE_STARTUP_DONE = 0xAC,
|
2022-09-08 20:43:30 +00:00
|
|
|
ERASE_STARTUP_ERROR = 0xAD
|
|
|
|
}configuration_erase_startup_t;
|
|
|
|
|
2023-06-12 19:30:57 +00:00
|
|
|
typedef enum configuration_button_function_t {
|
|
|
|
|
|
|
|
BUTTON_DISABLED = 0,
|
|
|
|
BUTTON_SEND_WX = 1,
|
|
|
|
BUTTON_SEND_WX_INTERNET = 2,
|
|
|
|
BUTTON_SEND_BEACON = 3,
|
|
|
|
BUTTON_FORCE_UART_KISS = 4,
|
|
|
|
BUTTON_FORCE_UART_LOG = 5,
|
2023-06-14 20:36:31 +00:00
|
|
|
BUTTON_RESET_GSM_GPRS = 6,
|
|
|
|
BUTTON_RECONNECT_APRSIS = 7,
|
2023-06-12 19:30:57 +00:00
|
|
|
}configuration_button_function_t;
|
|
|
|
|
2021-04-29 21:27:48 +00:00
|
|
|
uint32_t configuration_handler_check_crc(void);
|
2021-05-09 20:30:32 +00:00
|
|
|
uint32_t configuration_handler_restore_default_first(void);
|
2021-05-12 20:52:06 +00:00
|
|
|
uint32_t configuration_handler_restore_default_second(void);
|
|
|
|
void configuration_handler_load_configuration(configuration_handler_region_t region);
|
2022-09-08 20:43:30 +00:00
|
|
|
configuration_erase_startup_t configuration_handler_erase_startup(void);
|
|
|
|
configuration_erase_startup_t configuration_handler_program_startup(uint8_t * data, uint8_t dataln, uint16_t offset);
|
2021-04-29 21:27:48 +00:00
|
|
|
|
2021-06-13 18:25:45 +00:00
|
|
|
uint32_t configuration_get_register(void);
|
|
|
|
void configuration_set_register(uint32_t value);
|
|
|
|
void configuration_set_bits_register(uint32_t value);
|
|
|
|
void configuration_clear_bits_register(uint32_t value);
|
|
|
|
|
2022-08-18 20:15:25 +00:00
|
|
|
configuration_handler_region_t configuration_get_current(uint32_t * size);
|
2022-08-21 14:56:45 +00:00
|
|
|
const uint32_t * configuration_get_address(configuration_handler_region_t region);
|
2022-01-11 15:35:44 +00:00
|
|
|
|
2022-09-19 17:00:11 +00:00
|
|
|
int configuration_get_inhibit_wx_pwr_handle(void);
|
2022-09-20 18:58:11 +00:00
|
|
|
int configuration_get_early_tx_assert(void);
|
2023-02-01 15:05:18 +00:00
|
|
|
int configuration_get_power_cycle_vbat_r(void);
|
2023-02-03 15:45:27 +00:00
|
|
|
int configuration_get_reboot_after_24_hours(void);
|
2023-06-10 15:51:41 +00:00
|
|
|
int configuration_get_power_cycle_gsmradio_on_no_communications(void);
|
2022-09-19 17:00:11 +00:00
|
|
|
|
2023-04-09 17:30:09 +00:00
|
|
|
uint16_t configuration_get_vbat_a_coeff(void);
|
|
|
|
uint16_t configuration_get_vbat_b_coeff(void);
|
|
|
|
|
2023-06-12 19:30:57 +00:00
|
|
|
configuration_button_function_t configuration_get_left_button(void);
|
|
|
|
configuration_button_function_t configuration_get_right_button(void);
|
|
|
|
|
2023-06-29 17:00:12 +00:00
|
|
|
int configuration_get_is_security_access_required(uint8_t medium, uint8_t routine_type);
|
|
|
|
|
2023-04-09 17:30:09 +00:00
|
|
|
|
2021-04-29 21:27:48 +00:00
|
|
|
#endif /* CONFIGURATION_HANDLER_H_ */
|