OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::Power Namespace Reference

Power/voltage methods. More...

Functions

ModuleResult setVoltage (Voltage volts)
bool lockVoltage ()
void lockVoltage (Voltage newVoltage)
void unlockVoltage ()
void voltageLockMenu ()
Voltage getVoltage ()
Voltage getVoltageSelect ()
bool checkVoltage (Voltage voltage)
bool voltagesOk ()
bool enableCartridge (bool abortIncorrectVoltage=true)
void disableCartridge ()
bool cartridgeEnabled ()
bool sleeping ()
void sleep ()
void wake ()
bool wakeEvent ()
void busy ()
void idle ()

Detailed Description

Power/voltage methods.

Function Documentation

◆ busy()

void OSCR::Power::busy ( )
extern

Reset the idle timer.

◆ cartridgeEnabled()

bool OSCR::Power::cartridgeEnabled ( )
extern

Check if the cartridge power rail is enabled.

◆ checkVoltage()

bool OSCR::Power::checkVoltage ( Voltage voltage)
extern

Get the current voltage using the voltage monitors.

◆ disableCartridge()

void OSCR::Power::disableCartridge ( )
extern

Disable the cartridge power rail.

◆ enableCartridge()

bool OSCR::Power::enableCartridge ( bool abortIncorrectVoltage = true)
extern

Enable the cartridge power rail.

◆ getVoltage()

Voltage OSCR::Power::getVoltage ( )
extern

Get the current voltage reading.

◆ getVoltageSelect()

Voltage OSCR::Power::getVoltageSelect ( )
extern

Get the current voltage output from VSELECT (TPS2113).

◆ idle()

void OSCR::Power::idle ( )
extern

Check the idle timer and enter sleep if idle for long enough.

◆ setVoltage()

ModuleResult OSCR::Power::setVoltage ( Voltage volts)
extern

Adjust the voltage and/or clock prescaler, if enabled.

Parameters
newVoltageThe voltage to set.

Without VSELECT Without VSELECT, this will prompt the user to set the voltage switch to the specified voltage. If the 3V3 fix is enabled, the prompt happens before the clock change when switching to 5V, or after the clock change when switching to 3.3V.

With VSELECT When changing to 5V the voltage is set first so that the MPU will be stable at 16MHz. When going down to 3.3V the clock is changed to 8MHz first so that the MPU will be stable when the voltage is changed to 3.3V.

Note
3V3FIX works best with VSELECT as the firmware controls the timing of all of this. If you are doing this manually, then you'll need to start the OSCR with 5V set and only switch to 3.3V once prompted.

◆ sleep()

void OSCR::Power::sleep ( )
extern

Enter sleep state.

◆ sleeping()

bool OSCR::Power::sleeping ( )
extern

Check if we are sleeping.

◆ voltagesOk()

bool OSCR::Power::voltagesOk ( )
extern

Check if the voltages of the power rails are valid.

◆ wake()

void OSCR::Power::wake ( )
extern

Wake from sleep state.

◆ wakeEvent()

bool OSCR::Power::wakeEvent ( )
extern

If sleeping, wake and return true, else false.