86
void HTML_print(char *data)
// Write <data> to THR of SC16IS750 followed by a delay
{
SPI_Uart_WriteArray(data,strlen(data));
delay(30);
}
void SPI_Uart_print(char *data)
// Print string <data> to SC16IS750 using strlen instead of
hard-coded length
{
SPI_Uart_WriteArray(data,strlen(data));
}
char spi_transfer(volatile char data)
{
SPDR = data; // Start the transmission
while (!(SPSR & (1<<SPIF))) // Wait for the end of the
transmission
{
};
return SPDR; // return the received byte
}
void ledblink(int times, int lengthms, int pinnum){
for (int x=0; x<times;x++){
digitalWrite(pinnum, HIGH);
delay (lengthms);
digitalWrite(pinnum, LOW);
delay(lengthms);
}
}
Comentários a estes Manuais