13#ifndef ZEPHYR_INCLUDE_DRIVERS_SYSCON_H_
14#define ZEPHYR_INCLUDE_DRIVERS_SYSCON_H_
97static inline int z_impl_syscon_get_base(
const struct device *dev,
uintptr_t *addr)
131 return api->
read(dev, reg, val);
157 return api->
write(dev, reg, val);
185static inline int z_impl_syscon_update_bits(
const struct device *dev,
uint16_t reg,
208static inline int z_impl_syscon_get_size(
const struct device *dev,
size_t *size)
227#include <zephyr/syscalls/syscon.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1375
int(* syscon_api_write_reg)(const struct device *dev, uint16_t reg, uint32_t val)
Write a single register.
Definition syscon.h:53
int(* syscon_api_get_base)(const struct device *dev, uintptr_t *addr)
Get the base address of the syscon region.
Definition syscon.h:41
int(* syscon_api_update_bits)(const struct device *dev, uint16_t reg, uint32_t mask, uint32_t val)
Atomically update bits in a register.
Definition syscon.h:59
int(* syscon_api_read_reg)(const struct device *dev, uint16_t reg, uint32_t *val)
Read a single register.
Definition syscon.h:47
int(* syscon_api_get_size)(const struct device *dev, size_t *size)
Get the size of the syscon register region.
Definition syscon.h:66
int syscon_get_base(const struct device *dev, uintptr_t *addr)
Get the syscon base address.
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_write_reg(const struct device *dev, uint16_t reg, uint32_t val)
Write to syscon register.
int syscon_update_bits(const struct device *dev, uint16_t reg, uint32_t mask, uint32_t val)
Atomically update bits in a syscon register.
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define NULL
Definition iar_missing_defs.h:20
__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:513
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:519
<span class="mlabel">Driver Operations</span> SYSCON driver operations
Definition syscon.h:71
syscon_api_get_base get_base
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition syscon.h:79
syscon_api_read_reg read
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition syscon.h:73
syscon_api_get_size get_size
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition syscon.h:81
syscon_api_update_bits update_bits
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition syscon.h:77
syscon_api_write_reg write
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition syscon.h:75