SW006013 Microchip Technology, SW006013 Datasheet - Page 48
![MPLAB C Compiler For DsPIC DSCs](/photos/9/32/93254/sw006013_sml.jpg)
SW006013
Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet
1.SW006014.pdf
(246 pages)
Specifications of SW006013
Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
- Current page: 48 of 246
- Download datasheet (3Mb)
DS51456E-page 44
Mixing modules compiled with these options may result in a larger executable size, or
incorrect execution if large and small double-sized data is shared across modules.
2.13.2
The standard I/O relies on helper functions described in Chapter 4. “Standard C
Libraries - Support Functions”. These functions include
and
with standard I/O
customize as you wish.
The simplest way to redirect standard I/O to the pheripheral of your choice is to select
one of the default handles already in use. Also, you could open files with a specific
name, via
read()
If only a specific peripheral is required, then you could associate handle
or
interested peripheral.
A complete generic solution might be:
/* should be in a header file */
enum my_handles {
};
int __attribute__((__weak__, __section__(".libc"))) open(const char
*name, int access, int mode) {
}
Single letters were used in this example because they are faster to check and use less
memory. However, if memory is not an issue, you could use
names.
In
write(int handle, void *buffer, unsigned int len) {
•
2 == stderr
write()
-fno-short-double
routines that support
close()
handle_stdin,
handle_stdout,
handle_stderr,
handle_can1,
handle_can2,
handle_spi1,
handle_spi2,
}
switch (name[0]) {
int i;
volatile UxMODEBITS *umode = &U1MODEbits;
volatile UxSTABITS *ustatus = &U1STAbits;
volatile unsigned int *txreg = &U1TXREG;
volatile unsigned int *brg = &U1BRG;
switch (handle)
or
case 'i' : return handle_stdin;
case 'o' : return handle_stdout;
case 'e' : return handle_stderr;
case 'c' : return handle_can1;
case 'C' : return handle_can2;
case 's' : return handle_spi1;
case 'S' : return handle_spi2;
default: return handle_stderr;
fopen()
Customizing STDIO
write()
, you would write:
which are called to read, write, open or close handles that are associated
, to another peripheral by writing the correct code to talk to the
FILE
, by rewriting
, as appropriate.
pointers. The sources for these libraries are provided for you to
will cause the compiler to generate calls to formatted I/O
double
open()
as if it were a
to return a new handle to be recognized by
long double
© 2008 Microchip Technology Inc.
read()
strcmp
type.
,
write()
to compare full
1 == stdout
,
open()
,
,
Related parts for SW006013
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![TC1014-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1014-5.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.8VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-4.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1186-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1186-2.85VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet: