hosted/bmp_remote: Implemented support for the new remote protocol target clock tristating

This commit is contained in:
dragonmux 2022-08-10 00:27:55 +01:00 committed by Piotr Esden-Tempski
parent 84527d501b
commit 450581cc0a
2 changed files with 19 additions and 6 deletions

View File

@ -180,6 +180,17 @@ const char *remote_target_voltage(void)
return (char *)&construct[1];
}
void remote_target_clk_output_enable(const bool enable)
{
char buffer[REMOTE_MAX_MSG_SIZE];
int length = snprintf(buffer, REMOTE_MAX_MSG_SIZE, REMOTE_TARGET_CLK_OE_STR, enable ? '1' : '0');
platform_buffer_write((uint8_t *)buffer, length);
length = platform_buffer_read((uint8_t *)buffer, REMOTE_MAX_MSG_SIZE);
if (length < 1 || buffer[0] == REMOTE_RESP_ERR)
DEBUG_WARN("remote_target_clk_output_enable failed, error %s\n", length ? buffer + 1 : "unknown");
}
static uint32_t remote_adiv5_dp_read(ADIv5_DP_t *dp, uint16_t addr)
{
(void)dp;

View File

@ -16,8 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__BMP_REMOTE_H_)
#define __BMP_REMOTE_H_
#ifndef __BMP_REMOTE_H_
#define __BMP_REMOTE_H_
#include "jtagtap.h"
#include "adiv5.h"
#include "target.h"
@ -33,13 +34,14 @@ int remote_swdptap_init(ADIv5_DP_t *dp);
int remote_jtagtap_init(jtag_proc_t *jtag_proc);
bool remote_target_get_power(void);
const char *remote_target_voltage(void);
bool remote_target_set_power(const bool power);
bool remote_target_set_power(bool power);
void remote_nrst_set_val(bool assert);
bool remote_nrst_get_val(void);
void remote_max_frequency_set(uint32_t freq);
uint32_t remote_max_frequency_get(void);
const char *platform_target_voltage(void);
void remote_target_clk_output_enable(bool enable);
void remote_adiv5_dp_defaults(ADIv5_DP_t *dp);
void remote_add_jtag_dev(uint32_t i, const jtag_dev_t *jtag_dev);
#define __BMP_REMOTE_H_
#endif
#endif /*__BMP_REMOTE_H_*/