@@ -72,7 +72,7 @@ pub const DRIVER_NUM: usize = driver::NUM::Adc as usize;
72
72
/// Virtualized, and can be use by multiple applications at the same time;
73
73
/// requests are queued. Does not support continuous or high-speed sampling.
74
74
pub struct AdcVirtualized < ' a > {
75
- drivers : & ' a [ & ' a dyn hil:: adc:: AdcChannel ] ,
75
+ drivers : & ' a [ & ' a dyn hil:: adc:: AdcChannel < ' a > ] ,
76
76
apps : Grant < AppSys , UpcallCount < 1 > , AllowRoCount < 0 > , AllowRwCount < 0 > > ,
77
77
current_process : OptionalCell < ProcessId > ,
78
78
}
@@ -81,10 +81,10 @@ pub struct AdcVirtualized<'a> {
81
81
/// Not currently virtualized: does not share the ADC with other capsules
82
82
/// and only one application can use it at a time. Supports continuous and
83
83
/// high speed sampling.
84
- pub struct AdcDedicated < ' a , A : hil:: adc:: Adc + hil:: adc:: AdcHighSpeed > {
84
+ pub struct AdcDedicated < ' a , A : hil:: adc:: Adc < ' a > + hil:: adc:: AdcHighSpeed < ' a > > {
85
85
// ADC driver
86
86
adc : & ' a A ,
87
- channels : & ' a [ <A as hil:: adc:: Adc >:: Channel ] ,
87
+ channels : & ' a [ <A as hil:: adc:: Adc < ' a > >:: Channel ] ,
88
88
89
89
// ADC state
90
90
active : Cell < bool > ,
@@ -155,7 +155,7 @@ impl Default for AppSys {
155
155
/// swap. In testing, it seems to keep up fine.
156
156
pub const BUF_LEN : usize = 128 ;
157
157
158
- impl < ' a , A : hil:: adc:: Adc + hil:: adc:: AdcHighSpeed > AdcDedicated < ' a , A > {
158
+ impl < ' a , A : hil:: adc:: Adc < ' a > + hil:: adc:: AdcHighSpeed < ' a > > AdcDedicated < ' a , A > {
159
159
/// Create a new `Adc` application interface.
160
160
///
161
161
/// - `adc` - ADC driver to provide application access to
@@ -165,7 +165,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
165
165
pub fn new (
166
166
adc : & ' a A ,
167
167
grant : Grant < App , UpcallCount < 1 > , AllowRoCount < 0 > , AllowRwCount < 2 > > ,
168
- channels : & ' a [ <A as hil:: adc:: Adc >:: Channel ] ,
168
+ channels : & ' a [ <A as hil:: adc:: Adc < ' a > >:: Channel ] ,
169
169
adc_buf1 : & ' static mut [ u16 ; 128 ] ,
170
170
adc_buf2 : & ' static mut [ u16 ; 128 ] ,
171
171
adc_buf3 : & ' static mut [ u16 ; 128 ] ,
@@ -639,7 +639,7 @@ impl<'a> AdcVirtualized<'a> {
639
639
///
640
640
/// - `drivers` - Virtual ADC drivers to provide application access to
641
641
pub fn new (
642
- drivers : & ' a [ & ' a dyn hil:: adc:: AdcChannel ] ,
642
+ drivers : & ' a [ & ' a dyn hil:: adc:: AdcChannel < ' a > ] ,
643
643
grant : Grant < AppSys , UpcallCount < 1 > , AllowRoCount < 0 > , AllowRwCount < 0 > > ,
644
644
) -> AdcVirtualized < ' a > {
645
645
AdcVirtualized {
@@ -730,7 +730,9 @@ impl<'a> AdcVirtualized<'a> {
730
730
}
731
731
732
732
/// Callbacks from the ADC driver
733
- impl < A : hil:: adc:: Adc + hil:: adc:: AdcHighSpeed > hil:: adc:: Client for AdcDedicated < ' _ , A > {
733
+ impl < ' a , A : hil:: adc:: Adc < ' a > + hil:: adc:: AdcHighSpeed < ' a > > hil:: adc:: Client
734
+ for AdcDedicated < ' a , A >
735
+ {
734
736
/// Single sample operation complete.
735
737
///
736
738
/// Collects the sample and provides a callback to the application.
@@ -810,7 +812,9 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::Client for AdcDedicate
810
812
}
811
813
812
814
/// Callbacks from the High Speed ADC driver
813
- impl < A : hil:: adc:: Adc + hil:: adc:: AdcHighSpeed > hil:: adc:: HighSpeedClient for AdcDedicated < ' _ , A > {
815
+ impl < ' a , A : hil:: adc:: Adc < ' a > + hil:: adc:: AdcHighSpeed < ' a > > hil:: adc:: HighSpeedClient
816
+ for AdcDedicated < ' a , A >
817
+ {
814
818
/// Internal buffer has filled from a buffered sampling operation.
815
819
/// Copies data over to application buffer, determines if more data is
816
820
/// needed, and performs a callback to the application if ready. If
@@ -1142,7 +1146,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::HighSpeedClient for Ad
1142
1146
}
1143
1147
1144
1148
/// Implementations of application syscalls
1145
- impl < A : hil:: adc:: Adc + hil:: adc:: AdcHighSpeed > SyscallDriver for AdcDedicated < ' _ , A > {
1149
+ impl < ' a , A : hil:: adc:: Adc < ' a > + hil:: adc:: AdcHighSpeed < ' a > > SyscallDriver for AdcDedicated < ' a , A > {
1146
1150
/// Method for the application to command or query this driver.
1147
1151
///
1148
1152
/// - `command_num` - which command call this is
0 commit comments