From 385d2600699c5d210bd78bca9ae4e22d8f08afc4 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 31 May 2023 14:08:50 +0200 Subject: [PATCH] cpu/sam0_eth: disable PHY when MAC is sleeping - idle 13.88 mA - MAC off 11.48 mA - MAC+PHY off 10.73 mA --- cpu/sam0_common/periph/eth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpu/sam0_common/periph/eth.c b/cpu/sam0_common/periph/eth.c index a69c67904f..adbe740d2f 100644 --- a/cpu/sam0_common/periph/eth.c +++ b/cpu/sam0_common/periph/eth.c @@ -124,11 +124,17 @@ void sam0_eth_poweron(void) { _enable_clock(); sam0_clear_rx_buffers(); + + /* enable PHY */ + gpio_set(sam_gmac_config[0].rst_pin); _is_sleeping = false; } void sam0_eth_poweroff(void) { + /* disable PHY */ + gpio_clear(sam_gmac_config[0].rst_pin); + _is_sleeping = true; _disable_clock(); }