Ejemplo n.º 1
0
/*
 *  ======== DSK6713_AIC23_read ========
 *  Read a 32-bit value from the codec
 */
Int16 DSK6713_AIC23_read(DSK6713_AIC23_CodecHandle hCodec, Uint32 *val)
{
    /* If McBSP doesn't have new data available, return false */
    if (!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE)) {
        return (FALSE);
    }

    /* Read the data */
    *val = MCBSP_read(DSK6713_AIC23_DATAHANDLE);
    return (TRUE);
}
Ejemplo n.º 2
0
// input to right channel
short input_right_sample() {

	// if ready to receive
	if (poll) while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE));

	// read into right channel
	AIC_data.uint=MCBSP_read(DSK6713_AIC23_DATAHANDLE);

	// return right channel data
	return(AIC_data.channel[RIGHT]);
}
Ejemplo n.º 3
0
void sendData(uint32_t * ptr)
{
	while(!MCBSP_rrdy(mcbspDataHandle));
	MCBSP_write(mcbspDataHandle, *ptr);
	asm(" nop");
	asm(" nop");
	asm(" nop");
	asm(" nop");
	asm(" nop");
	asm(" nop");
}
Ejemplo n.º 4
0
unsigned char if_spiSend(hwInterface *iface, euint8 outgoing)
{
	unsigned char r;

/*	while((*(unsigned volatile long*)McBSP0_SPCR & 0x20000)==0);
	*(unsigned volatile char*)McBSP0_DXR=outgoing;
	while(((*(unsigned volatile long*)McBSP0_SPCR & 0x2)==0));
	r=*(unsigned volatile char*)McBSP0_DRR; */
	
	while(!MCBSP_xrdy(iface->port->hBsp));
	MCBSP_write(iface->port->hBsp,outgoing);
	while(!MCBSP_rrdy(iface->port->hBsp));
	r=MCBSP_read(iface->port->hBsp);
	
	return(r);
}
Ejemplo n.º 5
0
void mcbspSetup()
{
	mcbspControlHandle = MCBSP_open(MCBSP_DEV0, MCBSP_OPEN_RESET);
	mcbspDataHandle = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);
	if(mcbspControlHandle == INV || mcbspDataHandle == INV)
	{
		return;
	}
	MCBSP_config(mcbspControlHandle, &mcbsp_control_config);
	MCBSP_config(mcbspDataHandle, &mcbsp_data_config);
	MCBSP_start(mcbspControlHandle, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220);
	codec_reset();
	
	codec_config();
	if (MCBSP_rrdy(mcbspDataHandle))
		MCBSP_read(mcbspDataHandle);
	MCBSP_start(mcbspDataHandle, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220);
}
Ejemplo n.º 6
0
// for 32-bit input
Uint32 input_sample() {

	short CHANNEL_data;

	// if ready to receive
	if (poll) while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE));

	//read data
	AIC_data.uint=MCBSP_read(DSK6713_AIC23_DATAHANDLE);

	/********************************************************************
	 * Swapping left and right channels (see comments in output_sample())
	 ********************************************************************/

	//swap left and right channel
	CHANNEL_data=AIC_data.channel[RIGHT];
	AIC_data.channel[RIGHT]=AIC_data.channel[LEFT];
	AIC_data.channel[LEFT]=CHANNEL_data;

	return(AIC_data.uint);
}
Ejemplo n.º 7
0
void getData(uint32_t * ptr)
{
	while(!MCBSP_rrdy(mcbspDataHandle));
	*ptr = MCBSP_read(mcbspDataHandle);
}