42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
68#define MCP16331_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.adc_out = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
81#define MCP16331_RETVAL uint8_t
83#define MCP16331_OK 0x00
84#define MCP16331_INIT_ERROR 0xFF
#define MCP16331_RETVAL
Definition mcp16331.h:81
MCP16331_RETVAL mcp16331_init(mcp16331_t *ctx, mcp16331_cfg_t *cfg)
Initialization function.
void mcp16331_generic_transfer(mcp16331_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void mcp16331_cfg_setup(mcp16331_cfg_t *cfg)
Config Object Initialization function.
void mcp16331_set_vout(mcp16331_t *ctx, uint16_t millivolts_vout)
mcp16331 set vout
Click configuration structure definition.
Definition mcp16331.h:119
uint8_t spi_mode
Definition mcp16331.h:135
pin_name_t adc_out
Definition mcp16331.h:129
spi_master_chip_select_polarity_t cs_polarity
Definition mcp16331.h:136
pin_name_t sck
Definition mcp16331.h:124
pin_name_t mosi
Definition mcp16331.h:123
uint32_t spi_speed
Definition mcp16331.h:134
pin_name_t en
Definition mcp16331.h:130
pin_name_t miso
Definition mcp16331.h:122
pin_name_t cs
Definition mcp16331.h:125
Click ctx object definition.
Definition mcp16331.h:98
digital_out_t cs
Definition mcp16331.h:101
spi_master_t spi
Definition mcp16331.h:110
digital_out_t en
Definition mcp16331.h:102
pin_name_t chip_select
Definition mcp16331.h:111
digital_in_t adc_out
Definition mcp16331.h:106