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_spi_master.h"
74#define BUCK16_CMD_VOLATILE_WIPER_0 0x00
75#define BUCK16_CMD_NV_WIPER_0 0x20
76#define BUCK16_CMD_VOLATILE_TCON 0x40
77#define BUCK16_CMD_DATA_EEPROM_1 0x60
78#define BUCK16_CMD_DATA_EEPROM_2 0x70
79#define BUCK16_CMD_DATA_EEPROM_3 0x80
80#define BUCK16_CMD_DATA_EEPROM_4 0x90
81#define BUCK16_CMD_DATA_EEPROM_5 0xA0
82#define BUCK16_CMD_DATA_EEPROM_6 0xB0
83#define BUCK16_CMD_DATA_EEPROM_7 0xC0
84#define BUCK16_CMD_DATA_EEPROM_8 0xD0
85#define BUCK16_CMD_DATA_EEPROM_9 0xE0
86#define BUCK16_CMD_DATA_EEPROM_10 0xF0
92#define BUCK16_WRITE 0x00
93#define BUCK16_INCREMENT 0x04
94#define BUCK16_DECREMENT 0x08
116#define BUCK16_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
117#define BUCK16_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
135#define BUCK16_MAP_MIKROBUS( cfg, mikrobus ) \
136 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
137 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
138 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
139 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
140 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST );
buck16_return_value_t
Buck 16 Click return value data.
Definition buck16.h:187
@ BUCK16_ERROR
Definition buck16.h:189
@ BUCK16_OK
Definition buck16.h:188
void buck16_enable_output(buck16_t *ctx, uint8_t enable)
Enable/Disable voltage output.
err_t buck16_set_output(buck16_t *ctx, uint16_t vout)
Set output voltage.
err_t buck16_generic_write(buck16_t *ctx, uint8_t cmd, uint8_t cmd_bits, uint16_t tx_data)
Data writing function.
err_t buck16_set_potentiometer(buck16_t *ctx, uint16_t rwb)
Set potentiometer resistivity.
err_t buck16_init(buck16_t *ctx, buck16_cfg_t *cfg)
Buck 16 initialization function.
void buck16_cfg_setup(buck16_cfg_t *cfg)
Buck 16 configuration object setup function.
This file contains SPI specific macros, functions, etc.
Buck 16 Click configuration object.
Definition buck16.h:165
spi_master_chip_select_polarity_t cs_polarity
Definition buck16.h:178
pin_name_t sck
Definition buck16.h:169
spi_master_mode_t spi_mode
Definition buck16.h:177
pin_name_t mosi
Definition buck16.h:168
uint32_t spi_speed
Definition buck16.h:176
pin_name_t miso
Definition buck16.h:167
pin_name_t rst
Definition buck16.h:173
pin_name_t cs
Definition buck16.h:170
Buck 16 Click context object.
Definition buck16.h:150
spi_master_t spi
Definition buck16.h:155
digital_out_t rst
Definition buck16.h:152
pin_name_t chip_select
Definition buck16.h:156