⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tone.inc

📁 AMIS單晶片開發範本
💻 INC
字号:
// ----------------------------------------------------------------------------
// Copyright (c) 2008 Semiconductor Components Industries, LLC
// (d/b/a ON Semiconductor). All Rights Reserved.
//
// This code is the property of ON Semiconductor and may not be redistributed
// in any form without prior written permission from ON Semiconductor. The
// terms of use and warranty for this code are covered by contractual
// agreements between ON Semiconductor and the licensee.
// ----------------------------------------------------------------------------
// Tone.inc
// - Application-specific definitions and macros for tone generation 
//   application
// - A 2 kHz tone is toggled on and off every time the timer expires.
//   The 2 kHz tone is mixed with the pass-through audio.
// ----------------------------------------------------------------------------
// $Revision: 1.16 $
// $Date: 2008/10/29 18:00:25 $
// ----------------------------------------------------------------------------
#ifndef TONE_INC_INCLUDED
#define TONE_INC_INCLUDED

// ----------------------------------------------------------------------------
// The calling application must manually configure the following:
// - Set a specific time interval between timer interrupts using the
//   Set_Timer macro.
// - Configure the timer interrupt vector table entry with the Tone_TIMER_ISR 
//   routine using the Set_Int_Vect macro and enable the timer interrupt in 
//   the D_INT_EBL register.
// - Start the timer using the Start_Timer macro. 
// ----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// Tone generation Library Version
// -----------------------------------------------------------------------------
#define TONE_VERSION_MAJOR       0x01
#define TONE_VERSION_MINOR       0x00
#define TONE_VERSION_REVISION    0x01

#define TONE_VERSION (TONE_VERSION_MAJOR << 12 |\
                      TONE_VERSION_MINOR << 8  |\
                      TONE_VERSION_REVISION)   


// This MUST match the WOLA_R value defined in the calling application.
#define TONE_R           8

// -----------------------------------------------------------------------------
// Algorithm Interface
// ----------------------------------------------------------------------------- 
// -----------------------------------------------------------------------------
// Function:      Tone_TIMER_ISR
// Description:   This interrupt occurs at the end of each timer time-out period
//                according to the timer configuration in the application. When
//                this interrupt happens, the YL_TONE_STATUS flag is toggled. 
//                The state of YL_TONE_STATUS flag is checked in the 
//                Tone_Generation function. A tone will be generated if 
//                YL_TONE_STATUS is set to TONE_ON.
// Clock cycles:  Min: 16   Max: 18
// Modifies:      None
// -----------------------------------------------------------------------------
.extern Tone_TIMER_ISR

// -----------------------------------------------------------------------------
// Function:      Tone_Initialize
// Description:   Tone generation algorithm initialization routine.
// Clock cycles:  8
// Modifies:      AH, AE
// -----------------------------------------------------------------------------
.extern Tone_Initialize

// -----------------------------------------------------------------------------
// Function:      Tone_Generation
// Description:   Generates a tone by mixing a sinusoidal signal with the output
//                audio (i.e. the signal in the output FIFO).
// Clock cycles:  Min: 14   Max: 24+5*TONE_R
// Modifies:      AH, AE, LC0, R1, R4
// -----------------------------------------------------------------------------
// Control Registers
// -----------------------------------------------------------------------------
// Reads:         D_SMART_OUT_FIFO_BASE
// Writes:        D_SMART_OUT_FIFO_BASE
// -----------------------------------------------------------------------------
.extern Tone_Generation

// -----------------------------------------------------------------------------
// Function Ordering
// -----------------------------------------------------------------------------
//
// 1.  Name:          WOLA Analysis 
//     Processor:     WOLA filterbank coprocessor
//     Dependencies:  IOP interrupt received.
//
// 2.  Name:          Update Gains step
//     Processor:     RCore
//     Dependencies:  Step 1 complete.
//
// 3.  Name:          WOLA Synthesis
//     Processor:     WOLA filterbank coprocessor
//     Dependencies:  Step 2 complete.
//
// 4.  Name:          Tone_Generation
//     Processor:     RCore
//     Dependencies:  Step 3 complete.
//

#endif      // TONE_INC_INCLUDED
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -