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"
78#define SPIISOLATOR2_EEPROM5_CMD_WREN 0x06
79#define SPIISOLATOR2_EEPROM5_CMD_WRDI 0x04
80#define SPIISOLATOR2_EEPROM5_CMD_RDSR 0x05
81#define SPIISOLATOR2_EEPROM5_CMD_WRSR 0x01
82#define SPIISOLATOR2_EEPROM5_CMD_READ 0x03
83#define SPIISOLATOR2_EEPROM5_CMD_WRITE 0x02
84#define SPIISOLATOR2_EEPROM5_CMD_READ_ID 0x83
85#define SPIISOLATOR2_EEPROM5_CMD_WRITE_ID 0x82
86#define SPIISOLATOR2_EEPROM5_CMD_READ_LOCK_STATUS 0x83
87#define SPIISOLATOR2_EEPROM5_CMD_LOCK_ID 0x82
89#define SPIISOLATOR2_OUT_DISABLE 0x00
90#define SPIISOLATOR2_OUT_ENABLE 0x01
92#define SPIISOLATOR2_DUMMY 0x00
110#define SPIISOLATOR2_MAP_MIKROBUS( cfg, mikrobus ) \
111 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
112 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
113 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
114 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
115 cfg.en1 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
329 uint8_t *p_tx_data, uint8_t tx_data_n_bytes );
346 uint8_t *p_rx_data, uint8_t tx_data_n_bytes );
void spiisolator2_cfg_setup(spiisolator2_cfg_t *cfg)
SPI Isolator 2 configuration object setup function.
err_t spiisolator2_init(spiisolator2_t *ctx, spiisolator2_cfg_t *cfg)
SPI Isolator 2 initialization function.
void spiisolator2_set_cmd(spiisolator2_t *ctx, uint8_t cmd)
SPI Isolator 2 send command function.
uint8_t spiisolator2_read_byte(spiisolator2_t *ctx, uint8_t reg)
SPI Isolator 2 read the byte of data function.
void spiisolator2_multi_read(spiisolator2_t *ctx, uint32_t addr, uint8_t addr_n_bytes, uint8_t *p_rx_data, uint8_t tx_data_n_bytes)
SPI Isolator 2 multi read function.
void spiisolator2_burst_write(spiisolator2_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes)
SPI Isolator 2 burst write function.
err_t spiisolator2_generic_write(spiisolator2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
SPI Isolator 2 data writing function.
void spiisolator2_write_byte(spiisolator2_t *ctx, uint8_t reg, uint8_t tx_data)
SPI Isolator 2 write the byte of data function.
err_t spiisolator2_generic_read(spiisolator2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
SPI Isolator 2 data reading function.
void spiisolator2_multi_write(spiisolator2_t *ctx, uint32_t addr, uint8_t addr_n_bytes, uint8_t *p_tx_data, uint8_t tx_data_n_bytes)
SPI Isolator 2 multi write function.
void spiisolator2_burst_read(spiisolator2_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes)
SPI Isolator 2 burst read function.
void spiisolator2_output_enable(spiisolator2_t *ctx, uint8_t en_out)
SPI Isolator 2 output enable function.
spiisolator2_return_value_t
SPI Isolator 2 Click return value data.
Definition spiisolator2.h:163
@ SPIISOLATOR2_ERROR
Definition spiisolator2.h:165
@ SPIISOLATOR2_OK
Definition spiisolator2.h:164
SPI Isolator 2 Click configuration object.
Definition spiisolator2.h:141
spi_master_chip_select_polarity_t cs_polarity
Definition spiisolator2.h:154
pin_name_t sck
Definition spiisolator2.h:145
spi_master_mode_t spi_mode
Definition spiisolator2.h:153
pin_name_t en1
Definition spiisolator2.h:149
pin_name_t mosi
Definition spiisolator2.h:144
uint32_t spi_speed
Definition spiisolator2.h:152
pin_name_t miso
Definition spiisolator2.h:143
pin_name_t cs
Definition spiisolator2.h:146
SPI Isolator 2 Click context object.
Definition spiisolator2.h:125
spi_master_t spi
Definition spiisolator2.h:130
digital_out_t en1
Definition spiisolator2.h:127
pin_name_t chip_select
Definition spiisolator2.h:132