pico430prog/src/tool78/tool78_cmds.h

47 lines
1.6 KiB
C

#ifndef TOOL78_CMDS_H_
#define TOOL78_CMDS_H_
#include "tool78_defs.h"
#include "tool78_hw.h"
enum tool78_stat tool78_do_reset(struct tool78_hw* hw);
enum tool78_stat tool78_do_baud_rate_set(struct tool78_hw* hw);
enum tool78_stat tool78_do_osc_freq_set(struct tool78_hw* hw);
static inline enum tool78_stat tool78_do_generic_baudrate(struct tool78_hw* hw) {
if ((hw->target & tool78_mcu_mask) == tool78_mcu_78k0)
return tool78_do_osc_freq_set(hw);
else
return tool78_do_baud_rate_set(hw);
}
enum tool78_stat tool78_do_chip_erase(struct tool78_hw* hw);
enum tool78_stat tool78_do_block_erase(struct tool78_hw* hw, uint32_t start, uint32_t end);
enum tool78_stat tool78_do_programming(struct tool78_hw* hw, uint32_t start,
uint32_t end, const uint8_t* src);
enum tool78_stat tool78_do_verify(struct tool78_hw* hw, uint32_t start,
uint32_t end, const uint8_t* src);
enum tool78_stat tool78_do_block_blank_check(struct tool78_hw* hw,
uint32_t start, uint32_t end, bool check_flash_opt /* RL78 only */);
enum tool78_stat tool78_do_checksum(struct tool78_hw* hw, uint32_t start,
uint32_t end, uint16_t* ckout);
enum tool78_stat tool78_do_silicon_signature(struct tool78_hw* hw,
tool78_silicon_sig_t* sig_dest);
enum tool78_stat tool78_do_version_get(struct tool78_hw* hw, tool78_version_t* vout);
enum tool78_stat tool78_do_security_set(struct tool78_hw* hw,
const struct tool78_security* sec);
enum tool78_stat tool78_do_security_get(struct tool78_hw* hw,
struct tool78_security* sec);
enum tool78_stat tool78_do_security_release(struct tool78_hw* hw);
// ----
enum tool78_stat tool78_init(struct tool78_hw* hw, tool78_silicon_sig_t* sig);
#endif