samd: added tpwr support
This commit is contained in:
parent
6baf90ac4c
commit
3a9b0eee7a
@ -56,6 +56,8 @@ static volatile uint32_t time_ms;
|
|||||||
|
|
||||||
uint8_t button_pressed;
|
uint8_t button_pressed;
|
||||||
|
|
||||||
|
uint8_t tpwr_enabled;
|
||||||
|
|
||||||
void sys_tick_handler(void)
|
void sys_tick_handler(void)
|
||||||
{
|
{
|
||||||
if(running_status)
|
if(running_status)
|
||||||
@ -182,6 +184,9 @@ void platform_init(void)
|
|||||||
gpio_config_output(LED_PORT_UART, LED_UART, 0);//GPIO_OUT_FLAG_DEFAULT_HIGH);
|
gpio_config_output(LED_PORT_UART, LED_UART, 0);//GPIO_OUT_FLAG_DEFAULT_HIGH);
|
||||||
gpio_clear(LED_PORT_UART, LED_UART);
|
gpio_clear(LED_PORT_UART, LED_UART);
|
||||||
|
|
||||||
|
/* set up TPWR */
|
||||||
|
gpio_set(PWR_BR_PORT, PWR_BR_PIN);
|
||||||
|
gpio_config_output(PWR_BR_PORT, PWR_BR_PIN, GPIO_OUT_FLAG_DEFAULT_HIGH);
|
||||||
|
|
||||||
timing_init();
|
timing_init();
|
||||||
usbuart_init();
|
usbuart_init();
|
||||||
@ -207,6 +212,18 @@ bool platform_srst_get_val(void)
|
|||||||
return gpio_get(SRST_PORT, SRST_PIN) != 0;
|
return gpio_get(SRST_PORT, SRST_PIN) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool platform_target_get_power(void)
|
||||||
|
{
|
||||||
|
//return !gpio_get(PWR_BR_PORT, PWR_BR_PIN);
|
||||||
|
return tpwr_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void platform_target_set_power(bool power)
|
||||||
|
{
|
||||||
|
gpio_set_val(PWR_BR_PORT, PWR_BR_PIN, !power);
|
||||||
|
tpwr_enabled = power;
|
||||||
|
}
|
||||||
|
|
||||||
void platform_delay(uint32_t ms)
|
void platform_delay(uint32_t ms)
|
||||||
{
|
{
|
||||||
platform_timeout timeout;
|
platform_timeout timeout;
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
//#define PLATFORM_HAS_DEBUG
|
//#define PLATFORM_HAS_DEBUG
|
||||||
//#define USBUART_DEBUG
|
//#define USBUART_DEBUG
|
||||||
#define PLATFORM_HAS_UART_WHEN_SWDP
|
#define PLATFORM_HAS_UART_WHEN_SWDP
|
||||||
|
#define PLATFORM_HAS_POWER_SWITCH
|
||||||
#define PLATFORM_HAS_BOOTLOADER
|
#define PLATFORM_HAS_BOOTLOADER
|
||||||
|
|
||||||
#define BOARD_IDENT "Black Magic Probe (SAMD), (Firmware " FIRMWARE_VERSION ")"
|
#define BOARD_IDENT "Black Magic Probe (SAMD), (Firmware " FIRMWARE_VERSION ")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user