I/O Memory Access

Kernel-space I/O memory access declarations.

Cuddl kernel drivers may use this API to read from (or write to) a peripheral’s hardware registers in a platform-independent manner.

This part of the API is only applicable to kernel-space code.

type cuddlk_iomem_t

I/O memory accessor for kernel space.

Description

Type used to access kernel-space memory-mapped I/O regions.

Under Linux and Xenomai, this type is equivalent to void __iomem. Under RTEMS, this type is a raw pointer.

Pointers of type cuddlk_iomem_t * can be used with cuddlk_ioread32(), cuddlk_iowrite16(), etc.

uint8_t cuddlk_ioread8(cuddlk_iomem_t *addr)

Read an 8-bit value from device I/O memory.

Parameters

cuddlk_iomem_t *addr

I/O memory address for reading.

Return

Value that results from reading the specified memory address.

uint16_t cuddlk_ioread16(cuddlk_iomem_t *addr)

Read a 16-bit value from device I/O memory.

Parameters

cuddlk_iomem_t *addr

I/O memory address for reading.

Return

Value that results from reading the specified memory address.

uint32_t cuddlk_ioread32(cuddlk_iomem_t *addr)

Read a 32-bit value from device I/O memory.

Parameters

cuddlk_iomem_t *addr

I/O memory address for reading.

Return

Value that results from reading the specified memory address.

void cuddlk_iowrite8(uint8_t value, cuddlk_iomem_t *addr)

Write an 8-bit value to device I/O memory.

Parameters

uint8_t value

Value to be written.

cuddlk_iomem_t *addr

I/O memory address for writing.

void cuddlk_iowrite16(uint16_t value, cuddlk_iomem_t *addr)

Write a 16-bit value to device I/O memory.

Parameters

uint16_t value

Value to be written.

cuddlk_iomem_t *addr

I/O memory address for writing.

void cuddlk_iowrite32(uint32_t value, cuddlk_iomem_t *addr)

Write a 32-bit value to device I/O memory.

Parameters

uint32_t value

Value to be written.

cuddlk_iomem_t *addr

I/O memory address for writing.