SW006015 Microchip Technology, SW006015 Datasheet - Page 47

C COMPILER MPLAB C32

SW006015

Manufacturer Part Number
SW006015
Description
C COMPILER MPLAB C32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheets

Specifications of SW006015

Supported Families
PIC32MX5, MX6, And MX7
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC32 MCUs
Tool Function
Compiler
Supported Devices
PIC32 MCUs
Tool Type
Compiler
Processor Series
PIC32
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
2.1
2.2
2.3
2.4
© 2007 Microchip Technology Inc.
INTRODUCTION
HIGHLIGHTS
STANDARD I/O
WEAK FUNCTIONS
This chapter discusses using the MPLAB C32 C libraries.
Items discussed in this chapter are:
• Standard I/O
• Weak Functions
• “Helper” Header Files
• Multilibs
The standard input/output library functions support two modes of operation, simple and
full. The simple mode supports I/O via a two function interface on a single character
device used for stdout, stdin and stderr. The full mode supports the complete set
of standard I/O functions. The library will use full mode if the application calls fopen,
otherwise simple mode is used.
Simple mode performs I/O using four functions, _mon_puts, _mon_write,
_mon_getc and _mon_putc, to perform the raw device I/O. The default
implementation of _mon_getc always returns failure (i.e., by default, character input is
not available). The default implementation of _mon_putc writes a character to UART2.
It is assumed that the application has performed any necessary initialization of the
UART. The default implementations of _mon_puts and _mon_write both simply call
_mon_putc iteratively. All four functions are defined as weak functions, and so may be
overridden by the user application if different functionality is desired. See the MPLAB
C32 C Compiler Libraries for detailed information on these functions.
An application using full mode must supply the standard low-level POSIX I/O functions
open, read, write, lseek and close. No default implementations are provided. See
the “MPLAB C32 C Compiler Libraries” (DS51685) for detailed information on these
functions.
The standard library provides a number of weak function implementations of low level
interfaces. User applications which use this functionality will often implement more full
featured versions of these functions. For details of the specific functions, see the
“MPLAB C32 C Compiler Libraries” (DS51685).
As described above, the standard I/O library functions utilize a set of weak functions for
simple output: _mon_write, _mon_putc, _mon_puts, and _mon_getc.
The standard startup code (See Section 5.7 “Startup and Initialization”) invokes a
number of weak functions directly and provides weak handlers for bootstrap exceptions
and general exceptions: _on_reset, _nmi_handler,
_bootstrap_exception_handler, _general_exception_handler, and
_on_bootstrap.
Chapter 2. Library Environment
MPLAB
®
C32 C COMPILER
USER’S GUIDE
DS51686A-page 43

Related parts for SW006015