Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AS504x DIAG and MAGN addresses. #462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions encoder/enc_as504x.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <string.h>
#include <math.h>

#define AS504x_SPI_PARITY_BIT 0x8000
#define AS504x_SPI_READ_BIT 0x4000
#define AS504x_SPI_WRITE_BIT 0x0000

Expand All @@ -42,11 +43,11 @@

#define AS504x_SPI_EXCLUDE_PARITY_AND_ERROR_BITMASK 0x3FFF

#define AS504x_SPI_DIAG_ADR 0x3FFD
#define AS504x_SPI_MAGN_ADR 0x3FFE
#define AS504x_SPI_DIAG_ADR 0x3FFC
#define AS504x_SPI_MAGN_ADR 0x3FFD
#define AS504x_SPI_CLEAR_ERROR_ADR 0x0001

#define AS504x_SPI_READ_DIAG_MSG (AS504x_SPI_DIAG_ADR | AS504x_SPI_READ_BIT)
#define AS504x_SPI_READ_DIAG_MSG (AS504x_SPI_DIAG_ADR | AS504x_SPI_READ_BIT | AS504x_SPI_PARITY_BIT)
#define AS504x_SPI_READ_MAGN_MSG (AS504x_SPI_MAGN_ADR | AS504x_SPI_READ_BIT)
#define AS504x_SPI_READ_CLEAR_ERROR_MSG (AS504x_SPI_CLEAR_ERROR_ADR | AS504x_SPI_READ_BIT)

Expand Down