Wifly Driver
V1.0
|
#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"
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] |
#define BUFSIZE (BUFSIZE_WIFLY) |
Definition at line 19 of file PrintF.c.
Referenced by PrintF_ClBuffUart().
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
portNum | UART port number (0,1,2,3). |
strScan | Character string received by the UART |
strExp | Character string that contains expected response. |
timeout | Waiting time required to receive the answer |
Definition at line 244 of file PrintF.c.
References FALSE, NULL, PrintF_ClBuffUart(), PrintF_scan(), and TRUE.
Referenced by Wifly_reset().
void PrintF_ClBuffUart | ( | uint8_t | portNum | ) |
Initializes the UART port buffer chosen and the PrintF module
portNum | UART 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().
void PrintF_delayMs | ( | uint32_t | ms | ) |
Time delay
ms | time 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().
void PrintF_print | ( | uint32_t | portNum, |
const char *restrict | format, | ||
... | |||
) |
Write printf format string into the selected UART
portNum | UART port number (0,1,2,3). |
format | string 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().
void PrintF_scan | ( | uint8_t | port, |
char * | string, | ||
uint32_t | timeout | ||
) |
Read the response of the UART and moves it to the string parameter
port | UART port number (0,1,2,3). |
string | Character string received by the UART |
timeout | Waiting 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().
uint32_t PrintF_start | ( | uint32_t | portNum, |
uint32_t | baudRate | ||
) |
Initialize UART port, and baud rate transmission.
portNum | UART port number (0,1,2,3). |
baudRate | UART port Baud |
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().
uint32_t PrintF_stop | ( | uint32_t | PortNum | ) |
Close UART port
PortNum | UART port number (0,1,2,3). |
Definition at line 91 of file PrintF.c.
References FALSE, TRUE, UART0PORT, UART1PORT, UART2PORT, UART3PORT, UARTClose(), xMutexUART0, xMutexUART1, xMutexUART2, and xMutexUART3.
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().