|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
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_mutex * | tla2528_get_lock (const struct device *dev) |
| get the mutex lock for the TLA2528 | |
| enum 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. |
| enum tla2528_reg |
#include <zephyr/drivers/mfd/tla2528.h>
TLA2528 Register mapping.
#include <zephyr/drivers/mfd/tla2528.h>
get the mutex lock for the TLA2528
| dev | instance of TLA2528 |
#include <zephyr/drivers/mfd/tla2528.h>
read a sample of ADC data from the TLA2528
| dev | instance of TLA2528 |
| data | pointer to store the read ADC data |
| 0 | on success, negative errno code otherwise |
| 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
| dev | instance of TLA2528 |
| reg | register to modify |
| bits | bits to clear |
| 0 | on success, negative errno code otherwise |
| 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
| dev | instance of TLA2528 |
| reg | register to read from |
| data | pointer to store the read data |
| 0 | on success, negative errno code otherwise |
| 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
| dev | instance of TLA2528 |
| reg | register to modify |
| bits | bits to set |
| 0 | on success, negative errno code otherwise |
| 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
| dev | instance of TLA2528 |
| reg | register to write to |
| data | data to write |
| 0 | on success, negative errno code otherwise |