diff options
Diffstat (limited to 'firmware/export/rds.h')
-rw-r--r-- | firmware/export/rds.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/firmware/export/rds.h b/firmware/export/rds.h index ff1608f5c4..6c42e16f56 100644 --- a/firmware/export/rds.h +++ b/firmware/export/rds.h | |||
@@ -18,18 +18,45 @@ | |||
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #ifndef RDS_H | ||
22 | #define RDS_H | ||
23 | |||
21 | #include <stdint.h> | 24 | #include <stdint.h> |
22 | #include <stdbool.h> | 25 | #include <stdbool.h> |
23 | #include "time.h" | 26 | #include "time.h" |
24 | 27 | ||
25 | void rds_init(void); | 28 | void rds_init(void); |
26 | |||
27 | void rds_reset(void); | 29 | void rds_reset(void); |
28 | bool rds_process(uint16_t data[4]); | 30 | void rds_sync(void); |
31 | |||
32 | #if (CONFIG_RDS & RDS_CFG_PROCESS) | ||
33 | /* RDS raw data processing */ | ||
34 | void rds_process(const uint16_t data[4]); | ||
35 | #endif /* (CONFIG_RDS & RDS_CFG_PROCESS) */ | ||
36 | |||
37 | enum rds_info_id | ||
38 | { | ||
39 | RDS_INFO_NULL = 0, | ||
40 | RDS_INFO_CODEABLE, /* code table, right now only G0 */ | ||
41 | RDS_INFO_PI, /* programme identifier */ | ||
42 | RDS_INFO_PS, /* programme service name */ | ||
43 | RDS_INFO_RT, /* radio text */ | ||
44 | RDS_INFO_CT, /* clock time */ | ||
45 | }; | ||
46 | |||
47 | enum rds_code_table | ||
48 | { | ||
49 | RDS_CT_G0, /* default code table G0 */ | ||
50 | RDS_CT_G1, /* alternate code table G1 */ | ||
51 | RDS_CT_G2, /* alternate code table G2 */ | ||
52 | }; | ||
29 | 53 | ||
30 | uint16_t rds_get_pi(void); | 54 | #if (CONFIG_RDS & RDS_CFG_PUSH) |
31 | char* rds_get_ps(void); | 55 | /* pushes preprocesed RDS information */ |
32 | char* rds_get_rt(void); | 56 | void rds_push_info(enum rds_info_id info_id, uintptr_t data, size_t size); |
33 | time_t rds_get_ct(void); | 57 | #endif /* (CONFIG_RDS & RDS_CFG_PUSH) */ |
34 | 58 | ||
59 | /* read fully-processed RDS data */ | ||
60 | size_t rds_pull_info(enum rds_info_id info_id, uintptr_t data, size_t size); | ||
35 | 61 | ||
62 | #endif /* RDS_H */ | ||