summaryrefslogtreecommitdiff
path: root/src/ao.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-10-31 00:38:39 -0700
committerKeith Packard <keithp@keithp.com>2010-10-31 00:38:39 -0700
commit3493b456399bcc0ea43d28fd4105928bd8793cff (patch)
tree869bc731152146632fc55cf9df7d4d6f125e8b68 /src/ao.h
parent3f53e5daeca4d9257aef017594fd65b379b97a1e (diff)
teleterra: Add PWM audio system
This uses timers 3 and 4 to emit 8-bit 11025Hz audio using a 93.8kHz carrier. A simple low-pass filter to eliminate the 93.8kHz signal results in credible 8-bit audio. There is a giant sample for testing in the ao_audio code which shouldn't be included in a product. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao.h')
-rw-r--r--src/ao.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ao.h b/src/ao.h
index a952c50d..a3519150 100644
--- a/src/ao.h
+++ b/src/ao.h
@@ -31,6 +31,9 @@
/* Convert a __data pointer into an __xdata pointer */
#define DATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xff00))
+/* Convert a __code pointer into an __xdata pointer */
+#define CODE_TO_XDATA(a) ((void __xdata *) ((uint16_t) (a)))
+
/* Stack runs from above the allocated __data space to 0xfe, which avoids
* writing to 0xff as that triggers the stack overflow indicator
*/
@@ -1112,4 +1115,15 @@ ao_terraui(void);
void
ao_terraui_init(void);
+/* ao_audio.c */
+
+void
+ao_audio_test(void);
+
+void
+ao_audio_send(__xdata uint8_t *samples, uint16_t nsamples) __reentrant;
+
+void
+ao_audio_init(void);
+
#endif /* _AO_H_ */