USB stick covox & pwm wav player

Dependents:   wave_player_pwm_and_covox_lib

Files at this revision

API Documentation at this revision

Comitter:
vsolonar
Date:
Thu Jan 03 13:48:19 2019 +0000
Parent:
2:da5d90e12f27
Commit message:
tested, job done

Changed in this revision

wave_player.cpp Show annotated file Show diff for this revision Revisions of this file
wave_player.h Show annotated file Show diff for this revision Revisions of this file
diff -r da5d90e12f27 -r 97da0d3bf0cd wave_player.cpp
--- a/wave_player.cpp	Fri Dec 05 02:31:00 2014 +0000
+++ b/wave_player.cpp	Thu Jan 03 13:48:19 2019 +0000
@@ -13,6 +13,7 @@
 
 #include <mbed.h>
 #include <stdio.h>
+#include "pinout.h"
 #include <wave_player.h>
 
 
@@ -206,8 +207,23 @@
 #ifdef VERBOSE
   printf("ISR rdptr %d got %u\n",DAC_rptr,DAC_fifo[DAC_rptr]);
 #endif
-    wave_DAC->write_u16(DAC_fifo[DAC_rptr]);
+//    wave_DAC->write_u16(DAC_fifo[DAC_rptr]);
+    wave_player::covox_out(DAC_fifo[DAC_rptr]);
     wave_PWM->write(float(DAC_fifo[DAC_rptr]/65536.0));
     DAC_rptr=(DAC_rptr+1) & 0xff;
   }
 }
+
+void wave_player::covox_out(int covox)
+{
+R0 = (covox>>7)        & 1;
+R1 = (covox >> 8)   & 1;
+R2 = (covox >> 9)   & 1;
+R3 = (covox >> 10)   & 1;
+R4 = (covox >> 11)   & 1;
+R5 = (covox >> 12)   & 1;
+R6 = (covox >> 13)   & 1;
+R7 = (covox >> 14)   & 1;
+R8 = (covox >> 15)   & 1;
+//R9 = ((covox) & 1) | ((covox >> 1) & 1) | ((covox >> 2) & 1);
+}
\ No newline at end of file
diff -r da5d90e12f27 -r 97da0d3bf0cd wave_player.h
--- a/wave_player.h	Fri Dec 05 02:31:00 2014 +0000
+++ b/wave_player.h	Thu Jan 03 13:48:19 2019 +0000
@@ -57,6 +57,7 @@
  * @param v the verbosity level
  */
 void set_verbosity(int v);
+void covox_out(int covox);
 
 private:
 void dac_out(void);