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_i2c_master.h"
66#define SRAM2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.wp = MIKROBUS( mikrobus, MIKROBUS_PWM )
76#define SRAM2_RETVAL uint8_t
79#define SRAM2_INIT_ERROR 0xFF
86#define SRAM2_WR_ENABLE 0x01
87#define SRAM2_WR_DISABLE 0x00
94#define SRAM2_SLAVE_ADDR_0_0 0x51
95#define SRAM2_SLAVE_ADDR_0_1 0x53
96#define SRAM2_SLAVE_ADDR_1_0 0x55
97#define SRAM2_SLAVE_ADDR_1_1 0x57
#define SRAM2_RETVAL
Definition sram2.h:76
void sram2_write_protect(sram2_t *ctx, uint8_t state)
Set PWM pin for write protection.
void sram2_generic_read(sram2_t *ctx, uint16_t reg, uint8_t *rx_data)
Generic read function.
SRAM2_RETVAL sram2_init(sram2_t *ctx, sram2_cfg_t *cfg)
Initialization function.
void sram2_cfg_setup(sram2_cfg_t *cfg)
Config Object Initialization function.
void sram2_generic_write(sram2_t *ctx, uint16_t reg, uint8_t wr_data)
Generic write function.
Click configuration structure definition.
Definition sram2.h:130
uint32_t i2c_speed
Definition sram2.h:142
pin_name_t wp
Definition sram2.h:138
pin_name_t scl
Definition sram2.h:133
pin_name_t sda
Definition sram2.h:134
uint8_t i2c_address
Definition sram2.h:143
Click ctx object definition.
Definition sram2.h:111
i2c_master_t i2c
Definition sram2.h:118
uint8_t slave_address
Definition sram2.h:122
digital_out_t wp
Definition sram2.h:114