42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
65#define BUCK_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.a0= MIKROBUS( mikrobus, MIKROBUS_RST ); \
67 cfg.en= MIKROBUS( mikrobus, MIKROBUS_CS ); \
68 cfg.a1= MIKROBUS( mikrobus, MIKROBUS_PWM ); \
69 cfg.pg= MIKROBUS( mikrobus, MIKROBUS_INT );
76#define BUCK_RETVAL uint8_t
79#define BUCK_INIT_ERROR 0xFF
86#define BUCK_DEVICE_DISABLE 0
87#define BUCK_DEVICE_ENABLE 1
94#define BUCK_FREQ_400KHz 0x00
95#define BUCK_FREQ_1200KHz 0x01
96#define BUCK_FREQ_800KHz 0x02
97#define BUCK_FREQ_1600KHz 0x03
104#define BUCK_SET_MULTIPLEXER_A0 0
105#define BUCK_SET_MULTIPLEXER_A1 1
#define BUCK_RETVAL
Definition buck.h:76
void buck_device_reset(buck_t *ctx)
Device reset chip function.
void buck_default_cfg(buck_t *ctx)
Click Default Configuration function.
void buck_set_multiplexer_state(buck_t *ctx, uint8_t mux, uint8_t state)
Set multiplexer (A0 or A1) state.
BUCK_RETVAL buck_init(buck_t *ctx, buck_cfg_t *cfg)
Initialization function.
void buck_set_mode(buck_t *ctx, uint8_t mode)
Select buck mode (Disable / Enable)
void buck_switch_frequency(buck_t *ctx, uint8_t frequency)
Setting the switching frequency function.
uint8_t buck_get_power_good(buck_t *ctx)
Get state internal comparator function.
void buck_cfg_setup(buck_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition buck.h:136
pin_name_t a0
Definition buck.h:139
pin_name_t en
Definition buck.h:140
pin_name_t a1
Definition buck.h:141
pin_name_t pg
Definition buck.h:142
Click ctx object definition.
Definition buck.h:119
digital_out_t a0
Definition buck.h:122
digital_out_t a1
Definition buck.h:124
digital_out_t en
Definition buck.h:123
digital_in_t pg
Definition buck.h:128