Commit graph

65 commits

Author SHA1 Message Date
William Wilgus
dcd71e66bd Optimize lcd-ssd1303 driver (clip series)
Saves 100+ bytes (50 of it in iram), saves a bit of power

Internal LCD clock decreased but with added efficiency of drawing routines
loses only around 2 Hz on the scanrate (~75Hz) while fps is slightly increased

Column offsets are now calculated outside the loops saving a few instructions

Passing a LCD_NOP command after lcd_update turns off Data/Cmd# gpio
saving a bit more power

Added a function lcd_write_cmd_triple() that allows 3 commands to be sent at once
when enabled with LCD_USE_FIFO_FOR_COMMANDS it sends them back to back without
checking FIFO status in between or sending to thhe D/C# Gpio.
Makes an assumption about the FIFO being large enough to
accept 3 commands after being emptied which should be the case on the
clipv1, clipv2, clipplus. I have only enabled it for the clip plus
as thats the only device I have to test it on.

On clip+ the SSP clock is now turned off when screen is off

Change-Id: Ib5fd24697bfe4ac8b8ee017361e789e4a7910d21
2018-07-26 04:23:28 +02:00
Marcin Bukat
89ba7e818c Get rid of stupid _backlight_* function names
_remote_backlight_* and _buttonlight_* are cleaned as well

Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2015-01-12 11:09:27 +01:00
Rafaël Carré
95cf63b294 button-target.h : move prototypes to button.h
no need to define BUTTON_REMOTE anymore

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31620 a1c6a512-1295-4272-9138-f99709370657
2012-01-08 00:07:19 +00:00
Rafaël Carré
dfff88562e Sansa Clip: simplify matrix key scan
Merge clipv1/clipv2 code since they use the same 3x3 matrix
clipzip keyscan buttons now work in bootloader
clipplus untouched (no matrix)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31235 a1c6a512-1295-4272-9138-f99709370657
2011-12-13 23:12:21 +00:00
Bertrik Sikken
55a4520f07 Sansa clip+: fix display brightness for players with newer OLED controller type (and reorganise the variant detection a bit in the process)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27522 a1c6a512-1295-4272-9138-f99709370657
2010-07-22 15:31:24 +00:00
Rafaël Carré
9a471e603e Clip+ LCD: support devices with a different controller
The new controller framebuffer (different from what is in clipv1/clipv2 and some clip+) has 128 columns, the old has 132 columns and is centered on the screen.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27257 a1c6a512-1295-4272-9138-f99709370657
2010-07-03 18:50:07 +00:00
Tobias Diedrich
68e2023184 Enable display and backlight on panic.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26917 a1c6a512-1295-4272-9138-f99709370657
2010-06-18 13:45:24 +00:00
Rafaël Carré
45c7498f59 FS#11335 by me: make ARM assembly functions thumb-friendly
We can't pop into pc on ARMv4t when using thumb: the T bit won't be
modified if we are returning to a thumb function
Code running on ARMv4t should use the new ldrpc / ldmpc macros instead
of ldr pc, [sp], #4 and ldm(cond) sp!, {regs, pc}
No modification on pure ARM builds and ARMv5+

Note: USE_THUMB is currently never defined, no targets can currently be
built with -mthumb, see FS#6734

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26756 a1c6a512-1295-4272-9138-f99709370657
2010-06-11 04:41:36 +00:00
Jens Arnold
081bda8ab2 Port greylib blitting optimisation to clipv1.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26557 a1c6a512-1295-4272-9138-f99709370657
2010-06-04 21:12:06 +00:00
Rafaël Carré
2f0f3490d3 Clip*: give lcd_hw_init() INIT_ATTR attribute
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26329 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 12:28:53 +00:00
Rafaël Carré
7f24c3095d Clipv1: charging curve
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26220 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 23:16:04 +00:00
Rafaël Carré
26c8eebe4f Clipv1: cosmetics
Move code not defined for bootloader under a single preprocessor check

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26219 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 23:15:56 +00:00
Rafaël Carré
59462a8bf8 Clipv1: move buttonlight functions to header
GPIO direction needs only to be set at init
both functions are now one liners so make them static inline

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26218 a1c6a512-1295-4272-9138-f99709370657
2010-05-20 23:15:48 +00:00
Bertrik Sikken
0dcae7402f Sansa as3525: Add missing lcd-clip.h header file to sansa clip lcd drivers. Set svn:keywords on scrollwheel-as3525.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25674 a1c6a512-1295-4272-9138-f99709370657
2010-04-18 16:58:33 +00:00
Rafaël Carré
91647264f8 lcd-ssd1303 (all Clips) : move model specific code in their own files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25248 a1c6a512-1295-4272-9138-f99709370657
2010-03-19 15:13:29 +00:00
Rafaël Carré
020322665b Clip+: LCD display (with FlynDice help)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24729 a1c6a512-1295-4272-9138-f99709370657
2010-02-17 18:43:13 +00:00
Rafaël Carré
3f43765925 Sansa Clip+: use 8 bits transfers, like DMA transfers
The code assumed LCD pixels were packed on 16 bits values but for the
Clip we use 8 bits values.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24563 a1c6a512-1295-4272-9138-f99709370657
2010-02-08 08:20:42 +00:00
Rafaël Carré
71e77aaff8 Sansa Clip+: use correct SSP settings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24559 a1c6a512-1295-4272-9138-f99709370657
2010-02-08 03:36:53 +00:00
Rafaël Carré
c8ea43f095 Untested attempt at a Clip+ LCD driver using SSP (PrimeCell PL022)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24523 a1c6a512-1295-4272-9138-f99709370657
2010-02-05 15:12:08 +00:00
Rafaël Carré
64566ce775 Clivp2: Fix typo when applying FS#10047
Make LCD work again

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24199 a1c6a512-1295-4272-9138-f99709370657
2010-01-08 08:11:50 +00:00
Rafaël Carré
2392bb4199 FS#10047 : Clipv2
Reuse some code from Clip (LCD) and a lot of code from AS3525
Add a new CPU type : AS3525v2, identical to AS3525 except it's an ARMv5 (arm926-ejs)
SD code still not working
For an unknown reason LCD doesn't work anymore (to be investigated)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24131 a1c6a512-1295-4272-9138-f99709370657
2009-12-31 19:15:20 +00:00
Michael Chicoine
bbc8b1b8cb FS#10796 - Clip - prevent power switch activation when coming out of hold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23686 a1c6a512-1295-4272-9138-f99709370657
2009-11-21 21:16:08 +00:00
Thomas Martitz
d85c3ec410 Convert lcd_activation callbacks to use the event system to allow for multiple parallel callbacks (for custom statusbar).
Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing).
Removed corresponding functions from the core and plugin api. Bump min version and sort.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23302 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:59 +00:00
Rafaël Carré
6932fa397b Sansa Clip & m200v4 : calls backlight_hold_changed() when hold button is toggled
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22323 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 15:02:51 +00:00
Jens Arnold
47d4c4739b ARM asm LCD and ATA driver functions: Don't save r12 as it is a scratch reg. Saves a bit of stack and execution time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21795 a1c6a512-1295-4272-9138-f99709370657
2009-07-11 23:43:44 +00:00
Bertrik Sikken
426cdb1284 Commit FS#10285 - Sansa Clip alternative button driver. This driver alternates one row in the button matrix per kernel tick, avoiding the need for explicit delays between selecting a button row and reading colums.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21253 a1c6a512-1295-4272-9138-f99709370657
2009-06-11 22:17:47 +00:00
Rafaël Carré
f504153857 FS#10048 : enable MMU and data cache on Sansa AMS to give a major speed up
- cache IRAM and DRAM
- map IRAM just next to DRAM to remove the need for -mlong-calls and reduce binsize
- tweak delays in Fuze button code
- tweak delays in Clip button code (down button sometimes doesn't respond anyway : an alternate driver is being worked on)

Before reporting any problem, please check your filesystem or format your player from the OF

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21228 a1c6a512-1295-4272-9138-f99709370657
2009-06-08 23:05:33 +00:00
Rafaël Carré
f8a8619615 FS#10273 : Power Sansa Clip screen for some models needing as3514's DCDC15
No battery life loss for models not needing it

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21207 a1c6a512-1295-4272-9138-f99709370657
2009-06-07 23:33:43 +00:00
Rafaël Carré
1d97a380e2 Sansa Clip: apply r21190 to asm lcd_greydata : 2% speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21199 a1c6a512-1295-4272-9138-f99709370657
2009-06-06 14:13:48 +00:00
Bertrik Sikken
82902a8ade Make more effective use of the DBOP FIFO for the sansa clip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21190 a1c6a512-1295-4272-9138-f99709370657
2009-06-04 19:53:39 +00:00
Rafaël Carré
ef9aacb2e0 FS#10245 by Jack Halpin : Adjust Clocking scheme on Sansa AMS
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21088 a1c6a512-1295-4272-9138-f99709370657
2009-05-26 18:44:02 +00:00
Rafaël Carré
1dfeba5702 Sansa Clip : ignore previous setting of CGU_DBOP (do not use ORR)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20986 a1c6a512-1295-4272-9138-f99709370657
2009-05-19 14:43:26 +00:00
Rafaël Carré
adb978a44d Sansa AMS: Various fixes/enhancements for clock frequencies
Fix CGU_DBOP setting

Set PCLK to the exact frequency (62MHz, not the maximal frequency)

Use a better comment for CLK_DIV macro

Use preprocessor safety checks for clock divider sizes to avoid future mistakes (not for SD_IDENT frequency since that check is handled by mci_set_clock_divider)

Use maximal IDE frequency of 66MHz (like OF), not 90MHz like written in AS3525 datasheet. The IDE chip is somehow linked to internal storage, and a too high frequency could affect the storage driver.

Use the same DBOP frequency of 32MHz for all models (like OF, verified clip, fuze, e200v2 and m200v4), compromise between performance and battery life could be added in the future for each target
Performance increase on Sansa Fuze with DBOP freq. set to 64MHz: +12% fps for lcd_update, +1% fps for yuv

Thanks to daytona955 on the forums for his help

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20923 a1c6a512-1295-4272-9138-f99709370657
2009-05-13 08:27:20 +00:00
Rafaël Carré
c58aaee55f Sansa Clip : remove unused variable xoffset from lcd driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20920 a1c6a512-1295-4272-9138-f99709370657
2009-05-12 13:24:13 +00:00
Thomas Martitz
4ed387d603 Fix reds and yellows (hopefully). Some targets apparently didn't properly #ifdef lcd_enable and lcd_sleep code out, so that it got partly active in the bootloader; rename the ui simulator stub fixes most reds; for the clip: move the hook code into lcd-1bit-vert.c which should fix the bootloader red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20333 a1c6a512-1295-4272-9138-f99709370657
2009-03-17 03:36:36 +00:00
Thomas Martitz
b7739fbf1c Rework lcd_enabled and lcd_set/call_enable hook
a) lcd_enabled() is now lcd_active(), and is available for HAVE_LCD_SLEEP only targets (e.g. ipod video) too. It was depandent on HAVE_LCD_ENALE only before
b) rename the hook accordingly, and implement the hook for other other targets too (e.g. the clip [the only mono target with lcd_enable/lcd_sleep yet, so the code is still in the lcd driver], ipod, fuze, c200)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20331 a1c6a512-1295-4272-9138-f99709370657
2009-03-17 02:43:47 +00:00
Bertrik Sikken
045b6e48cd Move powermgmt-target.h up one directory (from as3525/sansa-clip to as3525) in preparation to enable charging for other ams sansa targets.
AMS sansas.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20314 a1c6a512-1295-4272-9138-f99709370657
2009-03-12 22:49:36 +00:00
Bertrik Sikken
01d4b4c997 Sansa Clip: enable battery charging.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20006 a1c6a512-1295-4272-9138-f99709370657
2009-02-14 16:19:21 +00:00
Thomas Martitz
78e0e85ffb Redo some parts of my previous commit, thanks Jens and Dave
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19869 a1c6a512-1295-4272-9138-f99709370657
2009-01-27 19:45:00 +00:00
Thomas Martitz
a43b0db3d1 Sansa AMS: Debug screen, shows GPIO and (on the fuze) DBOP input for now, to be extended
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19866 a1c6a512-1295-4272-9138-f99709370657
2009-01-27 11:05:38 +00:00
Björn Stenberg
9ad94b9c35 Use the same poweroff count for clip as for other AMS targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19609 a1c6a512-1295-4272-9138-f99709370657
2008-12-28 21:58:13 +00:00
Dominik Wenger
02184a242e make fmradio-i2c code from clip more generic, so it works for m200v4 and hopefully all other as3525 targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19370 a1c6a512-1295-4272-9138-f99709370657
2008-12-09 17:21:16 +00:00
Bertrik Sikken
ed96b2a4dd Sansa Clip: implement the fmradio_i2c interface using generic_i2c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19366 a1c6a512-1295-4272-9138-f99709370657
2008-12-08 19:32:05 +00:00
Rafaël Carré
9856a37de3 Sansa Clip: revert 19353
If we don't set pin B6 to 1, display can go off at random times

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19364 a1c6a512-1295-4272-9138-f99709370657
2008-12-08 16:39:55 +00:00
Frank Gevaerts
3648e87054 Add small delays before lcd_write_data() and lcd_write_command(). This seems to be needed on some clips (i.e. mine)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19354 a1c6a512-1295-4272-9138-f99709370657
2008-12-06 16:39:49 +00:00
Rafaël Carré
8956f2b7f5 Sansa Clip: No need to use GPIO pin B6 in LCD
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19353 a1c6a512-1295-4272-9138-f99709370657
2008-12-06 01:30:46 +00:00
Rafaël Carré
68be3b15a5 Sansa Clip: No need to use GPIO pin B5 in LCD - it's likely used in FM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19352 a1c6a512-1295-4272-9138-f99709370657
2008-12-05 21:57:49 +00:00
Rafaël Carré
76617c8f94 Sansa Clip: remove unused variable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19332 a1c6a512-1295-4272-9138-f99709370657
2008-12-04 20:37:23 +00:00
Rafaël Carré
45711ac286 Sansa AMS: centralize clock settings in clock-target.h
Reorder system_init() to initialize peripherals not only in bootloader
Use a 65MHz PCLK (and memclk) which will be needed for realtime decoding

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19330 a1c6a512-1295-4272-9138-f99709370657
2008-12-04 20:04:31 +00:00
Rafaël Carré
874f4376ff Sansa AMS: ignore buttons when hold switch is on
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19311 a1c6a512-1295-4272-9138-f99709370657
2008-12-03 11:30:18 +00:00