Index

auto-plow / 8b6f76f

A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
8412 Jan 2023 16:048b6f76fRadio receiver handlersJosh Stockin1460G

Blob @ auto-plow / src / input.h

text/plain1399 bytesdownload raw
1// espy Copyright (c) 2023 Josh Stockin <josh@joshstock.in>
2// [https://joshstock.in] [https://github.com/joshuas3]
3//
4// This software is licensed and distributed under the terms of the MIT License.
5// See the MIT License in the LICENSE file of this project's root folder.
6//
7// This comment block and its contents, including this disclaimer, MUST be
8// preserved in all copies or distributions of this software's source.
9
10
11// Filename: input.h
12// Description: Input config/ISR/task functions and utilities
13
14
15#pragma once
16
17
18#include "esp_attr.h"
19#include "esp_err.h"
20
21// input utilities
22#define NUM_RADIO_CHANNELS 10
23#define RADIO_PULSE_STOPGAP_US 5000 // length of transmission block separation in microseconds
24
25// input functions
26esp_err_t setup_radio_and_rotenc_input( void ); // config, ISR creation, task creation
27void radio_pulse( void* arg ); // ISR
28void rotenc_switch( void* arg ); // ISR
29void rotenc_rotate( void* arg ); // ISR
30void input_handler_task( void* arg );
31
32// queue input event structure
33typedef struct xInputEvent {
34 uint8_t type;
35 uint32_t data;
36} xInputEvent;
37
38// input event types
39#define INPUT_EVENT_RADIOPULSE 0
40#define INPUT_EVENT_ROTENCSW 1
41#define INPUT_EVENT_ROTENCTURN 2
42
43// move to separate headers
44esp_err_t setup_epd( void );
45esp_err_t setup_control_hardware( void );
46esp_err_t setup_control_loop( void );
47