PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
serial_api_t Struct Reference

Serial communications interface abstraction. More...

#include <serial.h>

Data Fields

pixelkey_error_t(* read )(uint8_t *p_buffer, size_t *p_read_length)
 Read data from the serial instance. More...
 
pixelkey_error_t(* write )(uint8_t *p_buffer, size_t write_length)
 Write data to the serial instance. More...
 
pixelkey_error_t(* flush )(void)
 Flush the transmit buffer and wait for completion. More...
 
bool(* rts_get )(void)
 Get the state of the RTS signal. More...
 

Detailed Description

Serial communications interface abstraction.

Field Documentation

◆ flush

pixelkey_error_t(* serial_api_t::flush) (void)

Flush the transmit buffer and wait for completion.

Return values
PIXELKEY_ERROR_NONEFlush was successful.
PIXELKEY_ERROR_COMMUNICATION_ERRORCommunications error occurred.

◆ read

pixelkey_error_t(* serial_api_t::read) (uint8_t *p_buffer, size_t *p_read_length)

Read data from the serial instance.

Parameters
[out]p_bufferPointer to store read bytes at.
[in,out]p_read_lengthDesired read length, updated with actual length after completion.
Return values
PIXELKEY_ERROR_NONERead was successful.
PIXELKEY_ERROR_COMMUNICATION_ERRORCommunications error occurred.
PIXELKEY_ERROR_INPUT_BUFFER_OVERFLOWReceived data overflowed.

◆ rts_get

bool(* serial_api_t::rts_get) (void)

Get the state of the RTS signal.

Returns
RTS signal state.

◆ write

pixelkey_error_t(* serial_api_t::write) (uint8_t *p_buffer, size_t write_length)

Write data to the serial instance.

Parameters
[out]p_bufferPointer to write data from.
write_lengthDesired write length.
Return values
PIXELKEY_ERROR_NONEWrite was successful.
PIXELKEY_ERROR_COMMUNICATION_ERRORCommunications error occurred.
PIXELKEY_ERROR_BUFFER_FULLTransmit buffer is full.

The documentation for this struct was generated from the following file: