| Electronic Components Datasheet Search |
|
VS1103 Datasheet(PDF) 41 Page - VLSI Solution Oy |
|
|
|||||||||||||||||||||||||||||
VS1103 Datasheet(HTML) 41 Page - VLSI Solution Oy |
|
41 / 61 page ![]() VS1103b Datasheet 7 OPERATION void RecordAdpcm1103(void) { /* VS1003b/VS1023 */ u_int16 w = 0, idx = 0, n = 0; s_int32 adpcmBlocks = -1; ... /* Check and locate free space on disk */ WriteMp3SpiReg(SCI_CLOCKF, 0xC3E8); /* 4.0x 12.288MHz */ WaitForDreq(); /* Wait for DREQ to go up again */ WriteMp3SpiReg(SCI_MODE, 0x0804); /* Normal SW reset + other bits */ WaitForDreq(); /* Wait for DREQ to go up again */ WriteMp3SpiReg(SCI_VOL, 0x1414); /* Recording monitor volume */ WriteMp3SpiReg(SCI_BASS, 0); /* Bass/treble disabled */ WriteMp3SpiReg(SCI_MIXERVOL, 0x8000U | (23<<10) | (23<<5) | (23)); WriteMp3SpiReg(SCI_ADPCMRECCTL,25+20); /* Auto gain to max +20 dB */ WriteMp3SpiReg(SCI_MODE, 0x08c8); /* Line in, SDI MIDI, SCI ADPCM, 8 kHz */ for (idx=0; idx < sizeof(header); idx++) /* Save header first */ db[idx] = header[idx]; db[24] = sampleRate; /* Set sample rate */ db[25] = samplRate>>8; /* Synchronize */ do { n = 8 * ((ReadMp3SpiReg(SCI_IN1) >> 8) & 0xFF); Yield(1); /* Give control to other processes for 1 ms */ } while (n >= 480); /* whole buffer size = 512 words */ /* Record loop */ while (recording_on) { while (idx < 512) { do { n = 8 * ((ReadMp3SpiReg(SCI_IN1) >> 8) & 0xFF); Yield(1); /* Give control to other processes for 1 ms */ } while (n < 16); /* Only load data if >= 16 words available */ while (n--) { w = ReadMp3SpiReg(SCI_IN0); db[idx++] = w>>8; db[idx++] = w&0xFF; } } idx = 0; write_block(datasector++, db); /* Write one disk block */ adpcmBlocks+=2; /* Disk block contains 2 adpcm blocks */ } if (adpcmBlocks >= 0) { /* The previous algorithm will always write an unfinished ADPCM block. It doesn't matter as we consistently only tell of the data until the last completely written block. */ dataSizeD = adpcmBlocks*256; chunkSizeF = dataSizeD+52: numOfSamplesS = adpcmBlocks*505; ... /* Fix WAV header information */ } } Version: 1.04, 2018-03-16 41 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |