diff options
author | Ehsan Takalloo <ehsan.takalloo@gmail.com> | 2020-08-10 17:18:39 +0430 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2020-09-01 13:13:55 -0400 |
commit | 4cdb281367813ffc12face0bbcba300fe6e7e2d3 (patch) | |
tree | e69cfe4402212d1db80f963c54c7c7d86205e898 /binding/tef665x.h | |
parent | 377a25d3f0831b5fd4a0ac01358ec86341d2531e (diff) |
Add rds event
Update types in radio_impl_tef665x.c and radio_impl_tef665x.h
Add rds verb to tef665x and send latest rds as response
Implement rds parser based on rds standard structure and tef-665x user-manual for rds group types 0A, 0B, 1A, 2A, 2B and 4A
Implement scan_start verb for tef-665x
Implement scan_stop verb for tef-665x
Implement get stereo_mode verb for tef-665x
Fix an issue in tef665x_set_frequency_callback
Update README.md file
Signed-off-by: Ehsan Takalloo <ehsan.takalloo@gmail.com>
Change-Id: Ife057e46c52fc420541dbad3b4f51c7d01707a3d
Diffstat (limited to 'binding/tef665x.h')
-rw-r--r-- | binding/tef665x.h | 98 |
1 files changed, 60 insertions, 38 deletions
diff --git a/binding/tef665x.h b/binding/tef665x.h index add145b..10874e8 100644 --- a/binding/tef665x.h +++ b/binding/tef665x.h @@ -69,6 +69,13 @@ typedef enum typedef enum { + TEF665X_Cmd_Set_RDS_mode = 0x01, // default + TEF665X_Cmd_Set_RDS_autorestart= 0x02, // restart after tune + TEF665X_Cmd_Set_RDS_interface = 0, // no interface +} TEF665x_FM_COMMAND; + +typedef enum +{ TEF665X_Cmd_Tune_To = 0x01, TEF665X_Cmd_Set_Tune_Options =0x02, TEF665X_Cmd_Set_Bandwidth =0x0A, //10, @@ -158,13 +165,14 @@ typedef enum } TEF665x_AUDIO_CMD_22; typedef enum{ - eDevTEF665x_Power_on, eDevTEF665x_Boot_state , eDevTEF665x_Idle_state, eDevTEF665x_Wait_Active, eDevTEF665x_Active_state, - - eDevTEF665x_Not_Exist, + + eDevTEF665x_Power_on, + + eDevTEF665x_Not_Exist, eDevTEF665x_Last }TEF665x_STATE; @@ -312,54 +320,68 @@ unsigned char lutByteValues[]= 0xB1, 0x3B, 0xB1, 0x97, 0xB3, 0x03 }; -const uint patchSize = sizeof(patchByteValues); -const u8 *pPatchBytes = &patchByteValues[0]; +const uint32_t patchSize = sizeof(patchByteValues); +const uint8_t *pPatchBytes = &patchByteValues[0]; -const uint lutSize = sizeof(lutByteValues); -const u8 *pLutBytes = &lutByteValues[0]; +const uint32_t lutSize = sizeof(lutByteValues); +const uint8_t *pLutBytes = &lutByteValues[0]; static const u8 init_para[] = { //Set the Band related API settings... -11, 0x20,0x0A,0x01,0x00,0x01,0x09,0x38,0x05,0xDC,0x04,0xB0,//FM_BandWidth Auto, FM_Set_Bandwidth (1, 1, 2360, 1500, 1200) -5, 0x20,0x14,0x01,0x00,0x01,//FM_MphSuppression, FM_Set_MphSuppression (1, 1) -7, 0x20,0x17,0x01,0x00,0x01,0x04,0xB0,//FM_NoiseBlanker, FM_Set_NoiseBlanker (1, 1, 1200) +11, 0x20, 0x0A, 0x01, 0x00, 0x01, 0x09, 0x38, 0x05, 0xDC, 0x05, 0xDC, //FM_BandWidth Auto, FM_Set_Bandwidth (1, 1, 2360, 1500, 1200) +5, 0x20, 0x14, 0x01, 0x00, 0x01, //FM_MphSuppression, FM_Set_MphSuppression (1, 1) +//5, 0x20, 0x16, 0x01, 0x00, 0x01, +7, 0x20, 0x17, 0x01, 0x00, 0x01, 0x05, 0xDC, //FM_NoiseBlanker, FM_Set_NoiseBlanker (1, 1, 1200) //Set all Weaksignal API settings (LevelOffset)... //Set the SoftMute API settings... -9, 0x20,0x2A,0x01,0x00,0x03,0x00,0x64,0x00,0xFA,//FM_SmlMode, FM_Set_SoftMute_Level (1, 3, 100, 250) -11, 0x20,0x28,0x01,0x00,0x3C,0x00,0x78,0x00,0x0A,0x00,0x14,//FM_SmSlowAttack,FM_Set_SoftMute_Time (1, 60, 120, 10, 20) -9, 0x20,0x2C,0x01,0x00,0x03,0x01,0x90,0x03,0xE8,//FM_Smm,FM_Set_SoftMute_Mph (1, 3, 400, 1000) -9, 0x20,0x2B,0x01,0x00,0x03,0x01,0x90,0x03,0xE8,//FM_Smn,FM_Set_SoftMute_Noise (1, 3, 400, 1000) -7, 0x20,0x2D,0x01,0x00,0x01,0x00,0x64,//FM_SmMaximum,FM_Set_SoftMute_Max (1, 1, 100) +9, 0x20, 0x2A, 0x01, 0x00, 0x03, 0x00, 0x64, 0x00, 0xFA, //FM_SmlMode, FM_Set_SoftMute_Level (1, 3, 100, 250) +11, 0x20, 0x28, 0x01, 0x00, 0x3C, 0x00, 0x78, 0x00, 0x0A, 0x00, 0x14, //FM_SmSlowAttack,FM_Set_SoftMute_Time (1, 60, 120, 10, 20) +9, 0x20, 0x2C, 0x01, 0x00, 0x03, 0x01, 0x90, 0x03, 0xE8, //FM_Smm,FM_Set_SoftMute_Mph (1, 3, 400, 1000) +9, 0x20, 0x2B, 0x01, 0x00, 0x03, 0x01, 0x90, 0x03, 0xE8, //FM_Smn,FM_Set_SoftMute_Noise (1, 3, 400, 1000) +7, 0x20, 0x2D, 0x01, 0x00, 0x01, 0x00, 0x64, //FM_SmMaximum,FM_Set_SoftMute_Max (1, 1, 100) //Set the HighCut API settings... -9, 0x20,0x34,0x01,0x00,0x01,0x01,0xF4,0x00,0xC8,//FM_HclMode,FM_Set_HighCut_Level (1, 1, 500, 200) -11, 0x20,0x32,0x01,0x00,0x3C,0x00,0x78,0x00,0x14,0x00,0x14,//FM_HcSlowAttack,FM_Set_HighCut_Time (1, 60, 120, 20, 20) -11, 0x20,0x33,0x01,0x00,0x01,0x01,0x90,0x00,0xC8,0x03,0x20,//FM_Hco,FM_Set_HighCut_Mod (1, 1, 400, 200, 800) -9, 0x20,0x36,0x01,0x00,0x01,0x00,0x64,0x00,0x64,//FM_Hcm,FM_Set_HighCut_Mph (1, 1, 100, 100) -9, 0x20,0x35,0x01,0x00,0x01,0x00,0x64,0x00,0x64,//FM_Hcn,FM_Set_HighCut_Noise (1, 1, 100, 100) -7, 0x20,0x38,0x01,0x00,0x01,0x3A,0x98,//FM_HcMinimum,FM_Set_HighCut_Min (1, 1, 15000) -7, 0x20,0x3A,0x01,0x00,0x01,0x00,0x64,//FM_HcLowCutMinimum,FM_Set_LowCut_Min (1, 1, 100) -7, 0x20,0x37,0x01,0x00,0x01,0x05,0xDC,//FM_HcMaximum,FM_Set_HighCut_Max (1, 1, 1500) +9, 0x20, 0x34, 0x01, 0x00, 0x01, 0x01, 0xF4, 0x00, 0xC8, //FM_HclMode,FM_Set_HighCut_Level (1, 1, 500, 200) +11, 0x20, 0x32, 0x01, 0x00, 0x3C, 0x00, 0x78, 0x00, 0x14, 0x00, 0x14, //FM_HcSlowAttack,FM_Set_HighCut_Time (1, 60, 120, 20, 20) +11, 0x20, 0x33, 0x01, 0x00, 0x01, 0x01, 0x90, 0x00, 0xC8, 0x03, 0x20, //FM_Hco,FM_Set_HighCut_Mod (1, 1, 400, 200, 800) +9, 0x20, 0x36, 0x01, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, //FM_Hcm,FM_Set_HighCut_Mph (1, 1, 100, 100) +9, 0x20, 0x35, 0x01, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, //FM_Hcn,FM_Set_HighCut_Noise (1, 1, 100, 100) +7, 0x20, 0x38, 0x01, 0x00, 0x01, 0x3A, 0x98, //FM_HcMinimum,FM_Set_HighCut_Min (1, 1, 15000) +7, 0x20, 0x3A, 0x01, 0x00, 0x01, 0x00, 0x0A, //FM_HcLowCutMinimum,FM_Set_LowCut_Min (1, 1, 100) +7, 0x20, 0x37, 0x01, 0x00, 0x01, 0x05, 0xDC, //FM_HcMaximum,FM_Set_HighCut_Max (1, 1, 1500) //Set the Stereo API settings... -9, 0x20,0x3E,0x01,0x00,0x01,0x01,0xF4,0x00,0xFA,//FM_StlMode,FM_Set_Stereo_Level (1, 1, 500, 250) -11, 0x20,0x3C,0x01,0x00,0x3C,0x00,0x78,0x00,0x0A,0x00,0x14,//FM_StSlowAttack,FM_Set_Stereo_Time (1, 60, 120, 10, 20) -11, 0x20,0x3D,0x01,0x00,0x01,0x00,0xC8,0x00,0xC8,0x03,0xE8,//FM_Sto,FM_Set_Stereo_Mod (1, 1, 200, 200, 1000) -9, 0x20,0x40,0x01,0x00,0x01,0x00,0x64,0x00,0x64,//FM_Stm,FM_Set_Stereo_Mph (1, 1, 100, 100) -9, 0x20,0x3F,0x01,0x00,0x01,0x00,0x64,0x00,0x64,//FM_Stn,FM_Set_Stereo_Noise (1, 1, 100, 100) +9, 0x20, 0x3E, 0x01, 0x00, 0x01, 0x01, 0xF4, 0x00, 0xFA, //FM_StlMode,FM_Set_Stereo_Level (1, 1, 500, 250) +11, 0x20, 0x3C, 0x01, 0x00, 0x3C, 0x00, 0x78, 0x00, 0x0A, 0x00, 0x14, //FM_StSlowAttack,FM_Set_Stereo_Time (1, 60, 120, 10, 20) +11, 0x20, 0x3D, 0x01, 0x00, 0x01, 0x00, 0xC8, 0x00, 0xC8, 0x03, 0xE8, //FM_Sto,FM_Set_Stereo_Mod (1, 1, 200, 200, 1000) +9, 0x20, 0x40, 0x01, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, //FM_Stm,FM_Set_Stereo_Mph (1, 1, 100, 100) +9, 0x20, 0x3F, 0x01, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, //FM_Stn,FM_Set_Stereo_Noise (1, 1, 100, 100) +7, 0x20, 0x39, 0x01, 0x00, 0x01, 0x00, 0x50, +9, 0x20, 0x4A, 0x01, 0x00, 0x03, 0x00, 0x50, 0x00, 0x80, +9, 0x20, 0x49, 0x01, 0x00, 0x03, 0x00, 0x50, 0x00, 0x80, + +//Set_Deemphasis +5, 0x20, 0x1F, 0x01, 0x02, 0xEE, + +//Set RDS +9, 0x20, 0x51, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, //Set the Audio and Application related API settings... -9, 0x40,0x03,0x01,0x00,0x00,0x00,0x21,0x00,0x03,//AM_GPIO 0 Feature -9, 0x40,0x03,0x01,0x00,0x01,0x00,0x21,0x00,0x00,//AM_GPIO 1 Feature -9, 0x40,0x03,0x01,0x00,0x02,0x00,0x21,0x00,0x00,//AM_GPIO 2 Feature -9, 0x40,0x03,0x01,0x00,0x00,0x00,0x20,0x00,0x03,// FM_GPIO 0 Feature -9, 0x40,0x03,0x01,0x00,0x01,0x00,0x20,0x00,0x00,//FM_GPIO 1 Feature -9, 0x40,0x03,0x01,0x00,0x02,0x00,0x20,0x00,0x00,//FM_GPIO 2 Feature -13, 0x30,0x16,0x01,0x00,0x21,0x00,0x00,0x00,0x20,0x00,0x00,0x11,0x3A,//Dig_IO_IIS_SD_1 Mode -//5, 0x30,0x0B,0x01,0x00,0x00,//Mute -//5, 0x30,0x0A,0x01,0xFF,0xf0,//Volume -7, 0x30,0x0D,0x01,0x00,0x80,0x00,0xE0,//Audio Output Source DAC L/R +9, 0x40, 0x03, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, //AM_GPIO 0 Feature +9, 0x40, 0x03, 0x01, 0x00, 0x01, 0x00, 0x21, 0x00, 0x00, //AM_GPIO 1 Feature +9, 0x40, 0x03, 0x01, 0x00, 0x02, 0x00, 0x21, 0x00, 0x00, //AM_GPIO 2 Feature +9, 0x40, 0x03, 0x01, 0x00, 0x00, 0x00, 0x20, 0x01, 0x01, //FM_GPIO 0 Feature set for RDS +9, 0x40, 0x03, 0x01, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, //FM_GPIO 1 Feature +9, 0x40, 0x03, 0x01, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, //FM_GPIO 2 Feature + +5, 0x20, 0x1E, 0x01, 0x00, 0x01 , +5, 0x20, 0x54, 0x01, 0x00, 0x00 , +7, 0x20, 0x0B, 0x01, 0x03, 0x7A, 0x00, 0x00 +//13, 0x30, 0x16, 0x01, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x11, 0x3A, //Dig_IO_IIS_SD_1 Mode +//5, 0x30, 0x0B, 0x01, 0x00, 0x00, //Mute +//5, 0x30, 0x0A, 0x01, 0xFF, 0xf0, //Volume +//7, 0x30, 0x0D, 0x01, 0x00, 0x80, 0x00, 0xE0,//Audio Output Source DAC L/R }; typedef enum |