Mistake on this page?
Report an issue in GitHub or email us
Macros | Typedefs | Functions
lctr_int.h File Reference

Internal link layer controller interface file. More...

#include "lctr_api.h"
#include "lmgr_api.h"
#include "ll_defs.h"
#include "ll_math.h"
#include "util/crc32.h"
#include "pal_bb.h"

Go to the source code of this file.

Macros

#define LCTR_DATA_CHAN_DLY   1 /* 1.25 ms */
 Minimum delay between connect indication and data channel in CONNECT_IND units. More...
 
#define LCTR_DATA_CHAN_DLY_AUX_UNCODED   2 /* 2.5 ms */
 Minimum delay between auxiliary connect request and data channel using uncoded PHY in CONNECT_REQ units. More...
 
#define LCTR_DATA_CHAN_DLY_AUX_CODED   3 /* 3.75 ms */
 Minimum delay between auxiliary connect request and data channel using coded PHY in CONNECT_REQ units. More...
 
#define LCTR_CONN_IND_TICKS(x)    ((x) * (1250 / LL_BLE_US_PER_TICK))
 Convert connect indication ticks to scheduler ticks. More...
 
#define LCTR_CONN_IND_MS(x)    ((x) + ((x) >> 2) + (((x) & 3) ? 1 : 0))
 Convert connect indication ticks to milliseconds (no divide, rounds up). More...
 
#define LCTR_CONN_IND_US(x)    ((x) * 1250)
 Convert connect indication ticks to microseconds. More...
 
#define LCTR_CONN_IND_TO_MS(x)    ((x) * 10)
 Convert connect indication timeout ticks to milliseconds. More...
 
#define LCTR_US_TO_CONN_IND(x)    LL_MATH_DIV_1250(x)
 Convert microseconds to connection indication ticks. More...
 
#define LCTR_BLE_TO_US(x)    ((x) * LL_BLE_US_PER_TICK)
 Convert BLE protocol ticks to microseconds. More...
 
#define LCTR_PER_INTER_TO_US(x)    ((x) * 1250)
 Convert periodic interval milliseconds to microseconds. More...
 
#define LCTR_PER_INTER_TO_MS(x)    LL_MATH_DIV_1250(x)
 Convert periodic interval microseconds to milliseconds. More...
 
#define LCTR_PER_SYNC_TIMEOUT_TO_MS(x)    ((x) * 10)
 Convert periodic sync timeout unit to milliseconds. More...
 
#define LCTR_ISO_INT_TO_US(x)    ((x) * 1250)
 Convert isochronous interval to microseconds. More...
 
#define LCTR_FAST_TERM_CNT   6
 Fast termination supervision multiplier. More...
 
#define LCTR_ADV_PKT_1M_US(len)    ((LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_ADV_HDR_LEN + len + LL_CRC_LEN) << 3)
 Duration of a advertising packet in microseconds. More...
 
#define LCTR_CONN_IND_PKT_1M_US   LCTR_ADV_PKT_1M_US(LL_CONN_IND_PDU_LEN)
 Duration of a connection indication packet in microseconds. More...
 
#define LCTR_ADVB_BUF_EXTRA_SIZE   6
 Extra area in ADVB buffer. More...
 
#define LCTR_ADVB_BUF_SIZE   (WSF_MAX(BB_FIXED_ADVB_PKT_LEN, LL_ADVB_MAX_LEN) + LCTR_ADVB_BUF_EXTRA_SIZE)
 Size for ADVB buffer allocation. More...
 
#define LCTR_ADVB_BUF_OFFSET_RSSI   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 0)
 RSSI offset of extra data in ADVB buffer. More...
 
#define LCTR_ADVB_BUF_OFFSET_RX_RPA   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 1)
 RPA offset of extra data in ADVB buffer. More...
 
#define LCTR_ADVB_BUF_OFFSET_CRC   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 2)
 CRC offset of extra data in ADVB buffer. More...
 
#define LCTR_SCH_MAX_SPAN   ((BbGetBbTimerBoundaryUs() >> 1) + 1)
 LCTR Maximum span of scheduler elements. More...
 
#define LCTR_MAX_SCA   7
 LCTR Maximum value for sleep clock accuracy. More...
 
#define LCTR_SUP_TIMEOUT_VAL_TO_US(x)    (x * 10000)
 Change supervision timeout value to us. More...
 

Typedefs

typedef void(* LctrResetHdlr_t) (void)
 Call signature of a reset handler. More...
 
typedef void(* LctrMsgDisp_t) (lctrMsgHdr_t *pMsg)
 Call signature of a message dispatch handler. More...
 
typedef void(* LctrEvtHdlr_t) (void)
 Call signature of a message dispatch handler. More...
 
typedef void(* LctrRmCback_t) (uint32_t rsvnOffs[], uint32_t refTime)
 Reservation manager callback signature. More...
 
typedef uint8_t(* lctrChClassHdlr_t) (uint64_t chanMap)
 Channel class update handler call signature. More...
 

Functions

static uint16_t lctrCalcDID (const uint8_t *pBuf, uint16_t len)
 Calculate DID. More...
 
static PalBbPhy_t lctrPhysBitToPhy (uint8_t physBit)
 Convert PHYS bit to PHY. More...
 
static uint8_t lctrPhyToPhysBit (uint8_t phy)
 Convert PHY to PHYS bit. More...
 

Detailed Description

Internal link layer controller interface file.

Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved.

Copyright (c) 2019-2020 Packetcraft, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file lctr_int.h.

Macro Definition Documentation

#define LCTR_ADV_PKT_1M_US (   len)    ((LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_ADV_HDR_LEN + len + LL_CRC_LEN) << 3)

Duration of a advertising packet in microseconds.

Definition at line 91 of file lctr_int.h.

#define LCTR_ADVB_BUF_EXTRA_SIZE   6

Extra area in ADVB buffer.

Definition at line 97 of file lctr_int.h.

#define LCTR_ADVB_BUF_OFFSET_CRC   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 2)

CRC offset of extra data in ADVB buffer.

Definition at line 109 of file lctr_int.h.

#define LCTR_ADVB_BUF_OFFSET_RSSI   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 0)

RSSI offset of extra data in ADVB buffer.

Definition at line 103 of file lctr_int.h.

#define LCTR_ADVB_BUF_OFFSET_RX_RPA   ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 1)

RPA offset of extra data in ADVB buffer.

Definition at line 106 of file lctr_int.h.

Size for ADVB buffer allocation.

Definition at line 100 of file lctr_int.h.

#define LCTR_BLE_TO_US (   x)    ((x) * LL_BLE_US_PER_TICK)

Convert BLE protocol ticks to microseconds.

Definition at line 73 of file lctr_int.h.

#define LCTR_CONN_IND_MS (   x)    ((x) + ((x) >> 2) + (((x) & 3) ? 1 : 0))

Convert connect indication ticks to milliseconds (no divide, rounds up).

Definition at line 61 of file lctr_int.h.

#define LCTR_CONN_IND_PKT_1M_US   LCTR_ADV_PKT_1M_US(LL_CONN_IND_PDU_LEN)

Duration of a connection indication packet in microseconds.

Definition at line 94 of file lctr_int.h.

#define LCTR_CONN_IND_TICKS (   x)    ((x) * (1250 / LL_BLE_US_PER_TICK))

Convert connect indication ticks to scheduler ticks.

Definition at line 58 of file lctr_int.h.

#define LCTR_CONN_IND_TO_MS (   x)    ((x) * 10)

Convert connect indication timeout ticks to milliseconds.

Definition at line 67 of file lctr_int.h.

#define LCTR_CONN_IND_US (   x)    ((x) * 1250)

Convert connect indication ticks to microseconds.

Definition at line 64 of file lctr_int.h.

#define LCTR_DATA_CHAN_DLY   1 /* 1.25 ms */

Minimum delay between connect indication and data channel in CONNECT_IND units.

Definition at line 49 of file lctr_int.h.

#define LCTR_DATA_CHAN_DLY_AUX_CODED   3 /* 3.75 ms */

Minimum delay between auxiliary connect request and data channel using coded PHY in CONNECT_REQ units.

Definition at line 55 of file lctr_int.h.

#define LCTR_DATA_CHAN_DLY_AUX_UNCODED   2 /* 2.5 ms */

Minimum delay between auxiliary connect request and data channel using uncoded PHY in CONNECT_REQ units.

Definition at line 52 of file lctr_int.h.

#define LCTR_FAST_TERM_CNT   6

Fast termination supervision multiplier.

Definition at line 88 of file lctr_int.h.

#define LCTR_ISO_INT_TO_US (   x)    ((x) * 1250)

Convert isochronous interval to microseconds.

Definition at line 85 of file lctr_int.h.

#define LCTR_MAX_SCA   7

LCTR Maximum value for sleep clock accuracy.

Definition at line 115 of file lctr_int.h.

#define LCTR_PER_INTER_TO_MS (   x)    LL_MATH_DIV_1250(x)

Convert periodic interval microseconds to milliseconds.

Definition at line 79 of file lctr_int.h.

#define LCTR_PER_INTER_TO_US (   x)    ((x) * 1250)

Convert periodic interval milliseconds to microseconds.

Definition at line 76 of file lctr_int.h.

#define LCTR_PER_SYNC_TIMEOUT_TO_MS (   x)    ((x) * 10)

Convert periodic sync timeout unit to milliseconds.

Definition at line 82 of file lctr_int.h.

#define LCTR_SCH_MAX_SPAN   ((BbGetBbTimerBoundaryUs() >> 1) + 1)

LCTR Maximum span of scheduler elements.

Definition at line 112 of file lctr_int.h.

#define LCTR_SUP_TIMEOUT_VAL_TO_US (   x)    (x * 10000)

Change supervision timeout value to us.

Definition at line 118 of file lctr_int.h.

#define LCTR_US_TO_CONN_IND (   x)    LL_MATH_DIV_1250(x)

Convert microseconds to connection indication ticks.

Definition at line 70 of file lctr_int.h.

Typedef Documentation

typedef uint8_t(* lctrChClassHdlr_t) (uint64_t chanMap)

Channel class update handler call signature.

Definition at line 137 of file lctr_int.h.

typedef void(* LctrEvtHdlr_t) (void)

Call signature of a message dispatch handler.

Definition at line 131 of file lctr_int.h.

typedef void(* LctrMsgDisp_t) (lctrMsgHdr_t *pMsg)

Call signature of a message dispatch handler.

Definition at line 128 of file lctr_int.h.

typedef void(* LctrResetHdlr_t) (void)

Call signature of a reset handler.

Definition at line 125 of file lctr_int.h.

typedef void(* LctrRmCback_t) (uint32_t rsvnOffs[], uint32_t refTime)

Reservation manager callback signature.

Definition at line 134 of file lctr_int.h.

Function Documentation

static uint16_t lctrCalcDID ( const uint8_t *  pBuf,
uint16_t  len 
)
static

Calculate DID.

Parameters
pBufData buffer.
lenLength of data buffer.
Returns
DID value.

Definition at line 188 of file lctr_int.h.

static PalBbPhy_t lctrPhysBitToPhy ( uint8_t  physBit)
static

Convert PHYS bit to PHY.

Parameters
physBitPHYS bit.
Returns
PHY.

Definition at line 202 of file lctr_int.h.

static uint8_t lctrPhyToPhysBit ( uint8_t  phy)
static

Convert PHY to PHYS bit.

Parameters
phyPHY.
Returns
PHYS bit.

Definition at line 225 of file lctr_int.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.