Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mmio.c File Reference
#include <zephyr/ztest.h>
#include <zephyr/device.h>

Data Structures

struct  foo_single_dev_data
 
struct  foo_single_config_info
 
struct  foo_mult_dev_data
 
struct  foo_mult_config_info
 

Macros

#define DT_DRV_COMPAT   fakedriver
 
#define DEV_DATA(dev)   ((struct foo_mult_dev_data *)((dev)->data))
 
#define DEV_CFG(dev)   ((struct foo_mult_config_info *)((dev)->config))
 

Functions

int foo_single_init (const struct device *dev)
 
 ZTEST (device, test_mmio_single)
 Test DEVICE_MMIO_* macros.
 
int foo_mult_init (const struct device *dev)
 
 ZTEST (device, test_mmio_multiple)
 Test DEVICE_MMIO_NAMED_* macros.
 
 DEVICE_MMIO_TOPLEVEL (foo3, DT_DRV_INST(3))
 
 DEVICE_MMIO_TOPLEVEL_STATIC (foo4, DT_DRV_INST(4))
 
 ZTEST (device, test_mmio_toplevel)
 Test DEVICE_MMIO_TOPLEVEL_* macros.
 
 ZTEST (device, test_mmio_device_map)
 device_map() test
 

Variables

struct foo_single_dev_data foo0_data
 
const struct foo_single_config_info foo0_config
 
struct foo_mult_dev_data foo12_data
 
const struct foo_mult_config_info foo12_config
 

Macro Definition Documentation

◆ DEV_CFG

#define DEV_CFG (   dev)    ((struct foo_mult_config_info *)((dev)->config))

◆ DEV_DATA

#define DEV_DATA (   dev)    ((struct foo_mult_dev_data *)((dev)->data))

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   fakedriver

Function Documentation

◆ DEVICE_MMIO_TOPLEVEL()

DEVICE_MMIO_TOPLEVEL ( foo3  ,
DT_DRV_INST(3)   
)

◆ DEVICE_MMIO_TOPLEVEL_STATIC()

DEVICE_MMIO_TOPLEVEL_STATIC ( foo4  ,
DT_DRV_INST(4)   
)

◆ foo_mult_init()

int foo_mult_init ( const struct device dev)

◆ foo_single_init()

int foo_single_init ( const struct device dev)

◆ ZTEST()

ZTEST ( device  ,
test_mmio_device_map   
)

device_map() test

Show that device_map() populates a memory address. We don't do anything else; tests for k_map() will prove that virtual memory mapping actually works.

Variable Documentation

◆ foo0_config

const struct foo_single_config_info foo0_config
Initial value:
= {
}
#define DEVICE_MMIO_ROM_INIT(node_id)
Initialize a DEVICE_MMIO_ROM member.
Definition device_mmio.h:266
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:3604

◆ foo0_data

struct foo_single_dev_data foo0_data

◆ foo12_config

const struct foo_mult_config_info foo12_config
Initial value:
= {
}
#define DEVICE_MMIO_NAMED_ROM_INIT(name, node_id)
Initialize a named DEVICE_MMIO_NAMED_ROM member.
Definition device_mmio.h:463

◆ foo12_data

struct foo_mult_dev_data foo12_data