1 /* 2 * Copyright 2012-2020, 2023 NXP 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _PHNXPUCIHAL_LC_H_ 18 #define _PHNXPUCIHAL_LC_H_ 19 20 #include <phNxpUciHal.h> 21 22 /* Macros for parsing GetDeviceInfo response */ 23 #define UWB_INDEX_TO_RETRIEVE_PARAMS 0x08 24 #define UWBS_LIFECYCLE 0x06 25 #define UWBS_LIFECYCLE_LENGTH 0x04 26 27 /* LC Rotation data structure */ 28 typedef struct { 29 pthread_attr_t attr_thread; 30 pthread_t lcfwdl_tread; /* lcfwdl thread handle */ 31 uint8_t lcfwdl_thread_running; 32 /* Rx data */ 33 uint8_t rcv_data[100]; 34 uint16_t rcv_data_len; 35 /* To check LC rotation process*/ 36 uint8_t isLcRotationOngoing; 37 /* UWBs device lifecycle */ 38 uint32_t uwbsDeviceLc; 39 /* To check platformId */ 40 bool isPlatformIdSet; 41 /* Platform ID */ 42 uint8_t uwbsPlatformId[NXP_MAX_CONFIG_STRING_LEN]; 43 }phNxpUciHal_lcfwdl_Control_t; 44 45 #define UWBS_LC_DEVELOPMENT_MODE 0xC5C5C5C5 46 #define UWBS_LC_CUSTOMER_MODE 0xA5A5A5A5 47 #define UWBS_LC_PROTECTED_MODE 0x55555555 48 49 extern phNxpUciHal_lcfwdl_Control_t nxpucihal_lcfwdl_ctrl; 50 51 extern int phNxpUciHal_fw_lcrotation(); 52 tHAL_UWB_STATUS phNxpUciHal_start_lcfwdl_thread(); 53 uint32_t phNxpUciHal_parseUWBSLifecycle(uint8_t * p_rx_data , uint16_t rx_data_len); 54 void phNxpUciHal_parsePlatformId(uint8_t * p_rx_data , uint16_t rx_data_len); 55 tHAL_UWB_STATUS phNxpUciHal_getPlatformId(); 56 tHAL_UWB_STATUS phNxpUciHal_setPlatformId(); 57 tHAL_UWB_STATUS phNxpUciHal_setSecureConfig(); 58 59 #endif 60