This commit is contained in:
William Clark 2023-12-21 18:17:20 +00:00
parent e25f035863
commit 1726159cb8
4 changed files with 25 additions and 3 deletions

4
Makefile Normal file
View File

@ -0,0 +1,4 @@
CC=gcc
CFLAGS=-O2 -std=gnu99 -W -Werror -Wall -Wextra -I.
all:
$(CC) $(CFLAGS) main.c lis3dh.c -o main

View File

@ -1,9 +1,11 @@
#include "lis3dh.h"
int lis3dh_init(lis3dh_t *lis3dh) {
lis3dh->cfg.rate = 0;
return 0;
}
int lis3dh_deinit(lis3dh_t *lis3dh) {
lis3dh->cfg.rate = 0;
return 0;
}

View File

@ -3,7 +3,7 @@
#include <stdint.h>
/* rats */
/* rates */
#define LIS3DH_ODR_1_HZ 0b0001
#define LIS3DH_ODR_10_HZ 0b0010
#define LIS3DH_ODR_25_HZ 0b0011
@ -11,9 +11,8 @@
#define LIS3DH_ODR_100_HZ 0b0101
#define LIS3DH_ODR_200_HZ 0b0110
#define LIS3DH_ODR_400_HZ 0b0111
#define LIS3DH_ODR_10_HZ 0b0011
#define LIS3DH_ODR_LP_1600_HZ 0b1000
#define LIS3DH_ODR_NORM_1344_HZ 0b1001
#define LIS3DH_ODR_LP_1600_HZ 0b1000
#define LIS3DH_ODR_LP_5376_HZ 0b1001
/* range/sens */

17
main.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include "lis3dh.h"
int main() {
lis3dh_t lis;
if (!lis3dh_init(&lis)) {
puts("OK");
}
if (!lis3dh_deinit(&lis)) {
puts("OK");
}
return 0;
}