42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_spi_master.h"
66#define BUCK12_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST );
78#define BUCK12_RETVAL uint8_t
81#define BUCK12_INIT_ERROR 0xFF
88#define BUCK12_ENABLE 0x01
89#define BUCK12_DISABLE 0x00
96#define BUCK12_INPUT_VOLTAGE 0x02
97#define BUCK12_OUTPUT_VOLTAGE 0x03
104#define BUCK12_CHANNEL_0 0xA0
105#define BUCK12_CHANNEL_1 0xE0
#define BUCK12_RETVAL
Definition buck12.h:78
BUCK12_RETVAL buck12_init(buck12_t *ctx, buck12_cfg_t *cfg)
Initialization function.
void buck12_default_cfg(buck12_t *ctx)
Click Default Configuration function.
float buck12_get_voltage(buck12_t *ctx, uint8_t select_volt)
Function for get Voltage.
void buck12_cfg_setup(buck12_cfg_t *cfg)
Config Object Initialization function.
uint16_t buck12_get_channel_adc(buck12_t *ctx, uint8_t channel)
Function for read ADC on the channel.
void buck12_generic_transfer(buck12_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void buck12_control(buck12_t *ctx, uint8_t ctrl)
Function for enable or disable device.
Click configuration structure definition.
Definition buck12.h:134
spi_master_chip_select_polarity_t cs_polarity
Definition buck12.h:150
pin_name_t sck
Definition buck12.h:139
spi_master_mode_t spi_mode
Definition buck12.h:149
pin_name_t mosi
Definition buck12.h:138
uint32_t spi_speed
Definition buck12.h:148
pin_name_t en
Definition buck12.h:144
pin_name_t miso
Definition buck12.h:137
pin_name_t cs
Definition buck12.h:140
Click ctx object definition.
Definition buck12.h:119
digital_out_t cs
Definition buck12.h:123
spi_master_t spi
Definition buck12.h:125
digital_out_t en
Definition buck12.h:122
pin_name_t chip_select
Definition buck12.h:126