thumbstick  2.0.0.0
Data Structures | Macros | Functions
thumbstick.h File Reference

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

#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  thumbstick_t
 Click ctx object definition. More...
 
struct  thumbstick_cfg_t
 Click configuration structure definition. More...
 

Macros

#define THUMBSTICK_MAP_MIKROBUS(cfg, mikrobus)
 
#define THUMBSTICK_RETVAL   uint8_t
 
#define THUMBSTICK_OK   0x00
 
#define THUMBSTICK_INIT_ERROR   0xFF
 
#define THUMBSTICK_START_SINGLE_ENDED_BIT   0x04
 
#define THUMBSTICK_CHANNEL_V   0x00
 
#define THUMBSTICK_CHANNEL_H   0x40
 
#define THUMBSTICK_POSITION_START   0x00
 
#define THUMBSTICK_POSITION_TOP   0x01
 
#define THUMBSTICK_POSITION_RIGHT   0x02
 
#define THUMBSTICK_CHANNEL_BOTTOM   0x03
 
#define THUMBSTICK_CHANNEL_LEFT   0x04
 
#define THUMBSTICK_BUTTON_INACTIVE   0x00
 
#define THUMBSTICK_BUTTON_ACTIVE   0x01
 
#define THUMBSTICK_PRESS_BUTTON   0x00
 

Functions

void thumbstick_cfg_setup (thumbstick_cfg_t *cfg)
 Config Object Initialization function. More...
 
THUMBSTICK_RETVAL thumbstick_init (thumbstick_t *ctx, thumbstick_cfg_t *cfg)
 Initialization function. More...
 
void thumbstick_generic_transfer (thumbstick_t *ctx, spi_master_transfer_data_t *block)
 Generic transfer function. More...
 
uint16_t thumbstick_read_data (thumbstick_t *ctx, uint8_t channel)
 Generic read 2 byte of data function. More...
 
uint8_t thumbstick_get_position (thumbstick_t *ctx)
 Get thumbstick position function. More...
 
uint8_t thumbstick_button_state (thumbstick_t *ctx)
 Get state of thumbstick button function. More...
 

Detailed Description

This file contains API for Thumbstiick Click driver.