42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_spi_master.h"
65#define LINHALL_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
67 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
68 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
69 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS );
77#define LINHALL_RETVAL uint8_t
79#define LINHALL_OK 0x00
80#define LINHALL_INIT_ERROR 0xFF
#define LINHALL_RETVAL
Definition linhall.h:77
void linhall_cfg_setup(linhall_cfg_t *cfg)
Config Object Initialization function.
void linhall_generic_transfer(linhall_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
uint16_t linhall_read_data(linhall_t *ctx)
Read 12-bit data function.
LINHALL_RETVAL linhall_init(linhall_t *ctx, linhall_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition linhall.h:108
spi_master_chip_select_polarity_t cs_polarity
Definition linhall.h:120
pin_name_t sck
Definition linhall.h:113
spi_master_mode_t spi_mode
Definition linhall.h:119
pin_name_t mosi
Definition linhall.h:112
uint32_t spi_speed
Definition linhall.h:118
pin_name_t miso
Definition linhall.h:111
pin_name_t cs
Definition linhall.h:114
Click ctx object definition.
Definition linhall.h:94
digital_out_t cs
Definition linhall.h:95
spi_master_t spi
Definition linhall.h:99
pin_name_t chip_select
Definition linhall.h:100