42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
65#define INDEXCOUNTER_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.dir= MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.spd= MIKROBUS( mikrobus, MIKROBUS_RST )
74#define INDEXCOUNTER_RETVAL uint8_t
76#define INDEXCOUNTER_OK 0x00
77#define INDEXCOUNTER_INIT_ERROR 0xFF
80#define INDEXCOUNTER_ACTIVE 1
81#define INDEXCOUNTER_INACTIVE 0
83#define INDEXCOUNTER_SPEED_ENABLE 1
84#define INDEXCOUNTER_SPEED_DISABLE 0
86#define INDEXCOUNTER_ONE_MIN_CONV_MS 60000.0
#define INDEXCOUNTER_RETVAL
Definition indexcounter.h:74
void indexcounter_cfg_setup(indexcounter_cfg_t *cfg)
Config Object Initialization function.
uint8_t indexcounter_get_speed(indexcounter_t *ctx)
Get state of the speed pin function.
uint8_t indexcounter_get_dir(indexcounter_t *ctx)
Get state of the direction pin function.
void indexcounter_default_cfg(indexcounter_t *ctx)
Click Default Configuration function.
INDEXCOUNTER_RETVAL indexcounter_init(indexcounter_t *ctx, indexcounter_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition indexcounter.h:112
pin_name_t spd
Definition indexcounter.h:116
pin_name_t dir
Definition indexcounter.h:115
Click ctx object definition.
Definition indexcounter.h:99
digital_in_t spd
Definition indexcounter.h:104
digital_in_t dir
Definition indexcounter.h:103