minipix_uart_interface
A library and examples for the MiniPIX UART interface
mui.c File Reference
#include <mui.h>
+ Include dependency graph for mui.c:

Functions

void mui_initialize (MUI_Handler_t *mui_handler)
 The "constructor" of the MUI handler. Should be called by the user just after allocating it. More...
 
void mui_pwr (MUI_Handler_t *mui_handler, const bool state)
 Command to power on/off the Timepix3 chip. More...
 
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 obtaning data and will call the processFrameData() function will be called. More...
 
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 call the processFrameData() function will be called. More...
 
void mui_updatePixelMask (MUI_Handler_t *mui_handler, LLCP_UpdatePixelMaskReq_t *data)
 Command to update a mask of a particular pixel. More...
 
void mui_setThreshold (MUI_Handler_t *mui_handler, const uint16_t threshold_coarse, const uint16_t threshold_fine)
 Command to set energy threshold. More...
 
void mui_setConfigurationPreset (MUI_Handler_t *mui_handler, const uint8_t preset)
 Command to set configuration preset. More...
 
void mui_getStatus (MUI_Handler_t *mui_handler)
 Command to get the status of the MinixPIX HW. As a result, the method processStatus() will get called. More...
 
void mui_getTemperature (MUI_Handler_t *mui_handler)
 Command to get the temperature of the MinixPIX HW. As a result, the method processTemperature() will get called. More...
 
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. More...
 
void mui_update (MUI_Handler_t *mui_handler)
 Called by the user to led MUI do stuff in the background. Should be called regularly, e.g., in the main() loop or in a timer's callback. More...
 
void mui_sendAck (MUI_Handler_t *mui_handler, const bool success)
 Sends ack to the MiniPIX. Not to be called by the user. More...
 
void mui_sendMessage (MUI_Handler_t *mui_handler, const uint8_t *str_out, const uint16_t len)
 Abstraction above sending a message. Will use either sendString or sendChar basend on configuration. More...
 
void mui_ledSet (MUI_Handler_t *mui_handler, const bool new_state)
 set LED state More...
 
void mui_ledToggle (MUI_Handler_t *mui_handler)
 toggle the state of the LED More...
 

Function Documentation

◆ mui_getFrameData()

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 call the processFrameData() function will be called.

Parameters
mui_handler

◆ mui_getStatus()

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.

Parameters
mui_handle

◆ mui_getTemperature()

void mui_getTemperature ( MUI_Handler_t mui_handle)

Command to get the temperature of the MinixPIX HW. As a result, the method processTemperature() will get called.

Parameters
mui_handle

◆ mui_initialize()

void mui_initialize ( MUI_Handler_t mui_handler)

The "constructor" of the MUI handler. Should be called by the user just after allocating it.

Parameters
mui_handler

◆ mui_ledSet()

void mui_ledSet ( MUI_Handler_t mui_handler,
const bool  new_state 
)

set LED state

Parameters
mui_handler
new_statetrue = light is on, false = light is off

◆ mui_ledToggle()

void mui_ledToggle ( MUI_Handler_t mui_handler)

toggle the state of the LED

Parameters
mui_handler

◆ mui_measureFrame()

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 obtaning data and will call the processFrameData() function will be called.

Parameters
mui_handler
acquisition_timeAcquisition time in milliseconds
modepixel measurement mode: LLCP_TPX3_PXL_MODE_{TOA_TOT,TOA,MPX_ITOT}

◆ mui_pwr()

void mui_pwr ( MUI_Handler_t mui_handler,
const bool  state 
)

Command to power on/off the Timepix3 chip.

Parameters
mui_handler
statetrue/false, power on/off

◆ mui_receiveCharCallback()

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.

Parameters
mui_handler
byte_in

◆ mui_sendAck()

void mui_sendAck ( MUI_Handler_t mui_handler,
const bool  success 
)

Sends ack to the MiniPIX. Not to be called by the user.

Parameters
mui_handler
success

◆ mui_sendMessage()

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.

Parameters
mui_handler
messagethe string to send
lenhow many bytes to send

◆ mui_setConfigurationPreset()

void mui_setConfigurationPreset ( MUI_Handler_t mui_handler,
const uint8_t  preset 
)

Command to set configuration preset.

Parameters
mui_handler
preset

◆ mui_setThreshold()

void mui_setThreshold ( MUI_Handler_t mui_handler,
const uint16_t  threshold_coarse,
const uint16_t  threshold_fine 
)

Command to set energy threshold.

Parameters
mui_handler
threshold

◆ mui_update()

void mui_update ( MUI_Handler_t mui_handler)

Called by the user to led MUI do stuff in the background. Should be called regularly, e.g., in the main() loop or in a timer's callback.

Parameters
mui_handler

◆ mui_updatePixelMask()

void mui_updatePixelMask ( MUI_Handler_t mui_handler,
LLCP_UpdatePixelMaskReq_t data 
)

Command to update a mask of a particular pixel.

Parameters
mui_handler
LLCP_UpdatePixelMaskReq_t