aboutsummaryrefslogtreecommitdiff
path: root/examples/other/i2c_stts75_sensor/README
blob: 9d775afd42f1dbc0df982071fd022f0d0950de26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
------------------------------------------------------------------------------
README
------------------------------------------------------------------------------

This example program sends some characters on USART1.
Afterwards it connects to an STTS75 sensor (ST LM75 compatible)
at adress A0/1/2=0 and sets reverse polarity, 26 degree Tos and Thyst.
It reads out the temperature and submits the temperature over USART1 in
binary format (ASCII 0/1).

The terminal settings for the receiving device/PC are 115200 8n1.


Building
--------

 $ make

Running 'make' on the top-level libopenstm32 directory will automatically
also build this example. Or you can build the library "manually" and
then run 'make' in this directory.

You may want to override the toolchain (e.g., arm-elf or arm-none-eabi):

 $ PREFIX=arm-none-eabi make

For a more verbose build you can use

 $ make V=1


Flashing
--------

You can flash the generated code using OpenOCD:

 $ make flash

Or you can do the same manually via:

 $ openocd -f interface/jtagkey-tiny.cfg -f target/stm32.cfg
 $ telnet localhost 4444
 > reset halt
 > flash write_image erase i2c_stts75_sensor.hex
 > reset

Replace the "jtagkey-tiny.cfg" with whatever JTAG device you are using, and/or
replace "stm.cfg" with your respective config file.