stspin233 2.0.0.0
Public function

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

Function Documentation

◆ stspin233_cfg_setup()

void stspin233_cfg_setup ( stspin233_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ stspin233_default_cfg()

void stspin233_default_cfg ( stspin233_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for STSPIN233 click.

◆ stspin233_generic_read()

int32_t stspin233_generic_read ( stspin233_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

Parameters
ctxClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ stspin233_generic_write()

void stspin233_generic_write ( stspin233_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ stspin233_get_int_state()

uint8_t stspin233_get_int_state ( stspin233_t * ctx)

Get INT pin state.

Parameters
ctxClick object.
Returns
INT pin state

◆ stspin233_init()

STSPIN233_RETVAL stspin233_init ( stspin233_t * ctx,
stspin233_cfg_t * cfg )

Initialization function.

Parameters
stspin233Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ stspin233_send_double_cmd()

void stspin233_send_double_cmd ( stspin233_t * ctx,
uint8_t * cmd_buf,
uint8_t * arg_buf )

Send double command.

Parameters
ctxClick object.
cmd_bufCommand buffer
arg_bufArgument buffer

@Description This function sends two command buffer.

    example: Engine direction set command.
             Command: DIRECT
             Argument: 0 [CW] or 1 [CCW]

◆ stspin233_send_single_cmd()

void stspin233_send_single_cmd ( stspin233_t * ctx,
uint8_t * tx_buf )

Send single command.

Parameters
ctxClick object.
tx_bufCommand buffer

@Description This function sends one command buffer.

    example: Start motor command.
             Command: STARTM

◆ stspin233_set_reset_state()

void stspin233_set_reset_state ( stspin233_t * ctx,
uint8_t state )

Set RST pin state.

Parameters
ctxClick object.
stateRST pin state

◆ stspin233_wakeup()

void stspin233_wakeup ( stspin233_t * ctx)

Module wake-up (procedure)

Parameters
ctxClick object.