knob  2.0.0.0
Functions
Public function

Functions

void knob_cfg_setup (knob_cfg_t *cfg)
 Config Object Initialization function. More...
 
KNOB_RETVAL knob_init (knob_t *ctx, knob_cfg_t *cfg)
 Initialization function. More...
 
void knob_default_cfg (knob_t *ctx)
 Click Default Configuration function. More...
 
void knob_generic_write (knob_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void knob_generic_read (knob_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void knob_reset (knob_t *ctx)
 Functions for reset device. More...
 
void knob_led_output_enable (knob_t *ctx, uint8_t state)
 Functions for enable Led Output. More...
 
uint8_t knob_get_ena_state (knob_t *ctx)
 Functions for get ENA pin state. More...
 
uint8_t knob_get_enb_state (knob_t *ctx)
 Functions for get ENB pin state. More...
 
uint8_t knob_get_sw_button_state (knob_t *ctx)
 Functions for get SW pin(switch button) state. More...
 
void knob_set_encoder_start_position (knob_t *ctx, int32_t position)
 Functions for set new start encoder position. More...
 
void knob_set_led_state (knob_t *ctx, uint8_t led, uint8_t state)
 Functions for set led state(PWM on the LED) More...
 
void knob_set_brightness (knob_t *ctx, uint8_t led, uint8_t value)
 Functions for set Brightness. More...
 
void knob_set_output_gain (knob_t *ctx, uint8_t led, uint8_t value)
 Functions for set output GAIN. More...
 
void knob_get_encoder_position (knob_t *ctx, int32_t *position, uint8_t *dir)
 Functions for get Encoder position. More...
 

Detailed Description

Function Documentation

◆ knob_cfg_setup()

void knob_cfg_setup ( knob_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.

◆ knob_default_cfg()

void knob_default_cfg ( knob_t ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Knob Click.

Note
The default Click set contains:
  • Led output enable ** KNOB_ENABLE_LED_OUTPUTS
  • Output gain ** KNOB_OUTPUT_GAIN_ALL_LED ** KNOB_FULL_OUTPUT_CURRENT_GAIN
  • Encoder start position ** Sets on the 1 *

◆ knob_generic_read()

void knob_generic_read ( knob_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ knob_generic_write()

void knob_generic_write ( knob_t ctx,
uint8_t  reg,
uint8_t *  data_buf,
uint8_t  len 
)

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ knob_get_ena_state()

uint8_t knob_get_ena_state ( knob_t ctx)

Functions for get ENA pin state.

Parameters
ctxClick object.
Returns
ENA (AN) pin state

◆ knob_get_enb_state()

uint8_t knob_get_enb_state ( knob_t ctx)

Functions for get ENB pin state.

Parameters
ctxClick object.
Returns
ENB (CS) pin state

◆ knob_get_encoder_position()

void knob_get_encoder_position ( knob_t ctx,
int32_t *  position,
uint8_t *  dir 
)

Functions for get Encoder position.

Parameters
ctxClick object.
positionEncoder position (counter)
dirEncoder direction

◆ knob_get_sw_button_state()

uint8_t knob_get_sw_button_state ( knob_t ctx)

Functions for get SW pin(switch button) state.

Parameters
ctxClick object.
Returns
Switch (INT) pin state

◆ knob_init()

KNOB_RETVAL knob_init ( knob_t ctx,
knob_cfg_t cfg 
)

Initialization function.

Parameters
knobClick object.
cfgClick configuration structure.

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

◆ knob_led_output_enable()

void knob_led_output_enable ( knob_t ctx,
uint8_t  state 
)

Functions for enable Led Output.

Parameters
ctxClick object.
stateEnable or disable leds

◆ knob_reset()

void knob_reset ( knob_t ctx)

Functions for reset device.

Parameters
ctxClick object.

◆ knob_set_brightness()

void knob_set_brightness ( knob_t ctx,
uint8_t  led,
uint8_t  value 
)

Functions for set Brightness.

Parameters
ctxClick object.
ledLEDs
valuePWM(state)
Note
For Led you can choose to set all LEDs(_KNOBG_BRIGHTNESS_ALL_LED) or set one LED( BRIGHTNESS_CONTROL_LED_0 to BRIGHTNESS_CONTROL_LED_23 ) to the desired state

◆ knob_set_encoder_start_position()

void knob_set_encoder_start_position ( knob_t ctx,
int32_t  position 
)

Functions for set new start encoder position.

Parameters
ctxClick object.
positionStart encoder position

◆ knob_set_led_state()

void knob_set_led_state ( knob_t ctx,
uint8_t  led,
uint8_t  state 
)

Functions for set led state(PWM on the LED)

Parameters
ctxClick object.
ledLEDs
valuePWM (state)

◆ knob_set_output_gain()

void knob_set_output_gain ( knob_t ctx,
uint8_t  led,
uint8_t  value 
)

Functions for set output GAIN.

Parameters
ctxClick object.
ledLEDs
valuePWM(state)
Note
For Led you can choose to set all LEDs( OUTPUT_GAIN_ALL_LED ) or set one LED( OUTPUT_GAIN_CONTROL_0 to OUTPUT_GAIN_CONTROL_1 ) to the desired state