Go to the documentation of this file.
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 //500
267 #endif // _STSPIN250_H_
void stspin250_enable(stspin250_t *ctx, uint8_t state)
Enable pin function.
#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.
void stspin250_pwm_stop(stspin250_t *ctx)
Stop PWM module.
digital_in_t flt
Definition: stspin250.h:120
void stspin250_set_ph(stspin250_t *ctx, uint8_t state)
Dir ctrl pin function.
Click configuration structure definition.
Definition: stspin250.h:136
void stspin250_cfg_setup(stspin250_cfg_t *cfg)
Config Object Initialization function.
uint32_t dev_pwm_freq
Definition: stspin250.h:150
pwm_t pwm
Definition: stspin250.h:124
uint32_t pwm_freq
Definition: stspin250.h:128
pin_name_t rst
Definition: stspin250.h:144
pin_name_t pwm
Definition: stspin250.h:139
void stspin250_set_duty_cycle(stspin250_t *ctx, float duty_cycle)
Generic sets PWM duty cycle.
void stspin250_reset(stspin250_t *ctx)
Reset pin function.
Click ctx object definition.
Definition: stspin250.h:110
pin_name_t ph
Definition: stspin250.h:143
STSPIN250_RETVAL stspin250_init(stspin250_t *ctx, stspin250_cfg_t *cfg)
Initialization function.
pin_name_t flt
Definition: stspin250.h:146
digital_out_t en
Definition: stspin250.h:116
digital_out_t ph
Definition: stspin250.h:114
pin_name_t en
Definition: stspin250.h:145
digital_out_t rst
Definition: stspin250.h:115
void stspin250_default_cfg(stspin250_t *ctx)
Click Default Configuration function.