Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
CA-821x Core API

A high-level abstraction for interacting with the CA-821x. More...

Collaboration diagram for CA-821x Core API:

Classes

struct  ca821x_api_callbacks
 API user callbacks structure. More...
struct  ca821x_dev
 CA-821x Device reference struct. More...

Macros

#define PIB_NEW_MAC_MAXFRAMERETRIES   7
#define PIB_NEW_MAC_MAXCSMABACKOFFS   5
#define PIB_NEW_MAC_MINBE   7
#define PIB_NEW_MAC_MAXBE   8
#define PIB_NEW_PHY_CCAMODE   0 /* CCAM_EDORCS */
#define PIB_NEW_HWME_LQILIMIT   0
#define PIB_NEW_HWME_LQIMODE   1 /* HWME_LQIMODE_ED */
#define PIB_NEW_HWME_EDTHRESHOLD   106
#define PIB_NEW_HWME_CSTHRESHOLD   128
#define PIB_DEF_MAC_MAXFRAMERETRIES   3
#define PIB_DEF_MAC_MAXCSMABACKOFFS   4
#define PIB_DEF_MAC_MINBE   3
#define PIB_DEF_MAC_MAXBE   5
#define PIB_DEF_PHY_CCAMODE   3 /* CCAM_EDANDCS */
#define PIB_DEF_HWME_LQILIMIT   75
#define PIB_DEF_HWME_LQIMODE   0 /* HWME_LQIMODE_CS */
#define PIB_DEF_HWME_EDTHRESHOLD   60
#define PIB_DEF_HWME_CSTHRESHOLD   80

Functions

ca_mac_status MCPS_DATA_request (uint8_t SrcAddrMode, struct FullAddr DstAddr, uint8_t MsduLength, uint8_t *pMsdu, uint8_t MsduHandle, uint8_t TxOptions, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MCPS_DATA_request (Send Data) according to CA8211 API Spec.
ca_mac_status MCPS_PURGE_request_sync (uint8_t *MsduHandle, struct ca821x_dev *pDeviceRef)
 MCPS_PURGE_request/confirm according to API Spec.
ca_mac_status PCPS_DATA_request (uint8_t PsduHandle, uint8_t TxOpts, uint8_t PsduLength, uint8_t *pPsdu, struct ca821x_dev *pDeviceRef)
 PCPS_DATA_request (Send Data) according to API Spec.
ca_mac_status MLME_ASSOCIATE_request (uint8_t LogicalChannel, struct FullAddr DstAddr, uint8_t CapabilityInfo, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_ASSOCIATE_request according to API Spec.
ca_mac_status MLME_ASSOCIATE_response (uint8_t *pDeviceAddress, uint16_t AssocShortAddress, uint8_t Status, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_ASSOCIATE_response according to API Spec.
ca_mac_status MLME_DISASSOCIATE_request (struct FullAddr DevAddr, uint8_t DisassociateReason, uint8_t TxIndirect, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_DISASSOCIATE_request according to API Spec.
ca_mac_status MLME_GET_request_sync (uint8_t PIBAttribute, uint8_t PIBAttributeIndex, uint8_t *pPIBAttributeLength, void *pPIBAttributeValue, struct ca821x_dev *pDeviceRef)
 MLME_GET_request/confirm according to API Spec.
ca_mac_status MLME_ORPHAN_response (uint8_t *pOrphanAddress, uint16_t ShortAddress, uint8_t AssociatedMember, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_ORPHAN_response according to API Spec.
ca_mac_status MLME_RESET_request_sync (uint8_t SetDefaultPIB, struct ca821x_dev *pDeviceRef)
 MLME_RESET_request/confirm according to API Spec.
ca_mac_status MLME_RX_ENABLE_request_sync (uint8_t DeferPermit, uint32_t RxOnTime, uint32_t RxOnDuration, struct ca821x_dev *pDeviceRef)
 MLME_RX_ENABLE_request/confirm according to API Spec.
ca_mac_status MLME_SCAN_request (uint8_t ScanType, uint32_t ScanChannels, uint8_t ScanDuration, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_SCAN_request according to API Spec.
ca_mac_status MLME_SET_request_sync (uint8_t PIBAttribute, uint8_t PIBAttributeIndex, uint8_t PIBAttributeLength, const void *pPIBAttributeValue, struct ca821x_dev *pDeviceRef)
 MLME_SET_request/confirm according to API Spec.
ca_mac_status MLME_START_request_sync (uint16_t PANId, uint8_t LogicalChannel, uint8_t BeaconOrder, uint8_t SuperframeOrder, uint8_t PANCoordinator, uint8_t BatteryLifeExtension, uint8_t CoordRealignment, struct SecSpec *pCoordRealignSecurity, struct SecSpec *pBeaconSecurity, struct ca821x_dev *pDeviceRef)
 MLME_START_request/confirm according to API Spec.
ca_mac_status MLME_POLL_request_sync (struct FullAddr CoordAddress, uint8_t Interval[2], struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
 MLME_POLL_request/confirm according to CA8210 API Spec.
ca_mac_status HWME_SET_request_sync (uint8_t HWAttribute, uint8_t HWAttributeLength, uint8_t *pHWAttributeValue, struct ca821x_dev *pDeviceRef)
 HWME_SET_request/confirm according to API Spec.
ca_mac_status HWME_GET_request_sync (uint8_t HWAttribute, uint8_t *HWAttributeLength, uint8_t *pHWAttributeValue, struct ca821x_dev *pDeviceRef)
 HWME_GET_request/confirm according to API Spec.
ca_mac_status HWME_HAES_request_sync (uint8_t HAESMode, uint8_t *pHAESData, struct ca821x_dev *pDeviceRef)
 HWME_HAES_request/confirm according to API Spec.
ca_mac_status TDME_SETSFR_request_sync (uint8_t SFRPage, uint8_t SFRAddress, uint8_t SFRValue, struct ca821x_dev *pDeviceRef)
 TDME_SETSFR_request/confirm according to API Spec.
ca_mac_status TDME_GETSFR_request_sync (uint8_t SFRPage, uint8_t SFRAddress, uint8_t *SFRValue, struct ca821x_dev *pDeviceRef)
 TDME_GETSFR_request/confirm according to API Spec.
ca_mac_status TDME_TESTMODE_request_sync (uint8_t TestMode, struct ca821x_dev *pDeviceRef)
 TDME_TESTMODE_request/confirm according to API Spec.
ca_mac_status TDME_SET_request_sync (uint8_t TestAttribute, uint8_t TestAttributeLength, void *pTestAttributeValue, struct ca821x_dev *pDeviceRef)
 TDME_SET_request/confirm according to API Spec.
ca_mac_status TDME_TXPKT_request_sync (uint8_t TestPacketDataType, uint8_t *TestPacketSequenceNumber, uint8_t *TestPacketLength, void *pTestPacketData, struct ca821x_dev *pDeviceRef)
 TDME_TXPKT_request/confirm according to API Spec.
ca_mac_status TDME_LOTLK_request_sync (uint8_t *TestChannel, uint8_t *TestRxTxb, uint8_t *TestLOFDACValue, uint8_t *TestLOAMPValue, uint8_t *TestLOTXCALValue, struct ca821x_dev *pDeviceRef)
 TDME_LOTLK_request/confirm according to API Spec.
ca_mac_status TDME_ChipInit (struct ca821x_dev *pDeviceRef)
 TDME Chip Register Default Initialisation Macro.
ca_mac_status TDME_ChannelInit (uint8_t channel, struct ca821x_dev *pDeviceRef)
 TDME Channel Register Default Initialisation Macro (Tx).
ca_mac_status TDME_CheckPIBAttribute (uint8_t PIBAttribute, uint8_t PIBAttributeLength, const void *pPIBAttributeValue)
 Checks Attribute Values that are not checked in MAC.
ca_mac_status TDME_ReconfigurePIB (uint8_t SetDefaultPIB, struct ca821x_dev *pDeviceRef)
 Reconfigures PIB (MLME and HWME) from MAC defaults.
ca_mac_status TDME_SetTxPower (uint8_t txp, struct ca821x_dev *pDeviceRef)
 Sets the tx power for MLME_SET phyTransmitPower.
ca_mac_status TDME_GetTxPower (uint8_t *txp, struct ca821x_dev *pDeviceRef)
 Returns the tx power for MLME_GET phyTransmitPower.
uint8_t TDME_tx_dbm_to_paib (int8_t txpdbm)
 Function to convert transmit power in dBm to PA current setting.
int8_t TDME_tx_paib_to_dbm (uint8_t paib)
 Function to convert PA current setting to transmit power in dBm.
ca_error ca821x_api_init (struct ca821x_dev *pDeviceRef)
 Initialisation function for initialising a ca821x_dev data structure for use with the API.
union ca821x_api_callback * ca821x_get_callback (uint8_t cmdid, struct ca821x_dev *pDeviceRef)
 Function to get a reference to the callback for a certain command ID.
uint8_t ca821x_get_sync_response_id (uint8_t cmdid)
 Function to get the command ID for the synchronous response to a sync command.
const char * ca821x_get_version (void)
 Function to get the version string.
const char * ca821x_get_version_nodate (void)
 Function to get the version string without the compile date.
ca_error ca821x_upstream_dispatch (struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
 Call the relevant callback routine if populated or the generic_dispatch for a received command.
ca_error ca821x_api_downstream (const uint8_t *buf, uint8_t *response, struct ca821x_dev *pDeviceRef)
 Function for downstream api interface.

Detailed Description

A high-level abstraction for interacting with the CA-821x.

Macro Definition Documentation

◆ PIB_DEF_HWME_CSTHRESHOLD

#define PIB_DEF_HWME_CSTHRESHOLD   80

◆ PIB_DEF_HWME_EDTHRESHOLD

#define PIB_DEF_HWME_EDTHRESHOLD   60

◆ PIB_DEF_HWME_LQILIMIT

#define PIB_DEF_HWME_LQILIMIT   75

◆ PIB_DEF_HWME_LQIMODE

#define PIB_DEF_HWME_LQIMODE   0 /* HWME_LQIMODE_CS */

◆ PIB_DEF_MAC_MAXBE

#define PIB_DEF_MAC_MAXBE   5

◆ PIB_DEF_MAC_MAXCSMABACKOFFS

#define PIB_DEF_MAC_MAXCSMABACKOFFS   4

◆ PIB_DEF_MAC_MAXFRAMERETRIES

#define PIB_DEF_MAC_MAXFRAMERETRIES   3

◆ PIB_DEF_MAC_MINBE

#define PIB_DEF_MAC_MINBE   3

◆ PIB_DEF_PHY_CCAMODE

#define PIB_DEF_PHY_CCAMODE   3 /* CCAM_EDANDCS */

◆ PIB_NEW_HWME_CSTHRESHOLD

#define PIB_NEW_HWME_CSTHRESHOLD   128

◆ PIB_NEW_HWME_EDTHRESHOLD

#define PIB_NEW_HWME_EDTHRESHOLD   106

◆ PIB_NEW_HWME_LQILIMIT

#define PIB_NEW_HWME_LQILIMIT   0

◆ PIB_NEW_HWME_LQIMODE

#define PIB_NEW_HWME_LQIMODE   1 /* HWME_LQIMODE_ED */

◆ PIB_NEW_MAC_MAXBE

#define PIB_NEW_MAC_MAXBE   8

◆ PIB_NEW_MAC_MAXCSMABACKOFFS

#define PIB_NEW_MAC_MAXCSMABACKOFFS   5

◆ PIB_NEW_MAC_MAXFRAMERETRIES

#define PIB_NEW_MAC_MAXFRAMERETRIES   7

◆ PIB_NEW_MAC_MINBE

#define PIB_NEW_MAC_MINBE   7

◆ PIB_NEW_PHY_CCAMODE

#define PIB_NEW_PHY_CCAMODE   0 /* CCAM_EDORCS */

Function Documentation

◆ ca821x_api_downstream()

ca_error ca821x_api_downstream ( const uint8_t * buf,
uint8_t * response,
struct ca821x_dev * pDeviceRef )

Function for downstream api interface.

Internal function.

This function is called by all api functions when it comes to transmitting constructed commands to the ca821x. The cascoda baremetal or posix libraries implement this for their respective platform.

Parameters
buf- The buffer containing the Cascoda TLV command to send downstream. The length is encoded within the buffer.
response- The buffer to populate with a received synchronous response
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
CA_ERROR_SUCCESS for success, anything else for failure

◆ ca821x_api_init()

ca_error ca821x_api_init ( struct ca821x_dev * pDeviceRef)

Initialisation function for initialising a ca821x_dev data structure for use with the API.

This function should be called to initialise a pDeviceRef. This should be done prior to any other use of the structure.

Parameters
pDeviceRef- Pointer to ca821x_device_ref struct to be initialised.
Returns
CA_ERROR_SUCCESS: Structure successfully initialised
CA_ERROR_INVALID_ARGS: Structure initialisation failed (pDeviceRef cannot be NULL)

◆ ca821x_get_callback()

union ca821x_api_callback * ca821x_get_callback ( uint8_t cmdid,
struct ca821x_dev * pDeviceRef )

Function to get a reference to the callback for a certain command ID.

This is mainly used internally, and is probably not useful for most user applications.

Parameters
cmdid- The command ID of the desired callback
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Return values
Areference to the relevant callback, or NULL if the cmdid is not recognised

◆ ca821x_get_sync_response_id()

uint8_t ca821x_get_sync_response_id ( uint8_t cmdid)

Function to get the command ID for the synchronous response to a sync command.

This is mainly used internally, and is probably not useful for most user applications.

Parameters
cmdid- The command ID of the synchronous request
Return values
Thecommand ID of the associated response, or 0 for failure

◆ ca821x_get_version()

const char * ca821x_get_version ( void )

Function to get the version string.

This includes the git version, and build date of the sdk. Example: "v0.1-43-g0f4564d-dirty Feb 27 2019" representing 43 commits past version v0.1, with git hash 0f4564d, but dirty (with changes). Built on Feb 27th 2019.

Return values
Apointer to the version string

◆ ca821x_get_version_nodate()

const char * ca821x_get_version_nodate ( void )

Function to get the version string without the compile date.

This includes the git version only. Example: "v0.1-43-g0f4564d-dirty" representing 43 commits past version v0.1, with git hash 0f4564d, but dirty (with changes).

Return values
Apointer to the version string

◆ ca821x_upstream_dispatch()

ca_error ca821x_upstream_dispatch ( struct MAC_Message * msg,
struct ca821x_dev * pDeviceRef )

Call the relevant callback routine if populated or the generic_dispatch for a received command.

Internal function.

Parameters
*msg- Receive buffer
*pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
CA_ERROR_NOT_HANDLED: command was unhandled
CA_ERROR_SUCCESS: command was handled
CA_ERROR_*: any other error

◆ HWME_GET_request_sync()

ca_mac_status HWME_GET_request_sync ( uint8_t HWAttribute,
uint8_t * HWAttributeLength,
uint8_t * pHWAttributeValue,
struct ca821x_dev * pDeviceRef )

HWME_GET_request/confirm according to API Spec.

Parameters
HWAttribute- Attribute Number
HWAttributeLength- Attribute Length
pHWAttributeValue- Pointer to Attribute Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ HWME_HAES_request_sync()

ca_mac_status HWME_HAES_request_sync ( uint8_t HAESMode,
uint8_t * pHAESData,
struct ca821x_dev * pDeviceRef )

HWME_HAES_request/confirm according to API Spec.

Parameters
HAESMode- AES Mode (Encrypt/Decrypt)
pHAESData- Pointer to AES Input/Output Data
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ HWME_SET_request_sync()

ca_mac_status HWME_SET_request_sync ( uint8_t HWAttribute,
uint8_t HWAttributeLength,
uint8_t * pHWAttributeValue,
struct ca821x_dev * pDeviceRef )

HWME_SET_request/confirm according to API Spec.

Parameters
HWAttribute- Attribute Number
HWAttributeLength- Attribute Length
pHWAttributeValue- Pointer to Attribute Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ MCPS_DATA_request()

ca_mac_status MCPS_DATA_request ( uint8_t SrcAddrMode,
struct FullAddr DstAddr,
uint8_t MsduLength,
uint8_t * pMsdu,
uint8_t MsduHandle,
uint8_t TxOptions,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MCPS_DATA_request (Send Data) according to CA8211 API Spec.

Parameters
SrcAddrMode- Source Addressing Mode
DstAddr- Destination Address and PanId
MsduLength- Length of Data
pMsdu- Pointer to Data
MsduHandle- Handle of Data
TxOptions- Tx Options Bit Field
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MCPS_PURGE_request_sync()

ca_mac_status MCPS_PURGE_request_sync ( uint8_t * MsduHandle,
struct ca821x_dev * pDeviceRef )

MCPS_PURGE_request/confirm according to API Spec.

Parameters
MsduHandle- Handle of Data
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
: 802.15.4 status of confirm

◆ MLME_ASSOCIATE_request()

ca_mac_status MLME_ASSOCIATE_request ( uint8_t LogicalChannel,
struct FullAddr DstAddr,
uint8_t CapabilityInfo,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_ASSOCIATE_request according to API Spec.

Parameters
LogicalChannel- Channel Number
DstAddr- Destination Address
CapabilityInfo- Bitmap of operational Capabilities
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_ASSOCIATE_response()

ca_mac_status MLME_ASSOCIATE_response ( uint8_t * pDeviceAddress,
uint16_t AssocShortAddress,
uint8_t Status,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_ASSOCIATE_response according to API Spec.

Parameters
pDeviceAddress- Pointer to IEEE Address
AssocShortAddress- Short Address given to Device
Status- Status
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_DISASSOCIATE_request()

ca_mac_status MLME_DISASSOCIATE_request ( struct FullAddr DevAddr,
uint8_t DisassociateReason,
uint8_t TxIndirect,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_DISASSOCIATE_request according to API Spec.

Parameters
DevAddr- Device Address
DisassociateReason- Reason for Disassociation
TxIndirect- TxIndirect Flag
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_GET_request_sync()

ca_mac_status MLME_GET_request_sync ( uint8_t PIBAttribute,
uint8_t PIBAttributeIndex,
uint8_t * pPIBAttributeLength,
void * pPIBAttributeValue,
struct ca821x_dev * pDeviceRef )

MLME_GET_request/confirm according to API Spec.

Parameters
PIBAttribute- Attribute Number
PIBAttributeIndex- Index within Attribute if an Array
pPIBAttributeLength- Pointer to Attribute Length
pPIBAttributeValue- Pointer to Attribute Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ MLME_ORPHAN_response()

ca_mac_status MLME_ORPHAN_response ( uint8_t * pOrphanAddress,
uint16_t ShortAddress,
uint8_t AssociatedMember,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_ORPHAN_response according to API Spec.

Parameters
pOrphanAddress- Pointer to Orphan IEEE Address
ShortAddress- Short Address for Orphan
AssociatedMember- TRUE if associated
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_POLL_request_sync()

ca_mac_status MLME_POLL_request_sync ( struct FullAddr CoordAddress,
uint8_t Interval[2],
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_POLL_request/confirm according to CA8210 API Spec.

Parameters
CoordAddress- Coordinator Address
Interval- Polling Interval in 0.1 Seconds Resolution. 0 = poll once, 0xFFFF = stop polling.
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ MLME_RESET_request_sync()

ca_mac_status MLME_RESET_request_sync ( uint8_t SetDefaultPIB,
struct ca821x_dev * pDeviceRef )

MLME_RESET_request/confirm according to API Spec.

Parameters
SetDefaultPIB- Set defaults in PIB
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_RX_ENABLE_request_sync()

ca_mac_status MLME_RX_ENABLE_request_sync ( uint8_t DeferPermit,
uint32_t RxOnTime,
uint32_t RxOnDuration,
struct ca821x_dev * pDeviceRef )

MLME_RX_ENABLE_request/confirm according to API Spec.

Parameters
DeferPermit- Defer Permit Flag
RxOnTime- Receiver On Time
RxOnDuration- Receiver On Duration
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ MLME_SCAN_request()

ca_mac_status MLME_SCAN_request ( uint8_t ScanType,
uint32_t ScanChannels,
uint8_t ScanDuration,
struct SecSpec * pSecurity,
struct ca821x_dev * pDeviceRef )

MLME_SCAN_request according to API Spec.

Parameters
ScanType- Scan Type (see mlme_scan_type)
ScanChannels- Channel Bit mask (32 Bit)
ScanDuration- Time to scan for (See ca821x_scan_durations enum)
pSecurity- Pointer to Security Structure or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
: 802.15.4 status

◆ MLME_SET_request_sync()

ca_mac_status MLME_SET_request_sync ( uint8_t PIBAttribute,
uint8_t PIBAttributeIndex,
uint8_t PIBAttributeLength,
const void * pPIBAttributeValue,
struct ca821x_dev * pDeviceRef )

MLME_SET_request/confirm according to API Spec.

Parameters
PIBAttribute- Attribute Number
PIBAttributeIndex- Index within Attribute if an Array
PIBAttributeLength- Attribute Length
pPIBAttributeValue- Pointer to Attribute Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ MLME_START_request_sync()

ca_mac_status MLME_START_request_sync ( uint16_t PANId,
uint8_t LogicalChannel,
uint8_t BeaconOrder,
uint8_t SuperframeOrder,
uint8_t PANCoordinator,
uint8_t BatteryLifeExtension,
uint8_t CoordRealignment,
struct SecSpec * pCoordRealignSecurity,
struct SecSpec * pBeaconSecurity,
struct ca821x_dev * pDeviceRef )

MLME_START_request/confirm according to API Spec.

Parameters
PANId- PAN Identifier
LogicalChannel- Channel Number
BeaconOrder- Beacon Order
SuperframeOrder- Superframe Order
PANCoordinator- 1 if Coordinator
BatteryLifeExtension- 1 if battery save mode
CoordRealignment- 1 if a Coordinator Realignment
pCoordRealignSecurity- Pointer to Security Structure or NULLP for coordinator realignment frames
pBeaconSecurity- Pointer to Security Structure or NULLP for beacon frames
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ PCPS_DATA_request()

ca_mac_status PCPS_DATA_request ( uint8_t PsduHandle,
uint8_t TxOpts,
uint8_t PsduLength,
uint8_t * pPsdu,
struct ca821x_dev * pDeviceRef )

PCPS_DATA_request (Send Data) according to API Spec.

Parameters
PsduHandle- User-assigned handle to identify data request
TxOpts- TxOpts (such as for sending indirectly)
PsduLength- Length of Data
pPsdu- Pointer to Data
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status

◆ TDME_ChannelInit()

ca_mac_status TDME_ChannelInit ( uint8_t channel,
struct ca821x_dev * pDeviceRef )

TDME Channel Register Default Initialisation Macro (Tx).

Parameters
channel- 802.15.4 channel to initialise chip for
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
: 802.15.4 status of constituent commands

◆ TDME_CheckPIBAttribute()

ca_mac_status TDME_CheckPIBAttribute ( uint8_t PIBAttribute,
uint8_t PIBAttributeLength,
const void * pPIBAttributeValue )

Checks Attribute Values that are not checked in MAC.

Parameters
PIBAttribute- Attribute Number
PIBAttributeLength- Attribute Length
pPIBAttributeValue- Pointer to Attribute Value
Returns
802.15.4 status

◆ TDME_ChipInit()

ca_mac_status TDME_ChipInit ( struct ca821x_dev * pDeviceRef)

TDME Chip Register Default Initialisation Macro.

Parameters
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of constituent commands

◆ TDME_GETSFR_request_sync()

ca_mac_status TDME_GETSFR_request_sync ( uint8_t SFRPage,
uint8_t SFRAddress,
uint8_t * SFRValue,
struct ca821x_dev * pDeviceRef )

TDME_GETSFR_request/confirm according to API Spec.

Parameters
SFRPage- SFR Page
SFRAddress- SFR Address
SFRValue- SFR Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_GetTxPower()

ca_mac_status TDME_GetTxPower ( uint8_t * txp,
struct ca821x_dev * pDeviceRef )

Returns the tx power for MLME_GET phyTransmitPower.

Normalised to 802.15.4 Definition (6-bit, signed): Bit 7-6: not used Bit 5-0: tx power (-32 - +31 dB)

Parameters
*txp- Transmit Power
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_LOTLK_request_sync()

ca_mac_status TDME_LOTLK_request_sync ( uint8_t * TestChannel,
uint8_t * TestRxTxb,
uint8_t * TestLOFDACValue,
uint8_t * TestLOAMPValue,
uint8_t * TestLOTXCALValue,
struct ca821x_dev * pDeviceRef )

TDME_LOTLK_request/confirm according to API Spec.

Parameters
TestChannel- Pointer to Channel
TestRxTxb- Pointer to LO Mode (Rx when 1, Tx when 0)
TestLOFDACValue- Pointer LOFDAC Value
TestLOAMPValue- Pointer LOAMP Value
TestLOTXCALValue- Pointer LOTXCAL Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_ReconfigurePIB()

ca_mac_status TDME_ReconfigurePIB ( uint8_t SetDefaultPIB,
struct ca821x_dev * pDeviceRef )

Reconfigures PIB (MLME and HWME) from MAC defaults.

Returns
802.15.4 status

◆ TDME_SET_request_sync()

ca_mac_status TDME_SET_request_sync ( uint8_t TestAttribute,
uint8_t TestAttributeLength,
void * pTestAttributeValue,
struct ca821x_dev * pDeviceRef )

TDME_SET_request/confirm according to API Spec.

Parameters
TestAttribute- Test Attribute Number
TestAttributeLength- Test Attribute Length
pTestAttributeValue- Pointer to Test Attribute Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_SETSFR_request_sync()

ca_mac_status TDME_SETSFR_request_sync ( uint8_t SFRPage,
uint8_t SFRAddress,
uint8_t SFRValue,
struct ca821x_dev * pDeviceRef )

TDME_SETSFR_request/confirm according to API Spec.

Parameters
SFRPage- SFR Page
SFRAddress- SFR Address
SFRValue- SFR Value
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_SetTxPower()

ca_mac_status TDME_SetTxPower ( uint8_t txp,
struct ca821x_dev * pDeviceRef )

Sets the tx power for MLME_SET phyTransmitPower.

Normalised to 802.15.4 Definition (6-bit, signed):
Bit 7-6: not used
Bit 5-0: tx power (-32 - +31 dB)

Parameters
txp- Transmit Power
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_TESTMODE_request_sync()

ca_mac_status TDME_TESTMODE_request_sync ( uint8_t TestMode,
struct ca821x_dev * pDeviceRef )

TDME_TESTMODE_request/confirm according to API Spec.

Parameters
TestMode- Test Mode to be set
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm

◆ TDME_tx_dbm_to_paib()

uint8_t TDME_tx_dbm_to_paib ( int8_t txpdbm)

Function to convert transmit power in dBm to PA current setting.

Parameters
txdbm- Transmit power in dBm
Return values
PAcurrent register setting (0-63)

◆ TDME_tx_paib_to_dbm()

int8_t TDME_tx_paib_to_dbm ( uint8_t paib)

Function to convert PA current setting to transmit power in dBm.

Parameters
paib- PA current register setting (0-63)
Return values
Transmitpower in dBm

◆ TDME_TXPKT_request_sync()

ca_mac_status TDME_TXPKT_request_sync ( uint8_t TestPacketDataType,
uint8_t * TestPacketSequenceNumber,
uint8_t * TestPacketLength,
void * pTestPacketData,
struct ca821x_dev * pDeviceRef )

TDME_TXPKT_request/confirm according to API Spec.

Parameters
TestPacketDataType- Test Packet Data Type
TestPacketSequenceNumber- Pointer to Sequence Number
TestPacketLength- Pointer to Test Packet Length
pTestPacketData- Pointer to Test Packet Data or NULLP
pDeviceRef- Pointer to initialised ca821x_device_ref struct
Returns
802.15.4 status of confirm