Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
SYSCON Interface

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.
 

Detailed Description

SYSCON Interface .

Typedef Documentation

◆ syscon_api_get_base

typedef int(* syscon_api_get_base) (const struct device *dev, uintptr_t *addr)

#include <zephyr/drivers/syscon.h>

API template to get the base address of the syscon region.

See also
syscon_get_base

◆ syscon_api_get_size

typedef int(* syscon_api_get_size) (const struct device *dev, size_t *size)

#include <zephyr/drivers/syscon.h>

API template to get the size of the syscon register.

See also
syscon_get_size

◆ syscon_api_read_reg

typedef int(* syscon_api_read_reg) (const struct device *dev, uint16_t reg, uint32_t *val)

#include <zephyr/drivers/syscon.h>

API template to read a single register.

See also
syscon_read_reg

◆ syscon_api_write_reg

typedef int(* syscon_api_write_reg) (const struct device *dev, uint16_t reg, uint32_t val)

#include <zephyr/drivers/syscon.h>

API template to write a single register.

See also
syscon_write_reg

Function Documentation

◆ syscon_get_base()

int syscon_get_base ( const struct device * dev,
uintptr_t * addr )

#include <zephyr/drivers/syscon.h>

Get the syscon base address.

Parameters
devThe device to get the register size for.
addrWhere to write the base address.
Returns
0 When addr was written to.

◆ syscon_get_size()

int syscon_get_size ( const struct device * dev,
size_t * size )

#include <zephyr/drivers/syscon.h>

Get the size of the syscon register in bytes.

Parameters
devThe device to get the register size for.
sizePointer to write the size to.
Returns
0 for success.

◆ syscon_read_reg()

int syscon_read_reg ( const struct device * dev,
uint16_t reg,
uint32_t * val )

#include <zephyr/drivers/syscon.h>

Read from syscon register.

This function reads from a specific register in the syscon area

Parameters
devThe device to get the register size for.
regThe register offset
valThe returned value read from the syscon register
Returns
0 on success, negative on error

◆ syscon_write_reg()

int syscon_write_reg ( const struct device * dev,
uint16_t reg,
uint32_t val )

#include <zephyr/drivers/syscon.h>

Write to syscon register.

This function writes to a specific register in the syscon area

Parameters
devThe device to get the register size for.
regThe register offset
valThe value to be written in the register
Returns
0 on success, negative on error