minipix_uart_interface
A library and examples for the MiniPIX UART interface
|
Go to the documentation of this file.
9 #include <llcp_minipix_messages.h>
19 #ifndef MUI_USER_HANDSHAKES
20 #define MUI_USER_HANDSHAKES 0
24 #ifndef MUI_SEND_STRING
25 #define MUI_SEND_STRING 0
30 #define MUI_SEND_CHAR 0
35 #if ((MUI_SEND_CHAR == 1) && (MUI_SEND_STRING == 1))
36 #warning "MUI is compiled with both MUI_SEND_CHAR = 1 and MUI_SEND_STRING = 1, will expect pointer to mui_sendString_t during runtime"
37 #elif ((MUI_SEND_CHAR == 0) && (MUI_SEND_STRING == 0))
38 #error "Cannot have both MUI_SEND_CHAR and MUI_SEND_STRING set to 0. At least one data handling function needs to be used! Please, read README at https://github.com/klaxalk/minipix_uart_interface/tree/master/software/mui for more details."
39 #elif ((MUI_SEND_CHAR == 1) && (MUI_SEND_STRING == 0))
40 #pragma message("MUI is being compiled with MUI_SEND_CHAR = 1, it will expect pointer to the mui_sendChar_t function during runtime")
41 #elif ((MUI_SEND_CHAR == 0) && (MUI_SEND_STRING == 1))
42 #pragma message("MUI is being compiled with MUI_SEND_STRING = 1, it will expect pointer to the mui_sendString_t function during runtime")
45 #if MUI_USER_HANDSHAKES == 1
46 #warning "MUI_USER_HANDSHAKES is 1, do not forget to call mui_sendAck() according to the README"
void(* mui_processFrameData_t)(const LLCP_FrameData_t *image_data)
Function pointer to user implementation of callback to process incoming Frame data.
Definition: mui.h:83
void mui_initialize(MUI_Handler_t *mui_handler)
The "constructor" of the MUI handler. Should be called by the user just after allocating it.
Definition: mui.c:9
void(* mui_ledSetHW_t)(const bool)
Function pointer for implementation of seting an LED state.
Definition: mui.h:58
void mui_ledSet(MUI_Handler_t *mui_handler, const bool new_state)
set LED state
Definition: mui.c:383
void(* mui_processTemperature_t)(const LLCP_Temperature_t *temperature_data)
Function pointer to user implementation of callback to process incoming Temperature message.
Definition: mui.h:113
void(* mui_processAck_t)(const LLCP_Ack_t *ack_data)
Function pointer to user implementation of callback to process incoming Ack message.
Definition: mui.h:121
void(* mui_processFrameDataTerminator_t)(const LLCP_FrameDataTerminator_t *terminator)
Function pointer to user implementation of callback to process incoming Frame data terminator (the la...
Definition: mui.h:97
void mui_receiveCharCallback(MUI_Handler_t *mui_handler, const uint8_t byte_in)
Called by the user with every incoming byte on the UART to the MiniPIX.
Definition: mui.c:187
Structure containing pointers to user callbacks. User shouls provide implementations to all the liste...
Definition: mui.h:143
void(* mui_processMinipixError_t)(const LLCP_MinipixError_t *error_data)
Function pointer to user implementation of callback to process incoming MiniPIX error message.
Definition: mui.h:129
void mui_sendAck(MUI_Handler_t *mui_handler, const bool success)
Sends ack to the MiniPIX. Not to be called by the user.
Definition: mui.c:332
void mui_getFrameData(MUI_Handler_t *mui_handler)
Command to request measured frame data. As a result, the MiniPIX will start obtaning data and will ca...
Definition: mui.c:66
void(* mui_sendString_t)(const uint8_t *str_out, const uint16_t len)
Function pointer for implementation of sending a string (array of bytes) over a serial line to MiniPI...
Definition: mui.h:75
void mui_pwr(MUI_Handler_t *mui_handler, const bool state)
Command to power on/off the Timepix3 chip.
Definition: mui.c:21
void mui_update(MUI_Handler_t *mui_handler)
Called by the user to led MUI do stuff in the background. Should be called regularly,...
Definition: mui.c:318
LLCP_Temperature_t
Definition: llcp_minipix_messages.h:935
LLCP_UpdatePixelMaskReq_t
Definition: llcp_minipix_messages.h:468
void mui_setThreshold(MUI_Handler_t *mui_handler, const uint16_t threshold_coarse, const uint16_t threshold_fine)
Command to set energy threshold.
Definition: mui.c:106
void mui_measureFrame(MUI_Handler_t *mui_handler, const uint16_t acquisition_time, const uint8_t mode)
Command to acquire a frame over a period of the acquisition_time. As a result, the MiniPIX will start...
Definition: mui.c:44
void mui_updatePixelMask(MUI_Handler_t *mui_handler, LLCP_UpdatePixelMaskReq_t *data)
Command to update a mask of a particular pixel.
Definition: mui.c:86
void mui_setConfigurationPreset(MUI_Handler_t *mui_handler, const uint8_t preset)
Command to set configuration preset.
Definition: mui.c:127
void(* mui_processStatus_t)(const LLCP_Status_t *status_data)
Function pointer to user implementation of callback to process incoming Status message.
Definition: mui.h:105
LLCP_FrameData_t
Definition: llcp_minipix_messages.h:181
LLCP_Status_t
Definition: llcp_minipix_messages.h:829
void(* mui_sendChar_t)(const uint8_t char_out)
Function pointer for implementaion of sending a char (byte) over a serial line to MiniPIX.
Definition: mui.h:66
LLCP_Ack_t
Definition: llcp_minipix_messages.h:682
void mui_getTemperature(MUI_Handler_t *mui_handle)
Command to get the temperature of the MinixPIX HW. As a result, the method processTemperature() will ...
Definition: mui.c:167
void mui_getStatus(MUI_Handler_t *mui_handle)
Command to get the status of the MinixPIX HW. As a result, the method processStatus() will get called...
Definition: mui.c:149
#define LLCP_RX_TX_BUFFER_SIZE
Definition: llcp.h:54
void mui_ledToggle(MUI_Handler_t *mui_handler)
toggle the state of the LED
Definition: mui.c:394
LLCP_MinipixError_t
Definition: llcp_minipix_messages.h:1043
LLCP_FrameDataTerminator_t
Definition: llcp_minipix_messages.h:251
uint8_t tx_buffer[TX_SERIAL_BUFFER_SIZE]
Definition: main.cpp:16
void(* mui_processFrameMeasurementFinished_t)(void)
Function pointer to user implementation of callback to process message regarding that a measurement w...
Definition: mui.h:89
void(* mui_sleepHW_t)(const uint16_t duration)
Function pointer for implementation of a sleep function.
Definition: mui.h:136
LLCP_Receiver_t
Definition: llcp.h:107
void mui_sendMessage(MUI_Handler_t *mui_handler, const uint8_t *message, const uint16_t len)
Abstraction above sending a message. Will use either sendString or sendChar basend on configuration.
Definition: mui.c:357