OpenOCD
stm8.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /*
4 * OpenOCD STM8 target driver
5 * Copyright (C) 2017 Ake Rehnman
6 * ake.rehnman(at)gmail.com
7 */
8 
9 #ifndef OPENOCD_TARGET_STM8_H
10 #define OPENOCD_TARGET_STM8_H
11 
12 struct target;
13 
14 #define STM8_COMMON_MAGIC 0x53544D38U
15 #define STM8_NUM_CORE_REGS 6
16 
17 struct stm8_common {
18  unsigned int common_magic;
19 
20  void *arch_info;
23 
24  /* working area for fastdata access */
26 
28  bool bp_scanned;
29  uint8_t num_hw_bpoints;
32  uint32_t blocksize;
33  uint32_t flashstart;
34  uint32_t flashend;
35  uint32_t eepromstart;
36  uint32_t eepromend;
37  uint32_t optionstart;
38  uint32_t optionend;
40 
42  uint32_t flash_cr2;
43  uint32_t flash_ncr2;
44  uint32_t flash_iapsr;
45  uint32_t flash_dukr;
46  uint32_t flash_pukr;
47 
48  /* cc value used for interrupt flags restore */
49  uint32_t cc;
50  bool cc_valid;
51 
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);
55 };
56 
57 static inline struct stm8_common *
59 {
60  return target->arch_info;
61 }
62 
63 #endif /* OPENOCD_TARGET_STM8_H */
struct target * target
Definition: rtt/rtt.c:26
static struct stm8_common * target_to_stm8(struct target *target)
Definition: stm8.h:58
#define STM8_NUM_CORE_REGS
Definition: stm8.h:15
uint32_t cc
Definition: stm8.h:49
uint32_t flash_pukr
Definition: stm8.h:46
uint32_t eepromstart
Definition: stm8.h:35
uint32_t optionstart
Definition: stm8.h:37
uint8_t num_hw_bpoints_avail
Definition: stm8.h:30
struct stm8_comparator * hw_break_list
Definition: stm8.h:31
uint8_t num_hw_bpoints
Definition: stm8.h:29
uint32_t flash_ncr2
Definition: stm8.h:43
bool enable_stm8l
Definition: stm8.h:41
uint32_t optionend
Definition: stm8.h:38
bool bp_scanned
Definition: stm8.h:28
uint32_t flash_dukr
Definition: stm8.h:45
uint32_t flash_iapsr
Definition: stm8.h:44
uint32_t flashstart
Definition: stm8.h:33
uint32_t core_regs[STM8_NUM_CORE_REGS]
Definition: stm8.h:22
bool enable_step_irq
Definition: stm8.h:39
void * arch_info
Definition: stm8.h:20
int(* write_core_reg)(struct target *target, unsigned int num)
Definition: stm8.h:54
int(* read_core_reg)(struct target *target, unsigned int num)
Definition: stm8.h:53
uint32_t eepromend
Definition: stm8.h:36
struct working_area * fast_data_area
Definition: stm8.h:25
bool cc_valid
Definition: stm8.h:50
uint32_t flash_cr2
Definition: stm8.h:42
uint32_t blocksize
Definition: stm8.h:32
uint32_t flashend
Definition: stm8.h:34
bool swim_configured
Definition: stm8.h:27
unsigned int common_magic
Definition: stm8.h:18
struct reg_cache * core_cache
Definition: stm8.h:21
Definition: target.h:116
void * arch_info
Definition: target.h:164