Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_spi_master.h"
60 #define VCPMONITOR4_REG_CONFIG 0x00
61 #define VCPMONITOR4_REG_ADC_CONFIG 0x01
62 #define VCPMONITOR4_REG_SHUNT_CAL 0x02
63 #define VCPMONITOR4_REG_VSHUNT 0x04
64 #define VCPMONITOR4_REG_VBUS 0x05
65 #define VCPMONITOR4_REG_DIETEMP 0x06
66 #define VCPMONITOR4_REG_CURRENT 0x07
67 #define VCPMONITOR4_REG_POWER 0x08
68 #define VCPMONITOR4_REG_DIAG_ALERT 0x0B
69 #define VCPMONITOR4_REG_SOVL 0x0C
70 #define VCPMONITOR4_REG_SUVL 0x0D
71 #define VCPMONITOR4_REG_BOVL 0x0E
72 #define VCPMONITOR4_REG_BUVL 0x0F
73 #define VCPMONITOR4_REG_TEMP_LIMIT 0x10
74 #define VCPMONITOR4_REG_PWR_LIMIT 0x11
75 #define VCPMONITOR4_REG_MANUFACTURER_ID 0x3E
76 #define VCPMONITOR4_REG_DEVICE_ID 0x3F
94 #define VCPMONITOR4_CURRENT_LSB 0.000305
104 #define VCPMONITOR4_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
105 #define VCPMONITOR4_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
123 #define VCPMONITOR4_MAP_MIKROBUS( cfg, mikrobus ) \
124 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
125 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
126 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
127 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
128 cfg.alr = MIKROBUS( mikrobus, MIKROBUS_INT )
346 #endif // vcpmonitor4_H
VCP Monitor 4 Click context object.
Definition: vcpmonitor4.h:137
err_t vcpmonitor4_get_vbus(vcpmonitor4_t *ctx, float *vbus)
Get BUS voltage.
err_t vcpmonitor4_get_current(vcpmonitor4_t *ctx, float *current)
Get Current.
err_t vcpmonitor4_default_cfg(vcpmonitor4_t *ctx)
VCP Monitor 4 default configuration function.
err_t vcpmonitor4_generic_write(vcpmonitor4_t *ctx, uint8_t reg, uint16_t data_in)
VCP Monitor 4 data writing function.
err_t vcpmonitor4_init(vcpmonitor4_t *ctx, vcpmonitor4_cfg_t *cfg)
VCP Monitor 4 initialization function.
This file contains SPI specific macros, functions, etc.
spi_master_t spi
Definition: vcpmonitor4.h:143
uint8_t vcpmonitor4_get_alert(vcpmonitor4_t *ctx)
Get alert pin state.
spi_master_mode_t spi_mode
Definition: vcpmonitor4.h:166
vcpmonitor4_return_value_t
VCP Monitor 4 Click return value data.
Definition: vcpmonitor4.h:175
Definition: vcpmonitor4.h:178
spi_master_chip_select_polarity_t cs_polarity
Definition: vcpmonitor4.h:167
pin_name_t alr
Definition: vcpmonitor4.h:162
uint32_t spi_speed
Definition: vcpmonitor4.h:165
err_t vcpmonitor4_get_temperature(vcpmonitor4_t *ctx, float *temperature)
Get device temperature.
err_t vcpmonitor4_get_vshunt(vcpmonitor4_t *ctx, float *vshunt)
Get Shunt voltage.
pin_name_t cs
Definition: vcpmonitor4.h:159
pin_name_t mosi
Definition: vcpmonitor4.h:157
pin_name_t chip_select
Definition: vcpmonitor4.h:145
VCP Monitor 4 Click configuration object.
Definition: vcpmonitor4.h:153
pin_name_t sck
Definition: vcpmonitor4.h:158
err_t vcpmonitor4_get_power(vcpmonitor4_t *ctx, float *power)
Get Shunt voltage.
Definition: vcpmonitor4.h:177
pin_name_t miso
Definition: vcpmonitor4.h:156
err_t vcpmonitor4_generic_read(vcpmonitor4_t *ctx, uint8_t reg, uint32_t *data_out)
VCP Monitor 4 data reading function.
void vcpmonitor4_cfg_setup(vcpmonitor4_cfg_t *cfg)
VCP Monitor 4 configuration object setup function.
digital_in_t alr
Definition: vcpmonitor4.h:140