hdo  beta
Definice maker | Funkce
Dokumentace souboru /home/mrazik/Documents/web/old/hdo/at91lib/peripherals/dbgu/dbgu.h

Zobrazit zdrojový text tohoto souboru.

Definice maker

#define DBGU_STANDARD   AT91C_US_PAR_NONE
 Standard operating mode (asynchronous, 8bit, no parity, 1 stop bit)

Funkce

void DBGU_Configure (unsigned int mode, unsigned int baudrate, unsigned int mck)
unsigned char DBGU_GetChar (void)
void DBGU_PutChar (unsigned char c)
unsigned int DBGU_IsRxReady (void)
 Return 1 if a character can be read in DBGU.

Detailní popis

Purpose

This module provides definitions and functions for using the Debug Unit (DBGU).

It also overloads the fputc(), fputs() & putchar() functions so the printf() method outputs its data on the DBGU. This behavior can be suppressed by defining NOFPUT during compilation.

Usage

  1. Enable the DBGU pins (see pio & board.h).
  2. Configure the DBGU using DBGU_Configure with the desired operating mode.
  3. Send characters using DBGU_PutChar() or the printf() method.
  4. Receive characters using DBGU_GetChar().
Poznámka:
Unless specified, all the functions defined here operate synchronously; i.e. they all wait the data is sent/received before returning.

Definice v souboru dbgu.h.


Dokumentace funkcí

void DBGU_Configure ( unsigned int  mode,
unsigned int  baudrate,
unsigned int  mck 
)

Initializes the DBGU with the given parameters, and enables both the transmitter and the receiver. The mode parameter contains the value of the DBGU_MR register. Value DBGU_STANDARD can be used for mode to get the most common configuration (i.e. aysnchronous, 8bits, no parity, 1 stop bit, no flow control).

Parametry:
modeOperating mode to configure.
baudrateDesired baudrate (e.g. 115200).
mckFrequency of the system master clock in Hz.

Definice je uvedena na řádku 51 v souboru dbgu.c.

unsigned char DBGU_GetChar ( void  )

Reads and returns a character from the DBGU.

Poznámka:
This function is synchronous (i.e. uses polling).
Návratová hodnota:
Character received.

Definice je uvedena na řádku 103 v souboru dbgu.c.

void DBGU_PutChar ( unsigned char  c)

Outputs a character on the DBGU line.

Poznámka:
This function is synchronous (i.e. uses polling).
Parametry:
cCharacter to send.

Definice je uvedena na řádku 78 v souboru dbgu.c.