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 c420MAR_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_INT )
78#define c420MAR_RETVAL uint8_t
80#define c420MAR_OK 0x00
81#define c420MAR_INIT_ERROR 0xFF
#define c420MAR_RETVAL
Definition c420mar.h:78
float c420mar_read_data(c420mar_t *ctx)
Read data function.
void c420mar_generic_transfer(c420mar_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void c420mar_cfg_setup(c420mar_cfg_t *cfg)
Config Object Initialization function.
c420MAR_RETVAL c420mar_init(c420mar_t *ctx, c420mar_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition c420mar.h:113
spi_master_chip_select_polarity_t cs_polarity
Definition c420mar.h:129
pin_name_t sck
Definition c420mar.h:118
spi_master_mode_t spi_mode
Definition c420mar.h:128
pin_name_t mosi
Definition c420mar.h:117
uint32_t spi_speed
Definition c420mar.h:127
pin_name_t en
Definition c420mar.h:123
pin_name_t miso
Definition c420mar.h:116
pin_name_t cs
Definition c420mar.h:119
Click ctx object definition.
Definition c420mar.h:95
digital_out_t cs
Definition c420mar.h:96
spi_master_t spi
Definition c420mar.h:104
digital_out_t en
Definition c420mar.h:100
pin_name_t chip_select
Definition c420mar.h:105