Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <zephyr.h>
#include <device.h>
#include <init.h>
#include <ztest.h>
#include <sys/printk.h>
#include <pm/device_runtime.h>
#include <linker/sections.h>
#include "abstract_driver.h"

Data Structures

struct  init_record
 

Macros

#define DUMMY_PORT_1   "dummy"
 
#define DUMMY_PORT_2   "dummy_driver"
 
#define BAD_DRIVER   "bad_driver"
 
#define MY_DRIVER_A   "my_driver_A"
 
#define MY_DRIVER_B   "my_driver_B"
 

Functions

void test_mmio_multiple (void)
 Test DEVICE_MMIO_NAMED_* macros. More...
 
void test_mmio_toplevel (void)
 Test DEVICE_MMIO_TOPLEVEL_* macros. More...
 
void test_mmio_single (void)
 Test DEVICE_MMIO_* macros. More...
 
void test_mmio_device_map (void)
 device_map() test More...
 
void test_dummy_device (void)
 Test device object binding. More...
 
static void test_dynamic_name (void)
 Test device binding for existing device. More...
 
static void test_bogus_dynamic_name (void)
 Test device binding for non-existing device. More...
 
static void test_null_dynamic_name (void)
 Test device binding for passing null name. More...
 
static __pinned_func int add_init_record (bool pre_kernel)
 
static __pinned_func int pre1_fn (const struct device *dev)
 
static __pinned_func int pre2_fn (const struct device *dev)
 
static int post_fn (const struct device *dev)
 
static int app_fn (const struct device *dev)
 
 SYS_INIT (pre1_fn, PRE_KERNEL_1, 0)
 
 SYS_INIT (pre2_fn, PRE_KERNEL_2, 0)
 
 SYS_INIT (post_fn, POST_KERNEL, 0)
 
 SYS_INIT (app_fn, APPLICATION, 0)
 
static int null_driver_init (const struct device *dev)
 
 SYS_INIT (null_driver_init, POST_KERNEL, 0)
 
void test_pre_kernel_detection (void)
 Test detection of initialization before kernel services available. More...
 
static void test_enable_and_disable_automatic_runtime_pm (void)
 
static void test_build_suspend_device_list (void)
 
void test_dummy_device_pm (void)
 
void test_device_init_level (void)
 Test initialization level for device driver instances. More...
 
void test_device_init_priority (void)
 Test initialization priorities for device driver instances. More...
 
void test_abstraction_driver_common (void)
 Test abstraction of device drivers with common functionalities. More...
 
void test_main (void)
 

Variables

static __pinned_bss struct init_record init_records [4]
 
static __pinned_data struct init_recordrp = init_records
 
int init_level_sequence [4]
 
int init_priority_sequence [4]
 
unsigned int seq_level_cnt
 
unsigned int seq_priority_cnt
 

Macro Definition Documentation

◆ BAD_DRIVER

#define BAD_DRIVER   "bad_driver"

◆ DUMMY_PORT_1

#define DUMMY_PORT_1   "dummy"

◆ DUMMY_PORT_2

#define DUMMY_PORT_2   "dummy_driver"

◆ MY_DRIVER_A

#define MY_DRIVER_A   "my_driver_A"

◆ MY_DRIVER_B

#define MY_DRIVER_B   "my_driver_B"

Function Documentation

◆ test_main()

void test_main ( void  )

◆ 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.