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_analog_in.h"
73#define PROFET23A_MODE_ON 1
74#define PROFET23A_MODE_OFF 2
75#define PROFET23A_DIAGNOSTIC_ON 3
76#define PROFET23A_DIAGNOSTIC_OFF 4
94#define PROFET23A_MAP_MIKROBUS( cfg, mikrobus ) \
95 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
96 cfg.dsl = MIKROBUS( mikrobus, MIKROBUS_RST ); \
97 cfg.den = MIKROBUS( mikrobus, MIKROBUS_CS ); \
98 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
99 cfg.in0 = MIKROBUS( mikrobus, MIKROBUS_INT )
err_t profet23a_set_mode(profet23a_t *ctx, profet23a_channel_t channel, uint8_t mode)
Set mode device mode for specific channel channel.
void profet23a_set_dsl(profet23a_t *ctx, uint8_t state)
Set diagnostic select pin state.
void profet23a_set_in0(profet23a_t *ctx, uint8_t state)
Set channel 0 enable pin state.
err_t profet23a_read_an_pin_value(profet23a_t *ctx, uint16_t *data_out)
Read AN pin value function.
err_t profet23a_read_an_pin_voltage(profet23a_t *ctx, float *data_out)
Read AN pin voltage level function.
err_t profet23a_init(profet23a_t *ctx, profet23a_cfg_t *cfg)
PROFET 2 3A initialization function.
void profet23a_set_den(profet23a_t *ctx, uint8_t state)
Set diagnostic enable pin state.
void profet23a_cfg_setup(profet23a_cfg_t *cfg)
PROFET 2 3A configuration object setup function.
void profet23a_set_in1(profet23a_t *ctx, uint8_t state)
Set channel 1 enable pin state.
err_t profet23a_default_cfg(profet23a_t *ctx)
PROFET 2 3A default configuration function.
profet23a_channel_t
PROFET 2 3A channel select.
Definition profet23a.h:158
@ PROFET23A_CHANNEL_1
Definition profet23a.h:160
@ PROFET23A_CHANNEL_0
Definition profet23a.h:159
profet23a_return_value_t
PROFET 2 3A Click return value data.
Definition profet23a.h:146
@ PROFET23A_OK
Definition profet23a.h:147
@ PROFET23A_ERROR
Definition profet23a.h:148
@ PROFET23A_ERROR_CHANNEL
Definition profet23a.h:149
PROFET 2 3A Click configuration object.
Definition profet23a.h:129
pin_name_t in0
Definition profet23a.h:134
analog_in_resolution_t resolution
Definition profet23a.h:136
float vref
Definition profet23a.h:137
pin_name_t dsl
Definition profet23a.h:131
pin_name_t in1
Definition profet23a.h:133
pin_name_t den
Definition profet23a.h:132
pin_name_t an
Definition profet23a.h:130
PROFET 2 3A Click context object.
Definition profet23a.h:109
digital_out_t den
Definition profet23a.h:111
digital_out_t dsl
Definition profet23a.h:110
uint8_t mode
Definition profet23a.h:117
uint16_t rsens
Definition profet23a.h:119
uint8_t channel
Definition profet23a.h:118
uint16_t kilis
Definition profet23a.h:120
digital_out_t in1
Definition profet23a.h:112
analog_in_t adc
Definition profet23a.h:115
digital_out_t in0
Definition profet23a.h:113