#ifndef __SN32F100_CODEC_H
#define __SN32F100_CODEC_H

/*_____ D E F I N I T I O N S ______________________________________________*/
#define ENABLE 1
#define DISABLE 0

#define CODEC_MOD_ADC 1
#define CODEC_MOD_DAC 2
#define CODEC_MOD_ALL 3

#define MCLK_SOURCE_CLOCK_HZ 16384000
#define AUDIO_SAMPLE_RATE_HZ 16000

#define AUDIO_BIT_DEPTH 16 
#define I2S_DATA_LENGTH AUDIO_BIT_DEPTH
#define I2S_CHANNEL_LENGTH  32   // F100 CODEC fix channel length

#if (AUDIO_BIT_DEPTH == 16)
#define ADC_DATA_BIT 0

#elif (AUDIO_BIT_DEPTH == 24)
#define ADC_DATA_BIT 3

#endif

#define ADC_OUTPUT_DELAY 250 // 250*16*2*62.5

#include "SN32F100.h"

/*_____ D E C L A R A T I O N S ____________________________________________*/
extern void Codec_PowerControl(uint8_t enable, uint8_t module);
extern void DAC_Init(void);
extern void ADC_Init(void);

extern void DAC_DeInit(void);
extern void ADC_DeInit(void);

#endif
