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 AMBIENT4_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
77#define AMBIENT4_RETVAL uint8_t
79#define AMBIENT4_OK 0x00
80#define AMBIENT4_INIT_ERROR 0xFF
87#define AMBIENT4_CMD_POWER_DOWN 0x00
88#define AMBIENT4_CMD_POWER_ON 0x01
89#define AMBIENT4_CMD_AUTO_RESOLUTION_MODE 0x10
90#define AMBIENT4_CMD_HIGH_RESOLUTION_MODE 0x12
91#define AMBIENT4_CMD_LOW_RESOLUTION_MODE 0x13
#define AMBIENT4_RETVAL
Definition ambient4.h:77
void ambient4_device_reset(ambient4_t *ctx)
Function for device reset.
void ambient4_generic_read(ambient4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void ambient4_send_command(ambient4_t *ctx, uint8_t cmd)
Function for send command.
AMBIENT4_RETVAL ambient4_init(ambient4_t *ctx, ambient4_cfg_t *cfg)
Initialization function.
void ambient4_cfg_setup(ambient4_cfg_t *cfg)
Config Object Initialization function.
void ambient4_default_cfg(ambient4_t *ctx)
Click Default Configuration function.
uint16_t ambient4_read_data(ambient4_t *ctx)
Function for read 16bit data.
void ambient4_generic_write(ambient4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition ambient4.h:124
uint32_t i2c_speed
Definition ambient4.h:136
pin_name_t scl
Definition ambient4.h:127
pin_name_t sda
Definition ambient4.h:128
pin_name_t rst
Definition ambient4.h:132
uint8_t i2c_address
Definition ambient4.h:137
Click ctx object definition.
Definition ambient4.h:105
i2c_master_t i2c
Definition ambient4.h:112
digital_out_t rst
Definition ambient4.h:108
uint8_t slave_address
Definition ambient4.h:116