Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
mmio.c File Reference
#include <ztest.h>
#include <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)
 
void test_mmio_single (void)
 Test DEVICE_MMIO_* macros. More...
 
int foo_mult_init (const struct device *dev)
 
void test_mmio_multiple (void)
 Test DEVICE_MMIO_NAMED_* macros. More...
 
 DEVICE_MMIO_TOPLEVEL (foo3, DT_DRV_INST(3))
 
 DEVICE_MMIO_TOPLEVEL_STATIC (foo4, DT_DRV_INST(4))
 
void test_mmio_toplevel (void)
 Test DEVICE_MMIO_TOPLEVEL_* macros. More...
 
void test_mmio_device_map (void)
 device_map() test More...
 

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)

◆ test_mmio_device_map()

void test_mmio_device_map ( void  )

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:242
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition: devicetree.h:2073

◆ 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:435

◆ foo12_data

struct foo_mult_dev_data foo12_data