BEE click features MRF24J40MA 2.4 GHz IEEE 802.15.4 radio transceiver module from Microchip.
We provide a library for the Bee Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
for ( uint8_t cnt = 0; cnt < 2; cnt++ )
{
short_address1[ cnt ] = 1;
short_address2[ cnt ] = 2;
pan_id1[ cnt ] = 3;
pan_id2[ cnt ] = 3;
}
for ( uint8_t cnt = 0; cnt < 8; cnt++ )
{
long_address1[ cnt ] = 1;
long_address2[ cnt ] = 2;
}
log_printf( &logger, " Reset and WakeUp \r\n" );
#ifdef DEMO_APP_TRANSMITTER
log_printf( &logger, " Application Mode: Transmitter\r\n" );
tx_data_fifo[2] = 0x01;
tx_data_fifo[3] = 0x88;
tx_data_fifo[4] = 0x23;
tx_data_fifo[5] = pan_id2[1];
tx_data_fifo[6] = pan_id2[0];
tx_data_fifo[7] = short_address2[0];
tx_data_fifo[8] = short_address2[1];
tx_data_fifo[9] = pan_id1[0];
tx_data_fifo[10] = pan_id1[1];
tx_data_fifo[11] = short_address1[0];
tx_data_fifo[12] = short_address1[1];
log_printf( &logger, " Set address and PAN ID \r\n" );
#else
log_printf( &logger, " Application Mode: Receiver\r\n" );
log_printf( &logger, " Set address and PAN ID \r\n" );
#endif
log_printf( &logger, " Init ZigBee module: \r\n" );
log_printf( &logger, " - Set nonbeacon-enabled \r\n" );
log_printf( &logger, " - Set as PAN coordinator\r\n" );
log_printf( &logger, " - Set max TX power\r\n" );
log_printf( &logger, " - All frames 3, data frame\r\n" );
log_printf( &logger, " - Set normal mode\r\n" );
log_printf( &logger, " - Device Wake Up\r\n" );
Delay_1sec( );
}
#define BEE_DATA_LENGHT
Definition bee.h:201
#define BEE_HEADER_LENGHT
Definition bee.h:202
#define BEE_MAP_MIKROBUS(cfg, mikrobus)
Definition bee.h:68
void bee_soft_reset(bee_t *ctx)
Soft reset function.
void bee_set_reception_mode(bee_t *ctx, uint8_t r_mode)
Set reception mode function.
void bee_set_short_address(bee_t *ctx, uint8_t *short_address)
Set short address function.
void bee_set_pan_id(bee_t *ctx, uint8_t *pan_id)
Set PAN ID function.
void bee_hw_wake_up(bee_t *ctx)
Hardware Wake Up function.
void bee_rf_reset(bee_t *ctx)
RF state machine reset 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_set_tx_power(bee_t *ctx, uint8_t tx_power)
Set scale control for Tx power function.
void bee_hw_reset(bee_t *ctx)
Hardware reset function.
void bee_set_long_address(bee_t *ctx, uint8_t *long_address)
Set long address function.
void bee_nonbeacon_init(bee_t *ctx)
Initialization nonbeacon module function.
void bee_enable_immediate_wake_up(bee_t *ctx)
Enable Immediate Wake-up mode function.
void bee_set_frame_format_filter(bee_t *ctx, uint8_t fff_mode)
Set frame format filter function.
void bee_nonbeacon_pan_coordinator_device(bee_t *ctx)
Set device as PAN coordinator function.
#define BEE_INTSTAT
Definition bee.h:134
void application_init(void)
Definition main.c:49
{
#ifdef DEMO_APP_TRANSMITTER
log_printf( &logger, " - Sent data : " );
log_printf( &logger, "%.6s \r\n", data_tx1 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " - Sent data : " );
log_printf( &logger, "%.6s \r\n", data_tx2 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
#else
if ( memcmp( &rx_data_fifo_old[ 0 ], &rx_data_fifo[ 0 ],
BEE_DATA_LENGHT ) )
{
log_printf( &logger, " - Received data : " );
log_printf( &logger, "%.6s \r\n", rx_data_fifo );
Delay_ms ( 1000 );
Delay_ms ( 500 );
}
Delay_ms ( 500 );
#endif
}
void application_task(void)
Definition main.c:144
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.