Wifly Driver  V1.0
Macros | Functions | Variables
PrintF.c File Reference
#include "LPC17xx.h"
#include <stdio.h>
#include "uart.h"
#include "PrintF.h"
#include <string.h>
#include "Type.h"
#include "Config.h"
#include <stdarg.h>
#include "FreeRTOS.h"
#include "semphr.h"
Include dependency graph for PrintF.c:

Go to the source code of this file.

Macros

#define BUFSIZE   (BUFSIZE_WIFLY)
 

Functions

uint32_t PrintF_start (uint32_t PortNum, uint32_t baudRate)
 
uint32_t PrintF_stop (uint32_t PortNum)
 
void PrintF_print (uint32_t PortNum, const char *restrict format,...)
 
void PrintF_scan (uint8_t port, char *string, uint32_t timeout)
 
uint8_t PrintF_ChkScan (uint8_t PortNum, char *strScan, char *strExp, uint32_t timeout)
 
void PrintF_ClBuffUart (uint8_t portNum)
 
void PrintF_delayMs (uint32_t ms)
 

Variables

xSemaphoreHandle xMutexUART0
 
xSemaphoreHandle xMutexUART1
 
xSemaphoreHandle xMutexUART2
 
xSemaphoreHandle xMutexUART3
 
char cUART0Buffer [BUFSIZE]
 
char cUART1Buffer [BUFSIZE]
 
char cUART2Buffer [BUFSIZE]
 
char cUART3Buffer [BUFSIZE]
 

Macro Definition Documentation

#define BUFSIZE   (BUFSIZE_WIFLY)

Definition at line 19 of file PrintF.c.

Referenced by PrintF_ClBuffUart().

Function Documentation

uint8_t PrintF_ChkScan ( uint8_t  portNum,
char *  strScan,
char *  strExp,
uint32_t  timeout 
)

Llegeix la trama de la UART i la introdueix al parĂ metre String

Parameters
portNumUART port number (0,1,2,3).
strScanCharacter string received by the UART
strExpCharacter string that contains expected response.
timeoutWaiting time required to receive the answer
Returns
Returns if the received string is equal to the expected. SUCCESS= TRUE, ERROR = FALSE.

Definition at line 244 of file PrintF.c.

References FALSE, NULL, PrintF_ClBuffUart(), PrintF_scan(), and TRUE.

Referenced by Wifly_reset().

Here is the call graph for this function:

void PrintF_ClBuffUart ( uint8_t  portNum)

Initializes the UART port buffer chosen and the PrintF module

Parameters
portNumUART port number (0,1,2,3).

Definition at line 258 of file PrintF.c.

References BUFSIZE, clearBuffUart(), cUART0Buffer, cUART1Buffer, cUART2Buffer, cUART3Buffer, UART0PORT, UART1PORT, UART2PORT, and UART3PORT.

Referenced by PrintF_ChkScan(), and PrintF_print().

Here is the call graph for this function:

void PrintF_delayMs ( uint32_t  ms)

Time delay

Parameters
mstime delay (ms)

Definition at line 278 of file PrintF.c.

References delayMs().

Referenced by Wifly_ChangeBaudRate(), Wifly_reset(), Wifly_TCPTimeOpen(), Wifly_UDPReceive(), and Wifly_UDPSend().

Here is the call graph for this function:

void PrintF_print ( uint32_t  portNum,
const char *restrict  format,
  ... 
)

Write printf format string into the selected UART

Parameters
portNumUART port number (0,1,2,3).
formatstring that contains a format string that follows the same specifications as format in printf.

Definition at line 137 of file PrintF.c.

References cUART0Buffer, cUART1Buffer, cUART2Buffer, cUART3Buffer, NULL, PrintF_ClBuffUart(), UART0PORT, UART1PORT, UART2PORT, UART3PORT, UARTSend(), xMutexUART0, xMutexUART1, xMutexUART2, and xMutexUART3.

Referenced by Log_level(), Log_log(), and Log_slog().

Here is the call graph for this function:

void PrintF_scan ( uint8_t  port,
char *  string,
uint32_t  timeout 
)

Read the response of the UART and moves it to the string parameter

Parameters
portUART port number (0,1,2,3).
stringCharacter string received by the UART
timeoutWaiting time required to receive the answer

Definition at line 206 of file PrintF.c.

References UART0PORT, UART1PORT, UART2PORT, UART3PORT, UARTReceive(), xMutexUART0, xMutexUART1, xMutexUART2, and xMutexUART3.

Referenced by PrintF_ChkScan().

Here is the call graph for this function:

uint32_t PrintF_start ( uint32_t  portNum,
uint32_t  baudRate 
)

Initialize UART port, and baud rate transmission.

Parameters
portNumUART port number (0,1,2,3).
baudRateUART port Baud
Returns
Returns the result of initialisation. SUCCESS= TRUE, ERROR = FALSE.

Definition at line 27 of file PrintF.c.

References FALSE, NULL, TRUE, UART0PORT, UART1PORT, UART2PORT, UART3PORT, UARTInit(), xMutexUART0, xMutexUART1, xMutexUART2, and xMutexUART3.

Referenced by Log_start(), Wifly_ChangeBaudRate(), and Wifly_start().

Here is the call graph for this function:

uint32_t PrintF_stop ( uint32_t  PortNum)

Close UART port

Parameters
PortNumUART port number (0,1,2,3).
Returns
Returns the result of initialisation. SUCCESS= TRUE, ERROR = FALSE.

Definition at line 91 of file PrintF.c.

References FALSE, TRUE, UART0PORT, UART1PORT, UART2PORT, UART3PORT, UARTClose(), xMutexUART0, xMutexUART1, xMutexUART2, and xMutexUART3.

Here is the call graph for this function:

Variable Documentation

char cUART0Buffer[BUFSIZE]

Definition at line 23 of file PrintF.c.

Referenced by PrintF_ClBuffUart(), and PrintF_print().

char cUART1Buffer[BUFSIZE]

Definition at line 23 of file PrintF.c.

Referenced by PrintF_ClBuffUart(), and PrintF_print().

char cUART2Buffer[BUFSIZE]

Definition at line 23 of file PrintF.c.

Referenced by PrintF_ClBuffUart(), and PrintF_print().

char cUART3Buffer[BUFSIZE]

Definition at line 23 of file PrintF.c.

Referenced by PrintF_ClBuffUart(), and PrintF_print().

xSemaphoreHandle xMutexUART0

Definition at line 22 of file PrintF.c.

Referenced by PrintF_print(), PrintF_scan(), PrintF_start(), and PrintF_stop().

xSemaphoreHandle xMutexUART1

Definition at line 22 of file PrintF.c.

Referenced by PrintF_print(), PrintF_scan(), PrintF_start(), and PrintF_stop().

xSemaphoreHandle xMutexUART2

Definition at line 22 of file PrintF.c.

Referenced by PrintF_print(), PrintF_scan(), PrintF_start(), and PrintF_stop().

xSemaphoreHandle xMutexUART3

Definition at line 22 of file PrintF.c.

Referenced by PrintF_print(), PrintF_scan(), PrintF_start(), and PrintF_stop().