SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions
axp.c File Reference
#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <common.h>
#include <log.h>
#include <pmu/axp.h>
Include dependency graph for axp.c:

Functions

static axp_contrl_infoget_ctrl_info_from_tbl (char *name, axp_contrl_info *axp_ctrl_tbl, uint8_t axp_ctrl_tbl_size)
 Get control information from the table based on the given name.
 
int axp_set_vol (sunxi_i2c_t *i2c_dev, char *name, int set_vol, int onoff, axp_contrl_info *axp_ctrl_tbl, uint8_t axp_ctrl_tbl_size, uint8_t axp_addr)
 Set the voltage for a specific power domain controlled by AXP.
 
int axp_get_vol (sunxi_i2c_t *i2c_dev, char *name, axp_contrl_info *axp_ctrl_tbl, uint8_t axp_ctrl_tbl_size, uint8_t axp_addr)
 Get the voltage value for a specific power domain controlled by AXP.
 

Function Documentation

◆ axp_get_vol()

int axp_get_vol ( sunxi_i2c_t i2c_dev,
char *  name,
axp_contrl_info axp_ctrl_tbl,
uint8_t  axp_ctrl_tbl_size,
uint8_t  axp_addr 
)

Get the voltage value for a specific power domain controlled by AXP.

Parameters
i2c_devPointer to the I2C device structure.
nameName of the power domain.
axp_ctrl_tblPointer to the AXP control information table.
axp_ctrl_tbl_sizeSize of the AXP control information table.
axp_addrAXP device address.
Returns
The voltage value of the specified power domain.

◆ axp_set_vol()

int axp_set_vol ( sunxi_i2c_t i2c_dev,
char *  name,
int  set_vol,
int  onoff,
axp_contrl_info axp_ctrl_tbl,
uint8_t  axp_ctrl_tbl_size,
uint8_t  axp_addr 
)

Set the voltage for a specific power domain controlled by AXP.

Parameters
i2c_devPointer to the I2C device structure.
nameName of the power domain.
set_volVoltage value to set.
onoffWhether to turn on or off the power domain (1 for on, 0 for off).
axp_ctrl_tblPointer to the AXP control information table.
axp_ctrl_tbl_sizeSize of the AXP control information table.
axp_addrAXP device address.
Returns
Integer indicating the success status of the operation.

◆ get_ctrl_info_from_tbl()

static axp_contrl_info * get_ctrl_info_from_tbl ( char *  name,
axp_contrl_info axp_ctrl_tbl,
uint8_t  axp_ctrl_tbl_size 
)
static

Get control information from the table based on the given name.

Parameters
nameThe name of the control information to retrieve.
Returns
A pointer to the axp_contrl_info structure corresponding to the given name, or NULL if the name is not found in the table.