1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * OpenOCD STM8 target driver
5 * Copyright (C) 2017 Ake Rehnman
6 * ake.rehnman(at)gmail.com
9 #ifndef OPENOCD_TARGET_STM8_H
10 #define OPENOCD_TARGET_STM8_H
14 #define STM8_COMMON_MAGIC 0x53544D38
15 #define STM8_NUM_CORE_REGS 6
18 uint32_t common_magic;
20 struct reg_cache *core_cache;
21 uint32_t core_regs[STM8_NUM_CORE_REGS];
23 /* working area for fastdata access */
24 struct working_area *fast_data_area;
28 uint8_t num_hw_bpoints;
29 uint8_t num_hw_bpoints_avail;
30 struct stm8_comparator *hw_break_list;
47 /* cc value used for interrupt flags restore */
51 /* register cache to processor synchronization */
52 int (*read_core_reg)(struct target *target, unsigned int num);
53 int (*write_core_reg)(struct target *target, unsigned int num);
56 static inline struct stm8_common *
57 target_to_stm8(struct target *target)
59 return target->arch_info;
62 #endif /* OPENOCD_TARGET_STM8_H */