minipix_uart_interface
A library and examples for the MiniPIX UART interface
llcp.h File Reference
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
+ Include dependency graph for llcp.h:

Go to the source code of this file.

Macros

#define LLCP_COMM_HEXADECIMAL   0
 
#define LLCP_APPEND_ENDL   0
 
#define LLCP_DEBUG_PRINT   0
 
#define MAX_PAYLOAD_LEN   255
 
#define LLCP_CHECK_CHECKSUM   0
 
#define INIT_LEN   1
 
#define PAYLOAD_SIZE_LEN   1
 
#define CHECKSUM_LEN   1
 
#define ENDL_LEN   0
 
#define LLCP_RX_TX_BUFFER_SIZE   (INIT_LEN + PAYLOAD_SIZE_LEN + MAX_PAYLOAD_LEN + CHECKSUM_LEN + ENDL_LEN)
 

Enumerations

enum  LLCP_ReceiverState_t {
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3,
  WAITING_FOR_MESSSAGE = 0, EXPECTING_SIZE = 1, EXPECTING_PAYLOAD = 2, EXPECTING_CHECKSUM = 3
}
 state machine states for the LLCP receiver (binary transfer) More...
 

Functions

struct __attribute__ ((packed))
 Structure for interpreting the ToA and ToT mode can be used only after derandomization of the data. More...
 
uint8_t llcp_hex2bin (const uint8_t *ptr)
 
void llcp_bin2hex (const uint8_t byte, uint8_t *buffer)
 convert a single byte to hexadecimal More...
 
void llcp_initialize (LLCP_Receiver_t *receiver)
 
bool llcp_processChar (const uint8_t char_in, LLCP_Receiver_t *receiver, LLCP_Message_t **message, bool *checksum_matched)
 
uint16_t llcp_prepareMessage (uint8_t *what, uint8_t len, uint8_t *buffer)
 

Variables

 LLCP_Receiver_t
 
 LLCP_Message_t
 

Macro Definition Documentation

◆ CHECKSUM_LEN

#define CHECKSUM_LEN   1

◆ ENDL_LEN

#define ENDL_LEN   0

◆ INIT_LEN

#define INIT_LEN   1

◆ LLCP_APPEND_ENDL

#define LLCP_APPEND_ENDL   0

◆ LLCP_CHECK_CHECKSUM

#define LLCP_CHECK_CHECKSUM   0

◆ LLCP_COMM_HEXADECIMAL

#define LLCP_COMM_HEXADECIMAL   0

◆ LLCP_DEBUG_PRINT

#define LLCP_DEBUG_PRINT   0

◆ LLCP_RX_TX_BUFFER_SIZE

#define LLCP_RX_TX_BUFFER_SIZE   (INIT_LEN + PAYLOAD_SIZE_LEN + MAX_PAYLOAD_LEN + CHECKSUM_LEN + ENDL_LEN)

◆ MAX_PAYLOAD_LEN

#define MAX_PAYLOAD_LEN   255

◆ PAYLOAD_SIZE_LEN

#define PAYLOAD_SIZE_LEN   1

Enumeration Type Documentation

◆ LLCP_ReceiverState_t

state machine states for the LLCP receiver (binary transfer)

Enumerator
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 
WAITING_FOR_MESSSAGE 
EXPECTING_SIZE 
EXPECTING_PAYLOAD 
EXPECTING_CHECKSUM 

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

Structure for interpreting the ToA and ToT mode can be used only after derandomization of the data.

LLCP Message for error from MiniPIX.

Message data for LLCP_MinipixErrorMsg_t.

LLCP Message for requesting a MiniPIX temperature.

LLCP Message for MiniPIX temperature.

Message data for LLCP_TemperatureMsg_t.

LLCP Message for requesting a MiniPIX status.

LLCP Message for MiniPIX status.

Message data for LLCP_StatusMsg_t.

Message data for LLCP_PwrReqMsg_t.

LLCP Message for sending "ack".

Message data for LLCP_AckMsg_t.

Message data for LLCP_SetConfigurationPresetReqMsg_t.

Message data for LLCP_SetThresholdReqMsg_t.

LLCP Message for updating a pixel mask.

Message data for LLCP_UpdatePixelMaskReqMsg_t.

LLCP Message for requesting data from a previously-measured frame.

LLCP Message for getting noticed that MiniPIX measurement had just finished.

LLCP Message for requesting a frame measurement.

Message data for LLCP_MeasureFrameReqMsg_t.

Message data for LLCP_FrameDataTerminatorMsg_t.

LLCP Message for sending image data.

Message data for LLCP_FrameDataMsg_t.

Structure for holding pixel coordinates and measured pixel values.

Structure for interpreting the Mpx and iToT mode can be used only after derandomization of the data.

Structure for interpreting the ToA mode can be used only after derandomization of the data.

◆ llcp_bin2hex()

void llcp_bin2hex ( const uint8_t  x,
uint8_t *  buffer 
)

convert a single byte to hexadecimal

Parameters
xthe byte to convert
bufferpointer to a 2-char buffer for the result

◆ llcp_hex2bin()

uint8_t llcp_hex2bin ( const uint8_t *  ptr)

◆ llcp_initialize()

void llcp_initialize ( LLCP_Receiver_t receiver)

◆ llcp_prepareMessage()

uint16_t llcp_prepareMessage ( uint8_t *  what,
uint8_t  len,
uint8_t *  buffer 
)

◆ llcp_processChar()

bool llcp_processChar ( const uint8_t  char_in,
LLCP_Receiver_t receiver,
LLCP_Message_t **  message,
bool *  checksum_matched 
)

Variable Documentation

◆ LLCP_Message_t

LLCP_Message_t

◆ LLCP_Receiver_t

LLCP_Receiver_t