summaryrefslogtreecommitdiff
path: root/firmware/drivers/tuner/tea5767.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2010-11-11 21:13:29 +0000
committerBertrik Sikken <bertrik@sikken.nl>2010-11-11 21:13:29 +0000
commitde870b3ee049262f984254305c7a062a1cdf3026 (patch)
treef9636eb3e4634ac223a0c5a6dadeb4e1a25b61db /firmware/drivers/tuner/tea5767.c
parentb787c0dd05ef4ddd6727a86b06d2491be8600f07 (diff)
downloadrockbox-de870b3ee049262f984254305c7a062a1cdf3026.tar.gz
rockbox-de870b3ee049262f984254305c7a062a1cdf3026.zip
Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28559 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/tuner/tea5767.c')
-rw-r--r--firmware/drivers/tuner/tea5767.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/drivers/tuner/tea5767.c b/firmware/drivers/tuner/tea5767.c
index 67aa808f23..3f3af68602 100644
--- a/firmware/drivers/tuner/tea5767.c
+++ b/firmware/drivers/tuner/tea5767.c
@@ -34,6 +34,10 @@
34#define I2C_ADR 0xC0 34#define I2C_ADR 0xC0
35#endif 35#endif
36 36
37/* define RSSI range */
38#define RSSI_MIN 10
39#define RSSI_MAX 55
40
37static bool tuner_present = true; 41static bool tuner_present = true;
38static unsigned char write_bytes[5] = { 0x00, 0x00, 0x00, 0x00, 0x00 }; 42static unsigned char write_bytes[5] = { 0x00, 0x00, 0x00, 0x00, 0x00 };
39 43
@@ -132,6 +136,18 @@ int tea5767_get(int setting)
132 case RADIO_STEREO: 136 case RADIO_STEREO:
133 val = read_bytes[2] >> 7; 137 val = read_bytes[2] >> 7;
134 break; 138 break;
139
140 case RADIO_RSSI:
141 val = 10 + 3*(read_bytes[3] >> 4);
142 break;
143
144 case RADIO_RSSI_MIN:
145 val = RSSI_MIN;
146 break;
147
148 case RADIO_RSSI_MAX:
149 val = RSSI_MAX;
150 break;
135 } 151 }
136 152
137 return val; 153 return val;