![]() |
no-OS
|
Header file for ADGS6414D Driver. More...
Go to the source code of this file.
Classes | |
struct | adgs6414d_dev |
ADGS6414D Device Descriptor. More... | |
struct | adgs6414d_init_param |
ADGS6414D Initialization Parameters structure. More... | |
Macros | |
#define | ADGS6414D_NUM_SWITCHES 8 |
#define | ADGS6414D_REG_SW_DATA 0x01 |
#define | ADGS6414D_REG_ERR_FLAGS 0x03 |
#define | ADGS6414D_REG_BURST_EN 0x05 |
#define | ADGS6414D_REG_SOFT_RESETB 0x0B |
#define | ADGS6414D_CMD_WRITE 0x00 |
#define | ADGS6414D_CMD_READ 0x80 |
#define | ADGS6414D_SOFT_RESET_VAL1 0xA3 |
#define | ADGS6414D_SOFT_RESET_VAL2 0x05 |
#define | ADGS6414D_SW1 0 |
#define | ADGS6414D_SW2 1 |
#define | ADGS6414D_SW3 2 |
#define | ADGS6414D_SW4 3 |
#define | ADGS6414D_SW5 4 |
#define | ADGS6414D_SW6 5 |
#define | ADGS6414D_SW7 6 |
#define | ADGS6414D_SW8 7 |
Functions | |
int | adgs6414d_spi_write (struct adgs6414d_dev *dev, uint8_t reg_addr, uint8_t data) |
int | adgs6414d_spi_read (struct adgs6414d_dev *dev, uint8_t reg_addr, uint8_t *data) |
int | adgs6414d_soft_reset (struct adgs6414d_dev *dev) |
int | adgs6414d_set_switch (struct adgs6414d_dev *dev, uint8_t channel, bool state) |
int | adgs6414d_get_switch (struct adgs6414d_dev *dev, uint8_t channel, bool *state) |
int | adgs6414d_set_switches (struct adgs6414d_dev *dev, uint8_t mask) |
int | adgs6414d_get_switches (struct adgs6414d_dev *dev, uint8_t *mask) |
int | adgs6414d_init (struct adgs6414d_dev **device, struct adgs6414d_init_param *init_param) |
int | adgs6414d_remove (struct adgs6414d_dev *dev) |
Header file for ADGS6414D Driver.
Copyright 2025(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ADGS6414D_CMD_READ 0x80 |
#define ADGS6414D_CMD_WRITE 0x00 |
#define ADGS6414D_NUM_SWITCHES 8 |
#define ADGS6414D_REG_BURST_EN 0x05 |
#define ADGS6414D_REG_ERR_FLAGS 0x03 |
#define ADGS6414D_REG_SOFT_RESETB 0x0B |
#define ADGS6414D_REG_SW_DATA 0x01 |
#define ADGS6414D_SOFT_RESET_VAL1 0xA3 |
#define ADGS6414D_SOFT_RESET_VAL2 0x05 |
#define ADGS6414D_SW1 0 |
#define ADGS6414D_SW2 1 |
#define ADGS6414D_SW3 2 |
#define ADGS6414D_SW4 3 |
#define ADGS6414D_SW5 4 |
#define ADGS6414D_SW6 5 |
#define ADGS6414D_SW7 6 |
#define ADGS6414D_SW8 7 |
int adgs6414d_get_switch | ( | struct adgs6414d_dev * | dev, |
uint8_t | channel, | ||
bool * | state ) |
Get switch state for a specific channel.
dev | - The device structure. |
channel | - Switch channel (0-7). |
state | - Pointer to store the switch state. |
int adgs6414d_get_switches | ( | struct adgs6414d_dev * | dev, |
uint8_t * | mask ) |
Get all switch states as bitmask.
dev | - The device structure. |
mask | - Pointer to store the switch states bitmask. |
int adgs6414d_init | ( | struct adgs6414d_dev ** | device, |
struct adgs6414d_init_param * | init_param ) |
Initialize the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int adgs6414d_remove | ( | struct adgs6414d_dev * | dev | ) |
Free the resources allocated by adgs6414d_init().
dev | - The device structure. |
int adgs6414d_set_switch | ( | struct adgs6414d_dev * | dev, |
uint8_t | channel, | ||
bool | state ) |
Set switch state for a specific channel.
dev | - The device structure. |
channel | - Switch channel (0-7). |
state | - Switch state (true = closed, false = open). |
int adgs6414d_set_switches | ( | struct adgs6414d_dev * | dev, |
uint8_t | mask ) |
Set multiple switches at once using bitmask.
dev | - The device structure. |
mask | - Bitmask for switch states (bit 0 = SW1, bit 7 = SW8). |
int adgs6414d_soft_reset | ( | struct adgs6414d_dev * | dev | ) |
Perform software reset.
dev | - The device structure. |
int adgs6414d_spi_read | ( | struct adgs6414d_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t * | data ) |
SPI read operation.
dev | - The device structure. |
reg_addr | - Register address. |
data | - Pointer to store read data. |
int adgs6414d_spi_write | ( | struct adgs6414d_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | data ) |
SPI write operation.
dev | - The device structure. |
reg_addr | - Register address. |
data | - Data to write. |