Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
SYSCON Interface. More...
Data Structures | |
struct | syscon_driver_api |
System Control (syscon) register driver API. More... | |
Typedefs | |
typedef int(* | syscon_api_get_base) (const struct device *dev, uintptr_t *addr) |
API template to get the base address of the syscon region. | |
typedef int(* | syscon_api_read_reg) (const struct device *dev, uint16_t reg, uint32_t *val) |
API template to read a single register. | |
typedef int(* | syscon_api_write_reg) (const struct device *dev, uint16_t reg, uint32_t val) |
API template to write a single register. | |
typedef int(* | syscon_api_get_size) (const struct device *dev, size_t *size) |
API template to get the size of the syscon register. | |
Functions | |
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_write_reg (const struct device *dev, uint16_t reg, uint32_t val) |
Write to syscon register. | |
int | syscon_get_size (const struct device *dev, size_t *size) |
Get the size of the syscon register in bytes. | |
SYSCON Interface.
#include <zephyr/drivers/syscon.h>
API template to get the base address of the syscon region.
#include <zephyr/drivers/syscon.h>
API template to get the size of the syscon register.
#include <zephyr/drivers/syscon.h>
API template to write a single register.
#include <zephyr/drivers/syscon.h>
Get the syscon base address.
dev | The device to get the register size for. |
addr | Where to write the base address. |
#include <zephyr/drivers/syscon.h>
Get the size of the syscon register in bytes.
dev | The device to get the register size for. |
size | Pointer to write the size to. |
#include <zephyr/drivers/syscon.h>
Read from syscon register.
This function reads from a specific register in the syscon area
dev | The device to get the register size for. |
reg | The register offset |
val | The returned value read from the syscon register |
#include <zephyr/drivers/syscon.h>
Write to syscon register.
This function writes to a specific register in the syscon area
dev | The device to get the register size for. |
reg | The register offset |
val | The value to be written in the register |