ldo 2.1.0.0
LDO Click Driver

API for configuring and manipulating LDO Click driver. More...

Topics

 LDO Registers List
 List of registers of LDO Click driver.
 
 LDO Registers Settings
 Settings for registers of LDO Click driver.
 
 LDO MikroBUS Map
 MikroBUS pin mapping of LDO Click driver.
 

Functions

void ldo_cfg_setup (ldo_cfg_t *cfg)
 LDO configuration object setup function.
 
err_t ldo_init (ldo_t *ctx, ldo_cfg_t *cfg)
 LDO initialization function.
 
err_t ldo_default_cfg (ldo_t *ctx)
 LDO default configuration function.
 
err_t ldo_write_register (ldo_t *ctx, uint8_t reg, uint8_t data_in)
 LDO write register function.
 
err_t ldo_read_register (ldo_t *ctx, uint8_t reg, uint8_t *data_out)
 LDO read register function.
 
err_t ldo_set_pin_state (ldo_t *ctx, uint8_t pin_mask, uint8_t state)
 LDO set pin state function.
 
err_t ldo_set_vout (ldo_t *ctx, uint16_t vout)
 LDO set vout function.
 
void ldo_enable_device (ldo_t *ctx)
 LDO enable device function.
 
void ldo_disable_device (ldo_t *ctx)
 LDO disable device function.
 

Detailed Description

API for configuring and manipulating LDO Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ldo_cfg_setup()

void ldo_cfg_setup ( ldo_cfg_t * cfg)

LDO configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ldo_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ldo_default_cfg()

err_t ldo_default_cfg ( ldo_t * ctx)

LDO default configuration function.

This function executes a default configuration of LDO click board.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ldo_disable_device()

void ldo_disable_device ( ldo_t * ctx)

LDO disable device function.

This function disables the device by setting the EN pin to LOW logic state.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ldo_enable_device()

void ldo_enable_device ( ldo_t * ctx)

LDO enable device function.

This function enables the device by setting the EN pin to HIGH logic state.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ldo_init()

err_t ldo_init ( ldo_t * ctx,
ldo_cfg_t * cfg )

LDO initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See ldo_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ldo_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldo_read_register()

err_t ldo_read_register ( ldo_t * ctx,
uint8_t reg,
uint8_t * data_out )

LDO read register function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldo_set_pin_state()

err_t ldo_set_pin_state ( ldo_t * ctx,
uint8_t pin_mask,
uint8_t state )

LDO set pin state function.

This function sets the state of the selected pins. Others remain unchanged.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
[in]pin_mask: Bit-mask of pins to configure.
[in]state: State of pins (0-LOW, 1-OPEN).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldo_set_vout()

err_t ldo_set_vout ( ldo_t * ctx,
uint16_t vout )

LDO set vout function.

This function sets the voltage output.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
[in]vout: Voltage output in a range of 800 to 3950 mV.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldo_write_register()

err_t ldo_write_register ( ldo_t * ctx,
uint8_t reg,
uint8_t data_in )

LDO write register function.

This function writes a data byte to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ldo_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.