Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define ANTOPWM2_OTP_BIT 0x80
70 #define ANTOPWM2_STATUS_READY 0x00
71 #define ANTOPWM2_STATUS_TEST_FUSE 0x40
72 #define ANTOPWM2_STATUS_FATAL_ERROR 0x80
73 #define ANTOPWM2_STATUS_OTP_SUCCESS 0xC0
74 #define ANTOPWM2_STATUS_MASK 0xC0
80 #define ANTOPWM2_DIGIPOT_WIPER_MAX 0x3F
81 #define ANTOPWM2_DIGIPOT_R6 49900u
82 #define ANTOPWM2_DIGIPOT_WIPER_RES 60
83 #define ANTOPWM2_DIGIPOT_MAX_RES 50000u
89 #define ANTOPWM2_FREQ_MAX 1000000ul
90 #define ANTOPWM2_FREQ_MIN 500000ul
91 #define ANTOPWM2_RSET_REF 50000u
92 #define ANTOPWM2_NDIV 1
99 #define ANTOPWM2_DEVICE_ADDRESS 0x2C
117 #define ANTOPWM2_MAP_MIKROBUS( cfg, mikrobus ) \
118 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
119 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
120 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
@ ANTOPWM2_ERROR
Definition: antopwm2.h:165
uint8_t i2c_address
Definition: antopwm2.h:154
antopwm2_return_value_t
AN to PWM 2 Click return value data.
Definition: antopwm2.h:163
err_t antopwm2_read_digipot(antopwm2_t *ctx, uint8_t *data_out)
AN to PWM 2 read digipot function.
err_t antopwm2_set_digipot_otp(antopwm2_t *ctx, uint8_t wiper)
AN to PWM 2 set digipot otp function.
pin_name_t scl
Definition: antopwm2.h:148
uint8_t slave_address
Definition: antopwm2.h:138
void antopwm2_cfg_setup(antopwm2_cfg_t *cfg)
AN to PWM 2 configuration object setup function.
@ ANTOPWM2_OK
Definition: antopwm2.h:164
err_t antopwm2_set_digipot(antopwm2_t *ctx, uint8_t wiper)
AN to PWM 2 set digipot function.
digital_in_t int_pin
Definition: antopwm2.h:132
err_t antopwm2_set_frequency_otp(antopwm2_t *ctx, uint32_t freq)
AN to PWM 2 set frequency otp function.
uint8_t antopwm2_get_int_pin(antopwm2_t *ctx)
AN to PWM 2 get int pin function.
pin_name_t int_pin
Definition: antopwm2.h:151
err_t antopwm2_set_frequency(antopwm2_t *ctx, uint32_t freq)
AN to PWM 2 set frequency function.
uint32_t i2c_speed
Definition: antopwm2.h:153
i2c_master_t i2c
Definition: antopwm2.h:135
AN to PWM 2 Click configuration object.
Definition: antopwm2.h:147
err_t antopwm2_init(antopwm2_t *ctx, antopwm2_cfg_t *cfg)
AN to PWM 2 initialization function.
AN to PWM 2 Click context object.
Definition: antopwm2.h:130
pin_name_t sda
Definition: antopwm2.h:149