NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cli.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #include "drivers/serial.h"
21 #include "common/buf_writer.h"
22 
23 struct ninja;
24 struct cli {
25  uint8_t cliMode;
26 
29 
30  // buffer
31  char cliBuffer[48];
32  uint32_t bufferIndex;
33  uint8_t cliWriteBuffer[48];
34  //uint8_t cliWriteBuffer[sizeof(bufWriter_t) + 16];
35 
36  struct ninja *ninja;
37  struct config *config;
38  const struct system_calls *system;
39 };
40 
41 void cli_init(struct cli *self, struct ninja *ninja, struct config *config, const struct system_calls *system);
42 void cli_start(struct cli *self, serialPort_t *serialPort);
43 void cli_update(struct cli *self);
44 bool cli_is_active(struct cli *self);
45 bool cli_uses_port(struct cli *self, serialPort_t *serialPort);
void cli_start(struct cli *self, serialPort_t *serialPort)
Definition: cli.c:2105
Definition: config.h:81
Definition: ninja.h:40
Definition: cli.h:24
void cli_update(struct cli *self)
Definition: cli.c:2793
uint32_t bufferIndex
Definition: cli.h:32
void cli_init(struct cli *self, struct ninja *ninja, struct config *config, const struct system_calls *system)
Definition: cli.c:2906
struct system_config system
Definition: config.h:99
bufWriter_t * cliWriter
Definition: cli.h:28
const struct system_calls * system
Definition: cli.h:38
struct ninja * ninja
Definition: cli.h:36
struct config * config
Definition: cli.h:37
bool cli_is_active(struct cli *self)
Definition: cli.c:2902
Definition: buf_writer.h:23
serialPort_t * cliPort
Definition: cli.h:27
uint8_t cliWriteBuffer[48]
Definition: cli.h:33
bool cli_uses_port(struct cli *self, serialPort_t *serialPort)
Definition: system_calls.h:200
char cliBuffer[48]
Definition: cli.h:31
uint8_t cliMode
Definition: cli.h:25
Definition: serial.h:43