diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config-ipod4g.h | 6 | ||||
-rw-r--r-- | firmware/export/config-ipodcolor.h | 6 | ||||
-rw-r--r-- | firmware/export/config-ipodnano.h | 6 | ||||
-rw-r--r-- | firmware/export/config-ipodvideo.h | 6 | ||||
-rw-r--r-- | firmware/export/config.h | 1 | ||||
-rw-r--r-- | firmware/export/iap.h | 5 | ||||
-rw-r--r-- | firmware/export/ipod_remote_tuner.h | 75 | ||||
-rw-r--r-- | firmware/export/tuner.h | 21 |
8 files changed, 121 insertions, 5 deletions
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index c00a6788c6..e6bdc35bd8 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | 19 | /* Define bitmask of input sources - recordable bitmask can be defined |
20 | explicitly if different */ | 20 | explicitly if different */ |
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) | 21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) |
22 | 22 | ||
23 | /* define the bitmask of hardware sample rates */ | 23 | /* define the bitmask of hardware sample rates */ |
24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) | 24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) |
@@ -144,6 +144,10 @@ | |||
144 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ | 144 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | /* Define Apple remote tuner */ | ||
148 | #define CONFIG_TUNER IPOD_REMOTE_TUNER | ||
149 | #define HAVE_RDS_CAP | ||
150 | |||
147 | /* Define this if you have a PortalPlayer PP5020 */ | 151 | /* Define this if you have a PortalPlayer PP5020 */ |
148 | #define CONFIG_CPU PP5020 | 152 | #define CONFIG_CPU PP5020 |
149 | 153 | ||
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 751522d47b..0f1de4fdba 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | 19 | /* Define bitmask of input sources - recordable bitmask can be defined |
20 | explicitly if different */ | 20 | explicitly if different */ |
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) | 21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) |
22 | 22 | ||
23 | /* define the bitmask of hardware sample rates */ | 23 | /* define the bitmask of hardware sample rates */ |
24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) | 24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) |
@@ -121,6 +121,10 @@ | |||
121 | /* define this if the unit can be powered or charged via USB */ | 121 | /* define this if the unit can be powered or charged via USB */ |
122 | #define HAVE_USB_POWER | 122 | #define HAVE_USB_POWER |
123 | 123 | ||
124 | /* Define Apple remote tuner */ | ||
125 | #define CONFIG_TUNER IPOD_REMOTE_TUNER | ||
126 | #define HAVE_RDS_CAP | ||
127 | |||
124 | /* Define this if you have a PortalPlayer PP5020 */ | 128 | /* Define this if you have a PortalPlayer PP5020 */ |
125 | #define CONFIG_CPU PP5020 | 129 | #define CONFIG_CPU PP5020 |
126 | 130 | ||
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index 68ed152cda..e1ec1afa86 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | 19 | /* Define bitmask of input sources - recordable bitmask can be defined |
20 | explicitly if different */ | 20 | explicitly if different */ |
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) | 21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) |
22 | 22 | ||
23 | /* define the bitmask of hardware sample rates */ | 23 | /* define the bitmask of hardware sample rates */ |
24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) | 24 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) |
@@ -134,6 +134,10 @@ | |||
134 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ | 134 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ |
135 | #endif | 135 | #endif |
136 | 136 | ||
137 | /* Define Apple remote tuner */ | ||
138 | #define CONFIG_TUNER IPOD_REMOTE_TUNER | ||
139 | #define HAVE_RDS_CAP | ||
140 | |||
137 | /* Define this if you have a PortalPlayer PP5022 */ | 141 | /* Define this if you have a PortalPlayer PP5022 */ |
138 | #define CONFIG_CPU PP5022 | 142 | #define CONFIG_CPU PP5022 |
139 | 143 | ||
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index f00de9cbfd..59ac6466e5 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | 19 | /* Define bitmask of input sources - recordable bitmask can be defined |
20 | explicitly if different */ | 20 | explicitly if different */ |
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) | 21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) |
22 | 22 | ||
23 | /* define the bitmask of hardware sample rates */ | 23 | /* define the bitmask of hardware sample rates */ |
24 | #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \ | 24 | #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \ |
@@ -155,6 +155,10 @@ | |||
155 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ | 155 | #define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ |
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | /* Define Apple remote tuner */ | ||
159 | #define CONFIG_TUNER IPOD_REMOTE_TUNER | ||
160 | #define HAVE_RDS_CAP | ||
161 | |||
158 | /* Define this if you have a PortalPlayer PP5022 */ | 162 | /* Define this if you have a PortalPlayer PP5022 */ |
159 | #define CONFIG_CPU PP5022 | 163 | #define CONFIG_CPU PP5022 |
160 | 164 | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 9c7beca2bd..088cab7212 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define SI4700 0x08 /* Silicon Labs */ | 40 | #define SI4700 0x08 /* Silicon Labs */ |
41 | #define TEA5760 0x10 /* Philips */ | 41 | #define TEA5760 0x10 /* Philips */ |
42 | #define LV240000 0x20 /* Sanyo */ | 42 | #define LV240000 0x20 /* Sanyo */ |
43 | #define IPOD_REMOTE_TUNER 0x40 /* Apple */ | ||
43 | 44 | ||
44 | /* CONFIG_CODEC */ | 45 | /* CONFIG_CODEC */ |
45 | #define MAS3587F 3587 | 46 | #define MAS3587F 3587 |
diff --git a/firmware/export/iap.h b/firmware/export/iap.h index e945d0c979..d00e5f398a 100644 --- a/firmware/export/iap.h +++ b/firmware/export/iap.h | |||
@@ -20,6 +20,9 @@ | |||
20 | #ifndef __IAP_H__ | 20 | #ifndef __IAP_H__ |
21 | #define __IAP_H__ | 21 | #define __IAP_H__ |
22 | 22 | ||
23 | #define RX_BUFLEN 260 | ||
24 | #define TX_BUFLEN 128 | ||
25 | |||
23 | extern int iap_getc(unsigned char x); | 26 | extern int iap_getc(unsigned char x); |
24 | extern void iap_write_pkt(unsigned char data, int len); | 27 | extern void iap_write_pkt(unsigned char data, int len); |
25 | extern void iap_setup(int ratenum); | 28 | extern void iap_setup(int ratenum); |
@@ -27,5 +30,7 @@ extern void iap_bitrate_set(int ratenum); | |||
27 | extern void iap_periodic(void); | 30 | extern void iap_periodic(void); |
28 | extern void iap_handlepkt(void); | 31 | extern void iap_handlepkt(void); |
29 | extern void iap_track_changed(void *ignored); | 32 | extern void iap_track_changed(void *ignored); |
33 | extern void iap_send_pkt(const unsigned char * data, int len); | ||
34 | extern unsigned char serbuf[RX_BUFLEN]; | ||
30 | 35 | ||
31 | #endif | 36 | #endif |
diff --git a/firmware/export/ipod_remote_tuner.h b/firmware/export/ipod_remote_tuner.h new file mode 100644 index 0000000000..28fcfe1e93 --- /dev/null +++ b/firmware/export/ipod_remote_tuner.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: ipod_remote_tuner.h | ||
9 | * Tuner header for the ipod remote tuner and others remote tuners | ||
10 | * | ||
11 | * Copyright (C) 2009 Laurent Gautier | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | |||
23 | #ifndef _IPOD_REMOTE_TUNER_H_ | ||
24 | #define _IPOD_REMOTE_TUNER_H_ | ||
25 | |||
26 | #define HAVE_RADIO_REGION | ||
27 | #define TIMEOUT_VALUE 20 | ||
28 | |||
29 | extern int radio_present; | ||
30 | extern int tuner_frequency; | ||
31 | extern int tuner_signal_power; | ||
32 | extern int radio_tuned; | ||
33 | |||
34 | /* update tuner state: plugged or unplugged when in radio mode */ | ||
35 | extern void rmt_tuner_region(int region); | ||
36 | extern void rmt_tuner_set_freq(int curr_freq); | ||
37 | extern void rmt_tuner_freq(void); | ||
38 | extern void rmt_tuner_scan(int direction); | ||
39 | |||
40 | /* tuner mode state: ON or OFF */ | ||
41 | extern void rmt_tuner_sleep(int state); | ||
42 | |||
43 | /* parameters are stereo/mono, deemphasis, delta freq... */ | ||
44 | extern void rmt_tuner_set_param(unsigned char tuner_param); | ||
45 | |||
46 | extern void rmt_tuner_mute(int value); | ||
47 | extern void rmt_tuner_signal_power(unsigned char value); | ||
48 | |||
49 | extern void rmt_tuner_rds_data(void); | ||
50 | |||
51 | struct rmt_tuner_region_data | ||
52 | { | ||
53 | /* 0: 50us, 1: 75us */ | ||
54 | unsigned char deemphasis; | ||
55 | /* 0: europe, 1: japan (BL in TEA spec)*/ | ||
56 | unsigned char band; | ||
57 | /* 0: us/australia (200kHz), 1: europe/japan (100kHz), 2: (50kHz) */ | ||
58 | unsigned char spacing; | ||
59 | } __attribute__((packed)); | ||
60 | |||
61 | extern const struct rmt_tuner_region_data | ||
62 | rmt_tuner_region_data[TUNER_NUM_REGIONS]; | ||
63 | |||
64 | int ipod_rmt_tuner_set(int setting, int value); | ||
65 | int ipod_rmt_tuner_get(int setting); | ||
66 | char* ipod_get_rds_info(int setting); | ||
67 | |||
68 | |||
69 | #ifndef CONFIG_TUNER_MULTI | ||
70 | #define tuner_set ipod_rmt_tuner_set | ||
71 | #define tuner_get ipod_rmt_tuner_get | ||
72 | #define tuner_get_rds_info ipod_get_rds_info | ||
73 | #endif | ||
74 | |||
75 | #endif /* _IPOD_REMOTE_TUNER_H_ */ | ||
diff --git a/firmware/export/tuner.h b/firmware/export/tuner.h index b27e660667..63392160e5 100644 --- a/firmware/export/tuner.h +++ b/firmware/export/tuner.h | |||
@@ -33,7 +33,7 @@ enum | |||
33 | RADIO_MUTE, | 33 | RADIO_MUTE, |
34 | RADIO_FORCE_MONO, | 34 | RADIO_FORCE_MONO, |
35 | RADIO_SCAN_FREQUENCY, | 35 | RADIO_SCAN_FREQUENCY, |
36 | 36 | ||
37 | /* Put new general-purpose settings above this line */ | 37 | /* Put new general-purpose settings above this line */ |
38 | __RADIO_SET_STANDARD_LAST | 38 | __RADIO_SET_STANDARD_LAST |
39 | }; | 39 | }; |
@@ -44,11 +44,25 @@ enum | |||
44 | RADIO_PRESENT = 0, | 44 | RADIO_PRESENT = 0, |
45 | RADIO_TUNED, | 45 | RADIO_TUNED, |
46 | RADIO_STEREO, | 46 | RADIO_STEREO, |
47 | /* RADIO_EVENT is an event that requests a screen update */ | ||
48 | RADIO_EVENT, | ||
47 | 49 | ||
48 | /* Put new general-purpose readback values above this line */ | 50 | /* Put new general-purpose readback values above this line */ |
49 | __RADIO_GET_STANDARD_LAST | 51 | __RADIO_GET_STANDARD_LAST |
50 | }; | 52 | }; |
51 | 53 | ||
54 | #ifdef HAVE_RDS_CAP | ||
55 | /** Readback from the tuner RDS layer **/ | ||
56 | enum | ||
57 | { | ||
58 | RADIO_RDS_NAME, | ||
59 | RADIO_RDS_TEXT, | ||
60 | |||
61 | /* Put new general-purpose readback values above this line */ | ||
62 | __RADIO_GET_RDS_INFO_STANDARD_LAST | ||
63 | }; | ||
64 | #endif | ||
65 | |||
52 | /** Tuner regions **/ | 66 | /** Tuner regions **/ |
53 | 67 | ||
54 | /* Basic region information */ | 68 | /* Basic region information */ |
@@ -114,6 +128,11 @@ extern int (*tuner_get)(int setting); | |||
114 | #include "si4700.h" | 128 | #include "si4700.h" |
115 | #endif | 129 | #endif |
116 | 130 | ||
131 | /* Apple remote tuner */ | ||
132 | #if (CONFIG_TUNER & IPOD_REMOTE_TUNER) | ||
133 | #include "ipod_remote_tuner.h" | ||
134 | #endif | ||
135 | |||
117 | #endif /* SIMULATOR */ | 136 | #endif /* SIMULATOR */ |
118 | 137 | ||
119 | /* Additional messages that get enumerated after tuner driver headers */ | 138 | /* Additional messages that get enumerated after tuner driver headers */ |