Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MFD TLA2528 Interface

Files

file  tla2528.h
 Header file for the TLA2528 MFD driver.

Enumerations

enum  tla2528_reg {
  TLA2528_SYSTEM_STATUS = 0x0 , TLA2528_GENERAL_CFG = 0x1 , TLA2528_DATA_CFG = 0x2 , TLA2528_OSR_CFG = 0x3 ,
  TLA2528_OPMODE_CFG = 0x4 , TLA2528_PIN_CFG = 0x5 , TLA2528_GPIO_CFG = 0x7 , TLA2528_GPO_DRIVE_CFG = 0x9 ,
  TLA2528_GPO_VALUE = 0xb , TLA2528_GPI_VALUE = 0xd , TLA2528_SEQUENCE_CFG = 0x10 , TLA2528_CHANNEL_SEL = 0x11 ,
  TLA2528_AUTO_SEQ_CH_SEL = 0x12
}
 TLA2528 Register mapping. More...
enum  tla2528_general_cfg { TLA2528_CNVST = BIT(3) , TLA2528_CH_RST = BIT(2) , TLA2528_CAL = BIT(1) , TLA2528_RST = BIT(0) }
 Bit mapping for the GENERAL_CFG register of the TLA2528. More...

Functions

int tla2528_register_write (const struct device *dev, enum tla2528_reg reg, uint8_t data)
 write a specific register of the TLA2528
int tla2528_register_read (const struct device *dev, enum tla2528_reg reg, uint8_t *data)
 read a specific register of the TLA2528
int tla2528_register_set_bits (const struct device *dev, enum tla2528_reg reg, uint8_t bits)
 set specific bits in a register of the TLA2528
int tla2528_register_clear_bits (const struct device *dev, enum tla2528_reg reg, uint8_t bits)
 clear specific bits in a register of the TLA2528
int tla2528_read_adc_data (const struct device *dev, uint16_t *data)
 read a sample of ADC data from the TLA2528
struct k_mutextla2528_get_lock (const struct device *dev)
 get the mutex lock for the TLA2528

Detailed Description

Since
4.5
Version
0.1.0

Enumeration Type Documentation

◆ tla2528_general_cfg

#include <zephyr/drivers/mfd/tla2528.h>

Bit mapping for the GENERAL_CFG register of the TLA2528.

Enumerator
TLA2528_CNVST 

Start conversion.

TLA2528_CH_RST 

Reset all channels to analog mode.

TLA2528_CAL 

Calibrate ADC offset.

TLA2528_RST 

Soft-reset all registers.

◆ tla2528_reg

#include <zephyr/drivers/mfd/tla2528.h>

TLA2528 Register mapping.

Enumerator
TLA2528_SYSTEM_STATUS 

System status register.

TLA2528_GENERAL_CFG 

General configuration register.

TLA2528_DATA_CFG 

Data configuration register.

TLA2528_OSR_CFG 

Oversampling configuration register.

TLA2528_OPMODE_CFG 

Operation mode configuration register.

TLA2528_PIN_CFG 

Pin configuration register.

TLA2528_GPIO_CFG 

GPIO configuration register.

TLA2528_GPO_DRIVE_CFG 

GPIO output drive configuration register.

TLA2528_GPO_VALUE 

GPIO output value register.

TLA2528_GPI_VALUE 

GPIO input value register.

TLA2528_SEQUENCE_CFG 

ADC Sequence configuration register.

TLA2528_CHANNEL_SEL 

ADC Channel selection register.

TLA2528_AUTO_SEQ_CH_SEL 

ADC sequence channel selection register.

Function Documentation

◆ tla2528_get_lock()

struct k_mutex * tla2528_get_lock ( const struct device * dev)

#include <zephyr/drivers/mfd/tla2528.h>

get the mutex lock for the TLA2528

Parameters
devinstance of TLA2528
Returns
pointer to the mutex lock

◆ tla2528_read_adc_data()

int tla2528_read_adc_data ( const struct device * dev,
uint16_t * data )

#include <zephyr/drivers/mfd/tla2528.h>

read a sample of ADC data from the TLA2528

Parameters
devinstance of TLA2528
datapointer to store the read ADC data
Return values
0on success, negative errno code otherwise

◆ tla2528_register_clear_bits()

int tla2528_register_clear_bits ( const struct device * dev,
enum tla2528_reg reg,
uint8_t bits )

#include <zephyr/drivers/mfd/tla2528.h>

clear specific bits in a register of the TLA2528

Bits are cleared "atomically" (in a single I2C transaction), without read-modify-write cycle

Parameters
devinstance of TLA2528
regregister to modify
bitsbits to clear
Return values
0on success, negative errno code otherwise

◆ tla2528_register_read()

int tla2528_register_read ( const struct device * dev,
enum tla2528_reg reg,
uint8_t * data )

#include <zephyr/drivers/mfd/tla2528.h>

read a specific register of the TLA2528

Parameters
devinstance of TLA2528
regregister to read from
datapointer to store the read data
Return values
0on success, negative errno code otherwise

◆ tla2528_register_set_bits()

int tla2528_register_set_bits ( const struct device * dev,
enum tla2528_reg reg,
uint8_t bits )

#include <zephyr/drivers/mfd/tla2528.h>

set specific bits in a register of the TLA2528

Bits are set "atomically" (in a single I2C transaction), without read-modify-write cycle

Parameters
devinstance of TLA2528
regregister to modify
bitsbits to set
Return values
0on success, negative errno code otherwise

◆ tla2528_register_write()

int tla2528_register_write ( const struct device * dev,
enum tla2528_reg reg,
uint8_t data )

#include <zephyr/drivers/mfd/tla2528.h>

write a specific register of the TLA2528

Parameters
devinstance of TLA2528
regregister to write to
datadata to write
Return values
0on success, negative errno code otherwise