IRPyro messaging application
Communications program between IRPyro and IRPyro evaluation tool
main.c File Reference

IRPyro messaging application to communicate with the IRPyro evaluation tool. More...

#include "main.h"
Include dependency graph for main.c:

Go to the source code of this file.

Enumerations

enum  MainState_type {
  eevt_initialize, command_decode, sampling_data_get, apply_parameters,
  contact_gui, emitter_control
}
 

Functions

static void callback_setup ()
 assigns read and status functions interrupts More...
 
static void demo_board_sensor_control (int state)
 Changes the state of all the CS lines as used on the IRPyro backplane board. More...
 
static void eevt (MainState_type state)
 IRPyro evaluation tool state machine. More...
 
static void fn_apply_parameters (void)
 changes parameters from one or more sensors More...
 
static void fn_command_decode (void)
 
static void fn_contact_gui (void)
 changes parameters from one or more sensors More...
 
static void fn_eevt_initialize (void)
 Initializes board and populates sensors. More...
 
static void fn_emitter_control (void)
 configures and control the emitter More...
 
static void fn_sampling_data_get (void)
 Sends collected data from configured sensors. More...
 
static void IRPyro_sensor_population (IRPyro_devices this_list, uint8_t *list_size)
 Detect IRPyro sensors present in the demo board. More...
 
int main (void)
 point of entry for the evaluation tool software More...
 
static void sensor_configuration (IRPyro_devices this_list)
 sensor array population More...
 
static void sensor_power_stabilize ()
 power cycles the sensors on the board to assure stability More...
 

Variables

uint8_t BoardType = 0x47
 
uint8_t ChannelConfiguration [NUMBER_OF_SCOPES_IN_THE_GUI] = {0,0x03,0x08,0x0D,0x12,0,0}
 
uint8_t cmd_decoded = 0
 decodes a command from the USART. More...
 
uint8_t DarkPixelState = 0x00
 
uint16_t EmitterOFFTime = 50
 
uint16_t EmitterONTime = 50
 
uint8_t EmitterStatus = 0
 
uint8_t error_flag = 0
 
uint8_t FailureFlags = 0x00
 
IRPyro_devices IRPyro_device = {0}
 
IRPyro_arg_type IRPyro_device_arg = {0}
 
IRPyro_cmd_type IRPyro_device_cmd = {0}
 
uint8_t isStatus = 1
 
uint8_t isStreaming = 0
 
uint8_t mode_lowPower
 
uint8_t mode_sleeping
 
uint8_t num_of_IRPyro_on_demo_board = NUMBER_IRPyro
 
EXTernal_callback pointer_to_read_function = fn_sampling_data_get
 
TIM_callback pointer_to_status_function = NULL
 
EXTernal_callback pointer_to_wakeup_function = fn_apply_parameters
 
uint8_t sensor_destination = 0
 
static MainState_type state = eevt_initialize
 
uint8_t status_need_to_send = 1
 
uint8_t UnitID [2] = {0xda,0xde}
 

Detailed Description

IRPyro messaging application to communicate with the IRPyro evaluation tool.

Author
_KEMET, Ltd
Date
March 2018
Version
Release 1.0.0
Attention

© COPYRIGHT 2018 _KEMET, Ltd

   Copyright (c) 2018, _KEMET, Ltd
   All rights reserved.

   THIS SOFTWARE IS PROVIDED BY _KEMET, Ltd ''AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL _KEMET, Ltd BE LIABLE FOR ANY
   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file main.c.

Enumeration Type Documentation

◆ MainState_type

Enumerator
eevt_initialize 
command_decode 
sampling_data_get 
apply_parameters 
contact_gui 
emitter_control 

Definition at line 43 of file main.c.

Variable Documentation

◆ BoardType

uint8_t BoardType = 0x47

Definition at line 56 of file main.c.

◆ ChannelConfiguration

uint8_t ChannelConfiguration[NUMBER_OF_SCOPES_IN_THE_GUI] = {0,0x03,0x08,0x0D,0x12,0,0}

Definition at line 79 of file main.c.

◆ DarkPixelState

uint8_t DarkPixelState = 0x00

Definition at line 57 of file main.c.

◆ EmitterOFFTime

uint16_t EmitterOFFTime = 50

Definition at line 67 of file main.c.

◆ EmitterONTime

uint16_t EmitterONTime = 50

Definition at line 66 of file main.c.

◆ EmitterStatus

uint8_t EmitterStatus = 0

bit 0 : external emitter in use bit 1 : internal emitter in use bit 2 : internal emitter currently ON bit 3 : internal emitter in use but permanently OFF bit 7 : 0 = normal1 state, = status changed by external command

Definition at line 65 of file main.c.

◆ error_flag

uint8_t error_flag = 0

Definition at line 73 of file main.c.

◆ FailureFlags

uint8_t FailureFlags = 0x00

Definition at line 58 of file main.c.

◆ IRPyro_device

IRPyro_devices IRPyro_device = {0}

Definition at line 76 of file main.c.

◆ IRPyro_device_arg

IRPyro_arg_type IRPyro_device_arg = {0}

Definition at line 78 of file main.c.

◆ IRPyro_device_cmd

IRPyro_cmd_type IRPyro_device_cmd = {0}

Definition at line 77 of file main.c.

◆ isStatus

uint8_t isStatus = 1

Definition at line 71 of file main.c.

◆ isStreaming

uint8_t isStreaming = 0

Definition at line 70 of file main.c.

◆ mode_lowPower

uint8_t mode_lowPower

Definition at line 54 of file main.c.

◆ mode_sleeping

uint8_t mode_sleeping

Definition at line 53 of file main.c.

◆ num_of_IRPyro_on_demo_board

uint8_t num_of_IRPyro_on_demo_board = NUMBER_IRPyro

Definition at line 74 of file main.c.

◆ pointer_to_status_function

TIM_callback pointer_to_status_function = NULL

Definition at line 88 of file main.c.

◆ state

Definition at line 81 of file main.c.

◆ status_need_to_send

uint8_t status_need_to_send = 1

Definition at line 72 of file main.c.

◆ UnitID

uint8_t UnitID[2] = {0xda,0xde}

Definition at line 55 of file main.c.