42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_in.h"
64#define KEYLOCK2_MAP_MIKROBUS( cfg, mikrobus ) \
65 cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_RST ); \
66 cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
67 cfg.in3 = MIKROBUS( mikrobus, MIKROBUS_INT );
74#define KEYLOCK2_RETVAL uint8_t
76#define KEYLOCK2_OK 0x00
77#define KEYLOCK2_INIT_ERROR 0xFF
84#define KEYLOCK2_STATE_RST_PIN 0x01
85#define KEYLOCK2_STATE_PWM_PIN 0x02
86#define KEYLOCK2_STATE_INT_PIN 0x03
93#define KEYLOCK2_POSITION_1 0x01
94#define KEYLOCK2_POSITION_2 0x02
95#define KEYLOCK2_POSITION_3 0x03
#define KEYLOCK2_RETVAL
Definition keylock2.h:74
uint8_t keylock2_get_position(keylock2_t *ctx)
Get Pin State.
KEYLOCK2_RETVAL keylock2_init(keylock2_t *ctx, keylock2_cfg_t *cfg)
Initialization function.
void keylock2_cfg_setup(keylock2_cfg_t *cfg)
Config Object Initialization function.
uint8_t keylock2_get_pin_state(keylock2_t *ctx, uint8_t pin)
Get Pin State.
Click configuration structure definition.
Definition keylock2.h:122
pin_name_t in2
Definition keylock2.h:126
pin_name_t in1
Definition keylock2.h:125
pin_name_t in3
Definition keylock2.h:127
Click ctx object definition.
Definition keylock2.h:109
digital_in_t in2
Definition keylock2.h:113
digital_in_t in3
Definition keylock2.h:114
digital_in_t in1
Definition keylock2.h:112