-
Notifications
You must be signed in to change notification settings - Fork 0
/
uart_logger_task.h
47 lines (39 loc) · 1.08 KB
/
uart_logger_task.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
/**
* @file uart_logger.h
* Implements the task responsible for reading data from a UART, and writing it
* to an SD card log file.
*
* Pins Required:
* PD6- UART RX
* PD7- UART TX
*/
#ifndef UART_LOGGER_TASK_H
#define UART_LOGGER_TASK_H
#include <stdbool.h>
#include "cli.h"
/*
* PreOS Task for UART logger. Sets up uart instance for data transmission,
* This code MUST be called before the BIOS is started.
*/
void uart_logger_prebios(void);
/**
* Enables UART log forwarding.
* @param context: CLI context to log to
* @return 0 if log forwarding was enabled, or -1 if another console is already
* using the forwarding feature.
*/
int enable_log_forwarding(CLIContext *context);
/**
* Disables UART log forwarding.
* @return 0 if log forwarding could be disabled, or -1 if CLI does not have
* permissions to do so.
*/
int disable_log_forwarding(void);
/**
* Writes to the UART device being logged from.
* @param data: buffer of data to write
* @param len: length of data to write
* @return number of bytes written.
*/
int write_to_logger(char* data, int len);
#endif