Microchip® Advanced Software Framework

hid_mouse_app.c File Reference

HID Mouse Device Profile Application declarations.

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

#include <asf.h>
#include "platform.h"
#include "at_ble_api.h"
#include "console_serial.h"
#include "ble_manager.h"
#include "hid.h"
#include "hid_mouse_app.h"
#include "device_info.h"
#include "ble_utils.h"
#include "conf_extint.h"

Functions

void button_cb (void)
 
static at_ble_status_t hid_connect_cb (void *params)
 
static at_ble_status_t hid_custom_event (void *param)
 
static at_ble_status_t hid_disconnect_cb (void *params)
 
static void hid_mouse_app_init (void)
 
static bool hid_mouse_move (int8_t pos, uint8_t index_report)
 
static at_ble_status_t hid_notification_confirmed_cb (void *params)
 
static void hid_prf_boot_ntf_cb (hid_boot_ntf_t *boot_ntf_info_t)
 
static void hid_prf_control_point_ntf_cb (hid_control_mode_ntf_t *hid_control_point_value_t)
 
static void hid_prf_protocol_mode_ntf_cb (hid_proto_mode_ntf_t *protocol_mode)
 
static void hid_prf_report_ntf_cb (hid_report_ntf_t *report_info)
 
int main (void)
 

Variables

user_custom_event_t app_button_event
 
bool app_exec = true
 To keep the app executing continuously. More...
 
volatile bool app_init_done = false
 
int8_t app_mouse_report [4] = {0x00, 0x00, 0x00, 0x00}
 
hid_boot_ntf_t boot_ntf_info
 
uint8_t cnt = 0
 
uint8_t conn_status = 0
 
static const ble_gap_event_cb_t hid_app_gap_handle
 
static const
ble_gatt_server_event_cb_t 
hid_app_gatt_server_handle
 
static uint8_t hid_app_mouse_report_map []
 
hid_control_mode_ntf_t hid_control_point_value
 
static const ble_custom_event_cb_t hid_custom_event_cb
 
hid_prf_info_t hid_prf_data
 
hid_proto_mode_ntf_t hid_proto_mode_value
 
uint8_t mouse_pos = MOUSE_RIGHT_MOVEMENT
 
uint8_t mouse_status = 0
 
hid_report_ntf_t report_ntf_info
 

void button_cb ( void  )
static at_ble_status_t hid_connect_cb ( void *  params)
static
static at_ble_status_t hid_custom_event ( void *  param)
static

References AT_BLE_SUCCESS, and mouse_status.

static at_ble_status_t hid_disconnect_cb ( void *  params)
static
static bool hid_mouse_move ( int8_t  pos,
uint8_t  index_report 
)
static

References app_mouse_report.

Referenced by main().

static at_ble_status_t hid_notification_confirmed_cb ( void *  params)
static
static void hid_prf_boot_ntf_cb ( hid_boot_ntf_t boot_ntf_info_t)
static
static void hid_prf_control_point_ntf_cb ( hid_control_mode_ntf_t hid_control_point_value_t)
static
static void hid_prf_protocol_mode_ntf_cb ( hid_proto_mode_ntf_t protocol_mode)
static
static void hid_prf_report_ntf_cb ( hid_report_ntf_t report_info)
static

user_custom_event_t app_button_event
Initial value:
=
{
.bptr = NULL
}
#define NULL
Definition: nm_bsp.h:64
#define APP_BUTTON_EVENT_ID
Button event ID.
Definition: pas_app.h:57
bool app_exec = true

To keep the app executing continuously.

volatile bool app_init_done = false
int8_t app_mouse_report[4] = {0x00, 0x00, 0x00, 0x00}
hid_boot_ntf_t boot_ntf_info
uint8_t conn_status = 0
const ble_gap_event_cb_t hid_app_gap_handle
static
Initial value:
= {
.connected = hid_connect_cb,
.disconnected = hid_disconnect_cb
}
static at_ble_status_t hid_disconnect_cb(void *params)
Definition: hid_mouse_app.c:287
static at_ble_status_t hid_connect_cb(void *params)
Definition: hid_mouse_app.c:272
const ble_gatt_server_event_cb_t hid_app_gatt_server_handle
static
Initial value:
= {
.notification_confirmed = hid_notification_confirmed_cb,
}
static at_ble_status_t hid_notification_confirmed_cb(void *params)
Definition: hid_mouse_app.c:338
uint8_t hid_app_mouse_report_map[]
static

Referenced by hid_mouse_app_init().

hid_control_mode_ntf_t hid_control_point_value
const ble_custom_event_cb_t hid_custom_event_cb
static
Initial value:
= {
.custom_event = hid_custom_event
}
static at_ble_status_t hid_custom_event(void *param)
Definition: hid_mouse_app.c:262
hid_prf_info_t hid_prf_data
hid_proto_mode_ntf_t hid_proto_mode_value
uint8_t mouse_pos = MOUSE_RIGHT_MOVEMENT
uint8_t mouse_status = 0
hid_report_ntf_t report_ntf_info