Prusa MINI Firmware overview
jogwheel.h
Go to the documentation of this file.
1 // jogwheel.h
2 
3 #ifndef _JOGWHEEL_H
4 #define _JOGWHEEL_H
5 
6 #include <inttypes.h>
7 
8 #define JOGWHEEL_FLG_INV_DIR 0x01
9 #define JOGWHEEL_FLG_INV_ENC 0x02
10 #define JOGWHEEL_FLG_INV_E12 0x04
11 #define JOGWHEEL_FLG_2PULSES 0x08
12 //old encoder (with new encoder 2 steps per 1 count)
13 //#define JOGWHEEL_DEF_FLG (JOGWHEEL_FLG_INV_ENC | JOGWHEEL_FLG_INV_DIR)
14 //new encoder (1 steps per 1 count)
15 #define JOGWHEEL_DEF_FLG (JOGWHEEL_FLG_INV_ENC | JOGWHEEL_FLG_2PULSES)
16 
17 #pragma pack(push)
18 #pragma pack(1)
19 
20 typedef struct _jogwheel_config_t {
21  uint8_t pinEN1; // encoder phase1 pin
22  uint8_t pinEN2; // encoder phase2 pin
23  uint8_t pinENC; // button pin
24  uint8_t flg; // flags
26 
27 #pragma pack(pop)
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif //__cplusplus
32 
34 extern int32_t jogwheel_encoder;
35 extern uint16_t jogwheel_button_down;
37 
38 extern void jogwheel_init(void);
39 
40 extern void jogwheel_update_1ms(void);
41 
42 extern void jogwheel_encoder_set(int32_t val, int32_t min, int32_t max);
43 
45 
46 #ifdef __cplusplus
47 }
48 #endif //__cplusplus
49 
50 #endif // _JOGWHEEL_H
_jogwheel_config_t::pinEN2
uint8_t pinEN2
Definition: jogwheel.h:22
jogwheel_config
jogwheel_config_t jogwheel_config
Definition: jogwheel.c:95
jogwheel_changed
uint8_t jogwheel_changed
Definition: jogwheel.c:14
_jogwheel_config_t
Definition: jogwheel.h:20
jogwheel_init
void jogwheel_init(void)
Definition: jogwheel.c:16
max
#define max(a, b)
Definition: wiring_constants.h:40
jogwheel_encoder_set
void jogwheel_encoder_set(int32_t val, int32_t min, int32_t max)
Definition: jogwheel.c:83
jogwheel_encoder
int32_t jogwheel_encoder
Definition: jogwheel.c:10
min
#define min(a, b)
Definition: wiring_constants.h:36
jogwheel_signals
uint8_t jogwheel_signals
Definition: jogwheel.c:7
_jogwheel_config_t::flg
uint8_t flg
Definition: jogwheel.h:24
jogwheel_button_down
uint16_t jogwheel_button_down
Definition: jogwheel.c:13
uint8_t
const uint8_t[]
Definition: 404_html.c:3
jogwheel_update_1ms
void jogwheel_update_1ms(void)
Definition: jogwheel.c:22
jogwheel_config_t
struct _jogwheel_config_t jogwheel_config_t
_jogwheel_config_t::pinEN1
uint8_t pinEN1
Definition: jogwheel.h:21
_jogwheel_config_t::pinENC
uint8_t pinENC
Definition: jogwheel.h:23