OpenOCD
msgtypes.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2011 by Martin Schmoelzer *
5  * <martin.schmoelzer@student.tuwien.ac.at> *
6  ***************************************************************************/
7 
122 #ifndef __MSGTYPES_H
123 #define __MSGTYPES_H
124 
125 /*
126  * Command IDs:
127  *
128  * Bits 7..6: Reserved, should always be zero
129  * Bits 5..0: Command ID. There are 62 usable IDs. Of this 63 available IDs,
130  * the IDs 0x00..0x1F are commands with variable payload size,
131  * the IDs 0x20..0x3F are commands with fixed payload size.
132  */
133 
134 #define CMD_ID_MASK 0x3F
135 
136 /* Commands with variable payload size */
137 #define CMD_SCAN_IN 0x00
138 #define CMD_SLOW_SCAN_IN 0x01
139 #define CMD_SCAN_OUT 0x02
140 #define CMD_SLOW_SCAN_OUT 0x03
141 #define CMD_SCAN_IO 0x04
142 #define CMD_SLOW_SCAN_IO 0x05
143 
144 /* Commands with fixed payload size */
145 #define CMD_CLOCK_TMS 0x20
146 #define CMD_SLOW_CLOCK_TMS 0x21
147 #define CMD_CLOCK_TCK 0x22
148 #define CMD_SLOW_CLOCK_TCK 0x23
149 #define CMD_SLEEP_US 0x24
150 #define CMD_SLEEP_MS 0x25
151 #define CMD_GET_SIGNALS 0x26
152 #define CMD_SET_SIGNALS 0x27
153 #define CMD_CONFIGURE_TCK_FREQ 0x28
154 #define CMD_SET_LEDS 0x29
155 #define CMD_TEST 0x2A
156 
157 /* JTAG signal definition for jtag_get_signals() -- Input signals! */
158 #define SIGNAL_TDO (1<<0)
159 #define SIGNAL_BRKOUT (1<<1)
160 #define SIGNAL_TRAP (1<<2)
161 #define SIGNAL_RTCK (1<<3)
162 
163 /* JTAG signal definition for jtag_get_signals() -- Output signals! */
164 #define SIGNAL_TDI (1<<0)
165 #define SIGNAL_TMS (1<<1)
166 #define SIGNAL_TCK (1<<2)
167 #define SIGNAL_TRST (1<<3)
168 #define SIGNAL_BRKIN (1<<4)
169 #define SIGNAL_RESET (1<<5)
170 #define SIGNAL_OCDSE (1<<6)
171 
172 /* LED definitions for CMD_SET_LEDS and CMD_CLEAR_LEDS commands */
173 #define COM_LED_ON (1<<0)
174 #define RUN_LED_ON (1<<1)
175 #define COM_LED_OFF (1<<2)
176 #define RUN_LED_OFF (1<<3)
177 
178 #endif