39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define LDO_REG_INPUT_PORT 0x00
74#define LDO_REG_OUTPUT_PORT 0x01
75#define LDO_REG_POLARITY_INV 0x02
76#define LDO_REG_CONFIG 0x03
94#define LDO_PIN_NONE 0x00
95#define LDO_PIN_1600_mV 0x01
96#define LDO_PIN_800_mV 0x02
97#define LDO_PIN_400_mV 0x04
98#define LDO_PIN_200_mV 0x08
99#define LDO_PIN_100_mV 0x10
100#define LDO_PIN_50_mV 0x20
101#define LDO_PIN_ALL 0x3F
108#define LDO_PIN_OPEN 1
114#define LDO_VOUT_MIN 800
115#define LDO_VOUT_STEP 50
116#define LDO_VOUT_MAX 3950
122#define LDO_DEVICE_ADDRESS_0 0x38
123#define LDO_DEVICE_ADDRESS_1 0x39
124#define LDO_DEVICE_ADDRESS_2 0x3A
125#define LDO_DEVICE_ADDRESS_3 0x3B
126#define LDO_DEVICE_ADDRESS_4 0x3C
127#define LDO_DEVICE_ADDRESS_5 0x3D
128#define LDO_DEVICE_ADDRESS_6 0x3E
129#define LDO_DEVICE_ADDRESS_7 0x3F
147#define LDO_MAP_MIKROBUS( cfg, mikrobus ) \
148 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
149 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
150 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
void ldo_cfg_setup(ldo_cfg_t *cfg)
LDO configuration object setup function.
void ldo_disable_device(ldo_t *ctx)
LDO disable device function.
err_t ldo_write_register(ldo_t *ctx, uint8_t reg, uint8_t data_in)
LDO write register function.
err_t ldo_set_vout(ldo_t *ctx, uint16_t vout)
LDO set vout function.
err_t ldo_init(ldo_t *ctx, ldo_cfg_t *cfg)
LDO initialization function.
err_t ldo_set_pin_state(ldo_t *ctx, uint8_t pin_mask, uint8_t state)
LDO set pin state function.
void ldo_enable_device(ldo_t *ctx)
LDO enable device function.
err_t ldo_read_register(ldo_t *ctx, uint8_t reg, uint8_t *data_out)
LDO read register function.
err_t ldo_default_cfg(ldo_t *ctx)
LDO default configuration function.
ldo_return_value_t
LDO Click return value data.
Definition ldo.h:192
@ LDO_ERROR
Definition ldo.h:194
@ LDO_OK
Definition ldo.h:193
LDO Click configuration object.
Definition ldo.h:177
uint32_t i2c_speed
Definition ldo.h:182
pin_name_t scl
Definition ldo.h:178
pin_name_t en
Definition ldo.h:180
pin_name_t sda
Definition ldo.h:179
uint8_t i2c_address
Definition ldo.h:183
LDO Click context object.
Definition ldo.h:160
i2c_master_t i2c
Definition ldo.h:165
digital_out_t en
Definition ldo.h:162
uint8_t slave_address
Definition ldo.h:168