forked from orsonmmz/kicon19-badge-sw
-
Notifications
You must be signed in to change notification settings - Fork 1
/
command_handlers.h
48 lines (40 loc) · 1.86 KB
/
command_handlers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright (c) 2019 Maciej Suminski <orson@orson.net.pl>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef COMMAND_HANDLERS_H
#define COMMAND_HANDLERS_H
#include <stdint.h>
#include "commands_def.h"
/* Function that should be used by the command handlers to return a response */
void cmd_response(const uint8_t* buf, unsigned int len);
/* Starts a response to a command */
void cmd_resp_init(cmd_resp_t status);
/* Writes data to the response buffer */
void cmd_resp_write(uint8_t data);
void cmd_resp_writen(const uint8_t *data, unsigned int len);
/* Logic analyzer SUMP protocol handler */
int cmd_sump(const uint8_t* cmd, unsigned int len);
void cmd_uart(const uint8_t* data_in, unsigned int input_len);
void cmd_i2c(const uint8_t* data_in, unsigned int input_len);
void cmd_spi(const uint8_t* data_in, unsigned int input_len);
void cmd_led(const uint8_t* data_in, unsigned int input_len);
void cmd_lcd(const uint8_t* data_in, unsigned int input_len);
void cmd_btn(const uint8_t* data_in, unsigned int input_len);
/*void cmd_adc(const uint8_t* data_in, unsigned int input_len);*/
/*void cmd_dac(const uint8_t* data_in, unsigned int input_len);*/
#endif /* COMMAND_HANDLERS_H */