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 0x53544D38U
15 #define STM8_NUM_CORE_REGS 6
18 unsigned int common_magic
;
21 struct reg_cache
*core_cache
;
22 uint32_t core_regs
[STM8_NUM_CORE_REGS
];
24 /* working area for fastdata access */
25 struct working_area
*fast_data_area
;
29 uint8_t num_hw_bpoints
;
30 uint8_t num_hw_bpoints_avail
;
31 struct stm8_comparator
*hw_break_list
;
48 /* cc value used for interrupt flags restore */
52 /* register cache to processor synchronization */
53 int (*read_core_reg
)(struct target
*target
, unsigned int num
);
54 int (*write_core_reg
)(struct target
*target
, unsigned int num
);
57 static inline struct stm8_common
*
58 target_to_stm8(struct target
*target
)
60 return target
->arch_info
;
63 #endif /* OPENOCD_TARGET_STM8_H */