42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_in.h"
64#define LINEFOLLOWER_MAP_MIKROBUS( cfg, mikrobus ) \
65 cfg.u2= MIKROBUS( mikrobus, MIKROBUS_AN ); \
66 cfg.u1= MIKROBUS( mikrobus, MIKROBUS_RST ); \
67 cfg.u5= MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.u4= MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.u3= MIKROBUS( mikrobus, MIKROBUS_TX );
76#define LINEFOLLOWER_RETVAL uint8_t
78#define LINEFOLLOWER_OK 0x00
79#define LINEFOLLOWER_INIT_ERROR 0xFF
86#define LINEFOLLOWER_DATA_DIR_START 0x00
87#define LINEFOLLOWER_DATA_DIR_1 0x01
88#define LINEFOLLOWER_DATA_DIR_2 0x02
89#define LINEFOLLOWER_DATA_DIR_3 0x03
90#define LINEFOLLOWER_DATA_DIR_4 0x04
91#define LINEFOLLOWER_DATA_DIR_6 0x06
92#define LINEFOLLOWER_DATA_DIR_7 0x07
93#define LINEFOLLOWER_DATA_DIR_8 0x08
94#define LINEFOLLOWER_DATA_DIR_12 0x0C
95#define LINEFOLLOWER_DATA_DIR_16 0x10
96#define LINEFOLLOWER_DATA_DIR_24 0x18
97#define LINEFOLLOWER_DATA_DIR_28 0x1C
98#define LINEFOLLOWER_DATA_DIR_31 0x1F
105#define LINEFOLLOWER_BIT_0 0x01
106#define LINEFOLLOWER_BIT_1 0x02
107#define LINEFOLLOWER_BIT_2 0x04
108#define LINEFOLLOWER_BIT_3 0x08
109#define LINEFOLLOWER_BIT_4 0x10
116#define LINEFOLLOWER_DIR_STRAIGHT 0x00
117#define LINEFOLLOWER_DIR_LEFT 0x01
118#define LINEFOLLOWER_DIR_RIGHT 0x02
119#define LINEFOLLOWER_DIR_SHARP_LEFT 0x03
120#define LINEFOLLOWER_DIR_SHARP_RIGHT 0x04
121#define LINEFOLLOWER_DIR_TRACKING_LOST 0x05
170 // End constants group
#define LINEFOLLOWER_RETVAL
Definition linefollower.h:76
void linefollower_cfg_setup(linefollower_cfg_t *cfg)
Config Object Initialization function.
uint8_t linefollower_get_direction(linefollower_t *ctx)
Get direction data function.
uint8_t linefollower_get_u3(linefollower_t *ctx)
Get status of U3 pin function.
uint8_t linefollower_get_u5(linefollower_t *ctx)
Get status of U5 pin function.
void linefollower_data_track(linefollower_t *ctx, linefollower_direction_t *data_track)
Get status of all pin function.
uint8_t linefollower_get_u1(linefollower_t *ctx)
Get status of U1 pin function.
uint8_t linefollower_get_u4(linefollower_t *ctx)
Get status of U4 pin function.
LINEFOLLOWER_RETVAL linefollower_init(linefollower_t *ctx, linefollower_cfg_t *cfg)
Initialization function.
uint8_t linefollower_get_u2(linefollower_t *ctx)
Get status of U2 pin function.
Click configuration structure definition.
Definition linefollower.h:150
pin_name_t u2
Definition linefollower.h:154
pin_name_t u1
Definition linefollower.h:153
pin_name_t u5
Definition linefollower.h:157
pin_name_t u3
Definition linefollower.h:155
pin_name_t u4
Definition linefollower.h:156
Definition linefollower.h:177
uint8_t u3
Definition linefollower.h:180
uint8_t u4
Definition linefollower.h:181
uint8_t u5
Definition linefollower.h:182
uint8_t u1
Definition linefollower.h:178
uint8_t u2
Definition linefollower.h:179
Click ctx object definition.
Definition linefollower.h:135
digital_in_t u5
Definition linefollower.h:142
digital_in_t u3
Definition linefollower.h:140
digital_in_t u1
Definition linefollower.h:138
digital_in_t u4
Definition linefollower.h:141
digital_in_t u2
Definition linefollower.h:139