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 PROFET27A_MODE_ON 1
74#define PROFET27A_MODE_OFF 2
75#define PROFET27A_DIAGNOSTIC_ON 3
76#define PROFET27A_DIAGNOSTIC_OFF 4
94#define PROFET27A_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 profet27a_read_an_pin_value(profet27a_t *ctx, uint16_t *data_out)
Read AN pin value function.
void profet27a_cfg_setup(profet27a_cfg_t *cfg)
PROFET 2 7A configuration object setup function.
void profet27a_set_in0(profet27a_t *ctx, uint8_t state)
Set channel 0 enable pin state.
void profet27a_set_in1(profet27a_t *ctx, uint8_t state)
Set channel 1 enable pin state.
void profet27a_set_den(profet27a_t *ctx, uint8_t state)
Set diagnostic enable pin state.
err_t profet27a_read_an_pin_voltage(profet27a_t *ctx, float *data_out)
Read AN pin voltage level function.
err_t profet27a_default_cfg(profet27a_t *ctx)
PROFET 2 7A default configuration function.
err_t profet27a_init(profet27a_t *ctx, profet27a_cfg_t *cfg)
PROFET 2 7A initialization function.
err_t profet27a_set_mode(profet27a_t *ctx, profet27a_channel_t channel, uint8_t mode)
Set mode device mode for specific channel channel.
void profet27a_set_dsl(profet27a_t *ctx, uint8_t state)
Set diagnostic select pin state.
profet27a_return_value_t
PROFET 2 7A Click return value data.
Definition profet27a.h:146
@ PROFET27A_ERROR_CHANNEL
Definition profet27a.h:149
@ PROFET27A_OK
Definition profet27a.h:147
@ PROFET27A_ERROR
Definition profet27a.h:148
profet27a_channel_t
PROFET 2 7A channel select.
Definition profet27a.h:158
@ PROFET27A_CHANNEL_0
Definition profet27a.h:159
@ PROFET27A_CHANNEL_1
Definition profet27a.h:160
PROFET 2 7A Click configuration object.
Definition profet27a.h:129
pin_name_t in0
Definition profet27a.h:134
analog_in_resolution_t resolution
Definition profet27a.h:136
float vref
Definition profet27a.h:137
pin_name_t dsl
Definition profet27a.h:131
pin_name_t in1
Definition profet27a.h:133
pin_name_t den
Definition profet27a.h:132
pin_name_t an
Definition profet27a.h:130
PROFET 2 7A Click context object.
Definition profet27a.h:109
digital_out_t den
Definition profet27a.h:111
digital_out_t dsl
Definition profet27a.h:110
uint8_t mode
Definition profet27a.h:117
uint16_t rsens
Definition profet27a.h:119
uint8_t channel
Definition profet27a.h:118
uint16_t kilis
Definition profet27a.h:120
digital_out_t in1
Definition profet27a.h:112
analog_in_t adc
Definition profet27a.h:115
digital_out_t in0
Definition profet27a.h:113