Chameleon-Mini
Log.h
Go to the documentation of this file.
1 #ifndef LOG_H_
2 #define LOG_H_
3 
4 #include "Common.h"
5 
6 #define LOG_SIZE 2048
7 #define FRAM_LOG_START_ADDR 0x4000 // from the start of the second half of FRAM
8 #define FRAM_LOG_SIZE 0x4000 // the whole second half
9 
11 typedef enum {
12  /* Generic */
18 
19  /* Codec */
22 
23  /* App */
38 
39  LOG_EMPTY = 0x00
40 } LogEntryEnum;
41 
42 typedef enum {
43  LOG_MODE_OFF,
44  LOG_MODE_MEMORY,
45  LOG_MODE_LIVE
46 } LogModeEnum;
47 
48 typedef void (*LogFuncType) (LogEntryEnum Entry, const void* Data, uint8_t Length);
49 
50 extern LogFuncType CurrentLogFunc;
51 
52 void LogInit(void);
53 void LogTick(void);
54 void LogTask(void);
55 
56 void LogMemClear(void);
57 uint16_t LogMemFree(void);
58 /* XModem callback */
59 bool LogMemLoadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount);
60 
61 void LogSetModeById(LogModeEnum Mode);
62 bool LogSetModeByName(const char* Mode);
63 void LogGetModeByName(char* Mode, uint16_t BufferSize);
64 void LogGetModeList(char* List, uint16_t BufferSize);
65 void LogSRAMToFRAM(void);
66 
67 /* Wrapper function to call current logging function */
68 INLINE void LogEntry(LogEntryEnum Entry, const void* Data, uint8_t Length) { CurrentLogFunc(Entry, Data, Length); }
69 
70 #endif /* LOG_H_ */
Application processed authentication command.
Definition: Log.h:30
Application authentication failed.
Definition: Log.h:35
Application is in auth state.
Definition: Log.h:34
Application processed increment command.
Definition: Log.h:26
Currently active codec sent data.
Definition: Log.h:21
UID change.
Definition: Log.h:16
Empty Log Entry. This is not followed by a length byte nor the two systick bytes nor any data...
Definition: Log.h:39
LogEntryEnum
Definition: Log.h:11
Currently active codec received data.
Definition: Log.h:20
Application processed write command.
Definition: Log.h:25
Application processed halt command.
Definition: Log.h:31
Application processed an unknown command.
Definition: Log.h:32
Application reset.
Definition: Log.h:17
Unspecific log entry.
Definition: Log.h:13
Application processed restore command.
Definition: Log.h:29
Application processed read command.
Definition: Log.h:24
Application had a checksum fail.
Definition: Log.h:36
Application processed transfer command.
Definition: Log.h:28
Setting change.
Definition: Log.h:15
Application is not authenticated.
Definition: Log.h:37
Application processed decrement command.
Definition: Log.h:27
Configuration change.
Definition: Log.h:14
Application is in authing state.
Definition: Log.h:33