Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
ca821x_api.h File Reference

The main ca821x-api include file. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "ca821x_config.h"
#include "ca821x_endian.h"
#include "ca821x_error.h"
#include "ca821x_log.h"
#include "evbme_messages.h"
#include "mac_messages.h"
Include dependency graph for ca821x_api.h:

Go to the source code of this file.

Classes

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

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. More...
 
ca_mac_status MCPS_PURGE_request_sync (uint8_t *MsduHandle, struct ca821x_dev *pDeviceRef)
 MCPS_PURGE_request/confirm according to API Spec. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
ca_mac_status MLME_RESET_request_sync (uint8_t SetDefaultPIB, struct ca821x_dev *pDeviceRef)
 MLME_RESET_request/confirm according to API Spec. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
ca_mac_status TDME_TESTMODE_request_sync (uint8_t TestMode, struct ca821x_dev *pDeviceRef)
 TDME_TESTMODE_request/confirm according to API Spec. More...
 
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. More...
 
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. More...
 
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. More...
 
ca_mac_status TDME_ChipInit (struct ca821x_dev *pDeviceRef)
 TDME Chip Register Default Initialisation Macro. More...
 
ca_mac_status TDME_ChannelInit (uint8_t channel, struct ca821x_dev *pDeviceRef)
 TDME Channel Register Default Initialisation Macro (Tx) More...
 
ca_mac_status TDME_CheckPIBAttribute (uint8_t PIBAttribute, uint8_t PIBAttributeLength, const void *pPIBAttributeValue)
 Checks Attribute Values that are not checked in MAC. More...
 
ca_mac_status TDME_SetTxPower (uint8_t txp, struct ca821x_dev *pDeviceRef)
 Sets the tx power for MLME_SET phyTransmitPower. More...
 
ca_mac_status TDME_GetTxPower (uint8_t *txp, struct ca821x_dev *pDeviceRef)
 Returns the tx power for MLME_GET phyTransmitPower. More...
 
uint8_t TDME_tx_dbm_to_paib (int8_t txpdbm)
 Function to convert transmit power in dBm to PA current setting. More...
 
int8_t TDME_tx_paib_to_dbm (uint8_t paib)
 Function to convert PA current setting to transmit power in dBm. More...
 
ca_error ca821x_api_init (struct ca821x_dev *pDeviceRef)
 Initialisation function for initialising a ca821x_dev data structure for use with the API. More...
 
union ca821x_api_callbackca821x_get_callback (uint8_t cmdid, struct ca821x_dev *pDeviceRef)
 Function to get a reference to the callback for a certain command ID. More...
 
uint8_t ca821x_get_sync_response_id (uint8_t cmdid)
 Function to get the command ID for the synchronous response to a sync command. More...
 
const char * ca821x_get_version (void)
 Function to get the version string. More...
 
const char * ca821x_get_version_nodate (void)
 Function to get the version string without the compile date. More...
 
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. More...
 
ca_error ca821x_api_downstream (const uint8_t *buf, uint8_t *response, struct ca821x_dev *pDeviceRef)
 Function for downstream api interface. More...
 

Detailed Description

The main ca821x-api include file.

The functions in this file provide a high-level abstraction for controlling the ca821x.