EFM32 Gecko Software Documentation
efm32g-doc-4.2.1
|
Macros | |
#define | RXBUFSIZE 8 |
Functions | |
int | RETARGET_ReadChar (void) |
Receive a byte from USART/LEUART and put into global buffer. More... | |
int | RETARGET_WriteChar (char c) |
Transmit single byte to USART/LEUART. More... | |
int | _close (int file) |
Close a file. More... | |
int | _fstat (int file, struct stat *st) |
Status of an open file. More... | |
int | _isatty (int file) |
Query whether output stream is a terminal. More... | |
int | _lseek (int file, int ptr, int dir) |
Set position in a file. More... | |
int | _read (int file, char *ptr, int len) |
Read from a file. More... | |
caddr_t | _sbrk (int incr) |
Increase heap. More... | |
int | _write (int file, const char *ptr, int len) |
Write to a file. More... | |
void | _exit (int status) |
Exit the program. More... | |
int | _getpid (void) |
Get process ID. | |
int | _kill (int pid, int sig) |
Send signal to process. More... | |
void | RETARGET_IRQ_NAME (void) |
UART/LEUART IRQ Handler. | |
void | RETARGET_SerialCrLf (int on) |
UART/LEUART toggle LF to CRLF conversion. More... | |
void | RETARGET_SerialInit (void) |
Intializes UART/LEUART. | |
EMSTATUS | RETARGET_TextDisplayInit (void) |
Initialize/retarget a TEXTDISPLAY device to receivie stdout(put). More... | |
EMSTATUS | RETARGET_WriteString (char *str) |
Write a string of characters to the RETARGET text display device. More... | |
void | RETARGET_TFTTX (int c) |
Transmit/display a character. More... | |
void | RETARGET_TFTUpdate (bool fullFrame) |
Display framebuffer. More... | |
void | RETARGET_TftInit (void) |
Intializes TFT text display. | |
void | RETARGET_TftCrLf (int on) |
Toggle LF to CRLF conversion. More... | |
Variables | |
char | _end |
static volatile int | rxReadIndex = 0 |
static volatile int | rxWriteIndex = 0 |
static volatile int | rxCount = 0 |
static volatile uint8_t | rxBuffer [RXBUFSIZE] |
static uint8_t | LFtoCRLF = 0 |
static bool | initialized = false |
This module provide low-level stubs for retargetting stdio for all supported toolchains. The stubs are minimal yet sufficient implementations. Refer to chapter 12 in the reference manual for newlib 1.17.0 for details on implementing newlib stubs.
The source code of the RETARGETTEXTDISPLAY module is implemented in kits/common/drivers/retargettextdisplay.c and retargettextdisplay.h.
The RETARGETTEXTDISPLAY Library implements a stdout interface to a textdisplay device (TextDisplay Library) in order for the user to print text by calling standard C language functions that prints text to stdout.
This section contains a description of the configuration parameters of the RETARGETTEXTDISPLAY Library.
#define RETARGETTEXTDISPLAY_SCROLL_MODE Set to 'true' to enable scroll mode on the text display device where stdout is retargeted. Set to 'false' to disable scroll mode. #define RETARGETTEXTDISPLAY_LINE_FEED_MODE Set to 'true' to enable adding Carriage Return (CR) to Line Feed (LF) characters on the text display device where stdout is retargeted. Set to 'false' to disable line feed mode. #define RETARGETTEXTDISPLAY_DISPLAY_NO Select which TEXTDISPLAY device number to retarget stdout to. Normally there is only one display device present in the system therefore this parameter should be zero. However if there are more than one display device the user may want to select a different display device.
#define RXBUFSIZE 8 |
Buffer size for RX
Definition at line 38 of file retargetserial.c.
Referenced by RETARGET_IRQ_NAME(), and RETARGET_ReadChar().
int RETARGET_ReadChar | ( | void | ) |
Receive a byte from USART/LEUART and put into global buffer.
Receive a byte from USART/LEUART and put into global buffer.
Definition at line 210 of file retargetserial.c.
References initialized, INT_Disable(), INT_Enable(), RETARGET_SerialInit(), rxBuffer, RXBUFSIZE, rxCount, and rxReadIndex.
Referenced by _read().
int RETARGET_WriteChar | ( | char | c | ) |
c | Character to transmit |
Transmit single byte to USART/LEUART.
c | Character to write |
Transmit single byte to USART/LEUART.
c | Character to transmit |
Definition at line 240 of file retargetserial.c.
References BC_ARB_CTRL_EBI, BC_REGISTER, BC_UIF_AEM_EFM, bufferReset, fullUpdate, initialized, LFtoCRLF, RETARGET_SerialInit(), RETARGET_TFTTX(), RETARGET_TFTUpdate(), TEXTDISPLAY_WriteChar(), tftReset, and tftTextReset().
Referenced by _write().
int _close | ( | int | file | ) |
[in] | file | File you want to close. |
Definition at line 62 of file retargetio.c.
int _fstat | ( | int | file, |
struct stat * | st | ||
) |
[in] | file | Check status for this file. |
[in] | st | Status information. |
Definition at line 92 of file retargetio.c.
int _isatty | ( | int | file | ) |
[in] | file | Descriptor for the file. |
Definition at line 117 of file retargetio.c.
int _lseek | ( | int | file, |
int | ptr, | ||
int | dir | ||
) |
[in] | file | Descriptor for the file. |
[in] | ptr | Poiter to the argument offset. |
[in] | dir | Directory whence. |
Definition at line 151 of file retargetio.c.
int _read | ( | int | file, |
char * | ptr, | ||
int | len | ||
) |
[in] | file | Descriptor for the file you want to read from. |
[in] | ptr | Pointer to the chacaters that are beeing read. |
[in] | len | Number of characters to be read. |
Definition at line 175 of file retargetio.c.
References RETARGET_ReadChar(), and rxCount.
caddr_t _sbrk | ( | int | incr | ) |
[in] | incr | Number of bytes you want increment the program's data space. |
Definition at line 212 of file retargetio.c.
int _write | ( | int | file, |
const char * | ptr, | ||
int | len | ||
) |
[in] | file | Descriptor for the file you want to write to. |
[in] | ptr | Pointer to the text you want to write |
[in] | len | Number of characters to be written. |
Definition at line 250 of file retargetio.c.
References RETARGET_WriteChar().
Referenced by _sbrk().
void _exit | ( | int | status | ) |
[in] | status | The value to return to the parent process as the exit status (not used). |
Definition at line 73 of file retargetio.c.
int _kill | ( | int | pid, |
int | sig | ||
) |
[in] | pid | Process id (not used). |
[in] | sig | Signal to send (not used). |
Definition at line 128 of file retargetio.c.
void RETARGET_SerialCrLf | ( | int | on | ) |
on | If non-zero, automatic LF to CRLF conversion will be enabled |
Definition at line 83 of file retargetserial.c.
References LFtoCRLF.
EMSTATUS RETARGET_TextDisplayInit | ( | void | ) |
Definition at line 47 of file retargettextdisplay.c.
References DISPLAY_DeviceGet(), DISPLAY_EMSTATUS_OK, TEXTDISPLAY_Config_t::displayDeviceNo, TEXTDISPLAY_Config_t::lfToCrLf, TEXTDISPLAY_Config_t::scrollEnable, TEXTDISPLAY_EMSTATUS_OK, and TEXTDISPLAY_New().
EMSTATUS RETARGET_WriteString | ( | char * | str | ) |
[in] | str | String to write. |
Definition at line 116 of file retargettextdisplay.c.
References TEXTDISPLAY_EMSTATUS_NOT_INITIALIZED, and TEXTDISPLAY_WriteString().
void RETARGET_TFTTX | ( | int | c | ) |
[in] | c | ASCII character to output |
Definition at line 168 of file retargettft.c.
References charBuffer, CHARS, LINES, rgbColor, tftTextScrollUp(), xpos, and ypos.
Referenced by RETARGET_WriteChar().
void RETARGET_TFTUpdate | ( | bool | fullFrame | ) |
[in] | fullFrame | If true, draw entire screen, if false, draw incremental update (faster) |
Definition at line 230 of file retargettft.c.
References charBuffer, CHARS, fontBits, LINES, rgbColor, xpos, and ypos.
Referenced by RETARGET_WriteChar().
void RETARGET_TftCrLf | ( | int | on | ) |
on | If non-zero, automatic LF to CRLF conversion will be enabled |
Definition at line 68 of file retargettft.c.
References LFtoCRLF.
char _end |
Defined by the linker
Referenced by _sbrk().
|
static |
Index in buffer to be read
Definition at line 39 of file retargetserial.c.
Referenced by RETARGET_IRQ_NAME(), and RETARGET_ReadChar().
|
static |
Index in buffer to be written to
Definition at line 40 of file retargetserial.c.
Referenced by RETARGET_IRQ_NAME().
|
static |
Keeps track of how much data which are stored in the buffer
Definition at line 41 of file retargetserial.c.
Referenced by _read(), RETARGET_IRQ_NAME(), and RETARGET_ReadChar().
|
static |
Buffer to store data
Definition at line 42 of file retargetserial.c.
Referenced by KSZ8851SNL_SPI_ReadRegister(), RETARGET_IRQ_NAME(), RETARGET_ReadChar(), SPIDRV_MTransferSingleItemB(), UARTDRV_Abort(), and UARTDRV_GetReceiveStatus().
|
static |
LF to CRLF conversion disabled
Definition at line 43 of file retargetserial.c.
Referenced by RETARGET_SerialCrLf(), and RETARGET_WriteChar().
|
static |
Initialize UART/LEUART
Definition at line 44 of file retargetserial.c.
Referenced by DMADRV_AllocateChannel(), DMADRV_DeInit(), DMADRV_FreeChannel(), DMADRV_Init(), DMADRV_StopTransfer(), DMADRV_TransferActive(), DMADRV_TransferCompletePending(), DMADRV_TransferDone(), DMADRV_TransferRemainingCount(), RETARGET_ReadChar(), RETARGET_SerialInit(), RETARGET_WriteChar(), and TEXTDISPLAY_New().