Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 28304) +++ apps/lang/english.lang (working copy) @@ -12647,3 +12647,20 @@ *: "Start File Browser at root" + + id: LANG_FM_SIGNAL_STRENGTH + desc: Signal strength of a received FM station + user: core + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + + *: none + radio: "Field strength" + + Index: firmware/export/tuner.h =================================================================== --- firmware/export/tuner.h (revision 28304) +++ firmware/export/tuner.h (working copy) @@ -46,6 +46,7 @@ RADIO_STEREO, /* RADIO_EVENT is an event that requests a screen update */ RADIO_EVENT, + RADIO_RSSI, /* Put new general-purpose readback values above this line */ __RADIO_GET_STANDARD_LAST Index: firmware/export/lv24020lp.h =================================================================== --- firmware/export/lv24020lp.h (revision 28304) +++ firmware/export/lv24020lp.h (working copy) @@ -25,6 +25,7 @@ /* Define additional tuner messages here */ #define HAVE_RADIO_REGION +#define HAVE_RADIO_RSSI #define LV24020LP_CTRL_STAT (RADIO_GET_CHIP_FIRST+0) #define LV24020LP_REG_STAT (RADIO_GET_CHIP_FIRST+1) Index: firmware/export/tea5767.h =================================================================== --- firmware/export/tea5767.h (revision 28304) +++ firmware/export/tea5767.h (working copy) @@ -25,6 +25,7 @@ #define HAVE_RADIO_REGION #define HAVE_RADIO_MUTE_TIMEOUT +#define HAVE_RADIO_RSSI struct tea5767_dbg_info { Index: firmware/export/rda5802.h =================================================================== --- firmware/export/rda5802.h (revision 28304) +++ firmware/export/rda5802.h (working copy) @@ -26,6 +26,7 @@ #define _RDA5802_H_ #define HAVE_RADIO_REGION +#define HAVE_RADIO_RSSI struct rda5802_dbg_info { Index: firmware/export/si4700.h =================================================================== --- firmware/export/si4700.h (revision 28304) +++ firmware/export/si4700.h (working copy) @@ -26,6 +26,7 @@ #define _SI4700_H_ #define HAVE_RADIO_REGION +#define HAVE_RADIO_RSSI struct si4700_dbg_info { Index: firmware/export/tea5760.h =================================================================== --- firmware/export/tea5760.h (revision 28304) +++ firmware/export/tea5760.h (working copy) @@ -27,6 +27,7 @@ #include "tuner.h" #define HAVE_RADIO_REGION +#define HAVE_RADIO_RSSI struct tea5760_dbg_info { Index: firmware/drivers/tuner/tea5767.c =================================================================== --- firmware/drivers/tuner/tea5767.c (revision 28304) +++ firmware/drivers/tuner/tea5767.c (working copy) @@ -131,6 +131,10 @@ case RADIO_STEREO: val = read_bytes[2] >> 7; break; + + case RADIO_RSSI: + val = 9 + 3*(read_bytes[3] >> 4); + break; } return val; Index: firmware/drivers/tuner/lv24020lp.c =================================================================== --- firmware/drivers/tuner/lv24020lp.c (revision 28304) +++ firmware/drivers/tuner/lv24020lp.c (working copy) @@ -953,7 +953,7 @@ else lv24020lp_write_clear(STEREO_CTRL, ST_M); break; - + default: value = -1; } @@ -966,6 +966,8 @@ int lv24020lp_get(int setting) { int val = -1; + const unsigned char fst[7] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f}; + unsigned char fst_ndx, fs; mutex_lock(&tuner_mtx); @@ -994,6 +996,14 @@ break; } + case RADIO_RSSI: + fs = RSS_FS(lv24020lp_read(RADIO_STAT)); + for(fst_ndx=0; fst_ndx<7; fst_ndx++) + if(fs == fst[fst_ndx]) + break; + val = 75 - 10*fst_ndx; + break; + default: val = lv24020lp_debug_info(setting); } Index: firmware/drivers/tuner/rda5802.c =================================================================== --- firmware/drivers/tuner/rda5802.c (revision 28304) +++ firmware/drivers/tuner/rda5802.c (working copy) @@ -263,6 +263,12 @@ return (rda5802_read_reg(READCHAN) & READCHAN_ST); } +static int rda5802_rssi(void) +{ + uint16_t status = rda5802_read_reg(STATUSRSSI); + return STATUSRSSI_RSSIr(status); +} + /* tuner abstraction layer: set something to the tuner */ int rda5802_set(int setting, int value) { @@ -323,6 +329,10 @@ case RADIO_STEREO: val = rda5802_st(); break; + + case RADIO_RSSI: + val = rda5802_rssi(); + break; } return val; Index: firmware/drivers/tuner/si4700.c =================================================================== --- firmware/drivers/tuner/si4700.c (revision 28304) +++ firmware/drivers/tuner/si4700.c (working copy) @@ -481,6 +481,10 @@ case RADIO_STEREO: val = si4700_st(); break; + + case RADIO_RSSI: + val = si4700_read_reg(STATUSRSSI) & 0xFF; + break; } return val; Index: firmware/drivers/tuner/tea5760uk.c =================================================================== --- firmware/drivers/tuner/tea5760uk.c (revision 28304) +++ firmware/drivers/tuner/tea5760uk.c (working copy) @@ -138,6 +138,11 @@ case RADIO_STEREO: val = read_bytes[9] >> 2; break; + + case RADIO_RSSI: + val = (read_bytes[9] >> 4) & 0x0F; + val = (46 + 28 * val) / 10; + break; } return val;