rusefi-1/firmware/console/console_io.h

45 lines
955 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file console_io.h
*
* @date Dec 29, 2012
2017-01-03 03:05:22 -08:00
* @author Andrey Belomutskiy, (c) 2012-2017
2015-07-10 06:01:56 -07:00
*/
#ifndef CONSOLE_IO_H_
#define CONSOLE_IO_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
2015-07-10 06:01:56 -07:00
#include <ch.h>
#include <hal.h>
#ifdef __cplusplus
}
#endif /* __cplusplus */
2015-07-10 06:01:56 -07:00
typedef void (*CommandHandler)(char *);
#include "efifeatures.h"
#include "datalogging.h"
2015-12-21 17:02:32 -08:00
// todo: make this pin configurable
2015-07-10 06:01:56 -07:00
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
2017-05-23 10:10:43 -07:00
BaseChannel * getConsoleChannel(void);
2015-07-10 06:01:56 -07:00
void consolePutChar(int x);
void consoleOutputBuffer(const uint8_t *buf, int size);
void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p);
2017-01-05 02:01:46 -08:00
bool isCommandLineConsoleOverTTL(void);
2016-02-13 18:02:14 -08:00
void onDataArrived(void);
2015-07-10 06:01:56 -07:00
#if EFI_PROD_CODE || EFI_SIMULATOR || EFI_EGT
2017-01-05 01:03:02 -08:00
bool isCommandLineConsoleReady(void);
2015-07-10 06:01:56 -07:00
#else
2017-01-05 01:03:02 -08:00
#define isCommandLineConsoleReady() true
2015-07-10 06:01:56 -07:00
#endif
#endif /* CONSOLE_IO_H_ */