feat(spi_slave): add api for pm lock control

This commit is contained in:
wanlei
2024-05-10 11:55:27 +08:00
committed by wanckl
parent 4f2105d03e
commit 923255d7a7
17 changed files with 197 additions and 20 deletions

View File

@@ -121,7 +121,17 @@ void app_main(void)
//spi_slave_transmit does not return until the master has done a transmission, so by here we have sent our data and
//received data from the master. Print it.
printf("Received: %s\n", recvbuf);
//pause the slave to save power, transaction will also be paused
ret = spi_slave_disable(RCV_HOST);
if (ret == ESP_OK) {
printf("slave paused ...\n");
}
vTaskDelay(100); //now is able to sleep or do something to save power, any following transaction will be ignored
ret = spi_slave_enable(RCV_HOST);
if (ret == ESP_OK) {
printf("slave ready !\n");
}
n++;
}
}