Loading...
Searching...
No Matches
Atmel ATmega CPU: common files

AVR Atmega specific code More...

Detailed Description

AVR Atmega specific code

Pin Change Interrupts

Pin Change Interrupts (PCINTs) can be enabled using pseudo modules. To provide a low-memory overhead implementation, the PCINTs are grouped into banks. Each banks corresponds to one PCINT on the ATmega (PCINT0, ..., PCINT3).

To enable only a specific bank, simply add USEMODULE += atmega_pcintN to your Makefile. To enable all interrupts you can use USEMODULE += atmega_pcint.

In case you want to add a new CPU, simply provide an atmega_pcint.h with your CPU and adapt your Makefile.dep and Makefile.features files.

This is header file provides strings.h that is missing in AVR libc for compatibility.

Files

file  cpu_conf.h
 Implementation specific CPU configuration options.
 
file  atmega_gpio.h
 Macros and inline functions for accessing GPIOs of the ATmega family.
 
file  atmega_regs_common.h
 CMSIS style register definitions for the atmega family.
 
file  cpu_clock.h
 Common clock support for ATmega family based micro-controllers.
 
file  cpu_conf.h
 Implementation specific CPU configuration options.
 
file  gpio_ll_arch.h
 CPU specific part of the Peripheral GPIO Low-Level API.
 
file  periph_cpu_common.h
 CPU specific definitions for internal peripheral handling.
 
file  errno.h
 
file  inttypes.h
 Adds include for missing inttype definitions.
 
file  strings.h
 strings.h
 

Macros

#define PRIo64   "llo"
 Format string for octal 64-bit number.
 
#define PRIx64   "llx"
 Format string for hexadecimal 64-bit number.
 
#define PRIu64   "llu"
 Format string for unsigned 64-bit number.
 
#define PRId64   "lld"
 Format string for signed 64-bit number.
 

Functions

static void bzero (void *dest, size_t n_bytes)
 Same as memset(dest, 0, n_bytes), use memset() instead.
 
static int bcmp (const void *s1, const void *s2, size_t n)
 Same as memcmp(), use memcmp instead.
 
static void bcopy (const void *src, void *dest, size_t n)
 Same as memmove(), use memmove() or memcpy() instead.
 

Variables

int errno
 number of last error
 

Error numbers

#define E2BIG   (1)
 Argument list too long.
 
#define EACCES   (2)
 Permission denied.
 
#define EADDRINUSE   (3)
 Address in use.
 
#define EADDRNOTAVAIL   (4)
 Address not available.
 
#define EAFNOSUPPORT   (5)
 Address family not supported.
 
#define EAGAIN   (6)
 Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).
 
#define EALREADY   (7)
 Connection already in progress.
 
#define EBADF   (8)
 Bad file descriptor.
 
#define EBADMSG   (9)
 Bad message.
 
#define EBUSY   (10)
 Device or resource busy.
 
#define ECANCELED   (11)
 Operation canceled.
 
#define ECHILD   (12)
 No child processes.
 
#define ECONNABORTED   (13)
 Connection aborted.
 
#define ECONNREFUSED   (14)
 Connection refused.
 
#define ECONNRESET   (15)
 Connection reset.
 
#define EDEADLK   (16)
 Resource deadlock would occur.
 
#define EDESTADDRREQ   (17)
 Destination address required.
 
#define EMFILE   (18)
 File descriptor value too large.
 
#define EDQUOT   (19)
 Reserved.
 
#define EEXIST   (20)
 File exists.
 
#define EFAULT   (21)
 Bad address.
 
#define EFBIG   (22)
 File too large.
 
#define EHOSTUNREACH   (23)
 Host is unreachable.
 
#define EIDRM   (24)
 Identifier removed.
 
#define EILSEQ   (25)
 Illegal byte sequence.
 
#define EINPROGRESS   (26)
 Operation in progress.
 
#define EINTR   (27)
 Interrupted function.
 
#define EINVAL   (28)
 Invalid argument.
 
#define EIO   (29)
 I/O error.
 
#define EISCONN   (30)
 Socket is connected.
 
#define EISDIR   (31)
 Is a directory.
 
#define ELOOP   (32)
 Too many levels of symbolic links.
 
#define EDOM   (33)
 Mathematics argument out of domain of function.
 
#define ERANGE   (34)
 Result too large.
 
#define EMSGSIZE   (35)
 Message too large.
 
#define EMULTIHOP   (36)
 Reserved.
 
#define ENAMETOOLONG   (37)
 Filename too long.
 
#define ENETDOWN   (38)
 Network is down.
 
#define ENETRESET   (39)
 Connection aborted by network.
 
#define ENETUNREACH   (40)
 Network unreachable.
 
#define ENFILE   (41)
 Too many files open in system.
 
#define ENOBUFS   (42)
 No buffer space available.
 
#define ENODATA   (43)
 [OB XSR] [Option Start] No message is available on the STREAM head read queue.
 
#define ENODEV   (44)
 No such device.
 
#define ENOENT   (45)
 No such file or directory.
 
#define ENOEXEC   (46)
 Executable file format error.
 
#define ENOLCK   (47)
 No locks available.
 
#define ENOLINK   (48)
 Reserved.
 
#define ENOMEM   (49)
 Not enough space.
 
#define ENOMSG   (50)
 No message of the desired type.
 
#define ENOPROTOOPT   (51)
 Protocol not available.
 
#define ENOSPC   (52)
 No space left on device.
 
#define ENOSR   (53)
 [OB XSR] [Option Start] No STREAM resources.
 
#define ENOSTR   (54)
 [OB XSR] [Option Start] Not a STREAM.
 
#define ENOSYS   (55)
 Function not supported.
 
#define ENOTCONN   (56)
 The socket is not connected.
 
#define ENOTDIR   (57)
 Not a directory or a symbolic link to a directory.
 
#define ENOTEMPTY   (58)
 Directory not empty.
 
#define ENOTRECOVERABLE   (59)
 State not recoverable.
 
#define ENOTSOCK   (60)
 Not a socket.
 
#define ENOTSUP   (61)
 Not supported (may be the same value as [EOPNOTSUPP]).
 
#define ENOTTY   (62)
 Inappropriate I/O control operation.
 
#define ENXIO   (63)
 No such device or address.
 
#define EOPNOTSUPP   (64)
 Operation not supported on socket (may be the same value as [ENOTSUP]).
 
#define EOVERFLOW   (65)
 Value too large to be stored in data type.
 
#define EOWNERDEAD   (66)
 Previous owner died.
 
#define EPERM   (67)
 Operation not permitted.
 
#define EPIPE   (68)
 Broken pipe.
 
#define EPROTO   (69)
 Protocol error.
 
#define EPROTONOSUPPORT   (70)
 Protocol not supported.
 
#define EPROTOTYPE   (71)
 Protocol wrong type for socket.
 
#define EMLINK   (72)
 Too many links.
 
#define EROFS   (73)
 Read-only file system.
 
#define ESPIPE   (74)
 Invalid seek.
 
#define ESRCH   (75)
 No such process.
 
#define ESTALE   (76)
 Reserved.
 
#define ETIME   (77)
 [OB XSR] [Option Start] Stream ioctl() timeout.
 
#define ETIMEDOUT   (78)
 Connection timed out.
 
#define ETXTBSY   (79)
 Text file busy.
 
#define EWOULDBLOCK   (80)
 Operation would block (may be the same value as [EAGAIN]).
 
#define EXDEV   (81)
 Cross-device link.
 
#define EHOSTDOWN   (82)
 Host is down.
 
#define EPFNOSUPPORT   (83)
 Protocol family not supported.
 
#define ETOOMANYREFS   (84)
 Too many references: cannot splice.
 

Macro Definition Documentation

◆ E2BIG

#define E2BIG   (1)

Argument list too long.

Definition at line 70 of file errno.h.

◆ EACCES

#define EACCES   (2)

Permission denied.

Definition at line 71 of file errno.h.

◆ EADDRINUSE

#define EADDRINUSE   (3)

Address in use.

Definition at line 72 of file errno.h.

◆ EADDRNOTAVAIL

#define EADDRNOTAVAIL   (4)

Address not available.

Definition at line 73 of file errno.h.

◆ EAFNOSUPPORT

#define EAFNOSUPPORT   (5)

Address family not supported.

Definition at line 74 of file errno.h.

◆ EAGAIN

#define EAGAIN   (6)

Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).

Definition at line 75 of file errno.h.

◆ EALREADY

#define EALREADY   (7)

Connection already in progress.

Definition at line 76 of file errno.h.

◆ EBADF

#define EBADF   (8)

Bad file descriptor.

Definition at line 77 of file errno.h.

◆ EBADMSG

#define EBADMSG   (9)

Bad message.

Definition at line 78 of file errno.h.

◆ EBUSY

#define EBUSY   (10)

Device or resource busy.

Definition at line 79 of file errno.h.

◆ ECANCELED

#define ECANCELED   (11)

Operation canceled.

Definition at line 80 of file errno.h.

◆ ECHILD

#define ECHILD   (12)

No child processes.

Definition at line 81 of file errno.h.

◆ ECONNABORTED

#define ECONNABORTED   (13)

Connection aborted.

Definition at line 82 of file errno.h.

◆ ECONNREFUSED

#define ECONNREFUSED   (14)

Connection refused.

Definition at line 83 of file errno.h.

◆ ECONNRESET

#define ECONNRESET   (15)

Connection reset.

Definition at line 84 of file errno.h.

◆ EDEADLK

#define EDEADLK   (16)

Resource deadlock would occur.

Definition at line 85 of file errno.h.

◆ EDESTADDRREQ

#define EDESTADDRREQ   (17)

Destination address required.

Definition at line 86 of file errno.h.

◆ EDOM

#define EDOM   (33)

Mathematics argument out of domain of function.

Definition at line 102 of file errno.h.

◆ EDQUOT

#define EDQUOT   (19)

Reserved.

Definition at line 88 of file errno.h.

◆ EEXIST

#define EEXIST   (20)

File exists.

Definition at line 89 of file errno.h.

◆ EFAULT

#define EFAULT   (21)

Bad address.

Definition at line 90 of file errno.h.

◆ EFBIG

#define EFBIG   (22)

File too large.

Definition at line 91 of file errno.h.

◆ EHOSTDOWN

#define EHOSTDOWN   (82)

Host is down.

Definition at line 151 of file errno.h.

◆ EHOSTUNREACH

#define EHOSTUNREACH   (23)

Host is unreachable.

Definition at line 92 of file errno.h.

◆ EIDRM

#define EIDRM   (24)

Identifier removed.

Definition at line 93 of file errno.h.

◆ EILSEQ

#define EILSEQ   (25)

Illegal byte sequence.

Definition at line 94 of file errno.h.

◆ EINPROGRESS

#define EINPROGRESS   (26)

Operation in progress.

Definition at line 95 of file errno.h.

◆ EINTR

#define EINTR   (27)

Interrupted function.

Definition at line 96 of file errno.h.

◆ EINVAL

#define EINVAL   (28)

Invalid argument.

Definition at line 97 of file errno.h.

◆ EIO

#define EIO   (29)

I/O error.

Definition at line 98 of file errno.h.

◆ EISCONN

#define EISCONN   (30)

Socket is connected.

Definition at line 99 of file errno.h.

◆ EISDIR

#define EISDIR   (31)

Is a directory.

Definition at line 100 of file errno.h.

◆ ELOOP

#define ELOOP   (32)

Too many levels of symbolic links.

Definition at line 101 of file errno.h.

◆ EMFILE

#define EMFILE   (18)

File descriptor value too large.

Definition at line 87 of file errno.h.

◆ EMLINK

#define EMLINK   (72)

Too many links.

Definition at line 141 of file errno.h.

◆ EMSGSIZE

#define EMSGSIZE   (35)

Message too large.

Definition at line 104 of file errno.h.

◆ EMULTIHOP

#define EMULTIHOP   (36)

Reserved.

Definition at line 105 of file errno.h.

◆ ENAMETOOLONG

#define ENAMETOOLONG   (37)

Filename too long.

Definition at line 106 of file errno.h.

◆ ENETDOWN

#define ENETDOWN   (38)

Network is down.

Definition at line 107 of file errno.h.

◆ ENETRESET

#define ENETRESET   (39)

Connection aborted by network.

Definition at line 108 of file errno.h.

◆ ENETUNREACH

#define ENETUNREACH   (40)

Network unreachable.

Definition at line 109 of file errno.h.

◆ ENFILE

#define ENFILE   (41)

Too many files open in system.

Definition at line 110 of file errno.h.

◆ ENOBUFS

#define ENOBUFS   (42)

No buffer space available.

Definition at line 111 of file errno.h.

◆ ENODATA

#define ENODATA   (43)

[OB XSR] [Option Start] No message is available on the STREAM head read queue.

[Option End]

Definition at line 112 of file errno.h.

◆ ENODEV

#define ENODEV   (44)

No such device.

Definition at line 113 of file errno.h.

◆ ENOENT

#define ENOENT   (45)

No such file or directory.

Definition at line 114 of file errno.h.

◆ ENOEXEC

#define ENOEXEC   (46)

Executable file format error.

Definition at line 115 of file errno.h.

◆ ENOLCK

#define ENOLCK   (47)

No locks available.

Definition at line 116 of file errno.h.

◆ ENOLINK

#define ENOLINK   (48)

Reserved.

Definition at line 117 of file errno.h.

◆ ENOMEM

#define ENOMEM   (49)

Not enough space.

Definition at line 118 of file errno.h.

◆ ENOMSG

#define ENOMSG   (50)

No message of the desired type.

Definition at line 119 of file errno.h.

◆ ENOPROTOOPT

#define ENOPROTOOPT   (51)

Protocol not available.

Definition at line 120 of file errno.h.

◆ ENOSPC

#define ENOSPC   (52)

No space left on device.

Definition at line 121 of file errno.h.

◆ ENOSR

#define ENOSR   (53)

[OB XSR] [Option Start] No STREAM resources.

[Option End]

Definition at line 122 of file errno.h.

◆ ENOSTR

#define ENOSTR   (54)

[OB XSR] [Option Start] Not a STREAM.

[Option End]

Definition at line 123 of file errno.h.

◆ ENOSYS

#define ENOSYS   (55)

Function not supported.

Definition at line 124 of file errno.h.

◆ ENOTCONN

#define ENOTCONN   (56)

The socket is not connected.

Definition at line 125 of file errno.h.

◆ ENOTDIR

#define ENOTDIR   (57)

Not a directory or a symbolic link to a directory.

Definition at line 126 of file errno.h.

◆ ENOTEMPTY

#define ENOTEMPTY   (58)

Directory not empty.

Definition at line 127 of file errno.h.

◆ ENOTRECOVERABLE

#define ENOTRECOVERABLE   (59)

State not recoverable.

Definition at line 128 of file errno.h.

◆ ENOTSOCK

#define ENOTSOCK   (60)

Not a socket.

Definition at line 129 of file errno.h.

◆ ENOTSUP

#define ENOTSUP   (61)

Not supported (may be the same value as [EOPNOTSUPP]).

Definition at line 130 of file errno.h.

◆ ENOTTY

#define ENOTTY   (62)

Inappropriate I/O control operation.

Definition at line 131 of file errno.h.

◆ ENXIO

#define ENXIO   (63)

No such device or address.

Definition at line 132 of file errno.h.

◆ EOPNOTSUPP

#define EOPNOTSUPP   (64)

Operation not supported on socket (may be the same value as [ENOTSUP]).

Definition at line 133 of file errno.h.

◆ EOVERFLOW

#define EOVERFLOW   (65)

Value too large to be stored in data type.

Definition at line 134 of file errno.h.

◆ EOWNERDEAD

#define EOWNERDEAD   (66)

Previous owner died.

Definition at line 135 of file errno.h.

◆ EPERM

#define EPERM   (67)

Operation not permitted.

Definition at line 136 of file errno.h.

◆ EPFNOSUPPORT

#define EPFNOSUPPORT   (83)

Protocol family not supported.

Definition at line 152 of file errno.h.

◆ EPIPE

#define EPIPE   (68)

Broken pipe.

Definition at line 137 of file errno.h.

◆ EPROTO

#define EPROTO   (69)

Protocol error.

Definition at line 138 of file errno.h.

◆ EPROTONOSUPPORT

#define EPROTONOSUPPORT   (70)

Protocol not supported.

Definition at line 139 of file errno.h.

◆ EPROTOTYPE

#define EPROTOTYPE   (71)

Protocol wrong type for socket.

Definition at line 140 of file errno.h.

◆ ERANGE

#define ERANGE   (34)

Result too large.

Definition at line 103 of file errno.h.

◆ EROFS

#define EROFS   (73)

Read-only file system.

Definition at line 142 of file errno.h.

◆ ESPIPE

#define ESPIPE   (74)

Invalid seek.

Definition at line 143 of file errno.h.

◆ ESRCH

#define ESRCH   (75)

No such process.

Definition at line 144 of file errno.h.

◆ ESTALE

#define ESTALE   (76)

Reserved.

Definition at line 145 of file errno.h.

◆ ETIME

#define ETIME   (77)

[OB XSR] [Option Start] Stream ioctl() timeout.

[Option End]

Definition at line 146 of file errno.h.

◆ ETIMEDOUT

#define ETIMEDOUT   (78)

Connection timed out.

Definition at line 147 of file errno.h.

◆ ETOOMANYREFS

#define ETOOMANYREFS   (84)

Too many references: cannot splice.

Definition at line 153 of file errno.h.

◆ ETXTBSY

#define ETXTBSY   (79)

Text file busy.

Definition at line 148 of file errno.h.

◆ EWOULDBLOCK

#define EWOULDBLOCK   (80)

Operation would block (may be the same value as [EAGAIN]).

Definition at line 149 of file errno.h.

◆ EXDEV

#define EXDEV   (81)

Cross-device link.

Definition at line 150 of file errno.h.

◆ PRId64

#define PRId64   "lld"

Format string for signed 64-bit number.

Definition at line 30 of file inttypes.h.

◆ PRIo64

#define PRIo64   "llo"

Format string for octal 64-bit number.

Definition at line 27 of file inttypes.h.

◆ PRIu64

#define PRIu64   "llu"

Format string for unsigned 64-bit number.

Definition at line 29 of file inttypes.h.

◆ PRIx64

#define PRIx64   "llx"

Format string for hexadecimal 64-bit number.

Definition at line 28 of file inttypes.h.

Function Documentation

◆ bcmp()

static int bcmp ( const void * s1,
const void * s2,
size_t n )
inlinestatic

Same as memcmp(), use memcmp instead.

Parameters
[in]s1first memory chunk to compare
[in]s2second memory chunk to compare
[in]nnumber of bytes to compare
Return values
`0`The first n bytes of s1 and s2 are equal
`!=0`The first n bytes of s1 and s2 differ in at least one bit

Definition at line 54 of file strings.h.

◆ bcopy()

static void bcopy ( const void * src,
void * dest,
size_t n )
inlinestatic

Same as memmove(), use memmove() or memcpy() instead.

Parameters
[in]srcmemory to copy from
[out]destmemory to copy to
[in]nnumber of bytes to copy

src and dest may overlap

Note
It is preferred to use the standardize function memcpy() for non-overlapping memory regions and memmove() for overlapping memory regions instead of this obsolete function.

Definition at line 72 of file strings.h.

◆ bzero()

static void bzero ( void * dest,
size_t n_bytes )
inlinestatic

Same as memset(dest, 0, n_bytes), use memset() instead.

Parameters
[in,out]destMemory to clear
[in]n_bytesSize of memory to clear in bytes

Definition at line 38 of file strings.h.