quack/main/blue.h

50 lines
1.4 KiB
C
Raw Normal View History

2020-09-14 20:32:07 +00:00
/*
* blue.h
* quack
*
* Created by Michel DEPEIGE on 13/09/2020.
* Copyright (c) 2020 Michel DEPEIGE.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at:
2020-09-14 20:32:07 +00:00
*
* http://www.apache.org/licenses/LICENSE-2.0
2020-09-14 20:32:07 +00:00
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
2020-09-14 20:32:07 +00:00
*
*/
#ifndef BLUE_H
#define BLUE_H
2020-12-18 10:08:52 +00:00
/* defines */
#define BLUE_SCAN_DURATION 6
2021-04-20 22:33:42 +00:00
#define BLUE_SNIP "---8<------------------------------------------"
2020-12-18 10:08:52 +00:00
/* button bitmasks */
#define BLUE_BUTTON_N 0
#define BLUE_BUTTON_1 (1 << 0)
#define BLUE_BUTTON_2 (1 << 1)
#define BLUE_BUTTON_3 (1 << 2)
#define BLUE_BUTTON_E 0xF8 /* shouldn't happen */
2020-09-14 20:32:07 +00:00
/* prototypes */
void blue_adb2hid(void *pvParameters);
2020-09-14 20:32:07 +00:00
void blue_init(void);
void blue_h_input(esp_hidh_dev_t *dev, uint8_t *data, uint16_t length);
void blue_h_close(esp_hidh_event_data_t *p);
void blue_h_open(esp_hidh_event_data_t *p);
2020-12-18 10:08:52 +00:00
void blue_scan(void *pvParameters);
void blue_set_boot_protocol(esp_hidh_dev_t *dev);
2020-09-14 20:32:07 +00:00
2020-12-16 20:00:00 +00:00
/* global variables for tasks handles */
extern TaskHandle_t t_green, t_blue, t_yellow, t_red;
2020-09-14 20:32:07 +00:00
#endif