hw_spdif.h 1.3 KB
#ifndef SPDIF_H
#define SPDIF_H


#define SPDIF_IN_CH_0_PIN    //GPIO6_MASK
#define SPDIF_IN_CH_1_PIN    //GPIO8_MASK
#define SPDIF_IN_CH_2_PIN    //GPIO94_MASK
#define SPDIF_IN_CH_3_PIN    //GPIO95_MASK

#define SPDIF_OUT_CH_1_PIN   GPIO2_07_INDEX


enum {
	SPDIF_IN_CH_0 = 0,
	SPDIF_IN_CH_1,
	SPDIF_IN_CH_2,
	SPDIF_IN_CH_3,
	SPIF_IN_CH_LAST
};

#define SPDIF_IN_CH_DEFAULT    SPDIF_IN_CH_0
//#define SPDIF_IN_CH_DEFAULT    SPDIF_IN_CH_1
//#define SPDIF_IN_CH_DEFAULT    SPDIF_IN_CH_2
//#define SPDIF_IN_CH_DEFAULT    SPDIF_IN_CH_3

#if 0
typedef volatile struct {
	U32 spdif_enc_enable			:1;
	U32 spdif_dec_enable			:1;
	U32 spdif_dec_din_sel			:2;		//@2'b00:spdif in 0;....;2b11:spdif in 3
	U32 reserved_bit				:1;
	U32 spdif_enc_inv				:1;		//@0:normal;@1:invert
	U32 spdif_dec_inv				:1;		//@0:normal;@1:invert
	U32 spdif_dec_sr_detect_level	:1;		//@0:detect high;1:detect low
	U32 spdif_dec_sr_detect_start	:1;		//@start detect
	U32 spdif_dec_aux_mask			:1;		//@1 mask 4 bit aux to 0
	U32 sync_err_auto_recover		:1;		//@1 when sync err, auto recover
} SPDIF_CONFIGs;
#endif

void spdif_init(int channel);
void spdif_open(int channel);
void spdif_close(int channel);
void spdif_fini(void);

void spdif_sr_detect_enable(void);
void spdif_sr_detect_disable(void);

extern U8 spdif_sr_double; /*0, normal, 2, x2; 4, x4*/ 

#endif