Skip to content

Commit 2a2edd6

Browse files
committedJul 2, 2021
Edit README
1 parent 5425be5 commit 2a2edd6

File tree

3 files changed

+51
-43
lines changed

3 files changed

+51
-43
lines changed
 

‎README.md

+51-43
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,51 @@
1+
# Sensirion Embedded I2C SEN55 Driver
2+
3+
This is a generic embedded driver for the Sensirion SEN55 sensor module. It enables developers to communicate with the
4+
SEN55 sensor module on different hardware platforms by only adapting the I2C communication related source files.
5+
6+
<center><img src="images/SEN5x.png" width="500px"></center>
7+
18
# Getting started
29

10+
## Connecting the Sensor
11+
12+
Your sensor has the five different connectors: VCC, GND, SDA, SCL, SEL (the sixth connector will not be used for now).
13+
14+
<center><img src="images/SEN55_pinout.png" width="300px"></center>
15+
16+
| *Pin* | *Name* | *Description* | *Comments* |
17+
|-------|--------|---------------------------------|---------------------------------------|
18+
| 1 | VDD | Supply Voltage | 5V ±10%
19+
| 2 | GND | Ground |
20+
| 3 | SDA | I2C: Serial data input / output | TTL 5V and LVTTL 3.3V compatible
21+
| 4 | SCL | I2C: Serial clock input | TTL 5V and LVTTL 3.3V compatible
22+
| 5 | SEL | Interface select | Pull to GND to enable I2C interface
23+
| 6 | NC | Do not connect |
24+
325
## Implement the I2C Interface
426

527
So we need to adjust two files according to your platform.
628

729
### Edit `sensirion_i2c_hal.c`
830

9-
This file contains the implementation of the sensor communication, which
10-
depends on your hardware platform. We provide function stubs for your
11-
hardware's own implementation.
12-
Sample implementations are available for some platforms:
13-
[`sample-implementations`](sample-implementations). For Linux based platforms
14-
like Raspberry Pi you can just replace the unimplemented HAL template with the
15-
implementation in `sample-implementations/linux_user_space/`:
31+
This file contains the implementation of the sensor communication, which depends on your hardware platform. We provide
32+
function stubs for your hardware's own implementation. Sample implementations are available for some platforms:
33+
[`sample-implementations`](sample-implementations). For Linux based platforms like Raspberry Pi you can just replace the
34+
unimplemented HAL template with the implementation in `sample-implementations/linux_user_space/`:
1635

1736
```
1837
cp sample-implementations/linux_user_space/sensirion_i2c_hal.c ./
1938
```
2039

2140
### Edit `sensirion_config.h`
2241

23-
Skip this part for Linux based platforms since everything is already setup for
24-
this case.
42+
Skip this part for Linux based platforms since everything is already setup for this case.
2543

26-
Otherwise you need to check if the libraries `<stdint.h>` and `<stdlib.h>` are
27-
provided by your toolchain, compiler or system. If you have no idea on how to
28-
do that you can skip this step for now and come back when you get errors
29-
related to these names when compiling the driver.
30-
The features we use from those libraries are type definitions for integer sizes
31-
from `<stdint.h>` and `NULL` from `<stdlib.h>`. If they are not available you
32-
need to specify the following integer types yourself:
44+
Otherwise you need to check if the libraries `<stdint.h>` and `<stdlib.h>` are provided by your toolchain, compiler or
45+
system. If you have no idea on how to do that you can skip this step for now and come back when you get errors related
46+
to these names when compiling the driver. The features we use from those libraries are type definitions for integer
47+
sizes from `<stdint.h>` and `NULL` from `<stdlib.h>`. If they are not available you need to specify the following
48+
integer types yourself:
3349

3450
* `int64_t` = signed 64bit integer
3551
* `uint64_t` = unsigned 64bit integer
@@ -40,55 +56,47 @@ need to specify the following integer types yourself:
4056
* `int8_t` = signed 8bit integer
4157
* `uint8_t` = unsigned 8bit integer
4258

43-
In addition to that you will need to specify `NULL`. For both we have a
44-
detailed template where you just need to fill in your system specific values.
59+
In addition to that you will need to specify `NULL`. For both we have a detailed template where you just need to fill in
60+
your system specific values.
4561

4662
Now we are ready to compile and run the example usage for your sensor.
4763

4864
## Compile and Run
4965

50-
Pass the source `.c` and header `.h` files in this folder into your C compiler
51-
and run the resulting binary. This step may vary, depending on your platform.
52-
Here we demonstrate the procedure for Linux based platforms:
66+
Pass the source `.c` and header `.h` files in this folder into your C compiler and run the resulting binary. This step
67+
may vary, depending on your platform. Here we demonstrate the procedure for Linux based platforms:
5368

5469
1. Open up a terminal.
5570
2. Navigate to the directory where this README is located.
5671
3. Run `make` (this compiles the example code into one executable binary).
57-
4. Run the compiled executable with `./[SENSORNAME]_i2c_example_usage`
58-
5. Now you should see the first measurement values appear in your terminal. As
59-
a next step you can adjust the example usage file or write your own main
60-
function to use the sensor.
72+
4. Run the compiled executable with `./sen55_i2c_example_usage`
73+
5. Now you should see the first measurement values appear in your terminal. As a next step you can adjust the example
74+
usage file or write your own main function to use the sensor.
6175

6276
# Background
6377

6478
## Files
6579

6680
### sensirion\_i2c.[ch]
6781

68-
In these files you can find the implementation of the I2C protocol used by
69-
Sensirion sensors. The functions in these files are used by the embedded driver
70-
to build the correct frame out of data to be sent to the sensor or receive a
71-
frame of data from the sensor and convert it back to data readable by your
72-
machine. The functions in here calculate and check CRCs, reorder bytes for
73-
different byte orders and build the correct formatted frame for your sensor.
82+
In these files you can find the implementation of the I2C protocol used by Sensirion sensors. The functions in these
83+
files are used by the embedded driver to build the correct frame out of data to be sent to the sensor or receive a frame
84+
of data from the sensor and convert it back to data readable by your machine. The functions in here calculate and check
85+
CRCs, reorder bytes for different byte orders and build the correct formatted frame for your sensor.
7486

7587
### sensirion\_i2c\_hal.[ch]
7688

77-
These files contain the implementation of the hardware abstraction layer used
78-
by Sensirion's I2C embedded drivers. This part of the code is specific to the
79-
underlying hardware platform. This is an unimplemented template for the user to
80-
implement. In the `sample-implementations/` folder we provide implementations
81-
for the most common platforms.
89+
These files contain the implementation of the hardware abstraction layer used by Sensirion's I2C embedded drivers. This
90+
part of the code is specific to the underlying hardware platform. This is an unimplemented template for the user to
91+
implement. In the `sample-implementations/` folder we provide implementations for the most common platforms.
8292

8393
### sensirion\_config.h
8494

85-
In this file we keep all the included libraries for our drivers and global
86-
defines. Next to `sensirion_i2c_hal.c` *it's the only file you should need to
87-
edit to get your driver working.*
95+
In this file we keep all the included libraries for our drivers and global defines. Next to `sensirion_i2c_hal.c` *it's
96+
the only file you should need to edit to get your driver working.*
8897

8998
### sensirion\_common.[ch]
9099

91-
In these files you can find some helper functions used by Sensirion's embedded
92-
drivers. It mostly contains byte order conversions for different variable
93-
types. These functions are also used by the UART embedded drivers therefore
94-
they are kept in their own file.
100+
In these files you can find some helper functions used by Sensirion's embedded drivers. It mostly contains byte order
101+
conversions for different variable types. These functions are also used by the UART embedded drivers therefore they are
102+
kept in their own file.

‎images/SEN55_pinout.png

37.3 KB
Loading

‎images/SEN5x.png

439 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.