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 LLCSPI_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 )
79#define LLCSPI_RETVAL uint8_t
82#define LLCSPI_INIT_ERROR 0xFF
#define LLCSPI_RETVAL
Definition llcspi.h:79
void llcspi_generic_read(llcspi_t *ctx, uint8_t *p_buf, uint16_t n_bytes)
LLC SPI read.
void llcspi_generic_write(llcspi_t *ctx, uint8_t *p_buf, uint16_t n_bytes)
LLC SPI write.
void llcspi_generic_transfer(llcspi_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void llcspi_cfg_setup(llcspi_cfg_t *cfg)
Config Object Initialization function.
void llcspi_set_cs_pin(llcspi_t *ctx, uint8_t state)
Function for set CS pin state.
LLCSPI_RETVAL llcspi_init(llcspi_t *ctx, llcspi_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition llcspi.h:110
spi_master_chip_select_polarity_t cs_polarity
Definition llcspi.h:122
pin_name_t sck
Definition llcspi.h:115
spi_master_mode_t spi_mode
Definition llcspi.h:121
pin_name_t mosi
Definition llcspi.h:114
uint32_t spi_speed
Definition llcspi.h:120
pin_name_t miso
Definition llcspi.h:113
pin_name_t cs
Definition llcspi.h:116
Click ctx object definition.
Definition llcspi.h:96
digital_out_t cs
Definition llcspi.h:97
spi_master_t spi
Definition llcspi.h:101
pin_name_t chip_select
Definition llcspi.h:102