Microchip® Advanced Software Framework

iot_qtouch_demo/demo.h File Reference

IOT QTouch Sensor Demo.

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

Macros

#define CREDENTIAL_ENTRY_BUTTON   PIN_PA15
 
#define DEFAULT_AUTH   M2M_WIFI_SEC_WPA_PSK
 
#define DEFAULT_CHANNEL   M2M_WIFI_CH_ALL
 
#define DEFAULT_PWD   "default"
 
#define DEFAULT_SSID   "default"
 Default SSID and passphrase of the network to connect to. More...
 
#define DEMO_PRODUCT_NAME   "Touch"
 Sensor name. More...
 
#define DEMO_REPORT_INTERVAL   (100)
 
#define DEMO_SERVER_IP   "255.255.255.255"
 
#define DEMO_SERVER_PORT   (6666)
 
#define DEMO_WLAN_AP_CHANNEL   1
 
#define DEMO_WLAN_AP_DOMAIN_NAME   "atmelconfig.com"
 
#define DEMO_WLAN_AP_IP_ADDRESS   {192,168,1,10}
 
#define DEMO_WLAN_AP_MODE   0
 
#define DEMO_WLAN_AP_NAME   "WINC1500_TOUCH_MyAP"
 
#define DEMO_WLAN_AP_SECURITY   M2M_WIFI_SEC_OPEN
 
#define DEMO_WLAN_AP_WEP_INDEX   0
 
#define DEMO_WLAN_AP_WEP_KEY   "1234567890"
 
#define DEMO_WLAN_AP_WEP_SIZE   WEP_40_KEY_STRING_SIZE
 

Functions

void demo_start (void)
 Demo main function. More...
 

#define CREDENTIAL_ENTRY_BUTTON   PIN_PA15

Referenced by demo_start().

#define DEFAULT_AUTH   M2M_WIFI_SEC_WPA_PSK
#define DEFAULT_CHANNEL   M2M_WIFI_CH_ALL
#define DEFAULT_PWD   "default"
#define DEFAULT_SSID   "default"

Default SSID and passphrase of the network to connect to.

#define DEMO_PRODUCT_NAME   "Touch"

Sensor name.

#define DEMO_REPORT_INTERVAL   (100)
#define DEMO_SERVER_IP   "255.255.255.255"
#define DEMO_SERVER_PORT   (6666)
#define DEMO_WLAN_AP_CHANNEL   1
#define DEMO_WLAN_AP_DOMAIN_NAME   "atmelconfig.com"
#define DEMO_WLAN_AP_IP_ADDRESS   {192,168,1,10}
#define DEMO_WLAN_AP_MODE   0
#define DEMO_WLAN_AP_NAME   "WINC1500_TOUCH_MyAP"
#define DEMO_WLAN_AP_SECURITY   M2M_WIFI_SEC_OPEN
#define DEMO_WLAN_AP_WEP_INDEX   0
#define DEMO_WLAN_AP_WEP_KEY   "1234567890"
#define DEMO_WLAN_AP_WEP_SIZE   WEP_40_KEY_STRING_SIZE

void demo_start ( void  )

Demo main function.

Initialize timer.

Initialize QTouch library and configure touch sensors.

Configure port pins

Turn off all extension board LEDs

Start touch sensor measurement, if touch_time.time_to_measure_touch flag is set by timer.

Get touch sensor states

Clear all slider controlled LEDs

If slider is activated

Parse slider position

References _htons, AF_INET, at30tse_init(), at30tse_read_temperature(), s_msg_touch_report::b1_state, s_msg_touch_report::b2_state, bind(), button_press_duration(), s_msg_user_input::channel, cnt, configure_port_pins(), connected, CREDENTIAL_ENTRY_BUTTON, delay, delay_clt_keepalive, delay_ms, delay_srv_keepalive, delay_us, DEMO_REPORT_INTERVAL, DEMO_SERVER_PORT, demo_wifi_socket_handler(), demo_wifi_state(), gacHttpProvDomainName, GET_MUTLCAP_ROTOR_SLIDER_POSITION, GET_MUTLCAP_SENSOR_STATE, IMU_RX_TIMEOUT, IMU_TX_KEEPALIVE_DELAY, ioport_get_pin_level(), ioport_toggle_pin_level(), s_msg_temp_report::led, LED_1_PIN, LED_2_PIN, LED_3_PIN, LED_4_PIN, LED_5_PIN, LED_6_PIN, LED_7_PIN, LED_B_PIN, LED_G_PIN, LED_R_PIN, M2M_SUCCESS, m2m_wifi_connect(), m2m_wifi_default_connect(), m2m_wifi_disable_ap(), m2m_wifi_handle_events(), m2m_wifi_init(), m2m_wifi_socket_handler(), m2m_wifi_start_provision_mode(), m2m_wifi_state(), tag_touch_measure_data_t::measurement_done_touch, ms_ticks, nm_bsp_init(), NULL, p_mutlcap_measure_data, parse_user_input(), s_msg_user_input::password, tstrWifiInitParam::pfAppWifiCb, port_pin_get_input_level(), port_pin_get_output_level(), port_pin_set_output_level(), port_pin_toggle_output_level(), print_provisioning_details(), printf, PWM_Count, registerSocketCallback(), remote_addr, ret, s_msg_touch_report::rot_position, s_msg_touch_report::rot_state, rotor_position, rotor_state, rx_socket, in_addr::s_addr, s_msg_user_input::security, sendto(), setsockopt(), sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_port, s_msg_touch_report::sl_pos, s_msg_touch_report::sl_state, SO_SET_UDP_SEND_CALLBACK, SOCK_DGRAM, socket(), socketInit(), SOL_SOCKET, s_msg_user_input::SSID, s_msg_temp_report::temp, timer_init(), toggle_led_ms, touch_sensors_init(), touch_sensors_measure(), tx_socket, user_credentials, wifi_connected, and wifi_provisioned.

Referenced by main().