EasyManua.ls Logo

STMicroelectronics STEVAL-IHP005V1 - Page 42

STMicroelectronics STEVAL-IHP005V1
57 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Firmware description UM1619
42/56 DocID024383 Rev 1
4) Set module parameters: programming user parameters
uint8_t *buffer;
buffer[0] = 32;
buffer[1] = APP_SERVICE_FRAME;
buffer[2,3] = target_module.group;
buffer[4,5,6,7] = target_module.address;
buffer[8] = SERVICE_PARAM_SET;
buffer[9] = PROG_GRP_USER_DATA;
buffer[10 -> 29] = *user_data_buffer;
buffer[30,31] = CRC16;
5) Get module parameters
uint8_t *buffer;
buffer[0] = 12;
buffer[1] = APP_SERVICE_FRAME;
buffer[2,3] = target_module.group;
buffer[4,5,6,7] = target_module.address;
buffer[8] = SERVICE_PARAM_GET;
/* FOR GET DATA LINK STACK PARAMETERS */
buffer[9] = PROG_GRP_LL_STACK_PARAM;
/* FOR GET MODULE PARAMETERS */
buffer[9] = PROG_GRP_DEVICE_DATA;
/* FOR GET USER DATA */
buffer[9] = PROG_GRP_USER_DATA;
buffer[10,11] = CRC16;
After a certain delay from the get command acknowledgment, the PLM module will send the following
frame:
/* RESPONSE FRAME FOR DATA LINK STACK PARAMETERS GET COMMAND */
APP_userdata_t frame;
frame.source = SOURCE_PLM / ...; // Data source PLM, ...
frame.type = APP_SERVICE_FRAME;
frame.len = 52;
frame.error = APP_ERROR_NONE;
frame.broadcast = FALSE;
frame.group = sender.group; // Device (the one been queried)group
frame.address = sender.address; // Device (the one been queried)address
frame.data[0] = SERVICE_PARAM_GET; // Command echo
frame.data[1] = PROG_GRP_LL_STACK_PARAM; // Sub command echo
frame.data[2,3] = PLM_MIN_SLOT; // Minimum backoff time
frame.data[4,5] = PLM_MAX_SLOT; // Maximum backoff time
frame.data[6,7] = PLM_NTW_P_GLOBAL_TX_TO; // Timeout for global tx
frame.data[8,9,10,11] = PLM_NTW_P_BC_GLOBAL_TX_TO; // Timeout for broadcast frame retransmission
frame.data[12,13] = PLM_NTW_P_ACTIVITY_TO; // Timeout for network
frame.data[14,15] = PLM_NTW_P_WATCHDOG_TO; // Watchdog timeout
frame.data[16,17,18,19] = PLM_NTW_P_DATATRANSFER_TO;// Timeout for completing a transfer from
source to target
frame.data[20,21] = PLM_NTW_P_BANDINUSE_TO; // Timeout for the band in use signal
frame.data[22,33,24,25] = PLM_NTW_P_FRAME_TX_TO; // Timeout for sending a frame through SPI
frame.data[26,27,28,29] = PLM_NTW_P_BCAST_TX_TO; // Timeout for repeat a broadcast frame
frame.data[30,31,32,33] = PLM_NTW_P_ACK_RX_TO; // Timeout for receiving an ACK frame
frame.data[34,35,36,37] = PLM_NTW_P_bACK_RX_TO; // Timeout for receiving a bACK frame
frame.data[38,39,40,41] = PLM_NTW_P_FRM_RX_TO; // Timeout for frame receptions
frame.data[42,43,44,45] = PLM_NTW_P_NDX_TO; // Minimum delay before any
frame.data[46,47] = PLM_LL_MAX_ATTEMPT; // Max attempts if no activity is detected
frame.data[48,49] = PLM_LL_MAX_RPT_ATTEMPT; // Max repetition attempts (processed ID)
frame.data[50,51] = DEVICE_TIME_SYNC; // Timeclock update synchro frame interval
/* RESPONSE FRAME FOR MODULE PARAMETERS GET COMMAND */
APP_userdata_t frame;
frame.source = SOURCE_PLM / ...; // Data source PLM, ...
frame.type = APP_SERVICE_FRAME;
frame.len = 10;
frame.error = APP_ERROR_NONE;

Table of Contents

Related product manuals