
Arcom Embedded Linux Technical Manual Developing software for AEL
The following table explains the functions provided by libdevmem (which are also
described in /opt/arcom/SYSTEM-TYPE/include/libdevmem.h):
Function Description
libdevmem_open
Maps a physical address into the current virtual address
space, returning a libdevmem_handle that serves as a
handle onto the mapping.
Takes the physical address to map and the length of the
region to map and returns.
Returns NULL on error and sets errno accordingly.
libdevmem_close
Unmaps an existing mapping.
Takes a handle as returned by libdevmem_close.
Returns 0 on success, –1 on error, and sets errno
accordingly.
libdevmem_read_TYPE
Reads a value from an offset within a mapping.
Takes a handle and an offset and returns a TYPE_t that is
the value that was read. TYPE may be one of uint8, uint16 or
uint32.
libdevmem_write_TYPE
Writes a value to an offset within a mapping.
Takes a handle, an offset and a TYPE_t that is the value to
write. TYPE may be one of uint8, uint16 or uint32.
An application that wishes to use libdevmem must include the libdevmem.h. It must also
include libdevmem when linking:
$ arm-linux-gcc –o application application.o -ldevmem
The library is currently available only as a static library.
© 2006 Arcom Issue G 48
Comentarios a estos manuales