stspin233 2.0.0.0
stspin233.h File Reference

This file contains API for STSPIN233 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  stspin233_t
 Click ctx object definition. More...
 
struct  stspin233_cfg_t
 Click configuration structure definition. More...
 

Macros

#define DRV_RX_BUFFER_SIZE   500
 
#define STSPIN233_MAP_MIKROBUS(cfg, mikrobus)
 
#define STSPIN233_RETVAL   uint8_t
 
#define STSPIN233_OK   0x00
 
#define STSPIN233_INIT_ERROR   0xFF
 
#define STSPIN233_CMD_START_MOTOR   "STARTM"
 
#define STSPIN233_CMD_STOP_MOTOR   "STOPMT"
 
#define STSPIN233_CMD_DIR_MOTOR   "DIRECT"
 
#define STSPIN233_CMD_SET_SPEED   "SETSPD"
 
#define STSPIN233_CMD_GET_SPEED   "GETSPD"
 
#define STSPIN233_CMD_STATUS   "STATUS"
 
#define STSPIN233_CMD_HELP   "HELP"
 
#define STSPIN233_CMD_SET_PWM   "INIREF"
 
#define STSPIN233_CMD_COM_DELAY   "COMDEL"
 
#define STSPIN233_CMD_MOTOR_POLE   "POLESP"
 
#define STSPIN233_CMD_KP_PRM   "KP-PRM"
 
#define STSPIN233_CMD_KI_PRM   "KI-PRM"
 
#define STSPIN233_CW_DIR   "1"
 
#define STSPIN233_CCW_DIR   "0"
 
#define STSPIN233_START_PWM_DUTY_10p   "409"
 
#define STSPIN233_START_PWM_DUTY_20p   "819"
 
#define STSPIN233_START_PWM_DUTY_DEF   "819"
 
#define STSPIN233_START_PWM_DUTY_30p   "1229"
 
#define STSPIN233_START_PWM_DUTY_40p   "1638"
 
#define STSPIN233_START_PWM_DUTY_50p   "2048"
 
#define STSPIN233_START_PWM_DUTY_60p   "2458"
 
#define STSPIN233_START_PWM_DUTY_70p   "2867"
 
#define STSPIN233_START_PWM_DUTY_80p   "3277"
 
#define STSPIN233_START_PWM_DUTY_90p   "3687"
 
#define STSPIN233_START_PWM_DUTY_100p   "4095"
 
#define STSPIN233_COMM_DELAY_7ms   "7"
 
#define STSPIN233_COMM_DELAY_DEF   "7"
 
#define STSPIN233_M_POLE_2   "2"
 
#define STSPIN233_M_POLE_3   "3"
 
#define STSPIN233_M_POLE_4   "4"
 
#define STSPIN233_M_POLE_5   "5"
 
#define STSPIN233_M_POLE_6   "6"
 
#define STSPIN233_M_POLE_DEF   "6"
 
#define STSPIN233_M_POLE_7   "7"
 
#define STSPIN233_M_POLE_8   "8"
 
#define STSPIN233_KP_PRM_DEF   "500"
 
#define STSPIN233_KI_PRM_DEF   "250"
 
#define STSPIN233_SPEED_1000RPM   "1000"
 
#define STSPIN233_SPEED_DEF   "1000"
 
#define STSPIN233_SPEED_900RPM   "900"
 
#define STSPIN233_SPEED_1100RPM   "1100"
 
#define STSPIN233_SPEED_1200RPM   "1200"
 
#define STSPIN233_SPEED_1300RPM   "1300"
 
#define STSPIN233_SPEED_1400RPM   "1400"
 
#define STSPIN233_SPEED_1500RPM   "1500"
 
#define STSPIN233_SPEED_1600RPM   "1600"
 
#define STSPIN233_SPEED_1700RPM   "1700"
 
#define STSPIN233_SPEED_1800RPM   "1800"
 
#define STSPIN233_SPEED_1900RPM   "1900"
 
#define STSPIN233_SPEED_2000RPM   "2000"
 
#define STSPIN233_SPEED_2100RPM   "2100"
 

Functions

void stspin233_cfg_setup (stspin233_cfg_t *cfg)
 Config Object Initialization function.
 
STSPIN233_RETVAL stspin233_init (stspin233_t *ctx, stspin233_cfg_t *cfg)
 Initialization function.
 
void stspin233_default_cfg (stspin233_t *ctx)
 Click Default Configuration function.
 
void stspin233_generic_write (stspin233_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t stspin233_generic_read (stspin233_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void stspin233_wakeup (stspin233_t *ctx)
 Module wake-up (procedure)
 
void stspin233_send_single_cmd (stspin233_t *ctx, uint8_t *tx_buf)
 Send single command.
 
void stspin233_send_double_cmd (stspin233_t *ctx, uint8_t *cmd_buf, uint8_t *arg_buf)
 Send double command.
 
void stspin233_set_reset_state (stspin233_t *ctx, uint8_t state)
 Set RST pin state.
 
uint8_t stspin233_get_int_state (stspin233_t *ctx)
 Get INT pin state.
 

Detailed Description

This file contains API for STSPIN233 Click driver.