mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-22 03:22:48 -05:00
Adding new setting to System Settings <Accessory Power Supply -- off by default). This setting can be used to enable/disable the power supply for accessories. With this commit implemented for iPods with PCF50605 power controller.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17193 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cea07eb2a4
commit
850a11250a
16 changed files with 100 additions and 16 deletions
|
|
@ -21,6 +21,8 @@
|
|||
#include "config.h"
|
||||
#include "adc.h"
|
||||
#include "powermgmt.h"
|
||||
#include "pcf5060x.h"
|
||||
#include "pcf50605.h"
|
||||
|
||||
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
|
||||
{
|
||||
|
|
@ -88,3 +90,20 @@ unsigned int battery_adc_voltage(void)
|
|||
{
|
||||
return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ACCESSORY_SUPPLY
|
||||
void accessory_supply_set(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
/* Accessory voltage supply */
|
||||
pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Accessory voltage supply */
|
||||
pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue