@@ -78,11 +78,12 @@ pub struct Adc {
78
78
79
79
impl Adc {
80
80
pub async fn new ( bb : & mut BrokerBuilder ) -> Result < Self > {
81
- let iio_thread = IioThread :: new ( ) . await ?;
81
+ let stm32_thread = IioThread :: new_stm32 ( ) . await ?;
82
+ let powerboard_thread = IioThread :: new_powerboard ( ) . await ?;
82
83
83
84
let adc = Self {
84
85
usb_host_curr : AdcChannel {
85
- fast : iio_thread . clone ( ) . get_channel ( "usb-host-curr" ) . unwrap ( ) ,
86
+ fast : stm32_thread . clone ( ) . get_channel ( "usb-host-curr" ) . unwrap ( ) ,
86
87
topic : bb. topic (
87
88
"/v1/usb/host/total/feedback/current" ,
88
89
true ,
@@ -93,7 +94,7 @@ impl Adc {
93
94
) ,
94
95
} ,
95
96
usb_host1_curr : AdcChannel {
96
- fast : iio_thread . clone ( ) . get_channel ( "usb-host1-curr" ) . unwrap ( ) ,
97
+ fast : stm32_thread . clone ( ) . get_channel ( "usb-host1-curr" ) . unwrap ( ) ,
97
98
topic : bb. topic (
98
99
"/v1/usb/host/port1/feedback/current" ,
99
100
true ,
@@ -104,7 +105,7 @@ impl Adc {
104
105
) ,
105
106
} ,
106
107
usb_host2_curr : AdcChannel {
107
- fast : iio_thread . clone ( ) . get_channel ( "usb-host2-curr" ) . unwrap ( ) ,
108
+ fast : stm32_thread . clone ( ) . get_channel ( "usb-host2-curr" ) . unwrap ( ) ,
108
109
topic : bb. topic (
109
110
"/v1/usb/host/port2/feedback/current" ,
110
111
true ,
@@ -115,7 +116,7 @@ impl Adc {
115
116
) ,
116
117
} ,
117
118
usb_host3_curr : AdcChannel {
118
- fast : iio_thread . clone ( ) . get_channel ( "usb-host3-curr" ) . unwrap ( ) ,
119
+ fast : stm32_thread . clone ( ) . get_channel ( "usb-host3-curr" ) . unwrap ( ) ,
119
120
topic : bb. topic (
120
121
"/v1/usb/host/port3/feedback/current" ,
121
122
true ,
@@ -126,7 +127,7 @@ impl Adc {
126
127
) ,
127
128
} ,
128
129
out0_volt : AdcChannel {
129
- fast : iio_thread . clone ( ) . get_channel ( "out0-volt" ) . unwrap ( ) ,
130
+ fast : stm32_thread . clone ( ) . get_channel ( "out0-volt" ) . unwrap ( ) ,
130
131
topic : bb. topic (
131
132
"/v1/output/out_0/feedback/voltage" ,
132
133
true ,
@@ -137,7 +138,7 @@ impl Adc {
137
138
) ,
138
139
} ,
139
140
out1_volt : AdcChannel {
140
- fast : iio_thread . clone ( ) . get_channel ( "out1-volt" ) . unwrap ( ) ,
141
+ fast : stm32_thread . clone ( ) . get_channel ( "out1-volt" ) . unwrap ( ) ,
141
142
topic : bb. topic (
142
143
"/v1/output/out_1/feedback/voltage" ,
143
144
true ,
@@ -148,7 +149,7 @@ impl Adc {
148
149
) ,
149
150
} ,
150
151
iobus_curr : AdcChannel {
151
- fast : iio_thread . clone ( ) . get_channel ( "iobus-curr" ) . unwrap ( ) ,
152
+ fast : stm32_thread . clone ( ) . get_channel ( "iobus-curr" ) . unwrap ( ) ,
152
153
topic : bb. topic (
153
154
"/v1/iobus/feedback/current" ,
154
155
true ,
@@ -159,7 +160,7 @@ impl Adc {
159
160
) ,
160
161
} ,
161
162
iobus_volt : AdcChannel {
162
- fast : iio_thread . clone ( ) . get_channel ( "iobus-volt" ) . unwrap ( ) ,
163
+ fast : stm32_thread . clone ( ) . get_channel ( "iobus-volt" ) . unwrap ( ) ,
163
164
topic : bb. topic (
164
165
"/v1/iobus/feedback/voltage" ,
165
166
true ,
@@ -170,7 +171,7 @@ impl Adc {
170
171
) ,
171
172
} ,
172
173
pwr_volt : AdcChannel {
173
- fast : iio_thread . clone ( ) . get_channel ( "pwr-volt" ) . unwrap ( ) ,
174
+ fast : powerboard_thread . clone ( ) . get_channel ( "pwr-volt" ) . unwrap ( ) ,
174
175
topic : bb. topic (
175
176
"/v1/dut/feedback/voltage" ,
176
177
true ,
@@ -181,7 +182,7 @@ impl Adc {
181
182
) ,
182
183
} ,
183
184
pwr_curr : AdcChannel {
184
- fast : iio_thread . get_channel ( "pwr-curr" ) . unwrap ( ) ,
185
+ fast : powerboard_thread . get_channel ( "pwr-curr" ) . unwrap ( ) ,
185
186
topic : bb. topic (
186
187
"/v1/dut/feedback/current" ,
187
188
true ,
0 commit comments