Nrf5340-Dk: UART DMA Packetization

Hello, 

I am looking to send packets of real time accelerometer data over uart to my PC via uart. The packets are similar to the code shown below where the data array is a buffer full of the accelerometer samples: 

typedef struct __uart_packetet__{
    int8_t header;
    int8_t msg_ID;
    int8_t length;  
    unsigned char data[80];
    int8_t checksum;
}uart_packet_t;
I am struggling to find an API from the zephyr documentation that is intended for sending packets using uart DMA operations.
Does anyone have any suggestions? 
Any example implementations would be very helpful as well. 
Thanks, 
Matt 
Parents Reply
  • Hi Torbjørn, 

    Thanks for your response. 

    I was looking for the best way to packetize sensory data from my nrf5340 so that it could be passed over UART to my PC.

    I came up with a work around using uart_tx thought deliberately writing out the struct elements into the byte array but I was wondering if there was an api that could packetize a struct similar to that one over UART. 

    Thanks, 

    Matt 

     

Children
Related