joystick 2.0.0.0
joystick.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  joystick_t
 Click ctx object definition. More...
 
struct  joystick_cfg_t
 Click configuration structure definition. More...
 

Macros

#define JOYSTICK_I2C_ADDRESS_0   0x40
 
#define JOYSTICK_I2C_ADDRESS_1   0x41
 
#define JOYSTICK_ID_CODE   0x0C
 
#define JOYSTICK_ID_VERSION   0x0D
 
#define JOYSTICK_SIL_REV   0x0E
 
#define JOYSTICK_CONTROL1   0x0F
 
#define JOYSTICK_CONTROL2   0x2E
 
#define JOYSTICK_X   0x10
 
#define JOYSTICK_Y_RES_INT   0x11
 
#define JOYSTICK_XP   0x12
 
#define JOYSTICK_XN   0x13
 
#define JOYSTICK_YP   0x14
 
#define JOYSTICK_YN   0x15
 
#define JOYSTICK_AGC   0x2A
 
#define JOYSTICK_M_CTRL   0x2B
 
#define JOYSTICK_J_CTRL   0x2C
 
#define JOYSTICK_T_CTRL   0x2D
 
#define JOYSTICK_CONTROL2_TEST_CMD   0x84
 
#define JOYSTICK_AGC_MAX_SENSITIVITY_CMD   0x3F
 
#define JOYSTICK_T_CTRL_SCALING_90_8_CMD   0x0A
 
#define JOYSTICK_T_CTRL_SCALING_100_CMD   0x09
 
#define JOYSTICK_CONTROL1_RESET_CMD   0x88
 
#define JOYSTICK_INVERT_SPINING_CMD   0x86
 
#define JOYSTCIK_MAP_MIKROBUS(cfg, mikrobus)
 
#define JOYSTCIK_RETVAL   uint8_t
 
#define JOYSTCIK_OK   0x00
 
#define JOYSTCIK_INIT_ERROR   0xFF
 

Functions

void joystick_cfg_setup (joystick_cfg_t *cfg)
 Config Object Initialization function.
 
JOYSTCIK_RETVAL joystick_init (joystick_t *ctx, joystick_cfg_t *cfg)
 Initialization function.
 
void joystick_default_cfg (joystick_t *ctx)
 Click Default Configuration function.
 
void joystick_generic_write (joystick_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void joystick_generic_read (joystick_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void joystick_set_default_configuration (joystick_t *ctx)
 Set default configuration function.
 
uint8_t joystick_check_id_code (joystick_t *ctx)
 Check sensor ID code function.
 
uint8_t joystick_check_id_version (joystick_t *ctx)
 Check sensor ID version function.
 
void joystick_set_low_power_mode (joystick_t *ctx, uint8_t timings)
 Set Low Power Mode function.
 
void joystick_set_scaling_factor (joystick_t *ctx, uint8_t scaling_factor)
 Set scaling factor function.
 
void joystick_disabled_interrupt (joystick_t *ctx)
 Set interrupt disabled function.
 
void joystick_enabled_interrupt (joystick_t *ctx)
 Set interrupt enabled function.
 
void joystick_invert_spinning (joystick_t *ctx)
 Invert the channel voltage function.
 
uint8_t joystick_get_position (joystick_t *ctx)
 Get joystick position function.
 
uint8_t joystick_get_interrupt (joystick_t *ctx)
 Get state of interrupt pin function.
 
uint8_t joystick_press_button (joystick_t *ctx)
 Get state of Joystick button function.
 
void joystick_soft_reset (joystick_t *ctx)
 General soft reset function.
 
void joystick_hardware_reset (joystick_t *ctx)
 General hardware reset function.
 

Detailed Description

This file contains API for Joystick Click driver.