UART Input String Parsing | Cypress Semiconductor
UART Input String Parsing
I want to be able to interupt my main code when data is recieved via UART. The recieved data string will contain ASCII parameters and parameter values that will need to be parsed and saved into a structure. For example: "rate,10000,gain,4" would be saved as data.rate=10000 and data.gain=4. The incoming string will be less than 256 bytes.
I was able to setup an ISR to set a flag and interupt the main code using the "RX - On Byte Received" interupt on the UART. I however don't know how to handle the incoming string. Can someone help me with getting the data from UART to a structure?