solidswitch2 2.1.0.0
solidswitch2.h File Reference

This file contains API for SolidSwitch 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  solidswitch2_t
 SolidSwitch 2 Click context object. More...
 
struct  solidswitch2_cfg_t
 SolidSwitch 2 Click configuration object. More...
 

Macros

#define SOLIDSWITCH2_REG_CHIP_ID   0x00
 SolidSwitch 2 register map.
 
#define SOLIDSWITCH2_REG_CFG_0   0x01
 
#define SOLIDSWITCH2_REG_CFG_1   0x02
 
#define SOLIDSWITCH2_REG_CFG_2   0x03
 
#define SOLIDSWITCH2_REG_BIM   0x04
 
#define SOLIDSWITCH2_REG_RESERVED_1   0x05
 
#define SOLIDSWITCH2_REG_PWM_SPI   0x06
 
#define SOLIDSWITCH2_REG_MAP_IN0   0x07
 
#define SOLIDSWITCH2_REG_MAP_IN1   0x08
 
#define SOLIDSWITCH2_REG_MAP_PWM   0x09
 
#define SOLIDSWITCH2_REG_PWM_SEL   0x0A
 
#define SOLIDSWITCH2_REG_PWM_GEN_DC   0x0B
 
#define SOLIDSWITCH2_REG_PWM_LED_DC   0x0C
 
#define SOLIDSWITCH2_REG_DIAG_OFF_EN   0x0D
 
#define SOLIDSWITCH2_REG_DIAG_OPL_ON_EN   0x0E
 
#define SOLIDSWITCH2_REG_DIAG_OVC_OVT_RLW   0x0F
 
#define SOLIDSWITCH2_REG_STA_0   0x10
 
#define SOLIDSWITCH2_REG_STA_1   0x11
 
#define SOLIDSWITCH2_REG_DIAG_OVC_OVT   0x12
 
#define SOLIDSWITCH2_REG_DIAG_OPL_OFF   0x13
 
#define SOLIDSWITCH2_REG_DIAG_OPL_ON   0x14
 
#define SOLIDSWITCH2_REG_DIAG_SHD   0x15
 
#define SOLIDSWITCH2_CHIP_ID   0x56
 SolidSwitch 2 chip ID setting.
 
#define SOLIDSWITCH2_CFG_0_OUT7   0x80
 SolidSwitch 2 CFG_0 register setting.
 
#define SOLIDSWITCH2_CFG_0_OUT6   0x40
 
#define SOLIDSWITCH2_CFG_0_OUT5   0x20
 
#define SOLIDSWITCH2_CFG_0_OUT4   0x10
 
#define SOLIDSWITCH2_CFG_0_OUT3   0x08
 
#define SOLIDSWITCH2_CFG_0_OUT2   0x04
 
#define SOLIDSWITCH2_CFG_0_DIS_EN   0x02
 
#define SOLIDSWITCH2_CFG_0_NRES_EN   0x01
 
#define SOLIDSWITCH2_CFG_1_RST   0x80
 SolidSwitch 2 CFG_1 register setting.
 
#define SOLIDSWITCH2_CFG_1_ACT   0x40
 
#define SOLIDSWITCH2_CFG_1_PWM_DIV_LED_122p5Hz   0x00
 
#define SOLIDSWITCH2_CFG_1_PWM_DIV_LED_245p1Hz   0x01
 
#define SOLIDSWITCH2_CFG_1_PWM_DIV_LED_490p2Hz   0x02
 
#define SOLIDSWITCH2_CFG_1_PWM_DIV_LED_980p4Hz   0x03
 
#define SOLIDSWITCH2_CFG_2_FR_ADJ_NO_FREQ_ADJ   0x00
 SolidSwitch 2 CFG_2 register setting.
 
#define SOLIDSWITCH2_CFG_2_FR_ADJ_MINUS_15_PCT   0x04
 
#define SOLIDSWITCH2_CFG_2_FR_ADJ_PLUS_15_PCT   0x08
 
#define SOLIDSWITCH2_CFG_2_PWM_DIV_GEN_122p5Hz   0x00
 
#define SOLIDSWITCH2_CFG_2_PWM_DIV_GEN_245p1Hz   0x01
 
#define SOLIDSWITCH2_CFG_2_PWM_DIV_GEN_490p2Hz   0x02
 
#define SOLIDSWITCH2_CFG_2_PWM_DIV_GEN_980p4Hz   0x03
 
#define SOLIDSWITCH2_OUT7   0x80
 SolidSwitch 2 OUT mask setting.
 
#define SOLIDSWITCH2_OUT6   0x40
 
#define SOLIDSWITCH2_OUT5   0x20
 
#define SOLIDSWITCH2_OUT4   0x10
 
#define SOLIDSWITCH2_OUT3   0x08
 
#define SOLIDSWITCH2_OUT2   0x04
 
#define SOLIDSWITCH2_OUT1   0x02
 
#define SOLIDSWITCH2_OUT0   0x01
 
#define SOLIDSWITCH2_OUT_NONE   0x00
 
#define SOLIDSWITCH2_MAX_DUTY_CYCLE   0xFF
 SolidSwitch 2 duty cycle setting.
 
#define SOLIDSWITCH2_MIN_DUTY_CYCLE   0x00
 
#define SOLIDSWITCH2_SPI_RW_BIT   0x80
 SolidSwitch 2 SPI frame bits setting.
 
#define SOLIDSWITCH2_SPI_ERROR_BIT   0x80
 
#define SOLIDSWITCH2_ADDRESS_BIT_MASK   0x1F
 
#define SOLIDSWITCH2_ODD_PARITY   0x01
 
#define SOLIDSWITCH2_SPI_ERROR_BIT   0x80
 
#define SOLIDSWITCH2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define SOLIDSWITCH2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define SOLIDSWITCH2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  solidswitch2_return_value_t { SOLIDSWITCH2_OK = 0 , SOLIDSWITCH2_ERROR = -1 }
 SolidSwitch 2 Click return value data. More...
 

Functions

void solidswitch2_cfg_setup (solidswitch2_cfg_t *cfg)
 SolidSwitch 2 configuration object setup function.
 
err_t solidswitch2_init (solidswitch2_t *ctx, solidswitch2_cfg_t *cfg)
 SolidSwitch 2 initialization function.
 
err_t solidswitch2_default_cfg (solidswitch2_t *ctx)
 SolidSwitch 2 default configuration function.
 
err_t solidswitch2_write_register (solidswitch2_t *ctx, uint8_t reg, uint8_t data_in)
 SolidSwitch 2 data writing function.
 
err_t solidswitch2_read_register (solidswitch2_t *ctx, uint8_t reg, uint8_t *data_out)
 SolidSwitch 2 data reading function.
 
err_t solidswitch2_check_communication (solidswitch2_t *ctx)
 SolidSwitch 2 check communication function.
 
void solidswitch2_set_idle_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set idle pin function.
 
void solidswitch2_set_in0_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set in0 pin function.
 
void solidswitch2_set_in1_pin (solidswitch2_t *ctx, uint8_t state)
 SolidSwitch 2 set in1 pin function.
 
void solidswitch2_toggle_in0_pin (solidswitch2_t *ctx)
 SolidSwitch 2 toggle in0 pin function.
 
void solidswitch2_toggle_in1_pin (solidswitch2_t *ctx)
 SolidSwitch 2 toggle in1 pin function.
 
err_t solidswitch2_soft_reset (solidswitch2_t *ctx)
 SolidSwitch 2 soft reset function.
 

Detailed Description

This file contains API for SolidSwitch 2 Click Driver.

Enumeration Type Documentation

◆ solidswitch2_return_value_t

SolidSwitch 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
SOLIDSWITCH2_OK 
SOLIDSWITCH2_ERROR