oximeter 2.0.0.0
oximeter.h File Reference

This file contains API for Oximeter Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  oximeter_t
 Click ctx object definition. More...
 
struct  oximeter_cfg_t
 Click configuration structure definition. More...
 
struct  oximeter_enable_t
 

Macros

#define OXIMETER_MAP_MIKROBUS(cfg, mikrobus)
 
#define OXIMETER_OK   0
 
#define OXIMETER_ERROR   -1
 
#define OXIMETER_REG_STATUS   0x00
 
#define OXIMETER_REG_INT_MASK   0x01
 
#define OXIMETER_REG_GPIO_DRV   0x02
 
#define OXIMETER_REG_FIFO_THRESH   0x06
 
#define OXIMETER_REG_DEVID   0x08
 
#define OXIMETER_REG_I2CS_ID   0x09
 
#define OXIMETER_REG_CLK_RATIO   0x0A
 
#define OXIMETER_REG_GPIO_CTRL   0x0B
 
#define OXIMETER_REG_SLAVE_ADDRESS_KEY   0x0D
 
#define OXIMETER_REG_SW_RESET   0x0F
 
#define OXIMETER_REG_MODE   0x10
 
#define OXIMETER_REG_SLOT_EN   0x11
 
#define OXIMETER_REG_FSAMPLE   0x12
 
#define OXIMETER_REG_PD_LED_SELECT   0x14
 
#define OXIMETER_REG_NUM_AVG   0x15
 
#define OXIMETER_REG_SLOTA_CH1_OFFSET   0x18
 
#define OXIMETER_REG_SLOTA_CH2_OFFSET   0x19
 
#define OXIMETER_REG_SLOTA_CH3_OFFSET   0x1A
 
#define OXIMETER_REG_SLOTA_CH4_OFFSET   0x1B
 
#define OXIMETER_REG_SLOTB_CH1_OFFSET   0x1E
 
#define OXIMETER_REG_SLOTB_CH2_OFFSET   0x1F
 
#define OXIMETER_REG_SLOTB_CH3_OFFSET   0x20
 
#define OXIMETER_REG_SLOTB_CH4_OFFSET   0x21
 
#define OXIMETER_REG_ILED3_COARSE   0x22
 
#define OXIMETER_REG_ILED1_COARSE   0x23
 
#define OXIMETER_REG_ILED2_COARSE   0x24
 
#define OXIMETER_REG_ILED_FINE   0x25
 
#define OXIMETER_REG_SLOTA_LED_PULSE   0x30
 
#define OXIMETER_REG_SLOTA_NUMPULSES   0x31
 
#define OXIMETER_REG_LED_DISABLE   0x34
 
#define OXIMETER_REG_SLOTB_LED_PULSE   0x35
 
#define OXIMETER_REG_SLOTB_NUMPULSES   0x36
 
#define OXIMETER_REG_ALT_PWR_DN   0x37
 
#define OXIMETER_REG_EXT_SYNC_STARTUP   0x38
 
#define OXIMETER_REG_SLOTA_AFE_WINDOW   0x39
 
#define OXIMETER_REG_SLOTB_AFE_WINDOW   0x3B
 
#define OXIMETER_REG_AFE_PWR_CFG1   0x3C
 
#define OXIMETER_REG_SLOTA_TIA_CFG   0x42
 
#define OXIMETER_REG_SLOTA_AFE_CFG   0x43
 
#define OXIMETER_REG_SLOTB_TIA_CFG   0x44
 
#define OXIMETER_REG_SLOTB_AFE_CFG   0x45
 
#define OXIMETER_REG_SAMPLE_CLK   0x4B
 
#define OXIMETER_REG_CLK32M_ADJUST   0x4D
 
#define OXIMETER_REG_ADC_CLOCK   0x4E
 
#define OXIMETER_REG_EXT_SYNC_SEL   0x4F
 
#define OXIMETER_REG_CLK32M_CAL_EN   0x50
 
#define OXIMETER_REG_AFE_PWR_CFG2   0x54
 
#define OXIMETER_REG_TIA_INDEP_GAIN   0x55
 
#define OXIMETER_REG_DIGITAL_INT_EN   0x58
 
#define OXIMETER_REG_DIG_INT_CFG   0x5A
 
#define OXIMETER_REG_DATA_ACCESS_CTL   0x5F
 
#define OXIMETER_REG_FIFO_ACCESS   0x60
 
#define OXIMETER_REG_SLOTA_PD1_16BIT   0x64
 
#define OXIMETER_REG_SLOTA_PD2_16BIT   0x65
 
#define OXIMETER_REG_SLOTA_PD3_16BIT   0x66
 
#define OXIMETER_REG_SLOTA_PD4_16BIT   0x67
 
#define OXIMETER_REG_SLOTB_PD1_16BIT   0x68
 
#define OXIMETER_REG_SLOTB_PD2_16BIT   0x69
 
#define OXIMETER_REG_SLOTB_PD3_16BIT   0x6A
 
#define OXIMETER_REG_SLOTB_PD4_16BIT   0x6B
 
#define OXIMETER_REG_A_PD1_LOW   0x70
 
#define OXIMETER_REG_A_PD2_LOW   0x71
 
#define OXIMETER_REG_A_PD3_LOW   0x72
 
#define OXIMETER_REG_A_PD4_LOW   0x73
 
#define OXIMETER_REG_A_PD1_HIGH   0x74
 
#define OXIMETER_REG_A_PD2_HIGH   0x75
 
#define OXIMETER_REG_A_PD3_HIGH   0x76
 
#define OXIMETER_REG_A_PD4_HIGH   0x77
 
#define OXIMETER_REG_B_PD1_LOW   0x78
 
#define OXIMETER_REG_B_PD2_LOW   0x79
 
#define OXIMETER_REG_B_PD3_LOW   0x7A
 
#define OXIMETER_REG_B_PD4_LOW   0x7B
 
#define OXIMETER_REG_B_PD1_HIGH   0x7C
 
#define OXIMETER_REG_B_PD2_HIGH   0x7D
 
#define OXIMETER_REG_B_PD3_HIGH   0x7E
 
#define OXIMETER_REG_B_PD4_HIGH   0x7F
 
#define OXIMETER_DIS_SLOT   0x00
 
#define OXIMETER_EN_SLOT   0x01
 
#define OXIMETER_NO_PHOTODIODE_CONN   0x00
 
#define OXIMETER_ALL_PHOTODIODE_CONN   0x01
 
#define OXIMETER_PD5_PD6_PD7_PD8_CONN   0x02
 
#define OXIMETER_PD1_PD2_PD3_PD4_CONN   0x03
 
#define OXIMETER_PDX_TO_AFE   0x00
 
#define OXIMETER_LEDX1_EN   0x01
 
#define OXIMETER_LEDX2_EN   0x02
 
#define OXIMETER_LEDX3_EN   0x03
 
#define OXIMETER_DIS_LED   0x04
 
#define OXIMETER_SLOT_NORM_OP_MODE   0x00
 
#define OXIMETER_SLOT_DIG_INT_OP_MODE   0x01
 
#define OXIMETER_CH1_EN   0x00
 
#define OXIMETER_CH2_EN   0x01
 
#define OXIMETER_CH1_CH2_EN   0x02
 
#define OXIMETER_CH3_CH4_EN   0x03
 
#define OXIMETER_CH2_CH3_CH4_EN   0x04
 
#define OXIMETER_ALL_CHANN_EN   0x05
 
#define OXIMETER_AVERAGE_RES_MODE   0x00
 
#define OXIMETER_SUM_RES_MODE   0x01
 
#define OXIMETER_DEV_STANDBY_OP_MODE   0x0000
 
#define OXIMETER_DEV_PROGRAM_OP_MODE   0x0001
 
#define OXIMETER_DEV_NORMAL_OP_MODE   0x0002
 
#define OXIMETER_DEVICE_ADDRESS   0x64
 

Functions

void oximeter_cfg_setup (oximeter_cfg_t *cfg)
 Config Object Initialization function.
 
err_t oximeter_init (oximeter_t *ctx, oximeter_cfg_t *cfg)
 Initialization function.
 
void oximeter_default_cfg (oximeter_t *ctx)
 Click Default Configuration function.
 
err_t oximeter_write_reg (oximeter_t *ctx, uint8_t reg, uint16_t data_in)
 Generic Write function.
 
err_t oximeter_read_reg (oximeter_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t len)
 Generic Read function.
 
err_t oximeter_set_time_slot_a (oximeter_t *ctx, oximeter_enable_t *dev_enable, uint8_t set_mode)
 Time Slot A Set function.
 
err_t oximeter_set_time_slot_b (oximeter_t *ctx, oximeter_enable_t *dev_enable, uint8_t set_mode)
 Time Slot B Set function.
 
err_t oximeter_enable_channels (oximeter_t *ctx, uint8_t select_channel)
 Channels Enable function.
 
void oximeter_read_data (oximeter_t *ctx, uint32_t *chann_results, uint8_t result_mode)
 Data Read function.
 
uint8_t oximeter_get_int_gpio0 (oximeter_t *ctx)
 GPIO0 Interrupt Get function.
 
uint8_t oximeter_get_int_gpio1 (oximeter_t *ctx)
 GPIO1 Interrupt Get function.
 
void oximeter_reset (oximeter_t *ctx)
 Reset function.
 
err_t oximeter_set_mode (oximeter_t *ctx, uint16_t select_mode)
 Mode Set function.
 

Detailed Description

This file contains API for Oximeter Click driver.