summaryrefslogtreecommitdiff
path: root/firmware/export/power.h (follow)
Commit message (Collapse)AuthorAge
* Rework powermgmt to enable code re-use on appliation and sims.Thomas Martitz2012-01-03
| | | | | | | | | | | | | | | | | | | | | * Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application) to break powermgmt.c's assumption about the ability to read battery voltage. There's now additionally percentage (android) and remaining time measure (maemo). No measure at all also works (sdl app). If voltage can't be measured, then battery_level() is king and it'll be used for power_history and runtime estimation. * Implement target's API in the simulator, i.e. _battery_voltage(), so it doesn't need to implement it's own powermgmt.c and other stubs. Now the sim behaves much more like a native target, although it still changes the simulated battery voltage quickly, * Other changes include include renaming battery_adc_voltage() to _battery_voltage(), for consistency with the new target functions and making some of the apps code aware that voltage and runtime estimation is not always available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
* Fix simulator reds.Thomas Martitz2011-12-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31474 a1c6a512-1295-4272-9138-f99709370657
* ypr0: Enable battery voltage read-out, charging monitoring and charger ↵Thomas Martitz2011-12-31
| | | | | | | | | | | | | | detection. Voltage can be read using as3543 adc (i.e. ascodec api, on this target implemented via ioctl()). TODO: Look into possibly controlling charging more by re-using powermgmt-ascodec.c. However, charging seems to be controlled by the kernel, so may not be needed. Charger state can be read using /dev/minivet. It allows to differentiate between wall charger and usb charging, but that's not implemented (is it even worthwhile?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31470 a1c6a512-1295-4272-9138-f99709370657
* Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.Boris Gjenero2011-12-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
* Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz2010-06-21
| | | | | | | | | | | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
* FS#10756 - Free unused init codeThomas Martitz2010-03-03
| | | | | | | Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back. Only implemented for PP and as3525 so far. More targets could be added, as well as more functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
* Make si4700 tuner driver more sane with bit and field defines and entirely ↵Michael Sevakis2008-12-27
| | | | | | hide strange i2c interface from code with write/set/clear/masked functionality. On Gigabeat S use by-the-book busmode selection and GPIO lines. Implement some primitive station detection, debug registers in screen, and misc. changes to tie things together. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19600 a1c6a512-1295-4272-9138-f99709370657
* Simplify powermgmt thread loops so it calls functions turn (no more ↵Michael Sevakis2008-12-24
| | | | | | power_thread_sleep). Do other target-friendly simplifications, generic battery switch handling and split sim-specific code. Whoever can, please verify charging on the Archos Recorder (due to change in the charger duty cycle code). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19579 a1c6a512-1295-4272-9138-f99709370657
* Straighten out some powermanagement stuff. Give target complete control over ↵Michael Sevakis2008-12-03
| | | | | | how power inputs are sensed. Clean SIMULATOR stuff out of target files. Get rid of USB charging option on targets that don't support it or don't implement it yet. Menu string remains to avoid language incompatibility but should be removed on next cleanup for targets not using it (notice in english.lang). global_settings becomes incompatible for some builds and so plugin API version is incremented. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19315 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
* e200/c200: Take advantage of mutex recursion for the tuner driver and dump ↵Michael Sevakis2007-11-05
| | | | | | the awkward *_nolock stuff. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15468 a1c6a512-1295-4272-9138-f99709370657
* Moved archos power handling into target tree. * Tuner power handling cleaned ↵Jens Arnold2007-08-14
| | | | | | up a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14345 a1c6a512-1295-4272-9138-f99709370657
* Enable a lot more features for simulators and add stubs where necessary, ↵Nils Wallménius2007-08-12
| | | | | | simulators should now work with identical lng and voice files as the respective target git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14299 a1c6a512-1295-4272-9138-f99709370657
* e200: Tuner driver needs to yield alot and also be mutexed. FM debug screen ↵Michael Sevakis2007-07-14
| | | | | | got broken again and was ignoring cancellation and not drawing the lines. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13896 a1c6a512-1295-4272-9138-f99709370657
* Do some planned radio interface cleanup since adding in the LV24020LP.Michael Sevakis2007-07-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13880 a1c6a512-1295-4272-9138-f99709370657
* Fix remaining CONFIG_TUNER checks.Jens Arnold2007-02-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12385 a1c6a512-1295-4272-9138-f99709370657
* CONFIG_CHARGINGJonathan Gordon2007-02-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12384 a1c6a512-1295-4272-9138-f99709370657
* H100/General: HAL for S/PDIF and refinement/bufixes in optical output ↵Michael Sevakis2006-11-13
| | | | | | powering/source selection. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11523 a1c6a512-1295-4272-9138-f99709370657
* Work-in-progress rework of charging status reading & display: * Changed ↵Jens Arnold2006-06-06
| | | | | | several charging related HAVE_* macros into one multi-value CONFIG_CHARGING. * Always use proper macros for charging states. * Battery symbol charging animation now starts from current level on all targets with charging. Two-colour animation kept for non-b&w targets. Round down fill level while charging as before, but round to nearest pixel value for discharging on all targets. * Charging anim fixed on player. * Some code cleanup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10080 a1c6a512-1295-4272-9138-f99709370657
* 1. Updated battery_bench plugin:Hristo Kovachev2006-02-07
| | | | | | | | | | | 1.1 Don't use the plugin_get_buffer() so the playlist viewer should work with this plugin running; 1.2 Added new columns for charger inserted, charging, usb powered; 1.3 Some other small improvements 2. charger_inserted() again returns only the AC/DC charger state on H3x0, doesn't include the usb state; 3. Some ifdefs corrected in power.c and power.h; git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8607 a1c6a512-1295-4272-9138-f99709370657
* Charging state reporting on H3x0Brandon Low2006-01-19
| | | | | | | | | | Don't read the GPIO every refresh of statusbar or gwps for plugged state, use a variable exported from powermgmt instead. Allow Custom WPS to access %bc for battery charge state on targets that support this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8383 a1c6a512-1295-4272-9138-f99709370657
* refactored radio status codeAnton Oleynikov2005-11-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7999 a1c6a512-1295-4272-9138-f99709370657
* iRiver: Implemented S/PDIF transmit power control. The optical LED is now ↵Linus Nielsen Feltzing2005-04-11
| | | | | | off by default. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6268 a1c6a512-1295-4272-9138-f99709370657
* tuner cleanup + improvements:Jörg Hohensohn2004-10-19
| | | | | | | | - use sleep and powerdown for those who can - philips station search works now git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5306 a1c6a512-1295-4272-9138-f99709370657
* moved and renamed fmradio_set/get_status to power.c, where it now ↵Jörg Hohensohn2004-10-17
| | | | | | additionally serves well for tuner power enable on OndioFM git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5296 a1c6a512-1295-4272-9138-f99709370657
* No more spinning disk while charging flashed FM+V2 (you need the new ↵Jörg Hohensohn2003-12-03
| | | | | | bootloader to utilize it). ToDo: remove now false voltage reading from charging screen. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4095 a1c6a512-1295-4272-9138-f99709370657
* Slightly more correct initialization of the power/charging codeLinus Nielsen Feltzing2003-08-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3940 a1c6a512-1295-4272-9138-f99709370657
* Move publicly (from apps) accessed files from drivers/ to export/.Daniel Stenberg2003-02-07
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3219 a1c6a512-1295-4272-9138-f99709370657