Skip to content

Commit

Permalink
Further work
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Jun 27, 2023
1 parent b595770 commit c48f6c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/drivers/sensor/gen4/gen4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


uint8_t gen4_checksum(uint8_t *buffer, uint8_t length) {
uint16_t temp;
uint8_t checksum = 0;
for (temp = 0; temp < length; temp++)
checksum += *(buffer + temp);
}
16 changes: 16 additions & 0 deletions app/drivers/sensor/gen4/gen4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define GEN4_REG_CHIP_ID 0xC2C0
#define GEN4_REG_FW_VER 0xC2C1
#define GEN4_REG_SYSCONFIG_1 0xC2C2
#define GEN4_REG_SYSCONFIG_2 0xC2C3
#define GEN4_REG_FEEDCONFIG_1 0xC2C4
#define GEN4_REG_FEEDCONFIG_2 0xC2C5
#define GEN4_REG_FEEDCONFIG_3 0xC2C6
#define GEN4_REG_COMPCONFIG_1 0xC2C7
#define GEN4_REG_PS2_AUXCONTROL 0xC2C8
#define GEN4_REG_SAMPLERATE 0xC2C9
#define GEN4_REG_ZIDLE 0xC2CA
#define GEN4_REG_FILTERCONTROL 0xC2CB
#define GEN4_REG_POWERCONTROL 0xC2CE

#define GEN4_EXT_ACCESS_WRITE 0x0900
#define GEN4_EXT_ACCESS_READ 0x0901

0 comments on commit c48f6c6

Please sign in to comment.