Microchip® Advanced Software Framework

adp_example.c File Reference

ADP service implementation.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <asf.h>
#include <string.h>
#include "adp_example_adc.h"
#include "adp_example_tc.h"
#include "adp_window.h"

Macros

#define TERMINAL_STRING_LEN   50
 

Functions

static void adp_example_init (void)
 Initiate example. More...
 
static void adp_example_ioport_init (void)
 Initiate extension board ioport. More...
 
static void adp_example_transceive_single_stream (uint16_t stream_id, uint8_t *data, uint8_t data_size, uint8_t *receive_buf)
 Send single stream to PC. More...
 
static void adp_example_transceive_terminal (struct adp_msg_conf_terminal *const config, const char *label, uint8_t *receive_buf)
 Send terminal configure to PC. More...
 
static void executive_command (uint8_t *receive_buf)
 Executive command form PC to the target. More...
 
int main (void)
 
static void transceive_data (void)
 Read new light sensor value from ADC and handle it. More...
 

Variables

uint16_t hyst_high = 3000
 
uint16_t hyst_low = 2300
 
bool isLight = false
 
uint8_t receive_packet_data [MSG_RES_PACKET_DATA_MAX_LEN] = {0,}
 
char terminal_string [TERMINAL_STRING_LEN]
 

#define TERMINAL_STRING_LEN   50

Referenced by transceive_data().

static void adp_example_init ( void  )
static
static void adp_example_ioport_init ( void  )
static

Initiate extension board ioport.

References IOPORT_DIR_OUTPUT, ioport_set_pin_dir(), and ioport_set_pin_level().

Referenced by adp_example_init().

static void adp_example_transceive_single_stream ( uint16_t  stream_id,
uint8_t *  data,
uint8_t  data_size,
uint8_t *  receive_buf 
)
static

Send single stream to PC.

References executive_command().

Referenced by transceive_data().

static void adp_example_transceive_terminal ( struct adp_msg_conf_terminal *const  config,
const char *  label,
uint8_t *  receive_buf 
)
static

Send terminal configure to PC.

References executive_command().

Referenced by transceive_data().

static void executive_command ( uint8_t *  receive_buf)
static
int main ( void  )

uint16_t hyst_high = 3000
uint16_t hyst_low = 2300
bool isLight = false

Referenced by transceive_data().

uint8_t receive_packet_data[MSG_RES_PACKET_DATA_MAX_LEN] = {0,}

Referenced by transceive_data().

char terminal_string[TERMINAL_STRING_LEN]

Referenced by transceive_data().