cmsis: implement srst_set_val()
This commit is contained in:
parent
166eb3ee3e
commit
d4ae308f9f
@ -135,6 +135,11 @@ int dap_init(bmp_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dap_srst_set_val(bool assert)
|
||||||
|
{
|
||||||
|
dap_reset_pin(!assert);
|
||||||
|
}
|
||||||
|
|
||||||
static void dap_dp_abort(ADIv5_DP_t *dp, uint32_t abort)
|
static void dap_dp_abort(ADIv5_DP_t *dp, uint32_t abort)
|
||||||
{
|
{
|
||||||
/* DP Write to Reg 0.*/
|
/* DP Write to Reg 0.*/
|
||||||
|
@ -31,6 +31,7 @@ int dap_swdptap_init(ADIv5_DP_t *dp);
|
|||||||
int dap_jtag_dp_init(ADIv5_DP_t *dp);
|
int dap_jtag_dp_init(ADIv5_DP_t *dp);
|
||||||
uint32_t dap_swj_clock(uint32_t clock);
|
uint32_t dap_swj_clock(uint32_t clock);
|
||||||
void dap_swd_configure(uint8_t cfg);
|
void dap_swd_configure(uint8_t cfg);
|
||||||
|
void dap_srst_set_val(bool assert);
|
||||||
#else
|
#else
|
||||||
int dap_init(bmp_info_t *info)
|
int dap_init(bmp_info_t *info)
|
||||||
{
|
{
|
||||||
@ -47,6 +48,7 @@ int cmsis_dap_jtagtap_init(jtag_proc_t *jtag_proc) {return -1;}
|
|||||||
int dap_swdptap_init(ADIv5_DP_t *dp) {return -1;}
|
int dap_swdptap_init(ADIv5_DP_t *dp) {return -1;}
|
||||||
int dap_jtag_dp_init(ADIv5_DP_t *dp) {return -1;}
|
int dap_jtag_dp_init(ADIv5_DP_t *dp) {return -1;}
|
||||||
void dap_swd_configure(uint8_t cfg) {};
|
void dap_swd_configure(uint8_t cfg) {};
|
||||||
|
void dap_srst_set_val(assert) {};
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -200,7 +200,7 @@ void dap_disconnect(void)
|
|||||||
uint8_t buf[65];
|
uint8_t buf[65];
|
||||||
|
|
||||||
buf[0] = ID_DAP_DISCONNECT;
|
buf[0] = ID_DAP_DISCONNECT;
|
||||||
dbg_dap_cmd(buf, sizeof(buf), 65);
|
dbg_dap_cmd(buf, sizeof(buf), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t swj_clock;
|
static uint32_t swj_clock;
|
||||||
@ -277,10 +277,7 @@ void dap_reset_pin(int state)
|
|||||||
buf[1] = state ? DAP_SWJ_nRESET : 0; // Value
|
buf[1] = state ? DAP_SWJ_nRESET : 0; // Value
|
||||||
buf[2] = DAP_SWJ_nRESET; // Select
|
buf[2] = DAP_SWJ_nRESET; // Select
|
||||||
buf[3] = 0; // Wait
|
buf[3] = 0; // Wait
|
||||||
buf[4] = 0;
|
dbg_dap_cmd(buf, sizeof(buf), 4);
|
||||||
buf[5] = 0;
|
|
||||||
buf[6] = 0;
|
|
||||||
dbg_dap_cmd(buf, sizeof(buf), 7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dap_trst_reset(void)
|
void dap_trst_reset(void)
|
||||||
|
@ -69,6 +69,7 @@ void dap_transfer_configure(uint8_t idle, uint16_t count, uint16_t retry);
|
|||||||
void dap_swd_configure(uint8_t cfg);
|
void dap_swd_configure(uint8_t cfg);
|
||||||
int dap_info(int info, uint8_t *data, int size);
|
int dap_info(int info, uint8_t *data, int size);
|
||||||
void dap_reset_target(void);
|
void dap_reset_target(void);
|
||||||
|
void dap_srst_set_val(bool assert);
|
||||||
void dap_trst_reset(void);
|
void dap_trst_reset(void);
|
||||||
void dap_reset_target_hw(int state);
|
void dap_reset_target_hw(int state);
|
||||||
void dap_reset_pin(int state);
|
void dap_reset_pin(int state);
|
||||||
|
@ -292,6 +292,8 @@ void platform_srst_set_val(bool assert)
|
|||||||
return jlink_srst_set_val(&info, assert);
|
return jlink_srst_set_val(&info, assert);
|
||||||
case BMP_TYPE_LIBFTDI:
|
case BMP_TYPE_LIBFTDI:
|
||||||
return libftdi_srst_set_val(assert);
|
return libftdi_srst_set_val(assert);
|
||||||
|
case BMP_TYPE_CMSIS_DAP:
|
||||||
|
return dap_srst_set_val(assert);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user