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 KEYLOCK_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.out1= MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.out2= MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.out3= MIKROBUS( mikrobus, MIKROBUS_INT );
75#define KEYLOCK_RETVAL uint8_t
77#define KEYLOCK_OK 0x00
78#define KEYLOCK_INIT_ERROR 0xFF
85#define KEYLOCK_KEY_POS_1 1
86#define KEYLOCK_KEY_POS_2 2
87#define KEYLOCK_KEY_POS_3 3
94#define KEYLOCK_ERROR_FLAG 0
#define KEYLOCK_RETVAL
Definition keylock.h:75
uint8_t keylock_check_pwm_state(keylock_t *ctx)
Checks PWM pin state.
KEYLOCK_RETVAL keylock_init(keylock_t *ctx, keylock_cfg_t *cfg)
Initialization function.
uint8_t keylock_check_pin(keylock_t *ctx, uint8_t pin)
Checks pin state.
void keylock_cfg_setup(keylock_cfg_t *cfg)
Config Object Initialization function.
uint8_t keylock_check_an_state(keylock_t *ctx)
Checks AN pin state.
uint8_t keylock_get_position(keylock_t *ctx)
Gets key position.
uint8_t keylock_check_int_state(keylock_t *ctx)
Checks INT pin state.
Click configuration structure definition.
Definition keylock.h:121
pin_name_t out2
Definition keylock.h:125
pin_name_t out3
Definition keylock.h:126
pin_name_t out1
Definition keylock.h:124
Click ctx object definition.
Definition keylock.h:108
digital_in_t out1
Definition keylock.h:111
digital_in_t out2
Definition keylock.h:112
digital_in_t out3
Definition keylock.h:113