C# Class Gralin.NETMF.Nordic.NRF24L01Plus

Driver class for Nordic nRF24L01+ tranceiver
Afficher le fichier Open project: GerardSoleCa/IOSharp-netmf-Linux Class Usage Examples

Méthodes publiques

Свойство Type Description
_def_rx_addr_p0 byte[]
_def_rx_addr_p1 byte[]
_def_rx_addr_p2 byte[]
_def_rx_addr_p3 byte[]
_def_rx_addr_p4 byte[]
_def_rx_addr_p5 byte[]
slot AddressSlot[]

Méthodes publiques

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

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

Disable ( ) : void

Disables the module

DisableAA ( AddressSlot s ) : void

Disables the auto-auknowledge for a specific module address slot

DisableRX ( AddressSlot s ) : void

Disables a specific module address slot for reception

Enable ( ) : void

Enables the module

EnableAA ( AddressSlot s ) : void

Enables the auto-auknowledge for a specific module address slot

EnableRX ( AddressSlot s ) : void

Enables a specific module address slot for reception

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

GetDefaultAddress ( AddressSlot s ) : byte[]
GetFrequency ( ) : int

Gets the module radio frequency [MHz]

GetStatus ( ) : Status

Gets module basic status information

Initialize ( DriverExpand.SPI spi, DriverExpand.OutputPort chipEnablePin, InterruptPort interruptPort ) : 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 ) : void

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

SetAddress ( AddressSlot s, byte address, bool EN_AA ) : void

Set one of 6 available module addresses and enables it when in RX mode, sets also auto-ack if EN_AA is true

SetChannel ( byte channel ) : void

Sets the rf channel value used by all data pipes

SetFixedPayload ( int size ) : void

Sets fixed payload paquets of size bytes weitdh.

SetToDefaultAddress ( AddressSlot s ) : void

Set one of 6 available module addresses to its default value and disables it

Private Methods

Méthode Description
CheckIsInitialized ( ) : void
HandleInterrupt ( uint data1, uint data2, System.DateTime dateTime ) : void

returns the first free pipe loacted or 9 if there are not free pipes available

SetDisabled ( ) : void
SetEnabled ( ) : void
SetReceiveMode ( ) : void
SetTransmitMode ( ) : void
equals ( byte a1, byte a2 ) : bool

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

Disable() public méthode

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

DisableAA() public méthode

Disables the auto-auknowledge for a specific module address slot
public DisableAA ( AddressSlot s ) : void
s AddressSlot
Résultat void

DisableRX() public méthode

Disables a specific module address slot for reception
public DisableRX ( AddressSlot s ) : void
s AddressSlot
Résultat void

Enable() public méthode

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

EnableAA() public méthode

Enables the auto-auknowledge for a specific module address slot
public EnableAA ( AddressSlot s ) : void
s AddressSlot
Résultat void

EnableRX() public méthode

Enables a specific module address slot for reception
public EnableRX ( AddressSlot s ) : void
s AddressSlot
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

GetDefaultAddress() public méthode

public GetDefaultAddress ( AddressSlot s ) : byte[]
s AddressSlot
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

Initialize() public méthode

Initializes SPI connection and control pins
public Initialize ( DriverExpand.SPI spi, DriverExpand.OutputPort chipEnablePin, InterruptPort interruptPort ) : void
spi DriverExpand.SPI
chipEnablePin DriverExpand.OutputPort
interruptPort Microsoft.SPOT.Hardware.InterruptPort
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 ) : void
address byte
bytes byte
Résultat void

SetAddress() public méthode

Set one of 6 available module addresses and enables it when in RX mode, sets also auto-ack if EN_AA is true
public SetAddress ( AddressSlot s, byte address, bool EN_AA ) : void
s AddressSlot
address byte
EN_AA bool
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

SetFixedPayload() public méthode

Sets fixed payload paquets of size bytes weitdh.
public SetFixedPayload ( int size ) : void
size int
Résultat void

SetToDefaultAddress() public méthode

Set one of 6 available module addresses to its default value and disables it
public SetToDefaultAddress ( AddressSlot s ) : void
s AddressSlot
Résultat void

Property Details

_def_rx_addr_p0 public_oe property

public byte[] _def_rx_addr_p0
Résultat byte[]

_def_rx_addr_p1 public_oe property

public byte[] _def_rx_addr_p1
Résultat byte[]

_def_rx_addr_p2 public_oe property

public byte[] _def_rx_addr_p2
Résultat byte[]

_def_rx_addr_p3 public_oe property

public byte[] _def_rx_addr_p3
Résultat byte[]

_def_rx_addr_p4 public_oe property

public byte[] _def_rx_addr_p4
Résultat byte[]

_def_rx_addr_p5 public_oe property

public byte[] _def_rx_addr_p5
Résultat byte[]

slot public_oe property

public AddressSlot[] slot
Résultat AddressSlot[]