Ejemplo n.º 1
0
void codec_reg_set(uint16_t num, uint16_t val)
{
	val &= 0x1ff;
	while(!MCBSP_xrdy(mcbspControlHandle));
	MCBSP_write(mcbspControlHandle, (num << 9) | val);
	while(!MCBSP_xrdy(mcbspControlHandle));
}
Ejemplo n.º 2
0
/*
 * Helper function to write aic23 registers
 */
static void set_aic23_register(MCBSP_Handle hMcbsp, Uint16 reg, Uint16 val) {
	val &= 0x1ff;
	//LOG_printf(&LOG0, "Transmit data: %d", (reg<<9) | val);
	while(!MCBSP_xrdy(hMcbsp));
	MCBSP_write(hMcbsp, (reg<<9) | val);
	while (MCBSP_xrdy(hMcbsp));
}
Ejemplo n.º 3
0
// for out to Left and Right channels
void output_sample(int out_data) {

	short CHANNEL_data;

    // clear data structure
	AIC_data.uint=0;

    // 32-bit data -->data structure
	AIC_data.uint=out_data;


	/********************************************************************************
	 *  The existing interface defaults to right channel. To default instead to the
	 * left channel and use output_sample(short), left and right channels are swapped
	 * In main source program use LEFT 0 and RIGHT 1 (opposite of what is used here)
	 ********************************************************************************/
	// swap left and right channels
	CHANNEL_data=AIC_data.channel[RIGHT];
	AIC_data.channel[RIGHT]=AIC_data.channel[LEFT];
	AIC_data.channel[LEFT]=CHANNEL_data;

	// if ready to transmit
	if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE));

	// write/output data
	MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint);
}
Ejemplo n.º 4
0
static void DEBUG_putb_flush()
{
     int i = 0;
     while (i < putb_index) {
	  while (!MCBSP_xrdy(C55XX_UART_hMcbsp));
	  MCBSP_write32(C55XX_UART_hMcbsp, putb_data[i++]);
     }
     putb_index = 0;
}
Ejemplo n.º 5
0
unsigned char spiTransferByte(unsigned char arg_byte)
{
     unsigned char i;
     MCBSP_write(C55XX_SPI_hMcbsp, arg_byte);
     while (!MCBSP_xrdy(C55XX_SPI_hMcbsp));
     i = MCBSP_read(C55XX_SPI_hMcbsp);
#if 0
     if (arg_byte == 0 && i == 0) hpprintf ("*"); else
	  hpprintf("(%x)=%x\n", arg_byte, i);
#endif
     return i;
}
Ejemplo n.º 6
0
//for output from right channel
void output_right_sample(short out_data) {

    // clear data structure
	AIC_data.uint=0;

	// data from Right channel -->data structure
	AIC_data.channel[RIGHT]=out_data;

	// if ready to transmit
	if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE));

	// output right channel
	MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint);
}
static void set_aic23_register(MCBSP_Handle hMcbsp,unsigned short regnum, unsigned short regval)
{
	/* Programmierung erfolgt so, dass in B[15:9] die Registernummer steht und
		in B[8:0] die zu schreibenden Daten */

    /* zur Sicherheit maskieren auf 9 Bit */
    regval &= 0x1ff;

    //regnum &= 0x07f;
    
    /* warten */
    while (!MCBSP_xrdy(hMcbsp));
    
    /* schreiben */
    MCBSP_write(hMcbsp, (regnum << 9) | regval);
}
Ejemplo n.º 8
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.º 9
0
void spiStartTransfer(void)
{
     while (!MCBSP_xrdy(C55XX_SPI_hMcbsp));
     _GPIO_IODATA &= ~(GPIO_ZIGBEE);
}
Ejemplo n.º 10
0
void codec_reset()
{
	while(!MCBSP_xrdy(mcbspControlHandle));
	MCBSP_write(mcbspControlHandle, (15 << 9) | 0);
	while(!MCBSP_xrdy(mcbspControlHandle));
}