D-Link DSL-G684T Manual de usuario Pagina 74

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 118
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 73
74
SPI_Uart_WriteByte(LCR, 0xBF); // access EFR register
SPI_Uart_WriteByte(EFR, SPI_Uart_config.Flow); // enable
enhanced registers
SPI_Uart_WriteByte(LCR, SPI_Uart_config.DataFormat); // 8
data bit, 1 stop bit, no parity
SPI_Uart_WriteByte(FCR, 0x06); // reset TXFIFO, reset
RXFIFO, non FIFO mode
SPI_Uart_WriteByte(FCR, 0x01); // enable FIFO mode
// Perform read/write test to check if UART is working
SPI_Uart_WriteByte(SPR,'H');
data = SPI_Uart_ReadByte(SPR);
if(data == 'H'){
return 1;
}
else{
return 0;
}
}
void SPI_Uart_WriteByte(char address, char data)
// Write <data> to SC16IS750 register at <address>
{
long int length;
char senddata[2];
senddata[0] = address;
senddata[1] = data;
select();
length = SPI_Write(senddata, 2);
deselect();
Vista de pagina 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 117 118

Comentarios a estos manuales

Sin comentarios