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 |
Initiate example.
References adp_example_adc_init(), adp_example_ioport_init(), adp_example_tc_init(), and adp_window_init().
Referenced by main().
|
static |
Initiate extension board ioport.
References IOPORT_DIR_OUTPUT, ioport_set_pin_dir(), and ioport_set_pin_level().
Referenced by adp_example_init().
|
static |
|
static |
|
static |
Executive command form PC to the target.
References hyst_high, hyst_low, ioport_toggle_pin_level(), STREAM_ID_HYST_HIGH, STREAM_ID_HYST_LOW, and STREAM_ID_LED_TOGGLE.
Referenced by adp_example_transceive_single_stream(), and adp_example_transceive_terminal().
int main | ( | void | ) |
References adp_example_init(), board_init(), time_out, and transceive_data().
|
static |
Read new light sensor value from ADC and handle it.
References adp_example_adc_get_value(), adp_example_transceive_single_stream(), adp_example_transceive_terminal(), hyst_high, hyst_low, isLight, receive_packet_data, status, STREAM_ID_LIGHT_SENSOR, STREAM_ID_LIGHT_SENSOR_ADC, STREAM_ID_NIGHT_MODE, STREAM_ID_STATUS_MESSAGE, terminal_config, TERMINAL_LABEL, terminal_string, and TERMINAL_STRING_LEN.
Referenced by main().
uint16_t hyst_high = 3000 |
Referenced by executive_command(), and transceive_data().
uint16_t hyst_low = 2300 |
Referenced by executive_command(), and transceive_data().
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().