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_parport_cable_command)
 
 COMMAND_HANDLER (parport_handle_parport_port_command)
 
 COMMAND_HANDLER (parport_handle_parport_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 (int 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_parport_cable_command  )

Definition at line 408 of file parport.c.

References CMD_ARGC, CMD_ARGV, ERROR_OK, and parport_cable.

◆ COMMAND_HANDLER() [2/4]

COMMAND_HANDLER ( parport_handle_parport_port_command  )

◆ COMMAND_HANDLER() [3/4]

COMMAND_HANDLER ( parport_handle_parport_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 205 of file parport.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, and parport_toggling_time_ns.

◆ parport_led()

static int parport_led ( int  on)
static

Definition at line 187 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 109 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 167 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 199 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 216 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 125 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 99 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 105 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:31
static int parport_reset(int trst, int srst)
Definition: parport.c:167
static int parport_speed(int speed)
Definition: parport.c:199
static const struct command_registration parport_command_handlers[]
Definition: parport.c:504
static int parport_quit(void)
Definition: parport.c:375
static struct jtag_interface parport_interface
Definition: parport.c:515
static int parport_speed_div(int speed, int *khz)
Definition: parport.c:216
static int parport_khz(int khz, int *jtag_speed)
Definition: parport.c:205
static int parport_init(void)
Definition: parport.c:256

Definition at line 435 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:141
static bb_value_t parport_read(void)
Definition: parport.c:109
static int parport_led(int on)
Definition: parport.c:187

Definition at line 216 of file parport.c.

Referenced by parport_init().

◆ parport_cable

char* parport_cable
static

Definition at line 91 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:247
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration parport_subcommand_handlers[]
Definition: parport.c:466
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 435 of file parport.c.

◆ parport_exit

bool parport_exit
static

Definition at line 93 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(void)
Definition: bitbang.c:281
#define DEBUG_CAP_TMS_SEQ
Definition: interface.h:189

Definition at line 435 of file parport.c.

◆ parport_port

uint16_t parport_port
static

Definition at line 92 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 435 of file parport.c.

◆ parport_toggling_time_ns

uint32_t parport_toggling_time_ns = 1000
static

Definition at line 94 of file parport.c.

Referenced by COMMAND_HANDLER(), and parport_khz().

◆ statusport

unsigned long statusport
static

Definition at line 106 of file parport.c.

Referenced by parport_init(), and parport_read().

◆ wait_states

int wait_states
static

Definition at line 95 of file parport.c.

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