SAMV71 Xplained Ultra Software Package 1.3

dbg_console.c File Reference

#include "board.h"
#include <stdio.h>
#include <stdint.h>

Go to the source code of this file.

Defines

#define CONSOLE_BAUDRATE   115200
#define CONSOLE_EDBG
#define CONSOLE_ON_UART
#define CONSOLE_UART   UART0
#define CONSOLE_PINS   {PINS_UART0}
#define CONSOLE_ID   ID_UART0

Functions

void DBG_Configure (uint32_t baudrate, uint32_t masterClock)
 Configures an USART peripheral with the specified parameters.
void DBG_PutChar (uint8_t c)
 Outputs a character on the UART line.
uint32_t DBG_GetChar (void)
 Input a character from the UART line.
uint32_t DBG_IsRxReady (void)
 Check if there is Input from UART line.
void DBG_DumpFrame (uint8_t *pucFrame, uint32_t dwSize)
void DBG_DumpMemory (uint8_t *pucBuffer, uint32_t dwSize, uint32_t dwAddress)
uint32_t DBG_GetInteger (int32_t *pdwValue)
uint32_t DBG_GetIntegerMinMax (int32_t *pdwValue, int32_t dwMin, int32_t dwMax)
uint32_t DBG_GetHexa32 (uint32_t *pdwValue)
WEAK int puts (const char *ptr)
WEAK char * gets (char *ptr)

Detailed Description

Implements UART console.

Definition in file dbg_console.c.


Define Documentation

#define CONSOLE_BAUDRATE   115200

Console baud rate always using 115200.

Definition at line 53 of file dbg_console.c.

#define CONSOLE_EDBG

EDBG used USART1 as the console, but LON support on USART1 only

Definition at line 57 of file dbg_console.c.

#define CONSOLE_PINS   {PINS_UART0}

Pins description corresponding to Rxd,Txd, (UART pins)

Definition at line 82 of file dbg_console.c.

#define CONSOLE_UART   UART0

Usart Hw interface used by the console (UART0).

Definition at line 79 of file dbg_console.c.


Function Documentation

void DBG_Configure ( uint32_t  baudrate,
uint32_t  masterClock 
)

Configures an USART peripheral with the specified parameters.

Parameters:
baudrate Baudrate at which the USART should operate (in Hz).
masterClock Frequency of the system master clock (in Hz).

Definition at line 122 of file dbg_console.c.

Here is the call graph for this function:

void DBG_DumpFrame ( uint8_t *  pucFrame,
uint32_t  dwSize 
)

Displays the content of the given frame on the UART0.

Parameters:
pucFrame Pointer to the frame to dump.
dwSize Buffer size in bytes.

Definition at line 282 of file dbg_console.c.

void DBG_DumpMemory ( uint8_t *  pucBuffer,
uint32_t  dwSize,
uint32_t  dwAddress 
)

Displays the content of the given buffer on the UART0.

Parameters:
pucBuffer Pointer to the buffer to dump.
dwSize Buffer size in bytes.
dwAddress Start address to display

Definition at line 301 of file dbg_console.c.

Here is the call graph for this function:

uint32_t DBG_GetChar ( void   ) 

Input a character from the UART line.

Note:
This function is synchronous
Returns:
character received.

Definition at line 220 of file dbg_console.c.

Here is the call graph for this function:

uint32_t DBG_GetHexa32 ( uint32_t *  pdwValue  ) 

Reads an hexadecimal number

Parameters:
pdwValue Pointer to the uint32_t variable to contain the input value.

Definition at line 467 of file dbg_console.c.

Here is the call graph for this function:

uint32_t DBG_GetInteger ( int32_t *  pdwValue  ) 

Reads an integer

Parameters:
pdwValue Pointer to a integer variable to contain the input value.
Returns:
success(1) or failure(0)

Definition at line 370 of file dbg_console.c.

Here is the call graph for this function:

uint32_t DBG_GetIntegerMinMax ( int32_t *  pdwValue,
int32_t  dwMin,
int32_t  dwMax 
)

Reads an integer and check the value

Parameters:
pdwValue Pointer to a integer variable to contain the input value.
dwMin Minimum value
dwMax Maximum value
Returns:
success(1) or failure(0)

Definition at line 437 of file dbg_console.c.

Here is the call graph for this function:

uint32_t DBG_IsRxReady ( void   ) 

Check if there is Input from UART line.

Returns:
true if there is Input.

Definition at line 252 of file dbg_console.c.

Here is the call graph for this function:

void DBG_PutChar ( uint8_t  c  ) 

Outputs a character on the UART line.

Note:
This function is synchronous (i.e. uses polling).
Parameters:
c Character to send.

Definition at line 180 of file dbg_console.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines