Skip to content

Commit 7caac25

Browse files
authored
Merge pull request tock#4857 from tock/dev/syscall-driver-types
boards: nrf52840dk: use component types
2 parents 14a4bca + 4911446 commit 7caac25

8 files changed

Lines changed: 94 additions & 109 deletions

File tree

boards/components/src/analog_comparator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ macro_rules! analog_comparator_component_static {
5252
};};
5353
}
5454

55+
pub type AnalogComparatorComponentType<AC> = AnalogComparator<'static, AC>;
56+
5557
pub struct AnalogComparatorComponent<
5658
AC: 'static + kernel::hil::analog_comparator::AnalogComparator<'static>,
5759
> {

boards/components/src/ble.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ macro_rules! ble_component_static {
3737
}};
3838
}
3939

40+
pub type BLEComponentType<B, A> =
41+
capsules_extra::ble_advertising_driver::BLE<'static, B, VirtualMuxAlarm<'static, A>>;
42+
4043
pub struct BLEComponent<
4144
A: kernel::hil::time::Alarm<'static> + 'static,
4245
B: kernel::hil::ble_advertising::BleAdvertisementDriver<'static> + BleConfig + 'static,

boards/components/src/i2c.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ impl<I: 'static + i2c::I2CMaster<'static>> Component for I2CComponent<I> {
134134
}
135135
}
136136

137+
pub type I2CMasterSlaveDriverComponentType<I> =
138+
capsules_core::i2c_master_slave_driver::I2CMasterSlaveDriver<'static, I>;
139+
137140
pub struct I2CMasterSlaveDriverComponent<I: 'static + i2c::I2CMasterSlave<'static>> {
138141
board_kernel: &'static kernel::Kernel,
139142
driver_num: usize,

boards/components/src/process_console.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ macro_rules! process_console_component_static {
6565
};};
6666
}
6767

68+
pub type ProcessConsoleComponentType<A> = process_console::ProcessConsole<
69+
'static,
70+
{ capsules_core::process_console::DEFAULT_COMMAND_HISTORY_LEN },
71+
VirtualMuxAlarm<'static, A>,
72+
Capability,
73+
>;
74+
6875
pub struct ProcessConsoleComponent<const COMMAND_HISTORY_LEN: usize, A: 'static + Alarm<'static>> {
6976
board_kernel: &'static kernel::Kernel,
7077
uart_mux: &'static MuxUart<'static>,

boards/components/src/spi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ pub struct SpiMuxComponent<S: 'static + spi::SpiMaster<'static>> {
113113
spi: &'static S,
114114
}
115115

116+
pub type SpiSyscallComponentType<S> = Spi<'static, VirtualSpiMasterDevice<'static, S>>;
117+
116118
pub struct SpiSyscallComponent<S: 'static + spi::SpiMaster<'static>> {
117119
board_kernel: &'static kernel::Kernel,
118120
spi_mux: &'static MuxSpiMaster<'static, S>,

boards/components/src/udp_driver.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ macro_rules! udp_driver_component_static {
6868
};};
6969
}
7070

71+
pub type UDPDriverComponentType = capsules_extra::net::udp::UDPDriver<'static>;
72+
7173
pub struct UDPDriverComponent<A: Alarm<'static> + 'static> {
7274
board_kernel: &'static kernel::Kernel,
7375
driver_num: usize,

0 commit comments

Comments
 (0)