From 71d5dbec48d9ec132aca7a85187191623ac6ef9e Mon Sep 17 00:00:00 2001 From: MCUdude Date: Tue, 21 Dec 2021 23:22:06 +0100 Subject: [PATCH] Add more jtagmkii baud rates --- src/jtagmkII.c | 41 ++++++++++++++++++++++++++++++++--------- src/jtagmkII_private.h | 23 +++++++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/jtagmkII.c b/src/jtagmkII.c index be6a4ed6..38eba40d 100644 --- a/src/jtagmkII.c +++ b/src/jtagmkII.c @@ -1254,15 +1254,38 @@ static unsigned char jtagmkII_get_baud(long baud) long baud; unsigned char val; } baudtab[] = { - { 2400L, PAR_BAUD_2400 }, - { 4800L, PAR_BAUD_4800 }, - { 9600L, PAR_BAUD_9600 }, - { 19200L, PAR_BAUD_19200 }, - { 38400L, PAR_BAUD_38400 }, - { 57600L, PAR_BAUD_57600 }, - { 115200L, PAR_BAUD_115200 }, - { 14400L, PAR_BAUD_14400 }, - }; + { 2400L, PAR_BAUD_2400 }, + { 4800L, PAR_BAUD_4800 }, + { 9600L, PAR_BAUD_9600 }, + { 19200L, PAR_BAUD_19200 }, + { 38400L, PAR_BAUD_38400 }, + { 57600L, PAR_BAUD_57600 }, + { 115200L, PAR_BAUD_115200 }, + { 14400L, PAR_BAUD_14400 }, + /* Extension to jtagmkII protocol: extra baud rates, standard series. */ + { 153600L, PAR_BAUD_153600 }, + { 230400L, PAR_BAUD_230400 }, + { 460800L, PAR_BAUD_460800 }, + { 921600L, PAR_BAUD_921600 }, + /* Extension to jtagmkII protocol: extra baud rates, binary series. */ + { 128000L, PAR_BAUD_128000 }, + { 256000L, PAR_BAUD_256000 }, + { 512000L, PAR_BAUD_512000 }, + { 1024000L, PAR_BAUD_1024000 }, + /* Extension to jtagmkII protocol: extra baud rates, decimal series. */ + { 150000L, PAR_BAUD_150000 }, + { 200000L, PAR_BAUD_200000 }, + { 250000L, PAR_BAUD_250000 }, + { 300000L, PAR_BAUD_300000 }, + { 400000L, PAR_BAUD_400000 }, + { 500000L, PAR_BAUD_500000 }, + { 600000L, PAR_BAUD_600000 }, + { 666666L, PAR_BAUD_666666 }, + { 1000000L, PAR_BAUD_1000000 }, + { 1500000L, PAR_BAUD_1500000 }, + { 2000000L, PAR_BAUD_2000000 }, + { 3000000L, PAR_BAUD_3000000 }, +}; int i; for (i = 0; i < sizeof baudtab / sizeof baudtab[0]; i++) diff --git a/src/jtagmkII_private.h b/src/jtagmkII_private.h index 6df8f6f2..14860854 100644 --- a/src/jtagmkII_private.h +++ b/src/jtagmkII_private.h @@ -206,6 +206,29 @@ # define PAR_BAUD_57600 0x06 # define PAR_BAUD_115200 0x07 # define PAR_BAUD_14400 0x08 +/* Extension to jtagmkII protocol: extra baud rates, standard series. */ +# define PAR_BAUD_153600 0x09 +# define PAR_BAUD_230400 0x0A +# define PAR_BAUD_460800 0x0B +# define PAR_BAUD_921600 0x0C +/* Extension to jtagmkII protocol: extra baud rates, binary series. */ +# define PAR_BAUD_128000 0x0D +# define PAR_BAUD_256000 0x0E +# define PAR_BAUD_512000 0x0F +# define PAR_BAUD_1024000 0x10 +/* Extension to jtagmkII protocol: extra baud rates, decimal series. */ +# define PAR_BAUD_150000 0x11 +# define PAR_BAUD_200000 0x12 +# define PAR_BAUD_250000 0x13 +# define PAR_BAUD_300000 0x14 +# define PAR_BAUD_400000 0x15 +# define PAR_BAUD_500000 0x16 +# define PAR_BAUD_600000 0x17 +# define PAR_BAUD_666666 0x18 +# define PAR_BAUD_1000000 0x19 +# define PAR_BAUD_1500000 0x1A +# define PAR_BAUD_2000000 0x1B +# define PAR_BAUD_3000000 0x1C #define PAR_OCD_VTARGET 0x06 #define PAR_OCD_JTAG_CLK 0x07 #define PAR_OCD_BREAK_CAUSE 0x08