Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FS-ELAB
pilc2server
Commits
ac2e739f
Commit
ac2e739f
authored
Feb 08, 2022
by
Joshua Supra
Browse files
added encoder
parent
810ed3a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
pilc2_functions/pilc2_encoder.c
0 → 100644
View file @
ac2e739f
#include
"pilc2_encoder.h"
#include
"pilc2_register_func.h"
int
EncoderLoadPreloadValue
(
unsigned
int
ChannelMask
)
{
WriteFPGA
(
PILC_ENCODER_OFFSET
+
PILC_ENCODER_LPRLVREG
,
ChannelMask
);
WriteFPGA
(
PILC_ENCODER_OFFSET
+
PILC_ENCODER_LPRLVREG
,
0x0
);
return
0
;
}
int
EncoderSetPreloadValue
(
unsigned
int
channel
,
unsigned
int
preload_value
)
{
WriteFPGA
(
PILC_ENCODER_OFFSET
+
PILC_ENCODER_PRLV_OFFSET
+
channel
,
preload_value
);
return
0
;
}
int
EncoderGetValue
(
unsigned
int
channel
)
{
unsigned
int
value
;
value
=
ReadFPGA
(
PILC_ENCODER_OFFSET
+
PILC_ENCODER_VAL_OFFSET
+
channel
);
return
value
;
}
pilc2_functions/pilc2_encoder.h
0 → 100644
View file @
ac2e739f
#define PILC_ENCODER_OFFSET (0x9000>>2)
#define PILC_ENCODER_LPRLVREG 0x0
#define PILC_ENCODER_PRLV_OFFSET 0x8
#define PILC_ENCODER_VAL_OFFSET 0x10
#define PILC_ENCODER_CH_0 0x0
#define PILC_ENCODER_CH_1 0x1
#define PILC_ENCODER_CH_2 0x2
#define PILC_ENCODER_CH_3 0x3
#define PILC_ENCODER_CH_4 0x4
#define PILC_ENCODER_CH_5 0x5
#define PILC_ENCODER_CH_6 0x6
#define PILC_ENCODER_CH_7 0x7
int
EncoderLoadPreloadValue
(
unsigned
int
ChannelMask
);
int
EncoderSetPreloadValue
(
unsigned
int
channel
,
unsigned
int
preload_value
);
int
EncoderGetValue
(
unsigned
int
channel
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment