joystick2 2.0.0.0

Functions

void joystick2_cfg_setup (joystick2_cfg_t *cfg)
 Config Object Initialization function.
 
JOYSTICK2_RETVAL joystick2_init (joystick2_t *ctx, joystick2_cfg_t *cfg)
 Initialization function.
 
void joystick2_default_cfg (joystick2_t *ctx)
 Click Default Configuration function.
 
void joystick2_generic_write (joystick2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void joystick2_generic_read (joystick2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void joystick2_reset (joystick2_t *ctx)
 Functions for reset module.
 
uint8_t joystick2_get_interrupt_state (joystick2_t *ctx)
 Functions for read interrupt state.
 
void joystick2_set_cfg_register (joystick2_t *ctx, uint8_t cfg_data)
 Functions for configuration joystick.
 
uint8_t joystick2_get_position (joystick2_t *ctx)
 Functions for get Joystick position.
 

Detailed Description

Function Documentation

◆ joystick2_cfg_setup()

void joystick2_cfg_setup ( joystick2_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.

◆ joystick2_default_cfg()

void joystick2_default_cfg ( joystick2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Joystick2 click.

Note
Functions and setups that are included in the device's start configuration:
  CONFIGURATION
-------------------------------------------
  JOYSTICK2_CFG_ENABLE_DOWN_POS
  JOYSTICK2_CFG_ENABLE_LEFT_POS
  JOYSTICK2_CFG_ENABLE_UP_POS
  JOYSTICK2_CFG_ENABLE_RIGHT_POS
  JOYSTICK2_CFG_ENABLE_BUTTON

◆ joystick2_generic_read()

void joystick2_generic_read ( joystick2_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.

◆ joystick2_generic_write()

void joystick2_generic_write ( joystick2_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.

◆ joystick2_get_interrupt_state()

uint8_t joystick2_get_interrupt_state ( joystick2_t * ctx)

Functions for read interrupt state.

Parameters
ctxClick object.
Return values
Interruptstate on the INT pin

◆ joystick2_get_position()

uint8_t joystick2_get_position ( joystick2_t * ctx)

Functions for get Joystick position.

Parameters
ctxClick object.
Return values
Joystickposition (UP, DOWN, LEFT, RIGHT or BUTTON ACTIVE)

◆ joystick2_init()

JOYSTICK2_RETVAL joystick2_init ( joystick2_t * ctx,
joystick2_cfg_t * cfg )

Initialization function.

Parameters
joystick2Click object.
cfgClick configuration structure.

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

◆ joystick2_reset()

void joystick2_reset ( joystick2_t * ctx)

Functions for reset module.

Parameters
ctxClick object.

◆ joystick2_set_cfg_register()

void joystick2_set_cfg_register ( joystick2_t * ctx,
uint8_t cfg_data )

Functions for configuration joystick.

Parameters
ctxClick object.
cfg_dataThe configuration data to be set
Note
Use this functions when you want to enable or disable the joystick position