OpenOCD
testee.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
5  ***************************************************************************/
6 
7 #ifdef HAVE_CONFIG_H
8 #include "config.h"
9 #endif
10 
11 #include <helper/log.h>
12 
13 #include "target.h"
14 #include "target_type.h"
15 #include "hello.h"
16 
17 static const struct command_registration testee_command_handlers[] = {
18  {
19  .name = "testee",
20  .mode = COMMAND_ANY,
21  .help = "testee target commands",
22  .chain = hello_command_handlers,
23  .usage = "",
24  },
26 };
27 
28 static int testee_init(struct command_context *cmd_ctx, struct target *target)
29 {
30  return ERROR_OK;
31 }
32 static int testee_poll(struct target *target)
33 {
36  return ERROR_OK;
37 }
38 static int testee_halt(struct target *target)
39 {
41  return ERROR_OK;
42 }
43 static int testee_reset_assert(struct target *target)
44 {
46  return ERROR_OK;
47 }
48 static int testee_reset_deassert(struct target *target)
49 {
51  return ERROR_OK;
52 }
53 struct target_type testee_target = {
54  .name = "testee",
55  .commands = testee_command_handlers,
56 
57  .init_target = &testee_init,
58  .poll = &testee_poll,
59  .halt = &testee_halt,
60  .assert_reset = &testee_reset_assert,
61  .deassert_reset = &testee_reset_deassert,
62 };
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const struct command_registration hello_command_handlers[]
Export the registration for the hello command group, so it can be embedded in example drivers.
Definition: hello.c:85
#define ERROR_OK
Definition: log.h:155
const char * name
Definition: command.h:229
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235
This holds methods shared between all instances of a given target type.
Definition: target_type.h:26
const char * name
Name of this type of target.
Definition: target_type.h:31
Definition: target.h:120
enum target_state state
Definition: target.h:162
@ TARGET_RESET
Definition: target.h:56
@ TARGET_DEBUG_RUNNING
Definition: target.h:57
@ TARGET_HALTED
Definition: target.h:55
@ TARGET_RUNNING
Definition: target.h:54
static int testee_init(struct command_context *cmd_ctx, struct target *target)
Definition: testee.c:28
struct target_type testee_target
Definition: testee.c:53
static int testee_reset_assert(struct target *target)
Definition: testee.c:43
static int testee_poll(struct target *target)
Definition: testee.c:32
static int testee_reset_deassert(struct target *target)
Definition: testee.c:48
static const struct command_registration testee_command_handlers[]
Definition: testee.c:17
static int testee_halt(struct target *target)
Definition: testee.c:38