/* Write command */ void LCD_X_Write00(char c) { LCD_STOP(); LCD_START(); _Send1(LCD_SLAVE_WRITE); _Send1(LCD_CNTRLBT_WRITE_CMD); _Send1(c); LCD_STOP(); LCD_START(); _Send1(LCD_SLAVE_WRITE); _Send1(LCD_CNTRLBT_WRITE_DATA); }
/* Read status */ U8 LCD_X_Read00(void) { U8 c; LCD_STOP(); LCD_START(); _Send1(LCD_SLAVE_READ); c = _Read1(); LCD_STOP(); LCD_START(); _Send1(LCD_SLAVE_WRITE); _Send1(LCD_CNTRLBT_WRITE_DATA); return c; }
void uart_software_flow_control(){ int v; if(((PIOA->PIO_PDSR>>BIT_CDC_USB2UART_CTS) & 1) == 0) { _TxInProgress = 0; v = _CDC_BUFFER_SIZE - _NumBytesWriteFree(&_WriteBuffer); // NumBytes in write buffer if (v == 0) { // No more characters to send ?: Disable further tx interrupts UART_IER = UART_TX_INT_FLAG; } else{ _Send1(); //More bytes to send? Trigger sending of next byte } } else{
/* Write multiple data bytes*/ void LCD_X_WriteM01(char * pData, int NumBytes) { for (; NumBytes; NumBytes--) { _Send1(*pData++); } }
/* Write data */ void LCD_X_Write01(char c) { _Send1(c); }