Proteus-e click
PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU
[click Product page](CLICK_PRODUCT_PAGE_LINK)
Click library
- Author : Stefan Filipovic
- Date : Sep 2024.
- Type : UART type
Software Support
We provide a library for the Proteus-e 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Proteus-e Click driver.
Standard key functions :
proteuse_cfg_setup
Config Object Initialization function.
proteuse_init
Initialization function.
proteuse_default_cfg
Click Default Configuration function.
Example key functions :
proteuse_send_cmd
This function sends a desired command packet from the click context object.
proteuse_read_event
This function reads an event packet from the ring buffer and stores it in the click context object.
proteuse_get_user_setting
This function reads data from the desired user settings index and stores it in the click context event packet object.
Example Description
This example demonstrates the use of Proteus-e click board by processing data from a connected BT device.
The demo application is composed of two sections :
Application Init
Initializes the driver, resets and configures the click board, and reads the device info.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_printf( &logger, ">> Get device info.\r\n" );
{
log_printf( &logger, " < OS version: 0x%.2X%.2X\r\n",
( uint16_t ) proteuse.evt_pkt.payload[ 2 ],
( uint16_t ) proteuse.evt_pkt.payload[ 1 ] );
log_printf( &logger, " Build code: 0x%.2X%.2X%.2X%.2X\r\n",
( uint16_t ) proteuse.evt_pkt.payload[ 6 ],
( uint16_t ) proteuse.evt_pkt.payload[ 5 ],
( uint16_t ) proteuse.evt_pkt.payload[ 4 ],
( uint16_t ) proteuse.evt_pkt.payload[ 3 ] );
log_printf( &logger, " Package variant: 0x%.2X%.2X\r\n",
( uint16_t ) proteuse.evt_pkt.payload[ 8 ],
( uint16_t ) proteuse.evt_pkt.payload[ 7 ] );
log_printf( &logger, " Chip ID: 0x%.2X%.2X%.2X%.2X\r\n\n",
( uint16_t ) proteuse.evt_pkt.payload[ 12 ],
( uint16_t ) proteuse.evt_pkt.payload[ 11 ],
( uint16_t ) proteuse.evt_pkt.payload[ 10 ],
( uint16_t ) proteuse.evt_pkt.payload[ 9 ] );
}
log_printf( &logger, ">> Get FW version.\r\n" );
{
log_printf( &logger, " < FW version: %u.%u.%u\r\n\n",
( uint16_t ) proteuse.evt_pkt.payload[ 3 ],
( uint16_t ) proteuse.evt_pkt.payload[ 2 ],
( uint16_t ) proteuse.evt_pkt.payload[ 1 ] );
}
log_printf( &logger, ">> Get BT MAC.\r\n" );
{
log_printf( &logger, " < BT MAC: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\r\n\n",
( uint16_t ) proteuse.evt_pkt.payload[ 6 ],
( uint16_t ) proteuse.evt_pkt.payload[ 5 ],
( uint16_t ) proteuse.evt_pkt.payload[ 4 ],
( uint16_t ) proteuse.evt_pkt.payload[ 3 ],
( uint16_t ) proteuse.evt_pkt.payload[ 2 ],
( uint16_t ) proteuse.evt_pkt.payload[ 1 ] );
}
log_printf( &logger,
">> Set device name to \"%s\".\r\n", (
char * )
DEVICE_NAME );
{
log_printf( &logger, " < Request received, settings set successfully\r\n\n" );
}
log_printf( &logger, ">> Get device name.\r\n" );
{
log_printf( &logger, " < Device name: \"%s\"\r\n\n", &proteuse.evt_pkt.payload[ 1 ] );
}
log_info( &logger, " Application Task " );
}
Application Task
Reads and parses all the received event packets and displays them the USB UART. All incoming data messages received from the connected device will be echoed back.
{
{
proteuse_parse_event ( &proteuse );
}
}
Note
We recommend using the WE Bluetooth LE Terminal smartphone application for the test.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Proteuse
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.