Commit 2f1ad44a authored by Christos Gentsos's avatar Christos Gentsos

Master: add DUT power cycle function

parent d6814dc3
......@@ -706,6 +706,12 @@ pads:
mode: Digital output
user_label: LED
configuration: null
PCYC:
name: PA18
definition: Atmel:SAMD21_Drivers:0.0.1::SAMD21G18A-MF::pad::PA18
mode: Digital output
user_label: PCYC
configuration: null
PA22:
name: PA22
definition: Atmel:SAMD21_Drivers:0.0.1::SAMD21G18A-MF::pad::PA22
......
......@@ -23,6 +23,7 @@
#define PA02 GPIO(GPIO_PORTA, 2)
#define LED GPIO(GPIO_PORTA, 17)
#define PCYC GPIO(GPIO_PORTA, 18)
#define PA22 GPIO(GPIO_PORTA, 22)
#define PA23 GPIO(GPIO_PORTA, 23)
#define PA24 GPIO(GPIO_PORTA, 24)
......
......@@ -205,6 +205,20 @@ void system_init(void)
gpio_set_pin_function(LED, GPIO_PIN_FUNCTION_OFF);
// GPIO on PA18
gpio_set_pin_level(PCYC,
// <y> Initial level
// <id> pad_initial_level
// <false"> Low
// <true"> High
false);
// Set pin direction to output
gpio_set_pin_direction(PCYC, GPIO_DIRECTION_OUT);
gpio_set_pin_function(PCYC, GPIO_PIN_FUNCTION_OFF);
ADC_0_init();
I2C_0_init();
......
......@@ -161,6 +161,12 @@ void user_interaction()
check_res_print_error(res);
}
break;
case 'P':
print("Power cycling the MoniMods...");
gpio_set_pin_level(PCYC, 1);
delay_ms(1000);
gpio_set_pin_level(PCYC, 0);
break;
case 'v':
res = i2c_m_sync_my_cmd_read(&I2C_0, 0x8B, (uint8_t *)&volt, 2);
check_res_print_error(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment