extern "C" {
#endif
+/**
+ * @brief Initialize hal_board_funcs, which contains hal backend board functions
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_backend(void);
+
+/**
+ * @brief Release hal_board_funcs and set it to NULL
+ *
+ * @return 0 if it is successful or hal_board_funcs is NULL, else negative error value
+ */
int hal_device_board_put_backend(void);
+/**
+ * @brief Get device serial number and save it to a buffer
+ *
+ * @param[in] len Buffer size
+ * @param[out] buffer Serial number
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_device_serial_number(char *buffer, int len);
+
+/**
+ * @brief Get device revision (not in use, no hal backend function)
+ *
+ * @param[out] revision Revision number
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_device_revision(int *revision);
+
+/**
+ * @brief Set the BOOT_SUCCESS flag
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_set_boot_success(void);
+
+/**
+ * @brief Clear the BOOT_SUCCESS flag
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_clear_boot_mode(void);
+
+/**
+ * @brief Get the boot mode ("fota", "recovery", "normal")
+ *
+ * @param[in] len Buffer size
+ * @param[out] buffer boot mode
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_boot_mode(char *buffer, int len);
-int hal_device_board_get_boot_reason(char *buffer, int len);
+/**
+ * @brief Get the boot reason (not in use)
+ *
+ * @param[in] len Buffer size
+ * @param[out] buffer boot mode
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
+int hal_device_board_get_boot_reason(char *buffer, int len);// not in use
+
+
+/**
+ * @brief Switch partition to partition_ab ('a' or 'b')
+ *
+ * @param[in] partition_ab Partition name to switch to ('a' or 'b')
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_switch_partition(char partition_ab);
+
+/**
+ * @brief Set ithe cloned flag (for partition a, b)
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_set_partition_ab_cloned(void);
+
+/**
+ * @brief Clear the cloned flag (for partition a, b)
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_clear_partition_ab_cloned(void);
+
+/**
+ * @brief Get the cloned flag (for partition a, b)
+ *
+ * @param[out] cloned Flag if partition a, b are cloned(1) or not(0)
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_partition_ab_cloned(int *cloned);
+
+/**
+ * @brief Set upgrade status
+ *
+ * @param[in] status Upgrade status
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_set_upgrade_status(int status);
+
+/**
+ * @brief Get upgrade status
+ *
+ * @param[out] status Upgrade status (-1 if upgrade fail, otherwise 0~100)
+ *
+ * @return 0 on success, otherwise a negative error value
+ */
int hal_device_board_get_upgrade_status(int *status);
#ifdef __cplusplus