42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define STSPIN250_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.ph = MIKROBUS( mikrobus, MIKROBUS_AN ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
78#define STSPIN250_RETVAL uint8_t
80#define STSPIN250_OK 0x00
81#define STSPIN250_INIT_ERROR 0xFF
88#define STSPIN250_DEVICE_ENABLE 1
89#define STSPIN250_DEVICE_DISABLE 0
96#define STSPIN250_DEF_FREQ 20000
#define STSPIN250_RETVAL
Definition stspin250.h:78
void stspin250_pwm_start(stspin250_t *ctx)
Start PWM module.
uint8_t stspin250_get_fault(stspin250_t *ctx)
Fault get function.
STSPIN250_RETVAL stspin250_init(stspin250_t *ctx, stspin250_cfg_t *cfg)
Initialization function.
void stspin250_enable(stspin250_t *ctx, uint8_t state)
Enable pin function.
void stspin250_cfg_setup(stspin250_cfg_t *cfg)
Config Object Initialization function.
void stspin250_set_duty_cycle(stspin250_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void stspin250_set_ph(stspin250_t *ctx, uint8_t state)
Dir ctrl pin function.
void stspin250_reset(stspin250_t *ctx)
Reset pin function.
void stspin250_pwm_stop(stspin250_t *ctx)
Stop PWM module.
void stspin250_default_cfg(stspin250_t *ctx)
Click Default Configuration function.
Click configuration structure definition.
Definition stspin250.h:136
pin_name_t ph
Definition stspin250.h:143
uint32_t dev_pwm_freq
Definition stspin250.h:150
pin_name_t flt
Definition stspin250.h:146
pin_name_t en
Definition stspin250.h:145
pin_name_t pwm
Definition stspin250.h:139
pin_name_t rst
Definition stspin250.h:144
Click ctx object definition.
Definition stspin250.h:110
digital_in_t flt
Definition stspin250.h:120
uint32_t pwm_freq
Definition stspin250.h:128
digital_out_t en
Definition stspin250.h:116
digital_out_t rst
Definition stspin250.h:115
digital_out_t ph
Definition stspin250.h:114
pwm_t pwm
Definition stspin250.h:124