audio.h

来自「IAR编译环境下的AT91SAM7S64芯片的PWM输出演示」· C头文件 代码 · 共 52 行

H
52
字号
//*----------------------------------------------------------------------------
//*      ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : audio.h
//* Object
//* 1.1 04/Apr/05 JPP
//*----------------------------------------------------------------------------
#ifndef Audio_h
#define Audio_h


//* PDC srtucture

#define INDEX_MAX	128

#define FIRST_PDC    0
#define NEXT_PDC     1
#define INIT_PDC     2

typedef void (*AT91F_AUDIO_FUNCTION) (char *ptr_data,int size);

typedef struct _AT91S_PWMC_PDC {
	AT91F_AUDIO_FUNCTION func;
	unsigned int   index;
	unsigned int   state;
    unsigned char  sample[INDEX_MAX*2];
} AT91S_PWMC_PDC, *AT91PS_PWMC_PDC;

extern AT91S_PWMC_PDC OutputSample;

extern void AT91F_PWM_OutputSample_init(void);

extern void SetConstant(char val);
extern void OutputConstant(char *ptr_data,int size);

extern void SinusInit(void);
extern void SetSinus(unsigned int freq );
extern void OutputSinus(char *ptr_data,int size);

extern void SetRamp(unsigned int freq );
extern void OutputRamp(char *ptr_data,int size);

void OutputSample_init(AT91F_AUDIO_FUNCTION func);

#endif

⌨️ 快捷键说明

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