12#ifndef ZEPHYR_INCLUDE_DRIVERS_SYSCON_H_
13#define ZEPHYR_INCLUDE_DRIVERS_SYSCON_H_
78static inline int z_impl_syscon_get_base(
const struct device *dev,
uintptr_t *addr)
86 return api->get_base(dev, addr);
111 return api->read(dev, reg, val);
136 return api->write(dev, reg, val);
148static inline int z_impl_syscon_get_size(
const struct device *dev,
size_t *size)
152 return api->get_size(dev, size);
163#include <zephyr/syscalls/syscon.h>
int syscon_get_base(const struct device *dev, uintptr_t *addr)
Get the syscon base address.
int(* syscon_api_write_reg)(const struct device *dev, uint16_t reg, uint32_t val)
API template to write a single register.
Definition syscon.h:50
int syscon_read_reg(const struct device *dev, uint16_t reg, uint32_t *val)
Read from syscon register.
int syscon_get_size(const struct device *dev, size_t *size)
Get the size of the syscon register in bytes.
int(* syscon_api_get_base)(const struct device *dev, uintptr_t *addr)
API template to get the base address of the syscon region.
Definition syscon.h:36
int(* syscon_api_read_reg)(const struct device *dev, uint16_t reg, uint32_t *val)
API template to read a single register.
Definition syscon.h:43
int syscon_write_reg(const struct device *dev, uint16_t reg, uint32_t val)
Write to syscon register.
int(* syscon_api_get_size)(const struct device *dev, size_t *size)
API template to get the size of the syscon register.
Definition syscon.h:57
#define ENOTSUP
Unsupported value.
Definition errno.h:114
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:409
System Control (syscon) register driver API.
Definition syscon.h:62
syscon_api_get_base get_base
Definition syscon.h:65
syscon_api_read_reg read
Definition syscon.h:63
syscon_api_get_size get_size
Definition syscon.h:66
syscon_api_write_reg write
Definition syscon.h:64