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

Go to the source code of this file.

Data Structures

struct  cable
 

Functions

 COMMAND_HANDLER (parport_handle_cable_command)
 
 COMMAND_HANDLER (parport_handle_port_command)
 
 COMMAND_HANDLER (parport_handle_toggling_time_command)
 
 COMMAND_HANDLER (parport_handle_write_on_exit_command)
 
static int parport_init (void)
 
static int parport_khz (int khz, int *jtag_speed)
 
static int parport_led (bool on)
 
static int parport_quit (void)
 
static bb_value_t parport_read (void)
 
static int parport_reset (int trst, int srst)
 
static int parport_speed (int speed)
 
static int parport_speed_div (int speed, int *khz)
 
static int parport_write (int tck, int tms, int tdi)
 
static void parport_write_data (void)
 

Variables

static const struct cablecable
 
static const struct cable cables []
 
static unsigned long dataport
 
static uint8_t dataport_value
 
struct adapter_driver parport_adapter_driver
 
static struct bitbang_interface parport_bitbang
 
static char * parport_cable
 
static const struct command_registration parport_command_handlers []
 
static bool parport_exit
 
static struct jtag_interface parport_interface
 
static uint16_t parport_port
 
static const struct command_registration parport_subcommand_handlers []
 
static uint32_t parport_toggling_time_ns = 1000
 
static unsigned long statusport
 
static int wait_states
 

Function Documentation

◆ COMMAND_HANDLER() [1/4]

COMMAND_HANDLER ( parport_handle_cable_command  )

Definition at line 416 of file parport.c.

References CMD_ARGC, CMD_ARGV, ERROR_FAIL, ERROR_OK, LOG_ERROR, and parport_cable.

◆ COMMAND_HANDLER() [2/4]

COMMAND_HANDLER ( parport_handle_port_command  )

◆ COMMAND_HANDLER() [3/4]

COMMAND_HANDLER ( parport_handle_toggling_time_command  )

◆ COMMAND_HANDLER() [4/4]

COMMAND_HANDLER ( parport_handle_write_on_exit_command  )

◆ parport_init()

◆ parport_khz()

static int parport_khz ( int  khz,
int *  jtag_speed 
)
static

Definition at line 213 of file parport.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, and parport_toggling_time_ns.

◆ parport_led()

static int parport_led ( bool  on)
static

Definition at line 195 of file parport.c.

References dataport_value, ERROR_OK, cable::led_mask, and parport_write_data().

Referenced by parport_init(), and parport_quit().

◆ parport_quit()

static int parport_quit ( void  )
static

◆ parport_read()

static bb_value_t parport_read ( void  )
static

Definition at line 118 of file parport.c.

References BB_HIGH, BB_LOW, cable::input_invert, statusport, and cable::tdo_mask.

◆ parport_reset()

static int parport_reset ( int  trst,
int  srst 
)
static

Definition at line 176 of file parport.c.

References dataport_value, ERROR_OK, LOG_DEBUG, parport_write_data(), cable::srst_mask, and cable::trst_mask.

Referenced by parport_init().

◆ parport_speed()

static int parport_speed ( int  speed)
static

Definition at line 207 of file parport.c.

References ERROR_OK, and wait_states.

◆ parport_speed_div()

static int parport_speed_div ( int  speed,
int *  khz 
)
static

Definition at line 224 of file parport.c.

◆ parport_write()

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

◆ parport_write_data()

static void parport_write_data ( void  )
inlinestatic

Definition at line 134 of file parport.c.

References dataport, dataport_value, output, and cable::output_invert.

Referenced by parport_led(), parport_quit(), parport_reset(), and parport_write().

Variable Documentation

◆ cable

const struct cable* cable
static

Definition at line 108 of file parport.c.

◆ cables

const struct cable cables[]
static
Initial value:
= {
{ "wiggler", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x80, 0x00 },
{ "wiggler2", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x01, 0x80, 0x80, 0x00, 0x20 },
{ "wiggler_ntrst_inverted", 0x80, 0x10, 0x02, 0x04, 0x08, 0x01, 0x11, 0x80, 0x80, 0x80, 0x00 },
{ "old_amt_wiggler", 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x11, 0x80, 0x80, 0x80, 0x00 },
{ "arm-jtag", 0x80, 0x01, 0x02, 0x04, 0x08, 0x10, 0x01, 0x80, 0x80, 0x80, 0x00 },
{ "chameleon", 0x80, 0x00, 0x04, 0x01, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00 },
{ "dlc5", 0x10, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00 },
{ "triton", 0x80, 0x08, 0x04, 0x01, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00 },
{ "lattice", 0x40, 0x10, 0x04, 0x02, 0x01, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00 },
{ "flashlink", 0x20, 0x10, 0x02, 0x01, 0x04, 0x20, 0x30, 0x20, 0x00, 0x00, 0x00 },
{ "altium", 0x10, 0x20, 0x04, 0x02, 0x01, 0x80, 0x00, 0x00, 0x10, 0x00, 0x08 },
{ "aspo", 0x10, 0x01, 0x04, 0x08, 0x02, 0x10, 0x17, 0x00, 0x17, 0x17, 0x00 },
{ NULL, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
}
#define NULL
Definition: usb.h:16

Definition at line 1 of file parport.c.

Referenced by parport_init().

◆ dataport

unsigned long dataport
static

Definition at line 114 of file parport.c.

Referenced by parport_init(), and parport_write_data().

◆ dataport_value

uint8_t dataport_value
static

◆ parport_adapter_driver

struct adapter_driver parport_adapter_driver
Initial value:
= {
.name = "parport",
.transports = jtag_only,
.init = parport_init,
.quit = parport_quit,
.reset = parport_reset,
.speed = parport_speed,
.khz = parport_khz,
.speed_div = parport_speed_div,
.jtag_ops = &parport_interface,
}
const char *const jtag_only[]
Definition: adapter.c:27
static int parport_reset(int trst, int srst)
Definition: parport.c:176
static int parport_speed(int speed)
Definition: parport.c:207
static const struct command_registration parport_command_handlers[]
Definition: parport.c:518
static int parport_quit(void)
Definition: parport.c:383
static struct jtag_interface parport_interface
Definition: parport.c:529
static int parport_speed_div(int speed, int *khz)
Definition: parport.c:224
static int parport_khz(int khz, int *jtag_speed)
Definition: parport.c:213
static int parport_init(void)
Definition: parport.c:264

Definition at line 447 of file parport.c.

◆ parport_bitbang

struct bitbang_interface parport_bitbang
static
Initial value:
= {
.read = &parport_read,
.write = &parport_write,
.blink = &parport_led,
}
static int parport_write(int tck, int tms, int tdi)
Definition: parport.c:150
static bb_value_t parport_read(void)
Definition: parport.c:118
static int parport_led(bool on)
Definition: parport.c:195

Definition at line 224 of file parport.c.

Referenced by parport_init().

◆ parport_cable

char* parport_cable
static

Definition at line 101 of file parport.c.

Referenced by COMMAND_HANDLER(), parport_init(), and parport_quit().

◆ parport_command_handlers

const struct command_registration parport_command_handlers[]
static
Initial value:
= {
{
.name = "parport",
.mode = COMMAND_ANY,
.help = "perform parport management",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration parport_subcommand_handlers[]
Definition: parport.c:480
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:241

Definition at line 447 of file parport.c.

◆ parport_exit

bool parport_exit
static

Definition at line 103 of file parport.c.

Referenced by COMMAND_HANDLER(), and parport_quit().

◆ parport_interface

struct jtag_interface parport_interface
static
Initial value:
= {
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = bitbang_execute_queue,
}
int bitbang_execute_queue(struct jtag_command *cmd_queue)
Definition: bitbang.c:293
#define DEBUG_CAP_TMS_SEQ
Definition: interface.h:187

Definition at line 447 of file parport.c.

◆ parport_port

uint16_t parport_port
static

Definition at line 102 of file parport.c.

Referenced by COMMAND_HANDLER(), and parport_init().

◆ parport_subcommand_handlers

const struct command_registration parport_subcommand_handlers[]
static

Definition at line 447 of file parport.c.

◆ parport_toggling_time_ns

uint32_t parport_toggling_time_ns = 1000
static

Definition at line 104 of file parport.c.

Referenced by COMMAND_HANDLER(), and parport_khz().

◆ statusport

unsigned long statusport
static

Definition at line 115 of file parport.c.

Referenced by parport_init(), and parport_read().

◆ wait_states

int wait_states
static

Definition at line 105 of file parport.c.

Referenced by COMMAND_HANDLER(), parport_speed(), and parport_write().