Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
62 #define STSPIN250_MAP_MIKROBUS( cfg, mikrobus ) \
63 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
64 cfg.ph = MIKROBUS( mikrobus, MIKROBUS_AN ); \
65 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
66 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
67 cfg.flt = MIKROBUS( mikrobus, MIKROBUS_INT )
74 #define STSPIN250_RETVAL uint8_t
76 #define STSPIN250_OK 0x00
77 #define STSPIN250_INIT_ERROR 0xFF
84 #define STSPIN250_DEVICE_ENABLE 1
85 #define STSPIN250_DEVICE_DISABLE 0
92 #define STSPIN250_DEF_FREQ 20000 //500
263 #endif // _STSPIN250_H_
void stspin250_enable(stspin250_t *ctx, uint8_t state)
Enable pin function.
#define STSPIN250_RETVAL
Definition: stspin250.h:74
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:116
void stspin250_set_ph(stspin250_t *ctx, uint8_t state)
Dir ctrl pin function.
Click configuration structure definition.
Definition: stspin250.h:132
void stspin250_cfg_setup(stspin250_cfg_t *cfg)
Config Object Initialization function.
uint32_t dev_pwm_freq
Definition: stspin250.h:146
pwm_t pwm
Definition: stspin250.h:120
uint32_t pwm_freq
Definition: stspin250.h:124
pin_name_t rst
Definition: stspin250.h:140
pin_name_t pwm
Definition: stspin250.h:135
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:106
pin_name_t ph
Definition: stspin250.h:139
STSPIN250_RETVAL stspin250_init(stspin250_t *ctx, stspin250_cfg_t *cfg)
Initialization function.
pin_name_t flt
Definition: stspin250.h:142
digital_out_t en
Definition: stspin250.h:112
digital_out_t ph
Definition: stspin250.h:110
pin_name_t en
Definition: stspin250.h:141
digital_out_t rst
Definition: stspin250.h:111
void stspin250_default_cfg(stspin250_t *ctx)
Click Default Configuration function.