Closed angan-code closed 3 years ago
Error is SENSIRION_SHDLC_ERR_ENCODING_ERROR
i recieve the char in a call back function from interrupt and copy the data into the buffer needed.
I'd advise to get it working with a blocking/synchronous implementation first and then switch to an interrupt based implementation. Getting things right with interrupts is much harder.
Hi,
I am trying to communicate the SPS30 with UART. I am able to transmit command using your driver files. for ex. if i send data for start measurement, i am able to hear the sensor switched on and running. int16_t sensirion_uart_tx(uint16_t data_len, const uint8_t data) { uint16_t len; len = UARTPuts(&gPM, (uint8_t) data, data_len); if(len == data_len) return data_len; return 0; }
Problem. I have issue recieving the full frame from the sensor. During debugging, i recieive 0x7e and remaining 0s in the Rxbuffer. i recieve the char in a call back function from interrupt and copy the data into the buffer needed.
Callback function void PM_ByteReceived(void){
}
from the usart implementation function int16_t sensirion_uart_rx(uint16_t max_data_len, uint8_t* data) {
}
I recieve 7E and 0 and Uartreadable gets out of the loop in the callback function. bool UARTReadable(sUART* uart) { if (uart->initialized) {
} else { return false; } }