[ion/bench] Stop, sleep and stanby commands

This commit is contained in:
Léa Saviot
2019-04-16 17:44:01 +02:00
parent 81b5f1841e
commit 69c5bac05a
3 changed files with 28 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
#include "command.h"
#include <ion.h>
#include <drivers/power.h>
#include <drivers/board.h>
#include <drivers/wakeup.h>
namespace Ion {
namespace Device {
@@ -12,8 +14,14 @@ void Sleep(const char * input) {
return;
}
reply(sOK);
Ion::Timing::msleep(100);
//Ion::Power::sleep(); TODO Decomment once the method exists
Device::Power::sleepConfiguration();
Device::Board::shutdownPeripherals();
Device::WakeUp::onUSBPlugging();
Device::Board::shutdownClocks();
Device::Power::enterLowPowerMode();
Device::Board::setStandardFrequency(Device::Board::Frequency::High);
Device::Board::initClocks();
Device::Board::initPeripherals();
}
}

View File

@@ -1,5 +1,7 @@
#include "command.h"
#include <ion.h>
#include <drivers/power.h>
#include <drivers/board.h>
#include <drivers/wakeup.h>
namespace Ion {
namespace Device {
@@ -12,8 +14,10 @@ void Standby(const char * input) {
return;
}
reply(sOK);
Ion::Timing::msleep(100);
//Ion::Power::standby(); TODO Decomment once the method exists
Device::Power::standbyConfiguration();
Device::Board::shutdown();
Device::Power::enterLowPowerMode();
assert(false);
}
}

View File

@@ -1,5 +1,7 @@
#include "command.h"
#include <ion.h>
#include <drivers/power.h>
#include <drivers/board.h>
#include <drivers/wakeup.h>
namespace Ion {
namespace Device {
@@ -12,8 +14,13 @@ void Stop(const char * input) {
return;
}
reply(sOK);
Ion::Timing::msleep(100);
Ion::Power::suspend(); //Ion::Power::stop(); TODO Decomment once the method exists
Device::Power::stopConfiguration();
Device::Board::shutdownPeripherals();
Device::WakeUp::onUSBPlugging();
Device::Board::shutdownClocks();
Device::Power::enterLowPowerMode();
Device::Board::initClocks();
Device::Board::initPeripherals();
}
}