C# Class HouseOfTheFuture.RF24Library.NRF24L01Plus

Afficher le fichier Open project: HouseOfTheFuture/IoT-Device

Méthodes publiques

Méthode Description
Configure ( byte address, byte channel ) : void

Configure the module basic settings. Module needs to be initiaized.

Configure ( byte address, byte channel, NRFDataRate dataRate ) : void

Configure the module basic settings. Module needs to be initiaized.

Disable ( ) : void

Disables the module

Enable ( ) : void

Enables the module

Execute ( byte command, byte addres, byte data ) : byte[]

Executes a command in NRF24L01+ (for details see module datasheet)

GetAddress ( AddressSlot slot, int width ) : byte[]

Read 1 of 6 available module addresses

GetChannel ( ) : byte

Reads the current rf channel value set in module

GetFrequency ( ) : int

Gets the module radio frequency [MHz]

GetStatus ( ) : Status

Gets module basic status information

HandleInterrupt ( uint data1, uint data2, System.DateTime dateTime ) : void
Initialize ( SpiMode spiMode, int chipSelectPin, int chipEnablePin, int interruptPin ) : void

Initializes SPI connection and control pins

NRF24L01Plus ( ) : System
SendTo ( byte address, byte bytes, int timeout ) : bool

Sends bytes to given address This is a blocking method that returns true if data was received by the recipient or false if timeout occured.

SendTo ( byte address, byte bytes, Acknowledge acknowledge = Acknowledge.Yes ) : void

Send bytes to given address This is a non blocking method.

SetAddress ( AddressSlot slot, byte address ) : void

Set one of 6 available module addresses

SetChannel ( byte channel ) : void

Sets the rf channel value used by all data pipes

Private Methods

Méthode Description
CheckIsInitialized ( ) : void
InitSpi ( int chipSelectPin, SpiMode mode ) : Task
SetDisabled ( ) : void
SetEnabled ( ) : void
SetReceiveMode ( ) : void
SetTransmitMode ( ) : void
_irqPin_ValueChanged ( Windows.Devices.Gpio.GpioPin sender, Windows.Devices.Gpio.GpioPinValueChangedEventArgs args ) : void

Method Details

Configure() public méthode

Configure the module basic settings. Module needs to be initiaized.
public Configure ( byte address, byte channel ) : void
address byte RF address (3-5 bytes). The width of this address determins the width of all addresses used for sending/receiving.
channel byte RF channel (0-127)
Résultat void

Configure() public méthode

Configure the module basic settings. Module needs to be initiaized.
public Configure ( byte address, byte channel, NRFDataRate dataRate ) : void
address byte RF address (3-5 bytes). The width of this address determins the width of all addresses used for sending/receiving.
channel byte RF channel (0-127)
dataRate NRFDataRate Data Rate to use
Résultat void

Disable() public méthode

Disables the module
public Disable ( ) : void
Résultat void

Enable() public méthode

Enables the module
public Enable ( ) : void
Résultat void

Execute() public méthode

Executes a command in NRF24L01+ (for details see module datasheet)
public Execute ( byte command, byte addres, byte data ) : byte[]
command byte Command
addres byte Register to write to
data byte Data to write
Résultat byte[]

GetAddress() public méthode

Read 1 of 6 available module addresses
public GetAddress ( AddressSlot slot, int width ) : byte[]
slot AddressSlot
width int
Résultat byte[]

GetChannel() public méthode

Reads the current rf channel value set in module
public GetChannel ( ) : byte
Résultat byte

GetFrequency() public méthode

Gets the module radio frequency [MHz]
public GetFrequency ( ) : int
Résultat int

GetStatus() public méthode

Gets module basic status information
public GetStatus ( ) : Status
Résultat Status

HandleInterrupt() public méthode

public HandleInterrupt ( uint data1, uint data2, System.DateTime dateTime ) : void
data1 uint
data2 uint
dateTime System.DateTime
Résultat void

Initialize() public méthode

Initializes SPI connection and control pins
public Initialize ( SpiMode spiMode, int chipSelectPin, int chipEnablePin, int interruptPin ) : void
spiMode SpiMode
chipSelectPin int
chipEnablePin int
interruptPin int
Résultat void

NRF24L01Plus() public méthode

public NRF24L01Plus ( ) : System
Résultat System

SendTo() public méthode

Sends bytes to given address This is a blocking method that returns true if data was received by the recipient or false if timeout occured.
public SendTo ( byte address, byte bytes, int timeout ) : bool
address byte
bytes byte
timeout int
Résultat bool

SendTo() public méthode

Send bytes to given address This is a non blocking method.
public SendTo ( byte address, byte bytes, Acknowledge acknowledge = Acknowledge.Yes ) : void
address byte
bytes byte
acknowledge Acknowledge
Résultat void

SetAddress() public méthode

Set one of 6 available module addresses
public SetAddress ( AddressSlot slot, byte address ) : void
slot AddressSlot
address byte
Résultat void

SetChannel() public méthode

Sets the rf channel value used by all data pipes
public SetChannel ( byte channel ) : void
channel byte 7 bit channel value
Résultat void