Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FT800_3 by
Diff: FT_Hal_Utils.cpp
- Revision:
- 5:c0ffdb08b8a5
- Parent:
- 4:363ec27cdfaa
- Child:
- 6:16e22c789f7d
diff -r 363ec27cdfaa -r c0ffdb08b8a5 FT_Hal_Utils.cpp --- a/FT_Hal_Utils.cpp Sat Sep 20 11:35:43 2014 +0000 +++ b/FT_Hal_Utils.cpp Thu Sep 25 20:32:21 2014 +0000 @@ -80,3 +80,31 @@ } } + +/* API to give fadeout effect by changing the display PWM from 100 till 0 */ +ft_void_t FT800::fadeout() +{ + ft_int32_t i; + + for (i = 100; i >= 0; i -= 3) + { + Wr8(REG_PWM_DUTY,i); + Sleep(2);//sleep for 2 ms + } +} + +/* API to perform display fadein effect by changing the display PWM from 0 till 100 and finally 128 */ +ft_void_t FT800::fadein() +{ + ft_int32_t i; + + for (i = 0; i <=100 ; i += 3) + { + Wr8(REG_PWM_DUTY,i); + Sleep(2);//sleep for 2 ms + } + /* Finally make the PWM 100% */ + i = 128; + Wr8(REG_PWM_DUTY,i); +} +