bee 2.0.0.0
Public function

Functions

void bee_cfg_setup (bee_cfg_t *cfg)
 Config Object Initialization function.
 
err_t bee_init (bee_t *ctx, bee_cfg_t *cfg)
 Initialization function.
 
void bee_generic_transfer (bee_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void bee_write_byte_short (bee_t *ctx, uint8_t reg_address, uint8_t write_data)
 Write the byte of data to the short register address function.
 
uint8_t bee_read_byte_short (bee_t *ctx, uint8_t reg_address)
 Read the byte of data from the short register address function.
 
void bee_write_byte_long (bee_t *ctx, uint16_t reg_address, uint8_t write_data)
 Write the byte of data to the long register address function.
 
uint8_t bee_read_byte_long (bee_t *ctx, uint16_t reg_address)
 Read the byte of data from the long register address function.
 
void bee_hw_reset (bee_t *ctx)
 Hardware reset function.
 
void bee_power_reset (bee_t *ctx)
 Power reset function.
 
void bee_bb_reset (bee_t *ctx)
 Baseband reset function.
 
void bee_mac_reset (bee_t *ctx)
 MAC reset function.
 
void bee_soft_reset (bee_t *ctx)
 Soft reset function.
 
void bee_rf_reset (bee_t *ctx)
 RF state machine reset function.
 
void bee_enable_interrupt (bee_t *ctx)
 Enable interrupt function.
 
void bee_set_channel (bee_t *ctx, uint8_t n_channel)
 Set channel function.
 
void bee_set_cca_mode (bee_t *ctx, uint8_t cca_mode)
 Set CCA mode function.
 
void bee_set_rssi_mode (bee_t *ctx, uint8_t rssi_mode)
 Set RSSI mode function.
 
void bee_nonbeacon_pan_coordinator_device (bee_t *ctx)
 Set device as PAN coordinator function.
 
void bee_nonbeacon_coordinator_device (bee_t *ctx)
 Set device as coordinator function.
 
void bee_nonbeacon_device (bee_t *ctx)
 Set nonbeacon device function.
 
void bee_set_ack (bee_t *ctx)
 Set ACK request function.
 
void bee_set_not_ack (bee_t *ctx)
 Set not ACK request function.
 
void bee_enable_encrypt (bee_t *ctx)
 Set enable encrypt function.
 
void bee_disabl_encrypt (bee_t *ctx)
 Disable encrypt function.
 
void bee_set_ifs_recomended (bee_t *ctx)
 Set interframe spacing function.
 
void bee_set_ifs_default (bee_t *ctx)
 Set default interframe spacing function.
 
void bee_set_reception_mode (bee_t *ctx, uint8_t r_mode)
 Set reception mode function.
 
void bee_set_frame_format_filter (bee_t *ctx, uint8_t fff_mode)
 Set frame format filter function.
 
void bee_flush_rx_fifo_pointer (bee_t *ctx)
 Set flush RX FIFO pointer function.
 
void bee_set_short_address (bee_t *ctx, uint8_t *short_address)
 Set short address function.
 
void bee_set_long_address (bee_t *ctx, uint8_t *long_address)
 Set long address function.
 
void bee_set_pan_id (bee_t *ctx, uint8_t *pan_id)
 Set PAN ID function.
 
void bee_enable_immediate_wake_up (bee_t *ctx)
 Enable Immediate Wake-up mode function.
 
void bee_hw_wake_up (bee_t *ctx)
 Hardware Wake Up function.
 
void bee_enable_pll (bee_t *ctx)
 Enable PLL function.
 
void bee_disable_pll (bee_t *ctx)
 Disable PLL function.
 
void bee_set_tx_power (bee_t *ctx, uint8_t tx_power)
 Set scale control for Tx power function.
 
void bee_basic_init (bee_t *ctx)
 Basic initialization module function.
 
void bee_nonbeacon_init (bee_t *ctx)
 Initialization nonbeacon module function.
 
uint8_t bee_interrupt_activity (bee_t *ctx)
 Check interrupt activity function.
 
void bee_start_transmit (bee_t *ctx)
 Start transmission function.
 
void bee_read_rx_fifo (bee_t *ctx, uint8_t *rx_data)
 Read RX FIFO function.
 
void bee_write_tx_normal_fifo (bee_t *ctx, uint16_t address_tx_normal_fifo, uint8_t *tx_data)
 Write TX normal FIFO function.
 
uint8_t bee_interrupt (bee_t *ctx)
 Get interrupt state function.
 

Detailed Description

Function Documentation

◆ bee_basic_init()

void bee_basic_init ( bee_t * ctx)

Basic initialization module function.

Parameters
ctxClick object.

@description The function set basic initialization module:

  • Power amplifier control 2 register sets:
    • FIFO Enable;
    • Transmitter Enable On Time Symbol ( recommended value: 0x60 );
  • TX stabilization register sets:
    • VCO Stabilization Period ( recommended value: 0x90 );
  • RF control 1 register sets:
    • VCO Optimize Control;
  • RF control 6 register sets:
    • Recovery from Sleep control less than 1 ms;
    • Battery Monitor Disabled;
  • RF control 7 register sets:
    • Sleep Clock Selection 100 kHz internal oscillator;
  • RF control 8 register sets:
    • VCO Control;
  • Sleep calibration 1 register sets:
    • Sleep Calibration Counter; of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_bb_reset()

void bee_bb_reset ( bee_t * ctx)

Baseband reset function.

Parameters
ctxClick object.

@description The function Baseband reset - reset baseband circuitry by sets to '1' [ bit 1 ] states of _BEE_SOFTRST register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
bit is automatically cleared to '0' by hardware

◆ bee_cfg_setup()

void bee_cfg_setup ( bee_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ bee_disabl_encrypt()

void bee_disabl_encrypt ( bee_t * ctx)

Disable encrypt function.

Parameters
ctxClick object.

@description The function set Encrypt TX Normal FIFO Security Disabled by cleared to '0' [ bit 1 ] states of _BEE_TXNCON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_disable_pll()

void bee_disable_pll ( bee_t * ctx)

Disable PLL function.

Parameters
ctxClick object.

@description The function enable PLL by cleared to '0' [ bit 7 ] states of _BEE_RFCON2 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_enable_encrypt()

void bee_enable_encrypt ( bee_t * ctx)

Set enable encrypt function.

Parameters
ctxClick object.

@description The function set Encrypt TX Normal FIFO Security Enabled by set to '1' [ bit 1 ] states of _BEE_TXNCON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_enable_immediate_wake_up()

void bee_enable_immediate_wake_up ( bee_t * ctx)

Enable Immediate Wake-up mode function.

Parameters
ctxClick object.

@description Function enable immediate wake-up mode by wake signal polarity is active-high, enable wake I/O pin and by sets to '1' [ bit 7 ] states of _BEE_WAKECON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_enable_interrupt()

void bee_enable_interrupt ( bee_t * ctx)

Enable interrupt function.

Parameters
ctxClick object.

@description The function enable all interrupts:

  • sleep alert interrupt,
  • wake-up alert interrupt,
  • half symbol timer interrupt,
  • security key request interrupt,
  • RX FIFO reception interrupt,
  • TX GTS2 FIFO transmission interrupt,
  • TX GTS1 FIFO transmission interrupt,
  • TX Normal FIFO transmission interrupt by clear to '0' [ bit 7 : bit 0 ] states of _BEE_INTCON_M register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_enable_pll()

void bee_enable_pll ( bee_t * ctx)

Enable PLL function.

Parameters
ctxClick object.

@description The function enable PLL by sets to '1' [ bit 7 ] states of _BEE_RFCON2 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_flush_rx_fifo_pointer()

void bee_flush_rx_fifo_pointer ( bee_t * ctx)

Set flush RX FIFO pointer function.

Parameters
ctxClick object.

@description The function set flush RX FIFO pointer by resets the RXFIFO address pointer to zero and RXFIFO data is not modified of the _BEE_RXFLUSH register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_generic_transfer()

void bee_generic_transfer ( bee_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ bee_hw_reset()

void bee_hw_reset ( bee_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description The function Hardware reset - resets the MRF24J40MA 2.4GHz transceiver module by cleared to '0' RST state pin, wait 5 ms and set to '1' RST state pin on BEE Click board.

Note
Delay is 10 ms.

◆ bee_hw_wake_up()

void bee_hw_wake_up ( bee_t * ctx)

Hardware Wake Up function.

Parameters
ctxClick object.

@description The function hardware Wake Up by set to '1' RST pin state of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
Delay is 5 ms

◆ bee_init()

err_t bee_init ( bee_t * ctx,
bee_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ bee_interrupt()

uint8_t bee_interrupt ( bee_t * ctx)

Get interrupt state function.

Parameters
ctxClick object.
Returns
interrupt state
  • 0 : not active
  • 1 : active

@description The function gets interrupt state by return status of INT pin of BEE Click board.

◆ bee_interrupt_activity()

uint8_t bee_interrupt_activity ( bee_t * ctx)

Check interrupt activity function.

Parameters
ctxClick object.
Returns
interrupt status:
  • 0 : interrupt is not active;
  • 1 : interrupt is active;

@description The function check interrupt status of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_mac_reset()

void bee_mac_reset ( bee_t * ctx)

MAC reset function.

Parameters
ctxClick object.

@description The function MAC reset - reset MAC circuitry by sets to '1' [ bit 0 ] states of _BEE_SOFTRST register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
bit is automatically cleared to '0' by hardware

◆ bee_nonbeacon_coordinator_device()

void bee_nonbeacon_coordinator_device ( bee_t * ctx)

Set device as coordinator function.

Parameters
ctxClick object.

@description The function set device as coordinator and disable Slotted CSMA-CA mode by sets to '1' [ bit 2 ] states of _BEE_RXMCR register address and cleared to '0' [ bit 5 ] states of _BEE_TXMCR register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_nonbeacon_device()

void bee_nonbeacon_device ( bee_t * ctx)

Set nonbeacon device function.

Parameters
ctxClick object.

@description The function set device is not set as PAN coordinator and device is not set as coordinator by cleared to '0' [ bit 3 : bit 2 ] states of _BEE_RXMCR register address and cleared to '0' [ bit 5 ] states of _BEE_TXMCR register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_nonbeacon_init()

void bee_nonbeacon_init ( bee_t * ctx)

Initialization nonbeacon module function.

Parameters
ctxClick object.

@description The function set initialization nonbeacon mode by:

  • sets basic initialization module;
  • set CCA mode to value 1;
  • set RSSI mode to value 2;
  • enable interrupt;
  • set channel to value 11;
  • RF state machine reset; of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_nonbeacon_pan_coordinator_device()

void bee_nonbeacon_pan_coordinator_device ( bee_t * ctx)

Set device as PAN coordinator function.

Parameters
ctxClick object.

@description The function set device as PAN coordinator and disable Slotted CSMA-CA mode by sets to '1' [ bit 3 ] states of _BEE_RXMCR register address and cleared to '0' [ bit 5 ] states of _BEE_TXMCR register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_power_reset()

void bee_power_reset ( bee_t * ctx)

Power reset function.

Parameters
ctxClick object.

@description The function Power reset - reset power management circuitry by sets to '1' [ bit 2 ] states of _BEE_SOFTRST register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
bit is automatically cleared to '0' by hardware

◆ bee_read_byte_long()

uint8_t bee_read_byte_long ( bee_t * ctx,
uint16_t reg_address )

Read the byte of data from the long register address function.

Parameters
reg_address16-bit register address

@description The function write the 8-bit of data to the targeted long 16-bit register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_read_byte_short()

uint8_t bee_read_byte_short ( bee_t * ctx,
uint8_t reg_address )

Read the byte of data from the short register address function.

Parameters
ctxClick object.
reg_address8-bit register address

@description The function write the 8-bit of data to the targeted short 8-bit register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_read_rx_fifo()

void bee_read_rx_fifo ( bee_t * ctx,
uint8_t * rx_data )

Read RX FIFO function.

Parameters
ctxClick object.
rx_datapointer to the memory location where rxData be stored

@description The function set short address by write shortAddress value to the _BEE_SADRL and _BEE_SADRH register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_rf_reset()

void bee_rf_reset ( bee_t * ctx)

RF state machine reset function.

Parameters
ctxClick object.

@description The function RF state machine reset activate normal operation of RF state machine by clear to '0' [ bit 2 ] states of _BEE_RFCTL register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
Delay is 1 ms.

◆ bee_set_ack()

void bee_set_ack ( bee_t * ctx)

Set ACK request function.

Parameters
ctxClick object.

@description The function set TX Normal FIFO Acknowledgement Request by sets to '1' [ bit 2 ] states of _BEE_TXNCON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_cca_mode()

void bee_set_cca_mode ( bee_t * ctx,
uint8_t cca_mode )

Set CCA mode function.

Parameters
ctxClick object.
cca_mode
  • 0x01 : CCA Mode 1, Energy above threshold. CCA shall report a busy medium upon detecting any energy above the Energy Detection (ED) threshold.
  • 0x02 : CCA Mode 2, Carrier sense only. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. This signal may be above or below the Energy Detection (ED) threshold (default).
  • 0x03 : CCA Mode 3, Carrier sense with energy above threshold. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. with energy above the Energy Detection (ED) threshold.

@description The function set CCA mode 1, 2 or 3 by write ccaMode value to the _BEE_RFCON0 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_channel()

void bee_set_channel ( bee_t * ctx,
uint8_t n_channel )

Set channel function.

Parameters
ctxClick object.
n_nhannel
  • 0x0B : Channel 11 (2405 MHz) (default);
  • 0x0C : Channel 12 (2410 MHz);
  • 0x0D : Channel 13 (2415 MHz);
  • 0x1A : Channel 26 (2480 MHz);

@description The function set channel by write number of channel value to the _BEE_RFCON0 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_frame_format_filter()

void bee_set_frame_format_filter ( bee_t * ctx,
uint8_t fff_mode )

Set frame format filter function.

Parameters
ctxClick object.
fff_mode
  • 0x01 : Frame Format Filter Mode 1:
    • All valid frames are received (default)
  • 0x02 : Frame Format Filter Mode 2:
    • Only command frames are received, all other frames are filtered out
  • 0x03 : Frame Format Filter Mode 3:
    • Only data frames are received, all other frames are filtered out
  • 0x04 : Frame Format Filter Mode 4:
    • Only beacon frames are received, all other frames are filtered out

@description The function set reception mode by write fffMode value to the _BEE_RXFLUSH register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_ifs_default()

void bee_set_ifs_default ( bee_t * ctx)

Set default interframe spacing function.

Parameters
ctxClick object.

@description The function set default interframe spacing by sets:

  • Disables automatic Acknowledgement response;
  • Device is not set as PAN coordinator;
  • Set device as coordinator;
  • Accept only packets with good CRC;
  • Receive all packet types with good CRC;
  • Minimum Long Interframe Spacing ( default );
  • VCO Stabilization Period ( default );
  • Turnaround Time ( default ); of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_ifs_recomended()

void bee_set_ifs_recomended ( bee_t * ctx)

Set interframe spacing function.

Parameters
ctxClick object.

@description The function set interframe spacing recomended by sets:

  • minimum number of symbols forming a Long Interframe Spacing (LIFS) period;
  • GTS1 and GTS2 FIFO will stop toggling with each other if the transmission fails;
  • Clears frame pending bit;
  • VCO Stabilization Period recomended;
  • Transmission to reception and reception to transmission turnaround time recomended; of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_long_address()

void bee_set_long_address ( bee_t * ctx,
uint8_t * long_address )

Set long address function.

Parameters
ctxClick object.
long_addresspointer of the long address value

@description The function set long address by write longAddress value start on _BEE_EADR0 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_not_ack()

void bee_set_not_ack ( bee_t * ctx)

Set not ACK request function.

Parameters
ctxClick object.

@description The function set TX Normal FIFO No Acknowledgement Request by cleared to '0' [ bit 2 ] states of _BEE_TXNCON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_pan_id()

void bee_set_pan_id ( bee_t * ctx,
uint8_t * pan_id )

Set PAN ID function.

Parameters
ctxClick object.
pan_idpointer of the PAN ID value

@description The function set PAN ID by write panId value to the _BEE_PANIDL and _BEE_PANIDH register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_reception_mode()

void bee_set_reception_mode ( bee_t * ctx,
uint8_t r_mode )

Set reception mode function.

Parameters
ctxClick object.
r_mode
  • 0x01 : Reception Mode 1:
    • Discard packet when there is a MAC address mismatch, illegal frame type, dPAN/sPAN or MAC short address mismatch (default)
    • Accept only packets with good CRC (default)
  • 0x02 : Reception Mode 2:
    • Discard packet when there is a MAC address mismatch, illegal frame type, dPAN/sPAN or MAC short address mismatch (default)
    • Accept all packets including those with CRC error
  • 0x03 : Reception Mode 3:
    • Receive all packet types with good CRC
    • Accept only packets with good CRC (default)

@description The function set reception mode by write rMode value to the _BEE_RXMCR register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_rssi_mode()

void bee_set_rssi_mode ( bee_t * ctx,
uint8_t rssi_mode )

Set RSSI mode function.

Parameters
ctxClick object.
rssi_mode
  • 0x01 : RSSI Mode 1, Initiate RSSI calculation;
  • 0x02 : RSSI Mode 2, Calculate RSSI for each received packet. The RSSI value is stored in RXFIFO;

@description The function set RSSI mode 1 or 2 by write rssiMode value to the _BEE_RFCON0 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_short_address()

void bee_set_short_address ( bee_t * ctx,
uint8_t * short_address )

Set short address function.

Parameters
short_addresspointer of the short address value

@description The function set short address by write shortAddress value to the _BEE_SADRL and _BEE_SADRH register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_set_tx_power()

void bee_set_tx_power ( bee_t * ctx,
uint8_t tx_power )

Set scale control for Tx power function.

Parameters
ctxClick object.
tx_powerTX power value from 0 to 31

@description The function set scale control for Tx power by write txPower value to the _BEE_RFCON3 register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_soft_reset()

void bee_soft_reset ( bee_t * ctx)

Soft reset function.

Parameters
ctxClick object.

@description The function soft reset - reset power, baseband and MAC circuitry by sets to '1' [ bit 3 : bit 0 ] states of _BEE_SOFTRST register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
bits is automatically cleared to '0' by hardware

◆ bee_start_transmit()

void bee_start_transmit ( bee_t * ctx)

Start transmission function.

Parameters
ctxClick object.

@description The function start transmission by sets transmit the frame in the TX Normal FIFO to the _BEE_TXNCON register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

Note
bits is automatically cleared to '0' by hardware

◆ bee_write_byte_long()

void bee_write_byte_long ( bee_t * ctx,
uint16_t reg_address,
uint8_t write_data )

Write the byte of data to the long register address function.

Parameters
reg_address16-bit register address
write_dataByte of data to write

@description The function writes the byte of data to the targeted long 16-bit register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_write_byte_short()

void bee_write_byte_short ( bee_t * ctx,
uint8_t reg_address,
uint8_t write_data )

Write the byte of data to the short register address function.

Parameters
ctxClick object.
reg_address8-bit register address
write_dataByte of data to write

@description The function writes the byte of data to the targeted short 8-bit register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.

◆ bee_write_tx_normal_fifo()

void bee_write_tx_normal_fifo ( bee_t * ctx,
uint16_t address_tx_normal_fifo,
uint8_t * tx_data )

Write TX normal FIFO function.

Parameters
ctxClick object.
address_tx_normal_fifo16-bit normal FIFO register address from 0x000 to 0x07F
tx_datapointer to the memory location where txData be stored

@description The function write TX normal FIFO by write txData value to the starts from addressTXnormalFIFO register address of MRF24J40MA 2.4GHz transceiver module on BEE Click board.