/**
@file log_creat.h
@brief Config asynchronous log output and debug cmd.

## changelog ##
______
Data        | Vesion   | Change Description
------------|----------|-------------------------------------
20221104    | 1.0      | First release
20221223    | 1.1      | Add comment
20230420    | 1.2      | Modified the log statement handling description.

## how to config ##
### precondition ###
1. Change the UART_SELECT to the corresponding uart channel.
2. Change the UART_TYPE to the corresponding uart type.

### creat step ###
1. Add your module name and buffer size with LOG_BUFF_CREAT in log_creat.c.
2. Add CRATELOGTABLE("your module name") to g_axLogBufferInfo in log_creat.c. 
3. Declare log processing with LOG_DECLARATION("your module name") in log_creat.h.
4. Call LOG_OUTPUT_DEBUG where you want to output asynchronous log.
5. Call LOG_GETINPUTSTRING_PROCESS to get debug cmd form uart you select in precondition.

@note
- If the uart channel changes, perform the precondition steps.
- Name in 2/3/4 must be the same.
- The valid range for the size in LOG_BUFF_CREAT is 1KB to 5KB, otherwise the log output will be disabled.
- The total size of all LOG_BUFF_CREAT can't exceed 100KB, otherwise log output will be disabled.
- You do not need to add "\n" at the EOL because log manage will add automatic.
- The log interface can't be used in interrupts.
- There is a log sample in hmidemo.


## terminal cmd ##
1. You can enter "logcat name" in the terminal to get log data.
2. You can enter "echo cmd > name" in the terminal to send debug cmd.

@note
 Name in 1/2 must be the same as "how to config".
*/

 
/********************************************************************************************
Multi-Inlcude-Prevent Section                                   
********************************************************************************************/
#ifndef LOGCREAT_H
#define LOGCREAT_H

/********************************************************************************************
Debug Switch Definition Section                                 
********************************************************************************************/


/********************************************************************************************
Include File Section                                          
********************************************************************************************/
#include "log.h"
//#include "uart.h"


/********************************************************************************************
Macro Definition Section     
********************************************************************************************/

/**
@brief Change the UART_SELECT to the corresponding uart channel.
*/
#define UART_SELECT  2 

/**
@brief Change the UART_TYPE to the corresponding uart type.
@note
- TYPE_FUSA_UART is FUSA uart.
- TYPE_PERI_UART is Peri uart.
*/
#define UART_TYPE   2  


#define BUF_SIZE_1K   1024  
#define BUF_SIZE_2K	  2048
#define BUF_SIZE_3K	  3072
#define BUF_SIZE_4K	  4096
#define BUF_SIZE_5K	  5120


/********************************************************************************************
Prototype Declaration Section                                 
********************************************************************************************/
/**
@brief Declare log processing.
@note The log processing of SafetyOS cannot be modified.
*/
/************Log used by SafetyOS start************/
LOG_DECLARATION(iic);
LOG_DECLARATION(flash);
LOG_DECLARATION(power);
LOG_DECLARATION(ipcl);

/************Log used by customer end*************/

#endif
