OpenOCD
remote_bitbang.c File Reference
Include dependency graph for remote_bitbang.c:

Go to the source code of this file.

Macros

#define REMOTE_BITBANG_HOST_MAX   255
 

Enumerations

enum  block_bool { NO_BLOCK , BLOCK }
 
enum  flush_bool_t { NO_FLUSH , FLUSH_SEND_BUF }
 

Functions

static bb_value_t char_to_int (int c)
 
 COMMAND_HANDLER (remote_bitbang_handle_remote_bitbang_host_command)
 
 COMMAND_HANDLER (remote_bitbang_handle_remote_bitbang_port_command)
 
static int remote_bitbang_blink (int on)
 
static int remote_bitbang_execute_queue (void)
 
static int remote_bitbang_fill_buf (enum block_bool block)
 
static int remote_bitbang_flush (void)
 
static int remote_bitbang_init (void)
 
static int remote_bitbang_init_tcp (void)
 
static int remote_bitbang_init_unix (void)
 
static int remote_bitbang_queue (int c, flush_bool_t flush)
 
static int remote_bitbang_quit (void)
 
static bb_value_t remote_bitbang_read_sample (void)
 
static unsigned int remote_bitbang_recv_buf_contiguous_available_space (void)
 
static bool remote_bitbang_recv_buf_empty (void)
 
static bool remote_bitbang_recv_buf_full (void)
 
static int remote_bitbang_reset (int trst, int srst)
 
static int remote_bitbang_sample (void)
 
static int remote_bitbang_write (int tck, int tms, int tdi)
 

Variables

struct adapter_driver remote_bitbang_adapter_driver
 
static struct bitbang_interface remote_bitbang_bitbang
 
static const struct command_registration remote_bitbang_command_handlers []
 
static int remote_bitbang_fd
 
static char * remote_bitbang_host
 
static struct jtag_interface remote_bitbang_interface
 
static char * remote_bitbang_port
 
static char remote_bitbang_recv_buf [256]
 
static unsigned int remote_bitbang_recv_buf_end
 
static unsigned int remote_bitbang_recv_buf_start
 
static uint8_t remote_bitbang_send_buf [512]
 
static unsigned int remote_bitbang_send_buf_used
 
static const struct command_registration remote_bitbang_subcommand_handlers []
 

Macro Definition Documentation

◆ REMOTE_BITBANG_HOST_MAX

#define REMOTE_BITBANG_HOST_MAX   255

Definition at line 23 of file remote_bitbang.c.

Enumeration Type Documentation

◆ block_bool

enum block_bool
Enumerator
NO_BLOCK 
BLOCK 

Definition at line 83 of file remote_bitbang.c.

◆ flush_bool_t

Enumerator
NO_FLUSH 
FLUSH_SEND_BUF 

Definition at line 137 of file remote_bitbang.c.

Function Documentation

◆ char_to_int()

static bb_value_t char_to_int ( int  c)
static

Definition at line 168 of file remote_bitbang.c.

References BB_ERROR, BB_HIGH, BB_LOW, LOG_ERROR, and remote_bitbang_quit().

Referenced by remote_bitbang_read_sample().

◆ COMMAND_HANDLER() [1/2]

COMMAND_HANDLER ( remote_bitbang_handle_remote_bitbang_host_command  )

◆ COMMAND_HANDLER() [2/2]

COMMAND_HANDLER ( remote_bitbang_handle_remote_bitbang_port_command  )

◆ remote_bitbang_blink()

static int remote_bitbang_blink ( int  on)
static

Definition at line 217 of file remote_bitbang.c.

◆ remote_bitbang_execute_queue()

static int remote_bitbang_execute_queue ( void  )
static

Definition at line 383 of file remote_bitbang.c.

◆ remote_bitbang_fill_buf()

◆ remote_bitbang_flush()

static int remote_bitbang_flush ( void  )
static

◆ remote_bitbang_init()

◆ remote_bitbang_init_tcp()

static int remote_bitbang_init_tcp ( void  )
static

◆ remote_bitbang_init_unix()

static int remote_bitbang_init_unix ( void  )
static

Definition at line 281 of file remote_bitbang.c.

References addr, ERROR_FAIL, LOG_ERROR, LOG_INFO, log_socket_error(), and remote_bitbang_host.

Referenced by remote_bitbang_init().

◆ remote_bitbang_queue()

◆ remote_bitbang_quit()

static int remote_bitbang_quit ( void  )
static

◆ remote_bitbang_read_sample()

static bb_value_t remote_bitbang_read_sample ( void  )
static

◆ remote_bitbang_recv_buf_contiguous_available_space()

static unsigned int remote_bitbang_recv_buf_contiguous_available_space ( void  )
static

◆ remote_bitbang_recv_buf_empty()

static bool remote_bitbang_recv_buf_empty ( void  )
static

◆ remote_bitbang_recv_buf_full()

static bool remote_bitbang_recv_buf_full ( void  )
static

◆ remote_bitbang_reset()

static int remote_bitbang_reset ( int  trst,
int  srst 
)
static

Definition at line 209 of file remote_bitbang.c.

References FLUSH_SEND_BUF, and remote_bitbang_queue().

◆ remote_bitbang_sample()

static int remote_bitbang_sample ( void  )
static

◆ remote_bitbang_write()

static int remote_bitbang_write ( int  tck,
int  tms,
int  tdi 
)
static

Definition at line 203 of file remote_bitbang.c.

References NO_FLUSH, and remote_bitbang_queue().

Variable Documentation

◆ remote_bitbang_adapter_driver

struct adapter_driver remote_bitbang_adapter_driver
Initial value:
= {
.name = "remote_bitbang",
.transports = jtag_only,
}
const char *const jtag_only[]
Definition: adapter.c:31
static int remote_bitbang_init(void)
static struct jtag_interface remote_bitbang_interface
static int remote_bitbang_reset(int trst, int srst)
static const struct command_registration remote_bitbang_command_handlers[]
static int remote_bitbang_quit(void)

Definition at line 383 of file remote_bitbang.c.

◆ remote_bitbang_bitbang

struct bitbang_interface remote_bitbang_bitbang
static
Initial value:
= {
.buf_size = sizeof(remote_bitbang_recv_buf) - 1,
.read_sample = &remote_bitbang_read_sample,
}
static char remote_bitbang_recv_buf[256]
static int remote_bitbang_sample(void)
static bb_value_t remote_bitbang_read_sample(void)
static int remote_bitbang_blink(int on)
static int remote_bitbang_write(int tck, int tms, int tdi)

Definition at line 217 of file remote_bitbang.c.

Referenced by remote_bitbang_init().

◆ remote_bitbang_command_handlers

const struct command_registration remote_bitbang_command_handlers[]
static
Initial value:
= {
{
.name = "remote_bitbang",
.mode = COMMAND_ANY,
.help = "perform remote_bitbang management",
.usage = "",
},
}
#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
static const struct command_registration remote_bitbang_subcommand_handlers[]
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 342 of file remote_bitbang.c.

◆ remote_bitbang_fd

int remote_bitbang_fd
static

◆ remote_bitbang_host

char* remote_bitbang_host
static

◆ remote_bitbang_interface

struct jtag_interface remote_bitbang_interface
static
Initial value:
= {
.execute_queue = &remote_bitbang_execute_queue,
}
static int remote_bitbang_execute_queue(void)

Definition at line 383 of file remote_bitbang.c.

◆ remote_bitbang_port

char* remote_bitbang_port
static

◆ remote_bitbang_recv_buf

◆ remote_bitbang_recv_buf_end

◆ remote_bitbang_recv_buf_start

◆ remote_bitbang_send_buf

uint8_t remote_bitbang_send_buf[512]
static

Definition at line 29 of file remote_bitbang.c.

Referenced by remote_bitbang_flush(), and remote_bitbang_queue().

◆ remote_bitbang_send_buf_used

unsigned int remote_bitbang_send_buf_used
static

Definition at line 30 of file remote_bitbang.c.

Referenced by remote_bitbang_flush(), and remote_bitbang_queue().

◆ remote_bitbang_subcommand_handlers

const struct command_registration remote_bitbang_subcommand_handlers[]
static
Initial value:
= {
{
.name = "port",
.handler = remote_bitbang_handle_remote_bitbang_port_command,
.mode = COMMAND_CONFIG,
.help = "Set the port to use to connect to the remote jtag.\n"
" if 0 or unset, use unix sockets to connect to the remote jtag.",
.usage = "port_number",
},
{
.name = "host",
.handler = remote_bitbang_handle_remote_bitbang_host_command,
.mode = COMMAND_CONFIG,
.help = "Set the host to use to connect to the remote jtag.\n"
" if port is 0 or unset, this is the name of the unix socket to use.",
.usage = "host_name",
},
}
@ COMMAND_CONFIG
Definition: command.h:41

Definition at line 342 of file remote_bitbang.c.