Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
52 #define STSPIN250_MAP_MIKROBUS( cfg, mikrobus ) \
53 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
54 cfg.ph = MIKROBUS( mikrobus, MIKROBUS_AN ); \
55 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
56 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
57 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
64 #define STSPIN250_RETVAL uint8_t
66 #define STSPIN250_OK 0x00
67 #define STSPIN250_INIT_ERROR 0xFF
74 #define STSPIN250_DEVICE_ENABLE 1
75 #define STSPIN250_DEVICE_DISABLE 0
82 #define STSPIN250_DEF_FREQ 20000 //500
253 #endif // _STSPIN250_H_
void stspin250_enable(stspin250_t *ctx, uint8_t state)
Enable pin function.
#define STSPIN250_RETVAL
Definition: stspin250.h:64
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:106
void stspin250_set_ph(stspin250_t *ctx, uint8_t state)
Dir ctrl pin function.
Click configuration structure definition.
Definition: stspin250.h:121
void stspin250_cfg_setup(stspin250_cfg_t *cfg)
Config Object Initialization function.
uint32_t dev_pwm_freq
Definition: stspin250.h:136
pwm_t pwm
Definition: stspin250.h:110
uint32_t pwm_freq
Definition: stspin250.h:114
pin_name_t rst
Definition: stspin250.h:130
pin_name_t pwm
Definition: stspin250.h:125
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:95
pin_name_t ph
Definition: stspin250.h:129
STSPIN250_RETVAL stspin250_init(stspin250_t *ctx, stspin250_cfg_t *cfg)
Initialization function.
pin_name_t flt
Definition: stspin250.h:132
digital_out_t en
Definition: stspin250.h:102
digital_out_t ph
Definition: stspin250.h:100
pin_name_t en
Definition: stspin250.h:131
digital_out_t rst
Definition: stspin250.h:101
void stspin250_default_cfg(stspin250_t *ctx)
Click Default Configuration function.