Iztech Fork
Fork of A2_Interface3_V_0_0 by
Embed:
(wiki syntax)
Show/hide line numbers
Audio.h
00001 /* 00002 Programmer: Roger McArdell 00003 Date: 04/08/2017 00004 00005 For Texas Instraments TLV320ADC3101 00006 00007 Versions 00008 V0.1 First version 00009 00010 */ 00011 00012 static uint8_t DSPAddWrite = '\x30'; // 7 bit Address is \x18 + write bit = \x30 00013 static uint8_t DSPAddRead = '\x31'; // 7 bit address is \x18 + read bit = \x31 00014 00015 // Prototypes 00016 00017 00018 00019 void ReadDSP(char Page, char RegAdd, uint8_t Bytes) 00020 { 00021 char TempRead[Bytes]; 00022 char TempWrite[5]; 00023 00024 TempWrite[0] = Page; 00025 TempWrite[1] = '\x0'; 00026 00027 I2CBus.start(); 00028 2CBus.write(DSPAddWrite, &TempWrite, 2); // Select page N (Write data N to register 0 regardless of the current page number). assumed repeated-START condition is not required 00029 I2CBus.read(DSPAddRead, TempRead, Bytes); // Read or write data from/to valid registers in page N. 00030 // Read or write data from/to valid registers in page N. 00031 // Select new page M (Write data M to register 0 regardless of the current page number). 00032 // Read or write data from/to valid registers in page M. 00033 // Repeat as desired 00034 I2CBus.stop(); 00035 00036 pc.printf("DSP Register %d: \r\n",SlaveAdd); 00037 for (uint8_t I = 0; I < Bytes; I++) 00038 { 00039 pc.printf("Value is %d: \r\n",TempRead[I]); 00040 } 00041 }
Generated on Tue Aug 2 2022 20:48:37 by
1.7.2
