icc.h File Reference

Go to the source code of this file.

Defines

#define printf   printf_M
 Specify enhanced AVR target.
#define puts   puts_M
#define sprintf   sprintf_M
#define vprintf   vprintf_M
#define scanf   scanf_M
#define gets   gets_M
#define malloc   malloc_M
#define realloc   realloc_M
#define free   free_M
#define cprintf   printf_P
 Redirected stdio routines.
#define csprintf   sprintf_P
#define cscanf   scanf_P
#define csscanf   sscanf_P
#define memcpy_P(dst, src_P, n)   cmemcpy(dst, src_P, n)
#define strcat_P(s1, s2_P)   cstrcat(s1, s2_P)
#define strcmp_P(s1_P, s2)   cstrcmp(s2, s1_P)
#define strlen_P(s_P)   cstrlen(s_P)
#define strncat_P(s1, s2_P, n)   cstrncat(s1, s2_P, n)
#define strncmp_P(s1_P, s2, n)   cstrncmp(s1_P, s2, n)
#define strcpy_P(dst, src_P)   cstrcpy(dst, src_P)
#define strncpy_P(x, y, z)   cstrncpy(x,y,z)
#define strcasecmp(s1, s2)   strcmp(s1, s2)
 Case insensitive string comparisions.
#define strncasecmp(s1, s2, n)   strncmp(s1, s2, n)
#define __heap_start   _bss_end
 Start of heap area.
#define __attribute__(x)
 Object attribute support.
#define PSTR(p)   (p)
 Declare static pointer to strings in program space.
#define PRG_RDB(p)   (*((const char *)(p)))
 Read byte from program space.
#define prog_char   const char
 Character in program space.
#define prog_int   const int
 Integer in program space.
#define PGM_P   prog_char *
 Pointer to character in program space.
#define wdt_enable(tmo)
#define wdt_disable()
#define wdt_reset()
#define __SFR_OFFSET   0
#define SFR_IO_ADDR(sfr)   ((sfr) - __SFR_OFFSET)
#define SFR_MEM_ADDR(sfr)   (sfr)
#define SFR_IO_REG_P(sfr)   ((sfr) < 0x40 + __SFR_OFFSET)
#define _SFR_MEM8(addr)   (addr)
#define _SFR_MEM16(addr)   (addr)
#define BV(x)   BIT(x)
#define _BV(x)   BIT(x)
#define cli()   CLI()
#define sei()   SEI()
#define cbi(reg, bit)   (reg &= ~BIT(bit))
#define sbi(reg, bit)   (reg |= BIT(bit))
#define loop_until_bit_is_set(reg, bit)   while((reg & BIT(bit)) == 0)
#define bit_is_clear(reg, bit)   ((reg & BIT(bit)) == 0)
#define bit_is_set(reg, bit)   ((reg & BIT(bit)) != 0)
#define parity_even_bit(x)   (0)
#define SIGNAL(x)   void x(void)
#define outp(val, reg)   (reg = val)
#define outb(reg, val)   (reg = val)
#define inp(reg)   (reg)
#define inb(reg)   (reg)
#define __AVR_ATmega103__
#define DOR   OVR
#define RAMEND   0x0FFF
#define WDCE   WDTOE
#define eeprom_read_block(dst, addr, size)   EEPROMReadBytes((int)addr, dst, size)
#define eeprom_write_byte(addr, src)   EEPROMwrite((int)addr, src)
#define eeprom_read_byte(addr)   EEPROMread((int)addr)


Define Documentation

#define printf   printf_M

Specify enhanced AVR target.

For backward compatibility this macro is automatically defined if _MCU_enhanced is defined.

Disable const keyword.

ICCAVR doesn't allow to mark function parameters unmodifable by the 'const' modifier. Even worse, the compiler redefines the meaning as a program memory attribute.

Disable inline keyword.

ICCAVR doesn't allow to explicitly mark a function for inline code generation.

Redefined standard library routines.

ImageCraft has a multipass linker, which is fine for complicated dependencies in most cases. However, there is the potential risk, that standard library calls with the same name are linked from the wrong library. To avoid this, an additional postfix is added to routines, which are implemented in Nut/OS libraries.

Examples:
caltime/caltime.c, canbus/candemo.c, ftpd/ftpserv.c, httpd/httpserv.c, inetq/inetq.c, logtime/logtime.c, nutpiper/nutpiper.c, playmp3/playmp3.c, pppc/pppc.c, tcps/tcps.c, and timers/timers.c.

Definition at line 133 of file icc.h.

Referenced by FtpService(), InitEthernetDevice(), main(), MmCardMount(), NutFtpProcessPwd(), NutFtpProcessRequest(), NutFtpProcessSystem(), NutFtpRespondBad(), NutFtpRespondOk(), NutFtpSendMode(), NutFtpServerSession(), PhatVolMount(), Scanner(), ScanStreamHeader(), Service(), Sleeper1(), Sleeper2(), Sleeper3(), Sleeper4(), TimerEvent1(), TimerEvent2(), TimerEvent3(), TimerEvent4(), X12Init(), X12RtcReadRegs(), and X12RtcWrite().

#define puts   puts_M

Examples:
caltime/caltime.c, canbus/candemo.c, events/events.c, ftpd/ftpserv.c, httpd/httpserv.c, inetq/inetq.c, logtime/logtime.c, nutpiper/nutpiper.c, playmp3/playmp3.c, pppc/pppc.c, tcps/tcps.c, threads/threads.c, and timers/timers.c.

Definition at line 134 of file icc.h.

Referenced by FtpService(), High(), InitEthernetDevice(), Low(), main(), ScanStreamHeader(), and Sleeper1().

#define sprintf   sprintf_M

Definition at line 135 of file icc.h.

Referenced by DisplayEntry(), DisplayStatus(), NutFtpTransferDirectory(), Rfc1123TimeString(), ScanStreamHeader(), vsyslog(), and vsyslog_P().

#define vprintf   vprintf_M

Definition at line 136 of file icc.h.

#define scanf   scanf_M

Examples:
caltime/caltime.c.

Definition at line 137 of file icc.h.

#define gets   gets_M

Definition at line 138 of file icc.h.

#define malloc   malloc_M

Examples:
pppc/pppc.c, and rs232d/rs232d.c.

Definition at line 139 of file icc.h.

Referenced by _fdopen(), _putf(), AsnOidBuild(), At45dbPageWrite(), At45dbParamRead(), At45dbParamWrite(), At49bvParamWrite(), At91EfcParamWrite(), basename(), calloc(), ConfigLoad(), ConfigStation(), CreateFullPathName(), dirname(), DiscoveryResponder(), DisplayInit(), DS1307RamWrite(), findenv(), fopen(), freopen(), GetParentPath(), GpioRegisterIrqHandler(), NutChat(), NutChat_P(), NutChatCreate(), NutChatSend(), NutDhcpClient(), NutFtpOpenSession(), NutFtpProcessCwd(), NutFtpServerSession(), NutFtpTransferDirectory(), NutFtpTransferFile(), NutHttpProcessPostQuery(), NutHttpURLEncode(), NutRegisterFtpRoot(), NutRegisterFtpUser(), opendir(), openlog(), PhatDirCreate(), PhatDirDelEntry(), PhatDirEntryFind(), PhatDirEntryStatus(), PhatDirOpen(), PhatDirRead(), PhatDirRemove(), PhatDirRenameEntry(), PhatFileOpen(), PhatVolMount(), ProcessRequests(), putenv(), ScanStreamHeader(), setenv(), SnmpAgent(), SnmpCommunityCreate(), SnmpMibFind(), SnmpMibRegister(), SnmpViewCreate(), strdup(), StreamCopy(), TermInit(), TermOpen(), time(), Tlv320DacWrite(), UsartOpen(), UxmlNodeAddAttrib(), UxmlNodeCreate(), UxmlParseStream(), and X12EepromWrite().

#define realloc   realloc_M

Definition at line 140 of file icc.h.

#define free   free_M

Examples:
rs232d/rs232d.c.

Definition at line 141 of file icc.h.

Referenced by _putf(), AsnOidBuild(), At45dbPageWrite(), At45dbParamRead(), At45dbParamWrite(), At49bvParamWrite(), At91EfcParamWrite(), closedir(), closelog(), ConfigLoad(), ConfigStation(), DS1307RamWrite(), fclose(), findenv(), fopen(), freopen(), NutChat(), NutChat_P(), NutChatDestroy(), NutDhcpClient(), NutFtpCloseSession(), NutFtpOpenSession(), NutFtpProcessCwd(), NutFtpProcessRequest(), NutFtpServerSession(), NutFtpTransferDirectory(), NutFtpTransferFile(), NutHttpProcessPostQuery(), NutRegisterFtpRoot(), NutRegisterFtpUser(), opendir(), PhatDirCreate(), PhatDirDelEntry(), PhatDirEntryFind(), PhatDirEntryStatus(), PhatDirOpen(), PhatDirOpenParent(), PhatDirRead(), PhatDirRemove(), PhatDirRenameEntry(), PhatFileClose(), PhatFileOpen(), PhatVolMount(), PhatVolUnmount(), putenv(), Scanner(), ScanStreamHeader(), setenv(), SnmpAgent(), SnmpMibFind(), StreamCopy(), TermClose(), time(), Tlv320DacWrite(), unsetenv(), UsartClose(), UsartOpen(), UxmlParseStream(), and X12EepromWrite().

#define cprintf   printf_P

Redirected stdio routines.

Native stdio routines with format strings in program space are redirected to their Nut/OS implementation.

Definition at line 149 of file icc.h.

#define csprintf   sprintf_P

Definition at line 150 of file icc.h.

#define cscanf   scanf_P

Definition at line 151 of file icc.h.

#define csscanf   sscanf_P

Definition at line 152 of file icc.h.

#define memcpy_P ( dst,
src_P,
 )     cmemcpy(dst, src_P, n)

Definition at line 154 of file icc.h.

#define strcat_P ( s1,
s2_P   )     cstrcat(s1, s2_P)

Definition at line 155 of file icc.h.

#define strcmp_P ( s1_P,
s2   )     cstrcmp(s2, s1_P)

Definition at line 156 of file icc.h.

#define strlen_P ( s_P   )     cstrlen(s_P)

Definition at line 157 of file icc.h.

#define strncat_P ( s1,
s2_P,
 )     cstrncat(s1, s2_P, n)

Definition at line 158 of file icc.h.

#define strncmp_P ( s1_P,
s2,
 )     cstrncmp(s1_P, s2, n)

Definition at line 159 of file icc.h.

#define strcpy_P ( dst,
src_P   )     cstrcpy(dst, src_P)

Definition at line 160 of file icc.h.

#define strncpy_P ( x,
y,
 )     cstrncpy(x,y,z)

Definition at line 161 of file icc.h.

#define strcasecmp ( s1,
s2   )     strcmp(s1, s2)

Case insensitive string comparisions.

Not supported by ICCAVR and temporarly redirected to the case sensitive routines.

Bug:
Case insensitive string comparisions fail with ICCAVR.

Definition at line 171 of file icc.h.

#define strncasecmp ( s1,
s2,
 )     strncmp(s1, s2, n)

Definition at line 172 of file icc.h.

#define __heap_start   _bss_end

Start of heap area.

Definition at line 178 of file icc.h.

#define __attribute__ (  ) 

Object attribute support.

Not supported by ICCAVR.

Definition at line 185 of file icc.h.

#define PSTR (  )     (p)

Declare static pointer to strings in program space.

No chance with ICCAVR.

Definition at line 192 of file icc.h.

#define PRG_RDB (  )     (*((const char *)(p)))

Read byte from program space.

Definition at line 197 of file icc.h.

#define prog_char   const char

Character in program space.

Definition at line 202 of file icc.h.

#define prog_int   const int

Integer in program space.

Definition at line 207 of file icc.h.

#define PGM_P   prog_char *

Pointer to character in program space.

Definition at line 212 of file icc.h.

#define wdt_enable ( tmo   ) 

Value:

{ \
    register unsigned char s = _BV(WDCE) | _BV(WDE); \
    register unsigned char r = tmo | _BV(WDE); \
    asm("in R0, 0x3F\n"     \
        "cli\n"             \
        "wdr\n"             \
        "out 0x21, %s\n"    \
        "out 0x21, %r\n"    \
        "out 0x3F, R0\n");  \
}

Definition at line 219 of file icc.h.

Referenced by AvrWatchDogEnable(), and AvrWatchDogStart().

 
#define wdt_disable (  ) 

Value:

{ \
    register unsigned char s = _BV(WDCE) | _BV(WDE); \
    register unsigned char r = 0;  \
    asm("in R0, $3F\n"      \
        "cli\n"             \
        "out 0x21, %s\n"    \
        "out 0x21, %r\n"    \
        "out 0x3F, R0\n");  \
}

Definition at line 231 of file icc.h.

Referenced by AvrWatchDogDisable().

 
#define wdt_reset (  ) 

Value:

{ \
    _WDR(); \
}

Definition at line 242 of file icc.h.

Referenced by AvrWatchDogRestart(), and AvrWatchDogStart().

#define __SFR_OFFSET   0

Definition at line 248 of file icc.h.

#define SFR_IO_ADDR ( sfr   )     ((sfr) - __SFR_OFFSET)

Definition at line 249 of file icc.h.

#define SFR_MEM_ADDR ( sfr   )     (sfr)

Definition at line 250 of file icc.h.

#define SFR_IO_REG_P ( sfr   )     ((sfr) < 0x40 + __SFR_OFFSET)

Definition at line 251 of file icc.h.

#define _SFR_MEM8 ( addr   )     (addr)

Definition at line 253 of file icc.h.

#define _SFR_MEM16 ( addr   )     (addr)

Definition at line 254 of file icc.h.

#define BV (  )     BIT(x)

Definition at line 256 of file icc.h.

Referenced by CFChange(), IDEInit(), NutInit(), SpiFlashEnable(), VsPlayerInit(), and VsPlayerReset().

#define _BV (  )     BIT(x)

Definition at line 257 of file icc.h.

 
#define cli (  )     CLI()

Definition at line 259 of file icc.h.

Referenced by CSEndFrame(), CSRead16(), CSReadPP16(), CSReadPP32(), CSWrite16(), and CSWritePP16().

 
#define sei (  )     SEI()

Definition at line 260 of file icc.h.

Referenced by CSEndFrame(), CSRead16(), CSReadPP32(), and CSWrite16().

#define cbi ( reg,
bit   )     (reg &= ~BIT(bit))

Definition at line 261 of file icc.h.

Referenced by ADCSetMode(), ADCSetPrescale(), ADCSetRef(), ADCStopConversion(), AhdlcAvrInit(), AhdlcAvrOpen(), GpioPinConfigSet(), GpioPinSetLow(), LancInit(), NicInit(), NicRx(), NutIdle(), NutIrInitSony(), SIG_INTERRUPT4(), SIG_OVERFLOW2(), SJAInit(), SpiDigitalGet(), SpiDigitalInit(), SpiDigitalSet(), SpiFlashEnable(), Sppi0Enable(), TwIOCtl(), VsPlayerInit(), and VsPlayerReset().

#define sbi ( reg,
bit   )     (reg |= BIT(bit))

Definition at line 262 of file icc.h.

Referenced by AceInit(), ADCInit(), ADCSetMode(), ADCSetPrescale(), ADCSetRef(), ADCStartConversion(), ADCStartLowNoiseConversion(), ADCStopConversion(), AhdlcAvrClose(), AhdlcAvrInit(), AhdlcAvrPut(), GpioPinConfigSet(), GpioPinSetHigh(), IDEInit(), NicInit(), NicRx(), NicRxLanc(), NutIdle(), NutIrInitSony(), NutRegisterTimer(), SIG_INTERRUPT4(), SJAInit(), SpiDigitalGet(), SpiDigitalInit(), SpiDigitalSet(), SpiFlashEnable(), Sppi0Enable(), TwIOCtl(), VsPlayerInit(), VsPlayerReset(), and wlandrv_Init().

#define loop_until_bit_is_set ( reg,
bit   )     while((reg & BIT(bit)) == 0)

Definition at line 265 of file icc.h.

Referenced by AtCanInit(), and Sppi0Byte().

#define bit_is_clear ( reg,
bit   )     ((reg & BIT(bit)) == 0)

Definition at line 267 of file icc.h.

Referenced by Sppi0Enable(), and VsPlayerReset().

#define bit_is_set ( reg,
bit   )     ((reg & BIT(bit)) != 0)

Definition at line 268 of file icc.h.

Referenced by AtCanGetFreeMob(), GpioPinGet(), NutIdle(), SpiDigitalGet(), TwIOCtl(), and UartAvrIOCtl().

#define parity_even_bit (  )     (0)

Definition at line 271 of file icc.h.

#define SIGNAL (  )     void x(void)

Definition at line 274 of file icc.h.

#define outp ( val,
reg   )     (reg = val)

Definition at line 276 of file icc.h.

Referenced by AhdlcAvrIOCtl(), CSNicInit(), NutInit(), SpiFlashEnable(), and UartAvrOutput().

#define outb ( reg,
val   )     (reg = val)

Definition at line 277 of file icc.h.

#define inp ( reg   )     (reg)

Definition at line 279 of file icc.h.

Referenced by AhdlcAvrIOCtl(), CSNicInit(), and VsPlayerInit().

#define inb ( reg   )     (reg)

Definition at line 280 of file icc.h.

#define __AVR_ATmega103__

Definition at line 362 of file icc.h.

#define DOR   OVR

Definition at line 365 of file icc.h.

#define RAMEND   0x0FFF

Definition at line 369 of file icc.h.

#define WDCE   WDTOE

Definition at line 373 of file icc.h.

#define eeprom_read_block ( dst,
addr,
size   )     EEPROMReadBytes((int)addr, dst, size)

Definition at line 378 of file icc.h.

Referenced by OnChipNvMemLoad().

#define eeprom_write_byte ( addr,
src   )     EEPROMwrite((int)addr, src)

Definition at line 379 of file icc.h.

Referenced by OnChipNvMemSave().

#define eeprom_read_byte ( addr   )     EEPROMread((int)addr)

Definition at line 380 of file icc.h.

Referenced by OnChipNvMemSave().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/