limit DMS22B to 4
This commit is contained in:
parent
a87546bfdf
commit
32e48b126c
|
@ -51,18 +51,6 @@
|
||||||
#define ADD22B12
|
#define ADD22B12
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GWDMS22B13
|
|
||||||
#define ADD22B13 ADD22B(DMS22B13,SPI1)
|
|
||||||
#ifndef GWDMS22B13_CS
|
|
||||||
#error "you need to define GWDMS22B13_CS"
|
|
||||||
#endif
|
|
||||||
#if GWDMS22B11_CS == -1
|
|
||||||
#error "multiple devices on one SPI bus need chip select defines - GWDMS22B11_CS is unset"
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define GWDMS22B13_CS -1
|
|
||||||
#define ADD22B13
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GWDMS22B21
|
#ifdef GWDMS22B21
|
||||||
#define ADD22B21 ADD22B(DMS22B21,SPI2)
|
#define ADD22B21 ADD22B(DMS22B21,SPI2)
|
||||||
|
@ -87,18 +75,6 @@
|
||||||
#define ADD22B22
|
#define ADD22B22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GWDMS22B23
|
|
||||||
#define ADD22B23 ADD22B(DMS22B23,SPI2)
|
|
||||||
#ifndef GWDMS22B23_CS
|
|
||||||
#error "you need to define GWDMS22B23_CS"
|
|
||||||
#endif
|
|
||||||
#if GWDMS22B21_CS == -1
|
|
||||||
#error "multiple devices on one SPI bus need chip select defines - GWDMS22B11_CS is unset"
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define GWDMS22B23_CS -1
|
|
||||||
#define ADD22B23
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,10 +120,8 @@ class GWDMS22B : public SSISensor{
|
||||||
virtual void readConfig(GwConfigHandler *cfg){
|
virtual void readConfig(GwConfigHandler *cfg){
|
||||||
DMS22B(DMS22B11);
|
DMS22B(DMS22B11);
|
||||||
DMS22B(DMS22B12);
|
DMS22B(DMS22B12);
|
||||||
DMS22B(DMS22B13);
|
|
||||||
DMS22B(DMS22B21);
|
DMS22B(DMS22B21);
|
||||||
DMS22B(DMS22B22);
|
DMS22B(DMS22B22);
|
||||||
DMS22B(DMS22B23);
|
|
||||||
intv=1000*fintv;
|
intv=1000*fintv;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -155,9 +129,7 @@ class GWDMS22B : public SSISensor{
|
||||||
void registerDMS22B(GwApi *api,SpiSensorList &sensors){
|
void registerDMS22B(GwApi *api,SpiSensorList &sensors){
|
||||||
ADD22B11
|
ADD22B11
|
||||||
ADD22B12
|
ADD22B12
|
||||||
ADD22B13
|
|
||||||
ADD22B21
|
ADD22B21
|
||||||
ADD22B22
|
ADD22B22
|
||||||
ADD22B23
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
"i": "12",
|
"i": "12",
|
||||||
"n": "1"
|
"n": "1"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"b": "1",
|
|
||||||
"i": "13",
|
|
||||||
"n": "13"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"b": "2",
|
"b": "2",
|
||||||
"i": "21",
|
"i": "21",
|
||||||
|
@ -27,14 +22,7 @@
|
||||||
"b": "2",
|
"b": "2",
|
||||||
"i": "22",
|
"i": "22",
|
||||||
"n": "22"
|
"n": "22"
|
||||||
},
|
|
||||||
{
|
|
||||||
"b": "2",
|
|
||||||
"i": "23",
|
|
||||||
"n": "23"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,8 @@ lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${sensors.lib_deps}
|
${sensors.lib_deps}
|
||||||
build_flags=
|
build_flags=
|
||||||
-D GWSPI0_CLK=21
|
-D GWSPI1_CLK=21
|
||||||
-D GWSPI0_MISO=25
|
-D GWSPI1_MISO=25
|
||||||
-D GWDMS22B11
|
-D GWDMS22B11
|
||||||
-D GWDMS22B11_CS=22
|
-D GWDMS22B11_CS=22
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
|
|
|
@ -483,22 +483,6 @@ types:
|
||||||
key: dms22b#busname#2cs
|
key: dms22b#busname#2cs
|
||||||
description: "chip select pin, only necessary for multiple devices on this bus"
|
description: "chip select pin, only necessary for multiple devices on this bus"
|
||||||
target: "define:GWDMS22B#busname#2_CS"
|
target: "define:GWDMS22B#busname#2_CS"
|
||||||
- type: checkbox
|
|
||||||
label: GWDMS22B-#busname#-3
|
|
||||||
description: "DMS22B rotatory encoder (SSI)"
|
|
||||||
key: dms22b#busname#3
|
|
||||||
target: define
|
|
||||||
url: "https://www.mouser.de/datasheet/2/54/bour_s_a0011704065_1-2262614.pdf"
|
|
||||||
values:
|
|
||||||
- key: true
|
|
||||||
value: GWDMS22B#busname#3
|
|
||||||
children:
|
|
||||||
- <<: *gpiopin
|
|
||||||
label: CS
|
|
||||||
key: dms22b#busname#3cs
|
|
||||||
description: "chip select pin, only necessary for multiple devices on this bus"
|
|
||||||
target: "define:GWDMS22B#busname#3_CS"
|
|
||||||
|
|
||||||
|
|
||||||
- &m5protochildren
|
- &m5protochildren
|
||||||
- *serial1
|
- *serial1
|
||||||
|
|
Loading…
Reference in New Issue