Struct capsules::rf233::RF233
[−]
[src]
pub struct RF233<'a, S: SpiMasterDevice + 'a> { spi: &'a S, radio_on: Cell<bool>, transmitting: Cell<bool>, receiving: Cell<bool>, spi_busy: Cell<bool>, interrupt_handling: Cell<bool>, interrupt_pending: Cell<bool>, config_pending: Cell<bool>, sleep_pending: Cell<bool>, wake_pending: Cell<bool>, power_client_pending: Cell<bool>, reset_pin: &'a Pin, sleep_pin: &'a Pin, irq_pin: &'a Pin, irq_ctl: &'a PinCtl, state: Cell<InternalState>, tx_buf: TakeCell<'static, [u8]>, rx_buf: TakeCell<'static, [u8]>, tx_len: Cell<u8>, tx_client: Cell<Option<&'static TxClient>>, rx_client: Cell<Option<&'static RxClient>>, cfg_client: Cell<Option<&'static ConfigClient>>, power_client: Cell<Option<&'static PowerClient>>, addr: Cell<u16>, addr_long: Cell<[u8; 8]>, pan: Cell<u16>, tx_power: Cell<i8>, channel: Cell<u8>, spi_rx: TakeCell<'static, [u8]>, spi_tx: TakeCell<'static, [u8]>, spi_buf: TakeCell<'static, [u8]>, }
Fields
spi: &'a S
radio_on: Cell<bool>
transmitting: Cell<bool>
receiving: Cell<bool>
spi_busy: Cell<bool>
interrupt_handling: Cell<bool>
interrupt_pending: Cell<bool>
config_pending: Cell<bool>
sleep_pending: Cell<bool>
wake_pending: Cell<bool>
power_client_pending: Cell<bool>
reset_pin: &'a Pin
sleep_pin: &'a Pin
irq_pin: &'a Pin
irq_ctl: &'a PinCtl
state: Cell<InternalState>
tx_buf: TakeCell<'static, [u8]>
rx_buf: TakeCell<'static, [u8]>
tx_len: Cell<u8>
tx_client: Cell<Option<&'static TxClient>>
rx_client: Cell<Option<&'static RxClient>>
cfg_client: Cell<Option<&'static ConfigClient>>
power_client: Cell<Option<&'static PowerClient>>
addr: Cell<u16>
addr_long: Cell<[u8; 8]>
pan: Cell<u16>
tx_power: Cell<i8>
channel: Cell<u8>
spi_rx: TakeCell<'static, [u8]>
spi_tx: TakeCell<'static, [u8]>
spi_buf: TakeCell<'static, [u8]>
Methods
impl<'a, S: SpiMasterDevice + 'a> RF233<'a, S>
[src]
pub fn new(
spi: &'a S,
reset: &'a Pin,
sleep: &'a Pin,
irq: &'a Pin,
ctl: &'a PinCtl
) -> RF233<'a, S>
[src]
spi: &'a S,
reset: &'a Pin,
sleep: &'a Pin,
irq: &'a Pin,
ctl: &'a PinCtl
) -> RF233<'a, S>
fn handle_interrupt(&self)
[src]
fn register_write(&self, reg: RF233Register, val: u8) -> ReturnCode
[src]
fn register_read(&self, reg: RF233Register) -> ReturnCode
[src]
fn frame_write(&self, buf: &'static mut [u8], frame_len: u8) -> ReturnCode
[src]
fn frame_read(&self, buf: &'static mut [u8], frame_len: u8) -> ReturnCode
[src]
fn state_transition_write(
&self,
reg: RF233Register,
val: u8,
state: InternalState
)
[src]
&self,
reg: RF233Register,
val: u8,
state: InternalState
)
fn state_transition_read(&self, reg: RF233Register, state: InternalState)
[src]
Trait Implementations
impl<'a, S: SpiMasterDevice + 'a> SpiMasterClient for RF233<'a, S>
[src]
fn read_write_done(
&self,
_write: &'static mut [u8],
read: Option<&'static mut [u8]>,
_len: usize
)
[src]
&self,
_write: &'static mut [u8],
read: Option<&'static mut [u8]>,
_len: usize
)
Called when a read/write operation finishes
impl<'a, S: SpiMasterDevice + 'a> Client for RF233<'a, S>
[src]
fn fired(&self, identifier: usize)
[src]
Called when an interrupt occurs. The identifier
will be the same value that was passed to enable_interrupt()
when the interrupt was configured. Read more
impl<'a, S: SpiMasterDevice + 'a> Radio for RF233<'a, S>
[src]
impl<'a, S: SpiMasterDevice + 'a> RadioConfig for RF233<'a, S>
[src]
fn initialize(
&self,
buf: &'static mut [u8],
reg_write: &'static mut [u8],
reg_read: &'static mut [u8]
) -> ReturnCode
[src]
&self,
buf: &'static mut [u8],
reg_write: &'static mut [u8],
reg_read: &'static mut [u8]
) -> ReturnCode
buf must be at least MAX_BUF_SIZE in length, and reg_read and reg_write must be 2 bytes. Read more
fn reset(&self) -> ReturnCode
[src]
fn start(&self) -> ReturnCode
[src]
fn stop(&self) -> ReturnCode
[src]
fn is_on(&self) -> bool
[src]
fn busy(&self) -> bool
[src]
fn set_config_client(&self, client: &'static ConfigClient)
[src]
fn set_power_client(&self, client: &'static PowerClient)
[src]
fn set_address(&self, addr: u16)
[src]
fn set_address_long(&self, addr: [u8; 8])
[src]
fn set_pan(&self, id: u16)
[src]
fn set_tx_power(&self, power: i8) -> ReturnCode
[src]
fn set_channel(&self, chan: u8) -> ReturnCode
[src]
fn get_address(&self) -> u16
[src]
fn get_address_long(&self) -> [u8; 8]
[src]
fn get_pan(&self) -> u16
[src]
The 16-bit PAN ID
fn get_tx_power(&self) -> i8
[src]
The transmit power, in dBm
fn get_channel(&self) -> u8
[src]
The 802.15.4 channel
fn config_commit(&self)
[src]
Commit the config calls to hardware, changing the address, PAN ID, TX power, and channel to the specified values, issues a callback to the config client when done. Read more
impl<'a, S: SpiMasterDevice + 'a> RadioData for RF233<'a, S>
[src]
fn set_transmit_client(&self, client: &'static TxClient)
[src]
fn set_receive_client(
&self,
client: &'static RxClient,
buffer: &'static mut [u8]
)
[src]
&self,
client: &'static RxClient,
buffer: &'static mut [u8]
)
fn set_receive_buffer(&self, buffer: &'static mut [u8])
[src]
fn transmit(
&self,
spi_buf: &'static mut [u8],
frame_len: usize
) -> (ReturnCode, Option<&'static mut [u8]>)
[src]
&self,
spi_buf: &'static mut [u8],
frame_len: usize
) -> (ReturnCode, Option<&'static mut [u8]>)