summaryrefslogtreecommitdiff
path: root/src/cmd.h
blob: d47d1dd134b61ad0027adb02c286874303134596 (plain)
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
49
/*
 * src/cmd.h
 * (c) 2021 Jonas Gunz <himself@jonasgunz.de>
 * License: MIT
 */

#ifndef _CMD_H_
#define _CMD_H_

#include <stdint.h>

#include "uart.h"
#include "pwm.h"
#include "helpers.h"

#define _CMD_CNT	3
#define _CMD_MAX_ARGC	4

#define _ERR_CMD	1
#define _ERR_ARGC	2

void cmd_init();

void cmd_tick(char _c);

/**
 * argc=3
 *
 * 0: Pin Num
 * 1-2: Dutycycle in HEX (00-FF)
 */
void cmd_set_pwm(uint8_t _argv[]);

/**
 * argc=3
 *
 * 0: Pin Num
 * 1-2: Dutycycle in HEX (00-FF)
 */
void cmd_fade_pwm(uint8_t _argv[]);

/**
 * argc=1
 *
 * 0: Error type
 */
void cmd_err(uint8_t _argv[]);

#endif