ESP_Me-no-dev wrote:Ritesh, you can look into HardwareSerial.cpp as well and see what happens when you start arduino Serial
it's pretty straight forward.
Code: Select all
#include "esp32-hal.h"
uart_t* uart1;
bool startUart(uint32_t baudrate, int8_t rxPin, int8_t txPin){
uart1 = uartBegin(1, baud, SERIAL_8N1, rxPin, txPin, 256, false);
return uart1 != NULL;
}
void sendSomeData(){
const char * message = "Hello UART! ESP32 here :)";
uartWriteBuf(uart1, (const uint8_t *)message, strlen(message));
}
void checkForData(){
int i;
size_t available = uartAvailable(uart1);
if(available){
uint8_t out[available];
for(i=0; i<available;i++){
out[i] = uartRead(uart1);
}
//out now contains all of the available data
}
}
Thanks - confirm, compile without errors in windows (7, 10 ) environment ( without VM and win binary )
me-no-dev, can u please give a snippy to make INTR on checkForData? ( Rx ) how you like to do this?
can we create (gpio) ISR too on "(rx) gpio way" and do a callback then? (anyedge?)
or do we this with timer and lookup?
thanks for your brilliant work! (
Have misjudged you sry )
best wishes rudi