struct ulink_cmd *next; ///< Pointer to next command (linked list)
};
-typedef struct ulink_cmd ulink_cmd_t;
-
/** Describes one driver instance */
struct ulink
{
struct usb_dev_handle *usb_handle;
enum ulink_type type;
- int delay_scan_in; ///< Delay value for SCAN_IN commands
- int delay_scan_out; ///< Delay value for SCAN_OUT commands
- int delay_scan_io; ///< Delay value for SCAN_IO commands
- int delay_clock_tck; ///< Delay value for CLOCK_TMS commands
- int delay_clock_tms; ///< Delay value for CLOCK_TCK commands
+ int delay_scan_in; ///< Delay value for SCAN_IN commands
+ int delay_scan_out; ///< Delay value for SCAN_OUT commands
+ int delay_scan_io; ///< Delay value for SCAN_IO commands
+ int delay_clock_tck; ///< Delay value for CLOCK_TMS commands
+ int delay_clock_tms; ///< Delay value for CLOCK_TCK commands
- int commands_in_queue; ///< Number of commands in queue
- ulink_cmd_t *queue_start; ///< Pointer to first command in queue
- ulink_cmd_t *queue_end; ///< Pointer to last command in queue
+ int commands_in_queue; ///< Number of commands in queue
+ struct ulink_cmd *queue_start; ///< Pointer to first command in queue
+ struct ulink_cmd *queue_end; ///< Pointer to last command in queue
};
/**************************** Function Prototypes *****************************/
void ulink_print_signal_states(uint8_t input_signals, uint8_t output_signals);
/* OpenULINK command generation helper functions */
-int ulink_allocate_payload(ulink_cmd_t *ulink_cmd, int size,
+int ulink_allocate_payload(struct ulink_cmd *ulink_cmd, int size,
enum ulink_payload_direction direction);
/* OpenULINK command queue helper functions */
int ulink_get_queue_size(struct ulink *device,
enum ulink_payload_direction direction);
void ulink_clear_queue(struct ulink *device);
-int ulink_append_queue(struct ulink *device, ulink_cmd_t *ulink_cmd);
+int ulink_append_queue(struct ulink *device, struct ulink_cmd *ulink_cmd);
int ulink_execute_queued_commands(struct ulink *device, int timeout);
#ifdef _DEBUG_JTAG_IO_
const char * ulink_cmd_id_string(uint8_t id);
-void ulink_print_command(ulink_cmd_t *ulink_cmd);
+void ulink_print_command(struct ulink_cmd *ulink_cmd);
void ulink_print_queue(struct ulink *device);
#endif
int ulink_queue_sleep(struct ulink *device, struct jtag_command *cmd);
int ulink_queue_stableclocks(struct ulink *device, struct jtag_command *cmd);
-int ulink_post_process_scan(ulink_cmd_t *ulink_cmd);
+int ulink_post_process_scan(struct ulink_cmd *ulink_cmd);
int ulink_post_process_queue(struct ulink *device);
/* JTAG driver functions (registered in struct jtag_interface) */
* @return on success: ERROR_OK
* @return on failure: ERROR_FAIL
*/
-int ulink_allocate_payload(ulink_cmd_t *ulink_cmd, int size,
+int ulink_allocate_payload(struct ulink_cmd *ulink_cmd, int size,
enum ulink_payload_direction direction)
{
uint8_t *payload;
int ulink_get_queue_size(struct ulink *device,
enum ulink_payload_direction direction)
{
- ulink_cmd_t *current = device->queue_start;
+ struct ulink_cmd *current = device->queue_start;
int sum = 0;
while (current != NULL) {
*/
void ulink_clear_queue(struct ulink *device)
{
- ulink_cmd_t *current = device->queue_start;
- ulink_cmd_t *next = NULL;
+ struct ulink_cmd *current = device->queue_start;
+ struct ulink_cmd *next = NULL;
while (current != NULL) {
/* Save pointer to next element */
* @return on success: ERROR_OK
* @return on failure: ERROR_FAIL
*/
-int ulink_append_queue(struct ulink *device, ulink_cmd_t *ulink_cmd)
+int ulink_append_queue(struct ulink *device, struct ulink_cmd *ulink_cmd)
{
int newsize_out, newsize_in;
int ret;
*/
int ulink_execute_queued_commands(struct ulink *device, int timeout)
{
- ulink_cmd_t *current;
+ struct ulink_cmd *current;
int ret, i, index_out, index_in, count_out, count_in;
uint8_t buffer[64];
*
* @param ulink_cmd pointer to OpenULINK command.
*/
-void ulink_print_command(ulink_cmd_t *ulink_cmd)
+void ulink_print_command(struct ulink_cmd *ulink_cmd)
{
int i;
- printf(" %-22s | OUT size = %i, bytes = 0x", ulink_cmd_id_string(ulink_cmd->id),
- ulink_cmd->payload_out_size);
+ printf(" %-22s | OUT size = %i, bytes = 0x",
+ ulink_cmd_id_string(ulink_cmd->id), ulink_cmd->payload_out_size);
for (i = 0; i < ulink_cmd->payload_out_size; i++) {
printf("%02X ", ulink_cmd->payload_out[i]);
}
- printf("\n | IN size = %i\n", ulink_cmd->payload_in_size);
+ printf("\n | IN size = %i\n",
+ ulink_cmd->payload_in_size);
}
/**
*/
void ulink_print_queue(struct ulink *device)
{
- ulink_cmd_t *current;
+ struct ulink_cmd *current;
printf("OpenULINK command queue:\n");
uint8_t tms_count_start, uint8_t tms_sequence_start, uint8_t tms_count_end,
uint8_t tms_sequence_end, struct jtag_command *origin, bool postprocess)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret, i, scan_size_bytes;
uint8_t bits_last_byte;
int ulink_append_clock_tms_cmd(struct ulink *device, uint8_t count,
uint8_t sequence)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
*/
int ulink_append_clock_tck_cmd(struct ulink *device, uint16_t count)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
*/
int ulink_append_get_signals_cmd(struct ulink *device)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
int ulink_append_set_signals_cmd(struct ulink *device, uint8_t low,
uint8_t high)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
*/
int ulink_append_sleep_cmd(struct ulink *device, uint32_t us)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
int ulink_append_configure_tck_cmd(struct ulink *device, int delay_scan_in,
int delay_scan_out, int delay_scan_io, int delay_tck, int delay_tms)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
*/
int ulink_append_led_cmd(struct ulink *device, uint8_t led_state)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
*/
int ulink_append_test_cmd(struct ulink *device)
{
- ulink_cmd_t *cmd = calloc(1, sizeof(ulink_cmd_t));
+ struct ulink_cmd *cmd = calloc(1, sizeof(struct ulink_cmd));
int ret;
if (cmd == NULL) {
* @return on success: ERROR_OK
* @return on failure: ERROR_FAIL
*/
-int ulink_post_process_scan(ulink_cmd_t *ulink_cmd)
+int ulink_post_process_scan(struct ulink_cmd *ulink_cmd)
{
struct jtag_command *cmd = ulink_cmd->cmd_origin;
int ret;
*/
int ulink_post_process_queue(struct ulink *device)
{
- ulink_cmd_t *current;
+ struct ulink_cmd *current;
struct jtag_command *openocd_cmd;
int ret;