Example application for the STMicroelectronics X-NUCLEO-NFC05A1

Dependencies:   RFAL ST25R3911 BSP05

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers logger.h Source File

logger.h

Go to the documentation of this file.
00001 /******************************************************************************
00002   * @attention
00003   *
00004   * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
00005   *
00006   * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
00007   * You may not use this file except in compliance with the License.
00008   * You may obtain a copy of the License at:
00009   *
00010   *        http://www.st.com/myliberty
00011   *
00012   * Unless required by applicable law or agreed to in writing, software
00013   * distributed under the License is distributed on an "AS IS" BASIS,
00014   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
00015   * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
00016   * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
00017   * See the License for the specific language governing permissions and
00018   * limitations under the License.
00019   *
00020 ******************************************************************************/
00021 /*
00022  *      PROJECT:
00023  *      $Revision: $
00024  *      LANGUAGE:  ANSI C
00025  */
00026 
00027 /*! \file
00028  *
00029  *  \author
00030  *
00031  *  \brief serial output log declaration file
00032  *
00033  */
00034 /*!
00035  *
00036  * This driver provides a printf-like way to output log messages
00037  * via the UART interface. It makes use of the uart driver.
00038  *
00039  * API:
00040  * - Write a log message to UART output: #DEBUG
00041  */
00042 
00043 #ifndef LOGGER_H
00044 #define LOGGER_H
00045 
00046 /*
00047 ******************************************************************************
00048 * INCLUDES
00049 ******************************************************************************
00050 */
00051 #include "platform1.h"
00052 
00053 /*
00054 ******************************************************************************
00055 * DEFINES
00056 ******************************************************************************
00057 */
00058 #define LOGGER_ON   1
00059 #define LOGGER_OFF  0
00060 
00061 /*!
00062  *****************************************************************************
00063  *  \brief  Writes out a formated string via UART interface
00064  *
00065  *  This function is used to write a formated string via the UART interface.
00066  *
00067  *****************************************************************************
00068  */
00069 extern void logUsartInit(UART_HandleTypeDef *husart);
00070 
00071 /*!
00072  *****************************************************************************
00073  *  \brief  Writes out a formated string via UART interface
00074  *
00075  *  This function is used to write a formated string via the UART interface.
00076  *
00077  *****************************************************************************
00078  */
00079 extern int logUsart(const char* format, ...);
00080 
00081 /*!
00082  *****************************************************************************
00083  *  \brief  helper to convert hex data into formated string
00084  *
00085  *  \param[in] data : pointer to buffer to be dumped.
00086  *
00087  *  \param[in] dataLen : buffer length
00088  *
00089  *  \return hex formated string
00090  *
00091  *****************************************************************************
00092  */
00093 extern char* hex2Str(unsigned char * data, size_t dataLen);
00094 
00095 #endif /* LOGGER_H */
00096