no-OS
Functions
mykonos_gpio.c File Reference

Contains Mykonos APIs for transceiver GPIO configuration and control. More...

#include <stdint.h>
#include <stddef.h>
#include "common.h"
#include "mykonos.h"
#include "mykonos_gpio.h"
#include "mykonos_macros.h"
#include "mykonos_user.h"
Include dependency graph for mykonos_gpio.c:

Functions

const char * getGpioMykonosErrorMessage (mykonosGpioErr_t errorCode)
 Helper function for return of character string based on 32-bit mykonosGpioErr_t enum value. More...
 
mykonosGpioErr_t MYKONOS_setGpioMonitorOut (mykonosDevice_t *device, uint8_t monitorIndex, uint8_t monitorMask)
 This API function configures the monitor output function for the GPIOs. More...
 
mykonosGpioErr_t MYKONOS_getGpioMonitorOut (mykonosDevice_t *device, uint8_t *monitorIndex, uint8_t *monitorMask)
 This API function reads the GPIO monitor index from Mykonos. More...
 
mykonosGpioErr_t MYKONOS_setRx1GainCtrlPin (mykonosDevice_t *device, uint8_t incStep, uint8_t decStep, mykonosGpioSelect_t rx1GainIncPin, mykonosGpioSelect_t rx1GainDecPin, uint8_t enable)
 This API function configures the GPIO inputs for controlling RX gain. More...
 
mykonosGpioErr_t MYKONOS_getRx1GainCtrlPin (mykonosDevice_t *device, uint8_t *incStep, uint8_t *decStep, mykonosGpioSelect_t *rx1GainIncPin, mykonosGpioSelect_t *rx1GainDecPin, uint8_t *enable)
 This API function returns the configuration RX1 gain Pin control. More...
 
mykonosGpioErr_t MYKONOS_setRx2GainCtrlPin (mykonosDevice_t *device, uint8_t incStep, uint8_t decStep, mykonosGpioSelect_t rx2GainIncPin, mykonosGpioSelect_t rx2GainDecPin, uint8_t enable)
 This API function configures the GPIO inputs for controlling RX gain. More...
 
mykonosGpioErr_t MYKONOS_getRx2GainCtrlPin (mykonosDevice_t *device, uint8_t *incStep, uint8_t *decStep, mykonosGpioSelect_t *rx2GainIncPin, mykonosGpioSelect_t *rx2GainDecPin, uint8_t *enable)
 This API function returns the configuration RX2 gain Pin control. More...
 
mykonosGpioErr_t MYKONOS_setRxHybridGainChangePin (mykonosDevice_t *device, mykonosGpioSelect_t rx1GainChangePin, mykonosGpioSelect_t rx2GainChangePin)
 This API function set the pins for hybrid gain control. More...
 
mykonosGpioErr_t MYKONOS_getRxHybridGainChangePin (mykonosDevice_t *device, mykonosGpioSelect_t *rx1GainChangePin, mykonosGpioSelect_t *rx2GainChangePin)
 This API function gets the pin configuration for hybrid gain control of RX1 and RX2. More...
 
mykonosGpioErr_t MYKONOS_setObsRxHybridGainChangePin (mykonosDevice_t *device, mykonosGpioSelect_t obsRxGainChangePin)
 This API function set the pins for hybrid gain control. More...
 
mykonosGpioErr_t MYKONOS_getObsRxHybridGainChangePin (mykonosDevice_t *device, mykonosGpioSelect_t *obsRxGainChangePin)
 This API function gets the pin configuration for hybrid gain control of observation channel. More...
 
mykonosGpioErr_t MYKONOS_setRxAgcEnSyncPin (mykonosDevice_t *device, mykonosGpioSelect_t rx1AgcSyncPin, mykonosGpioSelect_t rx2AgcSyncPin)
 This API function set the pins for sync AGC gain control. More...
 
mykonosGpioErr_t MYKONOS_getRxAgcEnSyncPin (mykonosDevice_t *device, mykonosGpioSelect_t *rx1AgcSyncPin, mykonosGpioSelect_t *rx2AgcSyncPin)
 This API function gets the GPIO pin configuration for AGC gain sync control of RX1 and RX2. More...
 
mykonosGpioErr_t MYKONOS_setObsRxAgcEnSyncPin (mykonosDevice_t *device, mykonosGpioSelect_t obsRxAgcSyncPin)
 This API function set the pins for AGC gain Sync control. More...
 
mykonosGpioErr_t MYKONOS_getObsRxAgcEnSyncPin (mykonosDevice_t *device, mykonosGpioSelect_t *obsRxAgcSyncPin)
 This API function gets the pin configuration for AGC Sync gain control of observation channel. More...
 
mykonosGpioErr_t MYKONOS_setTx1AttenCtrlPin (mykonosDevice_t *device, uint8_t stepSize, mykonosGpioSelect_t tx1AttenIncPin, mykonosGpioSelect_t tx1AttenDecPin, uint8_t enable, uint8_t useTx1ForTx2)
 This API function configures the GPIO inputs for controlling Tx attenuation settings. More...
 
mykonosGpioErr_t MYKONOS_getTx1AttenCtrlPin (mykonosDevice_t *device, uint8_t *stepSize, mykonosGpioSelect_t *tx1AttenIncPin, mykonosGpioSelect_t *tx1AttenDecPin, uint8_t *enable, uint8_t *useTx1ForTx2)
 This API function returns the configuration TX1 attenuation Pin control. More...
 
mykonosGpioErr_t MYKONOS_setTx2AttenCtrlPin (mykonosDevice_t *device, uint8_t stepSize, mykonosGpioSelect_t tx2AttenIncPin, mykonosGpioSelect_t tx2AttenDecPin, uint8_t enable)
 This API function configures the GPIO inputs for controlling Tx attenuation settings. More...
 
mykonosGpioErr_t MYKONOS_getTx2AttenCtrlPin (mykonosDevice_t *device, uint8_t *stepSize, mykonosGpioSelect_t *tx2AttenIncPin, mykonosGpioSelect_t *tx2AttenDecPin, uint8_t *enable, uint8_t *useTx1ForTx2)
 This API function returns the configuration TX2 attenuation Pin control. More...
 
mykonosGpioErr_t MYKONOS_setGpioPinLevel (mykonosDevice_t *device, uint32_t gpioPinLevel)
 Sets the Mykonos low voltage GPIO output pins level. More...
 
mykonosGpioErr_t MYKONOS_getGpioPinLevel (mykonosDevice_t *device, uint32_t *gpioPinLevel)
 Reads the Mykonos low voltage GPIO pin levels and returns their contents in a single 32-bit word. More...
 
mykonosGpioErr_t MYKONOS_getGpioSetLevel (mykonosDevice_t *device, uint32_t *gpioPinSetLevel)
 Reads the Mykonos GPIO pin output levels for BITBANG mode. More...
 
mykonosGpioErr_t MYKONOS_configGpInterrupt (mykonosDevice_t *device, uint16_t gpMask)
 Sets the General Purpose (GP) interrupt register bit mask to enable interrupt sources to assert the GP Interrupt pin. More...
 
mykonosGpioErr_t MYKONOS_readGpInterruptStatus (mykonosDevice_t *device, uint16_t *status)
 Reads the General Purpose (GP) interrupt status to determine what caused the GP Interrupt pin to assert. More...
 
mykonosGpioErr_t MYKONOS_setArmGpioPins (mykonosDevice_t *device)
 Sets the input and output GPIO pin selections for ARM related signals. More...
 
mykonosGpioErr_t MYKONOS_setupAuxAdcs (mykonosDevice_t *device, uint8_t adcDecimation, uint8_t enable)
 Sets up the auxiliary ADC. More...
 
mykonosGpioErr_t MYKONOS_setAuxAdcChannel (mykonosDevice_t *device, mykonosAuxAdcChannels_t auxAdcChannel)
 Sets the selected channel of the auxiliary ADC. More...
 
mykonosGpioErr_t MYKONOS_readAuxAdc (mykonosDevice_t *device, uint16_t *adcCode)
 Reads from the selected channel of the auxiliary ADC. More...
 
mykonosGpioErr_t MYKONOS_setupAuxDacs (mykonosDevice_t *device)
 Sets up the 10 AuxDACs on the Mykonos device. More...
 
mykonosGpioErr_t MYKONOS_writeAuxDac (mykonosDevice_t *device, uint8_t auxDacIndex, uint16_t auxDacCode)
 Writes the current AuxDAC code for a particular AuxDAC. More...
 
mykonosGpioErr_t MYKONOS_setupGpio (mykonosDevice_t *device)
 Sets the Mykonos low voltage GPIO configuration registers. More...
 
mykonosGpioErr_t MYKONOS_setGpioOe (mykonosDevice_t *device, uint32_t gpioOutEn, uint32_t gpioUsedMask)
 Sets the Mykonos low voltage GPIO output pins direction. More...
 
mykonosGpioErr_t MYKONOS_getGpioOe (mykonosDevice_t *device, uint32_t *gpioOutEn)
 Gets the Mykonos low voltage GPIO output pins direction. More...
 
mykonosGpioErr_t MYKONOS_setGpioSourceCtrl (mykonosDevice_t *device, uint32_t gpioSrcCtrl)
 Sets the Mykonos GPIO source control for different GPIO functionality. More...
 
mykonosGpioErr_t MYKONOS_getGpioSourceCtrl (mykonosDevice_t *device, uint32_t *gpioSrcCtrl)
 Reads the Mykonos GPIO source control for different GPIO functionality. More...
 
mykonosGpioErr_t MYKONOS_setupGpio3v3 (mykonosDevice_t *device)
 Sets the Mykonos 3.3 VDC GPIO configuration registers. More...
 
mykonosGpioErr_t MYKONOS_setGpio3v3PinLevel (mykonosDevice_t *device, uint16_t gpio3v3PinLevel)
 If the GPIO3v3 pins are setup for BITBANG mode, this function sets the output pin levels per pin. More...
 
mykonosGpioErr_t MYKONOS_getGpio3v3SetLevel (mykonosDevice_t *device, uint16_t *gpio3v3SetLevel)
 Reads the Mykonos 3.3 VDC GPIO pin output levels for BITBANG mode. More...
 
mykonosGpioErr_t MYKONOS_getGpio3v3PinLevel (mykonosDevice_t *device, uint16_t *gpio3v3PinLevel)
 Reads the Mykonos 3.3 VDC GPIO pin levels for BITBANG mode. More...
 
mykonosGpioErr_t MYKONOS_setGpio3v3Oe (mykonosDevice_t *device, uint16_t gpio3v3OutEn)
 This function sets the Pin direction control for the Mykonos 3.3 VDC GPIO. More...
 
mykonosGpioErr_t MYKONOS_getGpio3v3Oe (mykonosDevice_t *device, uint16_t *gpio3v3OutEn)
 Reads the Mykonos 3.3 VDC GPIO pin direction. More...
 
mykonosGpioErr_t MYKONOS_setGpio3v3SourceCtrl (mykonosDevice_t *device, uint16_t gpio3v3SrcCtrl)
 Sets the Mykonos GPIO 3.3 VDC source control for different GPIO fucntionality. More...
 
mykonosGpioErr_t MYKONOS_getGpio3v3SourceCtrl (mykonosDevice_t *device, uint16_t *gpio3v3SrcCtrl)
 Reads the Mykonos 3v3 GPIO source control for different GPIO functionality. More...
 
mykonosGpioErr_t MYKONOS_setRxGainCompensation (mykonosDevice_t *device, mykonosGainComp_t *gainComp, uint8_t enable)
 Gain compensation enable and setup function. More...
 
mykonosGpioErr_t MYKONOS_getRxGainCompensation (mykonosDevice_t *device, mykonosGainComp_t *gainComp, uint8_t *enabled)
 Get gain compensation setup and enabled function. More...
 
mykonosGpioErr_t MYKONOS_setObsRxGainCompensation (mykonosDevice_t *device, mykonosObsRxGainComp_t *gainComp, uint8_t enable)
 Gain compensation enable and setup function for the observation channel. More...
 
mykonosGpioErr_t MYKONOS_getObsRxGainCompensation (mykonosDevice_t *device, mykonosObsRxGainComp_t *gainComp, uint8_t *enabled)
 Get gain compensation setup and enabled function for the observation channel. More...
 
mykonosGpioErr_t MYKONOS_setRxSlicerCtrl (mykonosDevice_t *device, uint8_t slicerStep, mykonosRxSlicer_t rx1Pins, mykonosRxSlicer_t rx2Pins, uint8_t enable)
 Slicer control over GPIO inputs. More...
 
mykonosGpioErr_t MYKONOS_getRxSlicerCtrl (mykonosDevice_t *device, uint8_t *slicerStep, mykonosRxSlicer_t *rx1Pins, mykonosRxSlicer_t *rx2Pins, uint8_t *enable)
 This function will get the programmed Slicer control for Rx1 and Rx2 channels. More...
 
mykonosGpioErr_t MYKONOS_setObsRxSlicerCtrl (mykonosDevice_t *device, uint8_t slicerStep, mykonosObsRxSlicer_t obsRxPins, uint8_t enable)
 Slicer control over GPIO inputs for the observation channel. More...
 
mykonosGpioErr_t MYKONOS_getObsRxSlicerCtrl (mykonosDevice_t *device, uint8_t *slicerStep, mykonosObsRxSlicer_t *obsRxPins, uint8_t *enable)
 This function will get the programmed Slicer control for observation channel. More...
 
mykonosGpioErr_t MYKONOS_setFloatPointFrmt (mykonosDevice_t *device, mykonosFloatPntFrmt_t *floatFrmt)
 Floating point formatter enable and setup function. More...
 
mykonosGpioErr_t MYKONOS_getFloatPointFrmt (mykonosDevice_t *device, mykonosFloatPntFrmt_t *floatFrmt)
 Floating point formatter setup function. More...
 
mykonosGpioErr_t MYKONOS_setRxEnFloatPntFrmt (mykonosDevice_t *device, uint8_t rx1Att, uint8_t rx2Att, uint8_t enable)
 Floating point formatter enable/disable Rx1 and Rx2 function. More...
 
mykonosGpioErr_t MYKONOS_getRxEnFloatPntFrmt (mykonosDevice_t *device, uint8_t *rx1Att, uint8_t *rx2Att, uint8_t *enable)
 Floating point formatter setup function. More...
 
mykonosGpioErr_t MYKONOS_setOrxEnFloatPntFrmt (mykonosDevice_t *device, uint8_t orxAtt, uint8_t enable)
 Floating point formatter enable function for ORx channel. More...
 
mykonosGpioErr_t MYKONOS_getOrxEnFloatPntFrmt (mykonosDevice_t *device, uint8_t *orxAtt, uint8_t *enable)
 Floating point formatter enable and setup function. More...
 
mykonosGpioErr_t MYKONOS_setupTempSensor (mykonosDevice_t *device, mykonosTempSensorConfig_t *tempSensor)
 Sets up the Temperature Sensor. More...
 
mykonosGpioErr_t MYKONOS_getTempSensorConfig (mykonosDevice_t *device, mykonosTempSensorConfig_t *tempSensor)
 Reads from the Temperature Sensor registers and populates device data structure. More...
 
mykonosGpioErr_t MYKONOS_startTempMeasurement (mykonosDevice_t *device)
 Initiates temperature measurement. More...
 
mykonosGpioErr_t MYKONOS_readTempSensor (mykonosDevice_t *device, mykonosTempSensorStatus_t *tempStatus)
 Reads temperature code and statuses from the Temperature Sensor registers. More...
 
mykonosGpioErr_t MYKONOS_setGpioDrv (mykonosDevice_t *device, uint32_t gpioDrv)
 This function sets the drive strength for the required GPIOs. More...
 
mykonosGpioErr_t MYKONOS_getGpioDrv (mykonosDevice_t *device, uint32_t *gpioDrv)
 This function gets the GPIOs drive strength. More...
 
mykonosGpioErr_t MYKONOS_setGpioSlewRate (mykonosDevice_t *device, mykonosGpioSelect_t gpioSelect, mykonosGpioSlewRate_t slewRate)
 This function sets the slew rate for the required GPIOs. More...
 
mykonosGpioErr_t MYKONOS_getGpioSlewRate (mykonosDevice_t *device, mykonosGpioSelect_t gpioSelect, mykonosGpioSlewRate_t *slewRate)
 This function gets the GPIO slew rate setting. More...
 
mykonosGpioErr_t MYKONOS_setCmosDrv (mykonosDevice_t *device, mykonosCmosPadDrvStr_t cmosDrv)
 This function sets the CMOS output driver. More...
 
mykonosGpioErr_t MYKONOS_getCmosDrv (mykonosDevice_t *device, mykonosCmosPadDrvStr_t *cmosDrv)
 This function gets the programmed CMOS output driver. More...
 
mykonosGpioErr_t MYKONOS_spi2GpioSetup (mykonosDevice_t *device, uint8_t enable, uint8_t updateTxAttenPinSelect)
 This API function configures and enables the secondary SPI port. More...
 

Detailed Description

Contains Mykonos APIs for transceiver GPIO configuration and control.

Mykonos API version: 1.5.2.3566

Function Documentation

◆ getGpioMykonosErrorMessage()

const char* getGpioMykonosErrorMessage ( mykonosGpioErr_t  errorCode)

Helper function for return of character string based on 32-bit mykonosGpioErr_t enum value.

Legal Disclaimer Copyright 2015-2017 Analog Devices Inc. Released under the AD9371 API license, for more information see the "LICENSE.txt" file in this zip file. To save codespace, these error strings are ifdef'd out unless the user adds a define MYKONOS_VERBOSE to their workspace. This function can be useful for debug. Each function also returns unique error codes to make it easier to determine where the code broke.

Parameters
errorCodeis enumerated error code value
Returns
Returns character string based on enumerated value
Here is the caller graph for this function:

◆ MYKONOS_configGpInterrupt()

mykonosGpioErr_t MYKONOS_configGpInterrupt ( mykonosDevice_t device,
uint16_t  gpMask 
)

Sets the General Purpose (GP) interrupt register bit mask to enable interrupt sources to assert the GP Interrupt pin.

Mykonos has a single output pin called General Purpose Interrupt that asserts to a logic high level when certain events occur. The events that cause the GP Interrupt pin to assert are user selectable by setting the gpMask parameter in this function. Device default is mask = x1FF = ignore all events. The ARM Error interrupt can not be ignored and can always assert the GP interrupt pin.

gpMask Bit description
[0] TXPLL LOCK - 0 = allow PLL unlocking to assert GP Interrupt pin, 1 = ignore TXPLL LOCK
[1] RXPLL LOCK - 0 = allow PLL unlocking to assert GP Interrupt pin, 1 = ignore RXPLL LOCK
[2] SNIFFER PLL LOCK - 0 = allow PLL unlocking to assert GP Interrupt pin, 1 = ignore SNIFFER PLL LOCK
[3] CALIBRATION PLL LOCK - 0 = allow PLL unlocking to assert GP Interrupt pin, 1 = ignore CALIBRATION PLL LOCK
[4] CLKPLL LOCK - 0 = allow PLL unlocking to assert GP Interrupt pin, 1 = ignore CLKPLL LOCK
[5] 0 = Allow JESD204 deframer interrupt to assert GP Interrupt pin, 1 = ignore JESD204 deframer interrupt
[6] Tx1 PA protection - 0 = allow Tx1 PA protection event to assert GP Interrupt pin, 1 = ignore Tx1 PA protection
[7] Tx2 PA protection - 0 = allow Tx2 PA protection event to assert GP Interrupt pin, 1 = ignore Tx2 PA protection
[8] Mykonos ARM Watchdog - 0 = allow Mykonos ARM Watchdog timeout to assert GP Interrupt pin, 1 = ignore Watchdog timeout event
[15-9] Reserved for future use

Dependencies

  • device->spiSettings
Parameters
devicePointer to the device settings structure
gpMaskValue is passed to enable one or more general purpose interrupt sources (1=ignore source, 0 = enable source interrupt to GP Interrupt pin)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_INV_GP_INT_MASK_PARMif invalid interrupt mask is passed

◆ MYKONOS_getCmosDrv()

mykonosGpioErr_t MYKONOS_getCmosDrv ( mykonosDevice_t device,
mykonosCmosPadDrvStr_t cmosDrv 
)

This function gets the programmed CMOS output driver.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
cmosDrvwill be the programmed drive for the CMOS output driver
Return values
MYKONOS_ERR_CMOS_DRV_NULL_PARAMNull parameter passed to the function
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getFloatPointFrmt()

mykonosGpioErr_t MYKONOS_getFloatPointFrmt ( mykonosDevice_t device,
mykonosFloatPntFrmt_t floatFrmt 
)

Floating point formatter setup function.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range which increases the bit-width in the digital data-path.

Dependencies

  • device->spiSettings->chipSelectIndex
  • Gain compensation block has to be enabled in order to user floating point formatter
Parameters
deviceis a pointer to the device settings structure
floatFrmtwhich is a mykonosFloatPntFrmt_t structure.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_NULL_STRUCTfloating point formatter structure floatFrmt not initialized

◆ MYKONOS_getGpio3v3Oe()

mykonosGpioErr_t MYKONOS_getGpio3v3Oe ( mykonosDevice_t device,
uint16_t *  gpio3v3OutEn 
)

Reads the Mykonos 3.3 VDC GPIO pin direction.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpio3v3OutEnis a unit16_t pointer which will contain the output enable parameter, this will be a bit field, if a bit is set then the corresponding GPIO pin is an output, if the bit is not set then the corresponding pin is an input
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GPIO3V3OUTEN_NULL_PARMgpio3v3OutEn pointer is NULL in function parameter

◆ MYKONOS_getGpio3v3PinLevel()

mykonosGpioErr_t MYKONOS_getGpio3v3PinLevel ( mykonosDevice_t device,
uint16_t *  gpio3v3PinLevel 
)

Reads the Mykonos 3.3 VDC GPIO pin levels for BITBANG mode.

Note: this function is only capable of reading back pin levels for the 3.3v pins set to be inputs. Any pins set to be a GPIO output will read back as zero.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpio3v3PinLevelis a unit16_t pointer which contains the level of each GPIO3V3 pin that is defined as an input
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETGPIO3V3SPI_NULL_PARMgpio3v3PinLevel pointer is NULL in function parameter

◆ MYKONOS_getGpio3v3SetLevel()

mykonosGpioErr_t MYKONOS_getGpio3v3SetLevel ( mykonosDevice_t device,
uint16_t *  gpio3v3SetLevel 
)

Reads the Mykonos 3.3 VDC GPIO pin output levels for BITBANG mode.

This function allows reading the value that the 3.3v GPIO output pins are set to drive out the pins.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpio3v3SetLevelis a unit16_t pointer which contains the level of each GPIO3V3 pin (bit per pin)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETGPIO3V3OUT_NULL_PARMgpio3v3SetLevel pointer is NULL in function parameter

◆ MYKONOS_getGpio3v3SourceCtrl()

mykonosGpioErr_t MYKONOS_getGpio3v3SourceCtrl ( mykonosDevice_t device,
uint16_t *  gpio3v3SrcCtrl 
)

Reads the Mykonos 3v3 GPIO source control for different GPIO functionality.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpio3v3SrcCtrlnibble based source control, this is a 12 bit containing 3 nibbles that will be set the source control.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getGpioDrv()

mykonosGpioErr_t MYKONOS_getGpioDrv ( mykonosDevice_t device,
uint32_t *  gpioDrv 
)

This function gets the GPIOs drive strength.

This function will get the programmed drive strength for all the GPIOs

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure.
gpioDrvwill contain the current GPIOs drive strength setting.
Return values
MYKONOS_ERR_GETGPIODRV_NULL_PARAMnull parameter passed to the function.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getGpioMonitorOut()

mykonosGpioErr_t MYKONOS_getGpioMonitorOut ( mykonosDevice_t device,
uint8_t *  monitorIndex,
uint8_t *  monitorMask 
)

This API function reads the GPIO monitor index from Mykonos.

The monitor outputs are grouped in two set of nibbles, the user can set individual nibbles for having the monitor output function, this nibbles will output the monitor output as per the index set.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
  • GPIO output enable
  • GPIO source control
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
monitorIndexwhich will be the index at which the outputs are set to.
monitorMaskwhich will be enable the monitor function.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETGPIOMON_INDEX_NULL_PARMif the monitorIndex is null.
MYKONOS_ERR_GETGPIOMON_MONITORMASK_NULL_PARMif the monitorMask is null.

◆ MYKONOS_getGpioOe()

mykonosGpioErr_t MYKONOS_getGpioOe ( mykonosDevice_t device,
uint32_t *  gpioOutEn 
)

Gets the Mykonos low voltage GPIO output pins direction.

This function will get the GPIO direction currently set in the device, the direction can be either output or input. The return gpioOutEn function parameter returns a bit per GPIO pin. 1 = output from the Mykonos Device, 0 = input into the Mykonos device.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
*gpioOutEna pointer to the data to be returned with the output enable reading
gpioOutEn[bit] GPIO[bit] direction
0 input
1 output
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETGPIO_OE_NULL_PARMgpioOutEn function parameter is NULL
Here is the caller graph for this function:

◆ MYKONOS_getGpioPinLevel()

mykonosGpioErr_t MYKONOS_getGpioPinLevel ( mykonosDevice_t device,
uint32_t *  gpioPinLevel 
)

Reads the Mykonos low voltage GPIO pin levels and returns their contents in a single 32-bit word.

The GPIO pins that are set to be inputs in BITBANG mode will read back and be returned in the gpioPinLevel parameter. The return value is a bit per pin. GPIO 0 returns on bit 0 of the gpioPinLevel parameter. A logic low level returns a 0, a logic high level returns a 1.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioPinLevelInput Gpio pin levels read back on the pins assigned as inputs (bit per pin)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_READGPIOSPI_NULL_PARMThe pointer passed for gpioPinLevel parameter is NULL

◆ MYKONOS_getGpioSetLevel()

mykonosGpioErr_t MYKONOS_getGpioSetLevel ( mykonosDevice_t device,
uint32_t *  gpioPinSetLevel 
)

Reads the Mykonos GPIO pin output levels for BITBANG mode.

This function allows reading the value that the GPIO output pins are set to drive out the pins.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioPinSetLevelis a unit32_t pointer which contains the level of each GPIO pin (bit per pin)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETGPIOSETLEVEL_NULL_PARMgpioPinSetLevel pointer is NULL in function parameter

◆ MYKONOS_getGpioSlewRate()

mykonosGpioErr_t MYKONOS_getGpioSlewRate ( mykonosDevice_t device,
mykonosGpioSelect_t  gpioSelect,
mykonosGpioSlewRate_t slewRate 
)

This function gets the GPIO slew rate setting.

This function will get the programmed slew rate for the GPIO given by slewRateGpio.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure.
gpioSelectGPIO selection for getting the slew rate setting.
slewRatewill contain the GPIO slew rate setting.
Return values
MYKONOS_ERR_GPIO_GETSLEW_NULL_PARAMnull parameter passed to the function.
MYKONOS_ERR_GPIO_SLEW_RATE_INV_PARAMGPIO out of range- valid GPIOs are in the range 0x00000 to 0x7FFFF.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getGpioSourceCtrl()

mykonosGpioErr_t MYKONOS_getGpioSourceCtrl ( mykonosDevice_t device,
uint32_t *  gpioSrcCtrl 
)

Reads the Mykonos GPIO source control for different GPIO functionality.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioSrcCtrlnibble based source control, this is a 32 bit containing 5 nibbles that will be set the source control.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getObsRxAgcEnSyncPin()

mykonosGpioErr_t MYKONOS_getObsRxAgcEnSyncPin ( mykonosDevice_t device,
mykonosGpioSelect_t obsRxAgcSyncPin 
)

This API function gets the pin configuration for AGC Sync gain control of observation channel.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
obsRxAgcSyncPinWill return the GPIO pin used for observation channel AGC gain sync control,
Return values
MYKONOS_ERR_GPIO_AGC_SYNC_ORX_PIN_NULL_PARMif a null value has been passed to obsRxAgcSyncPin
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getObsRxGainCompensation()

mykonosGpioErr_t MYKONOS_getObsRxGainCompensation ( mykonosDevice_t device,
mykonosObsRxGainComp_t gainComp,
uint8_t *  enabled 
)

Get gain compensation setup and enabled function for the observation channel.

The gain compensation block is a function that compensates for the attenuation in the internal attenuator for the observation channels. This function will get the current setup and the enable state of the block.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gainComppointer to a mykonosObsRxGainComp_t structure, will held the current device gain compensation settings.
enabledpointer this parameter will contain the enable state of the gain compensation block. enabled = 1 disabled = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_OBS_RX_GAINCOMP_NULL_STRUCTobservation channel gain compensation structure gainComp is not initialised
MYKONOS_ERR_OBS_RX_GAINCOMP_EN_NULL_PARAMenabled is null pointer for the parameter passed

◆ MYKONOS_getObsRxHybridGainChangePin()

mykonosGpioErr_t MYKONOS_getObsRxHybridGainChangePin ( mykonosDevice_t device,
mykonosGpioSelect_t obsRxGainChangePin 
)

This API function gets the pin configuration for hybrid gain control of observation channel.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
obsRxGainChangePinWill return the GPIO pin used for observation channel in hybrid gain control.
Return values
MYKONOS_ERR_GPIO_HYBRID_ORX_PIN_NULL_PARMif a null value has been passed to obsRxGainChangePin
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getObsRxSlicerCtrl()

mykonosGpioErr_t MYKONOS_getObsRxSlicerCtrl ( mykonosDevice_t device,
uint8_t *  slicerStep,
mykonosObsRxSlicer_t obsRxPins,
uint8_t *  enable 
)

This function will get the programmed Slicer control for observation channel.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
slicerStepwill contain the configured step size
obsRxPinswill contain the configured GPIO combination
enablewill contain the programmed enable setting
Return values
MYKONOS_ERR_SLICER_OBS_RXPIN_NULL_PARMobsRxPins is null pointer for the passed parameter
MYKONOS_ERR_SLICER_OBS_RX_STEP_NULL_PARMslicerStep is null pointer for the passed parameter
MYKONOS_ERR_SLICER_OBS_RX_EN_NULL_PARM,enableis null pointer for the passed parameter
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getOrxEnFloatPntFrmt()

mykonosGpioErr_t MYKONOS_getOrxEnFloatPntFrmt ( mykonosDevice_t device,
uint8_t *  orxAtt,
uint8_t *  enable 
)

Floating point formatter enable and setup function.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range (total gain range on AD9371 is 42dB) which increases the bitwidth in the digital datapath.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
orxAttthis parameter sets the integer data attenuation for the ORx channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
enablethis parameter enables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_NULL_ORXATTnull pointer passed for orxAtt
MYKONOS_ERR_FLOATFRMT_NULL_ORXENABLEnull pointer passed for enable

◆ MYKONOS_getRx1GainCtrlPin()

mykonosGpioErr_t MYKONOS_getRx1GainCtrlPin ( mykonosDevice_t device,
uint8_t *  incStep,
uint8_t *  decStep,
mykonosGpioSelect_t rx1GainIncPin,
mykonosGpioSelect_t rx1GainDecPin,
uint8_t *  enable 
)

This API function returns the configuration RX1 gain Pin control.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
incStepwill contain the step that is used for increment.
decStepwill contain the step that is used for decrement.
rx1GainIncPinthis will have the pin used for increment.
rx1GainDecPinthis will have the pin used for decrement.
enablewill contain the enable status for this channel if it is set to 1 then this function is enable for this channel, if it is 0 it is not enable
Return values
MYKONOS_ERR_GETRX1PIN_INCSTEP_NULL_PARMif a null value has been passed to incStep
MYKONOS_ERR_GETRX1PIN_DECSTEP_NULL_PARMif a null value has been passed to decStep
MYKONOS_ERR_GETRX1PIN_INCPIN_NULL_PARMif a null value has been passed to rx1GainIncPin
MYKONOS_ERR_GETRX1PIN_DECPIN_NULL_PARMif a null value has been passed to rx1GainDecPin
MYKONOS_ERR_GETRX1PIN_EN_NULL_PARMif a null value has been passed to enable
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getRx2GainCtrlPin()

mykonosGpioErr_t MYKONOS_getRx2GainCtrlPin ( mykonosDevice_t device,
uint8_t *  incStep,
uint8_t *  decStep,
mykonosGpioSelect_t rx2GainIncPin,
mykonosGpioSelect_t rx2GainDecPin,
uint8_t *  enable 
)

This API function returns the configuration RX2 gain Pin control.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
incStepwill contain the step that is used for increment.
decStepwill contain the step that is used for decrement.
rx2GainIncPinthis will have the pin used for increment.
rx2GainDecPinthis will have the pin used for decrement.
enablewill contain the enable status for this channel if it is set to 1 then this function is enable for this channel, if it is 0 it is not enable
Return values
MYKONOS_ERR_GETRX2PIN_INCSTEP_NULL_PARMif a null value has been passed to incStep
MYKONOS_ERR_GETRX2PIN_DECSTEP_NULL_PARMif a null value has been passed to decStep
MYKONOS_ERR_GETRX2PIN_INCPIN_NULL_PARMif a null value has been passed to rx1GainIncPin
MYKONOS_ERR_GETRX2PIN_DECPIN_NULL_PARMif a null value has been passed to rx1GainDecPin
MYKONOS_ERR_GETRX2PIN_EN_NULL_PARMif a null value has been passed to enable
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getRxAgcEnSyncPin()

mykonosGpioErr_t MYKONOS_getRxAgcEnSyncPin ( mykonosDevice_t device,
mykonosGpioSelect_t rx1AgcSyncPin,
mykonosGpioSelect_t rx2AgcSyncPin 
)

This API function gets the GPIO pin configuration for AGC gain sync control of RX1 and RX2.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
rx1AgcSyncPinWill return the GPIO pin used for RX1 channel AGC gain sync control,
rx2AgcSyncPinWill return the GPIO pin used for RX2 channel AGC gain sync control,
Return values
MYKONOS_ERR_GPIO_AGC_SYNC_RX1_PIN_NULL_PARMif a null value has been passed to rx1AgcSyncPin
MYKONOS_ERR_GPIO_AGC_SYNC_RX2_PIN_NULL_PARMif a null value has been passed to rx2AgcSyncPin
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getRxEnFloatPntFrmt()

mykonosGpioErr_t MYKONOS_getRxEnFloatPntFrmt ( mykonosDevice_t device,
uint8_t *  rx1Att,
uint8_t *  rx2Att,
uint8_t *  enable 
)

Floating point formatter setup function.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range (total gain range on AD9371 is 42dB) which increases the bitwidth in the digital datapath.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
rx1Attthis parameter sets the integer data attenuation for the Rx1 channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
rx2Attthis parameter sets the integer data attenuation for the Rx2 channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
enablethis parameter enables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_NULL_RX1ATTnull pointer passed for rx1 attenuation in MYKONOS_setRxEnFloatPntFrmt()
MYKONOS_ERR_FLOATFRMT_NULL_RX2ATTnull pointer passed for rx2 attenuation in MYKONOS_setRxEnFloatPntFrmt()
MYKONOS_ERR_FLOATFRMT_NULL_ENABLEnull pointer passed for enable in MYKONOS_setRxEnFloatPntFrmt()

◆ MYKONOS_getRxGainCompensation()

mykonosGpioErr_t MYKONOS_getRxGainCompensation ( mykonosDevice_t device,
mykonosGainComp_t gainComp,
uint8_t *  enabled 
)

Get gain compensation setup and enabled function.

The gain compensation block is a function that compensates for the attenuation in the internal attenuator for the Rx channels. This function will get the current setup and the enable state of the block.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gainComppointer to a mykonosGainComp_t structure, will held the current device gain compensation settings.
enabledpointer this parameter will contain the enable state of the gain compensation block. enabled = 1 disabled = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GAINCOMP_NULL_STRUCTgain compensation structure gainComp is not initialised
MYKONOS_ERR_GAINCOMP_EN_NULL_PARMenable is null pointer for the passed parameter

◆ MYKONOS_getRxHybridGainChangePin()

mykonosGpioErr_t MYKONOS_getRxHybridGainChangePin ( mykonosDevice_t device,
mykonosGpioSelect_t rx1GainChangePin,
mykonosGpioSelect_t rx2GainChangePin 
)

This API function gets the pin configuration for hybrid gain control of RX1 and RX2.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
rx1GainChangePinWill return the GPIO pin used for Rx1 in hybrid gain control.
rx2GainChangePinWill return the GPIO pin used for Rx2 in hybrid gain control.
Return values
MYKONOS_ERR_GPIO_HYBRID_RX1_PIN_NULL_PARMif a null value has been passed to rx1GainChangePin
MYKONOS_ERR_GPIO_HYBRID_RX2_PIN_NULL_PARMif a null value has been passed to rx2GainChangePin
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getRxSlicerCtrl()

mykonosGpioErr_t MYKONOS_getRxSlicerCtrl ( mykonosDevice_t device,
uint8_t *  slicerStep,
mykonosRxSlicer_t rx1Pins,
mykonosRxSlicer_t rx2Pins,
uint8_t *  enable 
)

This function will get the programmed Slicer control for Rx1 and Rx2 channels.

The user can control the slicer position via 3 GPIO inputs per channel. There are various configurations for the GPIO pins, this configurations are enumerated in the mykonosRxSlicer_t.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
slicerStepwill contain the configured step size
rx1Pinswill contain the configured GPIO combination for Rx1
rx2Pinswill contain the configured GPIO combination for Rx2
enablewill contain the programmed enable setting
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SLICER_RX1PIN_NULL_PARMrx1Pins is null pointer for the passed parameter
MYKONOS_ERR_SLICER_RX2PIN_NULL_PARMrx1Pins is null pointer for the passed parameter
MYKONOS_ERR_SLICER_STEP_NULL_PARMslicerStep is null pointer for the passed parameter
MYKONOS_ERR_SLICER_EN_NULL_PARMenable is null pointer for the passed parameter

◆ MYKONOS_getTempSensorConfig()

mykonosGpioErr_t MYKONOS_getTempSensorConfig ( mykonosDevice_t device,
mykonosTempSensorConfig_t tempSensor 
)

Reads from the Temperature Sensor registers and populates device data structure.

After this function is executed, the tempSensor parameter holds updated values from the device registers.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
tempSensoris a pointer to the mykonosTempSensorConfig_t which holds the configuration settings for the tempSensor
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GETTEMPSENSORCONFIG_NULL_PARAMFunction parameter tempSensor is a NULL pointer

◆ MYKONOS_getTx1AttenCtrlPin()

mykonosGpioErr_t MYKONOS_getTx1AttenCtrlPin ( mykonosDevice_t device,
uint8_t *  stepSize,
mykonosGpioSelect_t tx1AttenIncPin,
mykonosGpioSelect_t tx1AttenDecPin,
uint8_t *  enable,
uint8_t *  useTx1ForTx2 
)

This API function returns the configuration TX1 attenuation Pin control.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
stepSizewill contain the step that is used for increment and decrement.
tx1AttenIncPinthis will have the pin used for increment.
tx1AttenDecPinthis will have the pin used for decrement.
enablewill contain the enable status for this channel if it is set to 1 then this function is enable for this channel, if it is 0 it is not enable
useTx1ForTx2is used to return if TX1 settings are used for TX2 channel.
Return values
MYKONOS_ERR_GETTX1PIN_STEP_NULL_PARMif a null value has been passed to stepSize
MYKONOS_ERR_GETTX1PIN_INC_NULL_PARMif a null value has been passed to tx1AttenIncPin
MYKONOS_ERR_GETTX1PIN_DEC_NULL_PARMif a null value has been passed to tx1AttenDecPin
MYKONOS_ERR_GETTX1PIN_EN_NULL_PARMif a null value has been passed to enable
MYKONOS_ERR_GETTX1PIN_TX1TX2_NULL_PARMif a null value has been passed to useTx1ForTx2
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_getTx2AttenCtrlPin()

mykonosGpioErr_t MYKONOS_getTx2AttenCtrlPin ( mykonosDevice_t device,
uint8_t *  stepSize,
mykonosGpioSelect_t tx2AttenIncPin,
mykonosGpioSelect_t tx2AttenDecPin,
uint8_t *  enable,
uint8_t *  useTx1ForTx2 
)

This API function returns the configuration TX2 attenuation Pin control.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
stepSizewill contain the step that is used for increment and decrement.
tx2AttenIncPinthis will have the pin used for increment.
tx2AttenDecPinthis will have the pin used for decrement.
enablewill contain the enable status for this channel if it is set to 1 then this function is enable for this channel, if it is 0 it is not enable
useTx1ForTx2is used to return if TX1 settings are used for TX2 channel.
Return values
MYKONOS_ERR_GETTX2PIN_STEP_NULL_PARMif a null value has been passed to stepSize
MYKONOS_ERR_GETTX2PIN_STEP_NULL_PARMif a null value has been passed to tx1AttenIncPin
MYKONOS_ERR_GETTX2PIN_DEC_NULL_PARMif a null value has been passed to tx1AttenDecPin
MYKONOS_ERR_GETTX2PIN_EN_NULL_PARMif a null value has been passed to enable
MYKONOS_ERR_GETTX2PIN_TX1TX2_NULL_PARMif a null value has been passed to useTx1ForTx2
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_readAuxAdc()

mykonosGpioErr_t MYKONOS_readAuxAdc ( mykonosDevice_t device,
uint16_t *  adcCode 
)

Reads from the selected channel of the auxiliary ADC.

Before using this function to read back the AuxADC value of the currently selected AuxADC, make sure that at least 1 conversion time of the ADC has passed since setting the AuxADC channel.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
adcCodeis a pointer for return of the 12bit ADC read value
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_READAUXADC_NULL_PARAMFunction parameter adcCode is a NULL pointer

◆ MYKONOS_readGpInterruptStatus()

mykonosGpioErr_t MYKONOS_readGpInterruptStatus ( mykonosDevice_t device,
uint16_t *  status 
)

Reads the General Purpose (GP) interrupt status to determine what caused the GP Interrupt pin to assert.

When the BBIC detects a rising edge on the General Purpose Interrupt pin, this function allows the BBIC to determine the source of the interrupt. The value returned in the status parameter will show one or more sources for the interrupt based on the following table.

The PLL unlock bits are not sticky. They will follow the current status of the PLLs. If the PLL relocks, the status bit will clear as well. The GP Interrupt pin is the logical OR of all the sources. When all the status bits are low, the GP Interrupt pin will be low. The status word readback will show the current value for all interrupt sources, even if they are disabled by the masked. However, the GP Interrupt pin will only assert for the enabled sources.

status Bit description
[0] 1 = TXPLL UNLOCK
[1] 1 = RXPLL UNLOCK
[2] 1 = SNIFFER PLL UNLOCK
[3] 1 = CALIBRATION PLL UNLOCK
[4] 1 = CLK PLL UNLOCK
[5] 1 = JESD204 deframer interrupt occurred
[6] 1 = Tx1 PA protection event
[7] 1 = Tx2 PA protection event
[8] 1 = Mykonos ARM Watchdog timeout
[9] 1 = ARM interrupt occurred
[15-10] Reserved for future use

Dependencies

  • device->spiSettings
Parameters
devicePointer to the device settings structure
statusparameter to return the IRQ source(s) that caused the GP Interrpt pin to assert.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GP_INT_STATUS_NULL_PARAMif null *status pointer is passed

◆ MYKONOS_readTempSensor()

mykonosGpioErr_t MYKONOS_readTempSensor ( mykonosDevice_t device,
mykonosTempSensorStatus_t tempStatus 
)

Reads temperature code and statuses from the Temperature Sensor registers.

This function reads the temperature sensor's statuses and temperature code. Allow at least one computation period to elapse. The temperature sensor computation period is as 6 times the AuxADC conversion time. AuxADC conversion time = (1/40Mhz) * (256 * 2^(tempDecimation))

Before using this function to read back the temperature, make sure that temperature sensor is setup using the MYKONOS_setupTempSensor() function.

Precondition
Before using this function to read back the sensor value: MYKONOS_setupTempSensor() function is needed in order to set up the Temperature sensor. MYKONOS_setAuxAdcChannel() function has to be called in order to set the proper AuxADC channel. AuxADC channel MYK_TEMPSENSOR is used for the Temperature sensor. MYKONOS_startTempMeasurement() this function will start the Temperature sensor, this function is needed to be called for every reading that needs to be performed.
Postcondition
"tempStatus" structure will contain the status information and the temperature code. If a valid measurement is achieved then tempStatus->tempValid will be set and tempStatus->tempCode will contain the actual reading.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
tempStatusis a pointer to the mykonosTempSensorStatus_t structure which will be updated with the temp sensor readings
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_READTEMPSENSOR_NULL_PARAMFunction parameter tempSensor is a NULL pointer
MYKONOS_ERR_READTEMPSENSOR_NOT_LOCKEDtemperature sensor reading is not locked

◆ MYKONOS_setArmGpioPins()

mykonosGpioErr_t MYKONOS_setArmGpioPins ( mykonosDevice_t device)

Sets the input and output GPIO pin selections for ARM related signals.

The BBP should not have to call this as it will automatically be setup during the MYKONOS_loadArmFromBinary() function call. If the BBP wishes to change the GPIO assignments this function can be called again to change the configuration while the ARM is in the radioOff state.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->armGpio : all members in structure
Parameters
deviceis a pointer to the device settings structure
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SET_ARMGPIO_INV_POINTERdevice->auxIo->armGpio pointer is null
MYKONOS_ERR_SET_ARMGPIO_PINS_INV_SIGNALIDInvalid ARM GPIO pin signal ID
MYKONOS_ERR_SET_ARMGPIO_PINS_INV_GPIOPINInvalid GPIO pin selected for ARM output (valid 0-15 + output enable in bit[4])
MYKONOS_ERR_SET_ARMGPIO_PINS_ARMERRORARM returned error setting GPIO pins
Here is the caller graph for this function:

◆ MYKONOS_setAuxAdcChannel()

mykonosGpioErr_t MYKONOS_setAuxAdcChannel ( mykonosDevice_t device,
mykonosAuxAdcChannels_t  auxAdcChannel 
)

Sets the selected channel of the auxiliary ADC.

After setting the AuxADC channel, wait at least 1 AuxADC conversion time before reading back the AuxADC value.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
auxAdcChanneldesired Aux ADC input(0-4 and 16 = temperature sensor)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_INV_AUX_ADC_CHAN_PARMInvalid AuxADC channel (valid 0-4 and 16)

◆ MYKONOS_setCmosDrv()

mykonosGpioErr_t MYKONOS_setCmosDrv ( mykonosDevice_t device,
mykonosCmosPadDrvStr_t  cmosDrv 
)

This function sets the CMOS output driver.

This function sets the CMOS output driver to increase pad drive strength for the SPI_DIO and GP_INTERRUPT pads according to the following settings of the enumeration type mykonosCmosPadDrvStr_t

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
cmosDrvdrive for the CMOS output driver
Return values
MYKONOS_ERR_CMOS_DRV_INV_PARAMinvalid drive strength, valid settings are given by mykonosCmosPadDrvStr_t
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setFloatPointFrmt()

mykonosGpioErr_t MYKONOS_setFloatPointFrmt ( mykonosDevice_t device,
mykonosFloatPntFrmt_t floatFrmt 
)

Floating point formatter enable and setup function.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range (total gain range on AD9371 is 42dB) which increases the bitwidth in the digital datapath.

Dependencies

  • device->spiSettings->chipSelectIndex
  • Gain compensation block has to be enabled in order to user floating point formatter
Parameters
deviceis a pointer to the device settings structure
floatFrmtwhich is a mykonosFloatPntFrmt_t structure.
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_SET_NULL_STRUCTfloating point formatter structure floatFrmt not initialized
MYKONOS_ERR_FLOATFRMT_INV_ROUND_MODEfloating point formatter structure floatFrmt.roundMode not valid parameter
MYKONOS_ERR_FLOATFRMT_INV_DATA_FORMATfloating point formatter structure floatFrmt.dataFormat not valid parameter
MYKONOS_ERR_FLOATFRMT_INV_ENC_NANfloating point formatter structure floatFrmt.encNan not valid parameter
MYKONOS_ERR_FLOATFRMT_INV_EXP_BITSfloating point formatter structure floatFrmt.expBits not valid parameter
MYKONOS_ERR_FLOATFRMT_INV_LEADINGfloating point formatter structure floatFrmt.leading not valid parameter

◆ MYKONOS_setGpio3v3Oe()

mykonosGpioErr_t MYKONOS_setGpio3v3Oe ( mykonosDevice_t device,
uint16_t  gpio3v3OutEn 
)

This function sets the Pin direction control for the Mykonos 3.3 VDC GPIO.

The bits in gpio3v3OutEn are used to configure each corresponding pin as an input or an output. If the bit is set, the pin is configured as an output, and if it is clear the pin is configured as an input. For example, setting gpio3v3OutEn = 0x02 will configure GPIO_3p3_2 as an output and the rest pins as inputs.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio3v3 - all members
Parameters
deviceis a pointer to the device settings structure
gpio3v3OutEnBit per pin to set the level of each GPIO3v3 output pin
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
Here is the caller graph for this function:

◆ MYKONOS_setGpio3v3PinLevel()

mykonosGpioErr_t MYKONOS_setGpio3v3PinLevel ( mykonosDevice_t device,
uint16_t  gpio3v3PinLevel 
)

If the GPIO3v3 pins are setup for BITBANG mode, this function sets the output pin levels per pin.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio3v3 - all members
Parameters
deviceis a pointer to the device settings structure
gpio3v3PinLevelBit per pin to set the level of each GPIO3v3 output pin
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpio3v3SourceCtrl()

mykonosGpioErr_t MYKONOS_setGpio3v3SourceCtrl ( mykonosDevice_t device,
uint16_t  gpio3v3SrcCtrl 
)

Sets the Mykonos GPIO 3.3 VDC source control for different GPIO fucntionality.

This function will only affect the GPIO pins that have their OE direction set to output.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpio3v3SrcCtrlnibble based source control, this is a 12 bit containing 3 nibbles that will be set the source control.
Return values
MYKONOS_ERR_SET_GPIO_3V3_INV_SRC_CTRLgpio3v3 members have invalid value for the GPIO3v3 source control mode.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpioDrv()

mykonosGpioErr_t MYKONOS_setGpioDrv ( mykonosDevice_t device,
uint32_t  gpioDrv 
)

This function sets the drive strength for the required GPIOs.

This function will set the required drive strength, the settings for GPIO drive strength are normal drive and double drive.

GPIO pins that can be assigned independent drive strength are: -MYKGPIO0 to MYKGPIO7 and MYKGPIO18

The rest of GPIOs are paired as: -MYKGPIO17 and MYKGPIO16 -MYKGPIO8 and MYKGPIO15 -MYKGPIO14 and MYKGPIO13 -MYKGPIO10 and MYKGPIO9 -MYKGPIO12 and MYKGPIO11

This means that if it is required to double the drive strength for MYKGPIO17 then the drive strength will also be doubled for MYKGPIO16.

If the particular bitfield for gpioDrv is set then the drive strength will be doubled. Note that multiple GPIOs can be set at a time.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioDrvGPIO drive strength setup, valid range is from 0x00000 to 0x7FFFF.
Return values
MYKONOS_ERR_GPIO_DRV_INV_PARAMGPIO out of range- valid GPIOs are in the range 0x00000 to 0x7FFFF.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpioMonitorOut()

mykonosGpioErr_t MYKONOS_setGpioMonitorOut ( mykonosDevice_t device,
uint8_t  monitorIndex,
uint8_t  monitorMask 
)

This API function configures the monitor output function for the GPIOs.

The monitor outputs are grouped in set of nibbles, the user can set individual nibbles for having the monitor output function across the available GPIO. In order to enable the GPIO monitor function the function setupGpio has to be run and the structure should have the proper setup:

  • device->auxIo->gpio->gpioOe = 0xXXXFF the first D7:D0 GPIOs will have the output enable
  • device->auxIo->gpio->gpioSrcCtrl3_0 = GPIO_MONITOR_MODE
  • device->auxIo->gpio->gpioSrcCtrl4_7 = GPIO_MONITOR_MODE

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio->gpioOe
  • device->auxIo->gpio->gpioSrcCtrl3_0
  • device->auxIo->gpio->gpioSrcCtrl4_7
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
monitorIndexwhich will be the index at which the outputs are going to be set. see table in documentation
monitorMaskwhich GPIO outputs are going to active, the available GPIO bit 0 will represent MYKGPIO0 and bit 7 will represent MYKGPIO7.
Return values
MYKONOS_ERR_MONITOR_OUT_INDEX_RANGEif GPIO Monitor output index is not in table
MYKONOS_ERR_EN_MONITOR_OUT_NOT_ENABLEDif GPIO source control not set for Monitor output
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpioOe()

mykonosGpioErr_t MYKONOS_setGpioOe ( mykonosDevice_t device,
uint32_t  gpioOutEn,
uint32_t  gpioUsedMask 
)

Sets the Mykonos low voltage GPIO output pins direction.

This function will set the GPIO direction given by the passed parameter, the direction can be either output or input. The gpioUsedMask parameter allows the function to only affect the GPIO pins of interest.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio->gpioOe
Parameters
deviceis a pointer to the device settings structure
gpioOutEn(valid range 0 - 0x07FFFF), bit per GPIO pin, the direction is
gpioOutEn[bit] GPIO[bit] direction
0 input
1 output
Parameters
gpioUsedMaskMask used to control which Oe bits are set/cleared. If mask bit =1, that bit will be modified by gpioOutEn bit
Return values
MYKONOS_ERR_GPIO_OE_INV_PARAMIf the Output enable parameter is invalid
MYKONOS_ERR_GPIO_OKFunction completed successfully
Here is the caller graph for this function:

◆ MYKONOS_setGpioPinLevel()

mykonosGpioErr_t MYKONOS_setGpioPinLevel ( mykonosDevice_t device,
uint32_t  gpioPinLevel 
)

Sets the Mykonos low voltage GPIO output pins level.

This function will only affect the GPIO pins that have their OE direction set to output and that have the correct source control for the nibbles in GPIO_BITBANG_MODE

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioPinLevelbit per GPIO pin, level to output for each GPIO pin. 0 = low output, 1= high output
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpioSlewRate()

mykonosGpioErr_t MYKONOS_setGpioSlewRate ( mykonosDevice_t device,
mykonosGpioSelect_t  gpioSelect,
mykonosGpioSlewRate_t  slewRate 
)

This function sets the slew rate for the required GPIOs.

This function will set the required slew rate, the settings for GPIO slew rate are given by the enumeration type mykonosGpioSlewRate_t.

GPIO pins that can be assigned independent slew rate are: -MYKGPIO0 to MYKGPIO7 and MYKGPIO18

The rest of GPIOs are paired as: -MYKGPIO17 and MYKGPIO16 -MYKGPIO8 and MYKGPIO15 -MYKGPIO14 and MYKGPIO13 -MYKGPIO10 and MYKGPIO9 -MYKGPIO12 and MYKGPIO11

This means that if it is required to set the slew rate for MYKGPIO17 then the same slew rate will be applied for MYKGPIO16.

If the particular bitfield for gpioSelect is set then slewRate will be set for that GPIO. Note that multiple GPIOs can be set at a time.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioSelectGPIO for which the slew rate will be changed, valid range 0x00000 to 0x7FFFF.
slewRateslew rate setting, valid slew rate settings are given by the enumeration type mykonosGpioSlewRate_t
Return values
MYKONOS_ERR_GPIO_SLEW_RATE_INV_PARAMGPIO out of range- valid GPIOs are in the range 0x00000 to 0x7FFFF.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setGpioSourceCtrl()

mykonosGpioErr_t MYKONOS_setGpioSourceCtrl ( mykonosDevice_t device,
uint32_t  gpioSrcCtrl 
)

Sets the Mykonos GPIO source control for different GPIO functionality.

This function will only affect the GPIO pins that have their OE direction set to output.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gpioSrcCtrlnibble based source control, this is a 32 bit containing 5 nibbles that will be set the source control.
Return values
MYKONOS_ERR_GPIO_SRC_PARAM_INVIf the source control parameter is invalid
MYKONOS_ERR_GPIO_OKFunction completed successfully
Here is the caller graph for this function:

◆ MYKONOS_setObsRxAgcEnSyncPin()

mykonosGpioErr_t MYKONOS_setObsRxAgcEnSyncPin ( mykonosDevice_t device,
mykonosGpioSelect_t  obsRxAgcSyncPin 
)

This API function set the pins for AGC gain Sync control.

In order to call this function the gain mode should be set to AGC mode. The AGC gain sync will be controlled with the selected GPIO pin: A pulse on the 'obsRxGainChangePin' in hybrid pin control will enable the AGC gain change for observation channel

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
obsRxAgcSyncPinGPIO pin that will be used for AGC sync gain control, the available pins for observation channel are: MYKGPIO6 MYKGPIO10 MYKGPIO17 MYKGPIONAN for none selected
Return values
MYKONOS_ERR_OBS_GAIN_CONTROL_NOT_AGCif the observation gain control mode is not set to AGC
MYKONOS_ERR_GPIO_AGC_SYNC_ORX_PINif invalid pin has been passed for ORX AGC sync gain control.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setObsRxGainCompensation()

mykonosGpioErr_t MYKONOS_setObsRxGainCompensation ( mykonosDevice_t device,
mykonosObsRxGainComp_t gainComp,
uint8_t  enable 
)

Gain compensation enable and setup function for the observation channel.

The gain compensation block is a function that compensates for the attenuation in the internal attenuator for the observation channels.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gainCompis a pointer to the mykonosObsRxGainComp_t structure.
enableenables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_OBS_RX_GAINCOMP_SET_NULL_STRUCTgain compensation structure gainComp is not initialised
MYKONOS_ERR_OBS_RX_GAINCOMP_INV_OFFSETgain compensation structure gainComp->obsRxOffset is invalid
MYKONOS_ERR_OBS_RX_GAINCOMP_INV_STEPgain compensation structure gainComp->compStep is invalid
MYKONOS_ERR_OBS_RX_GAINCOMP_INV_ENenable is not valid
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setObsRxHybridGainChangePin()

mykonosGpioErr_t MYKONOS_setObsRxHybridGainChangePin ( mykonosDevice_t device,
mykonosGpioSelect_t  obsRxGainChangePin 
)

This API function set the pins for hybrid gain control.

In order to call this function the gain mode should be set to Hybrid. The AGC gain change will be controlled with the selected GPIO pin: A pulse on the 'obsRxGainChangePin' in hybrid pin control will enable the AGC gain change for observation channel

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
obsRxGainChangePinGPIO pin that will be used for hybrid gain change control, the available pins for observation channel hybrid control are: MYKGPIO6 MYKGPIO10 MYKGPIO17 MYKGPIONAN for none selected
Return values
MYKONOS_ERR_AGC_OBS_NOT_IN_HYBRIDif the observation gain mode is not set to Hybrid
MYKONOS_ERR_GPIO_HYBRID_ORX_PINif invalid pin has been passed for ORX hybrid gain control.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setObsRxSlicerCtrl()

mykonosGpioErr_t MYKONOS_setObsRxSlicerCtrl ( mykonosDevice_t device,
uint8_t  slicerStep,
mykonosObsRxSlicer_t  obsRxPins,
uint8_t  enable 
)

Slicer control over GPIO inputs for the observation channel.

The user can control the slicer position via 3 GPIO inputs for the observation channel. There are various configurations for the GPIO pins, this configurations are enumerated in the mykonosObsRxSlicer_t.

Dependencies

  • device->spiSettings->chipSelectIndex
  • Gain compensation block has to be enabled in order to user the slicer control
Parameters
deviceis a pointer to the device settings structure
slicerStepconfigures the step size of the slicer when external pin contol mode is enabled. Slicer gain in this mode is determined by multiplying the step size by the input bit code from the BBP. Step sizes are as follows:
sllicerStep step
0 1
1 2
2 3
3 4
obsRxPinsobservation slicer inputs can take values from one of the following combinations that are specified in mykonosObsRxSlicer_t enum: -GPIO_18, GPIO_17 and GPIO_16 -GPIO_16, GPIO_15 and GPIO_14
enableenables the external pin control mode so the BBP can control the slicer setting. enable = 1 disable = 0
Return values
MYKONOS_ERR_SLICER_INV_OBS_RX_SELinvalid observation channel GPIO pin selection for Slicer control
MYKONOS_ERR_SLICER_OBS_RX_STEP_OUT_OF_RANGEslicer step is out of range
MYKONOS_ERR_SLICER_OBS_RX_EN_INVinvalid enable
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setOrxEnFloatPntFrmt()

mykonosGpioErr_t MYKONOS_setOrxEnFloatPntFrmt ( mykonosDevice_t device,
uint8_t  orxAtt,
uint8_t  enable 
)

Floating point formatter enable function for ORx channel.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range which increases the bit-width in the digital data-path.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
orxAttthis parameter sets the integer data attenuation for the ORx channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
enablethis parameter enables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_INV_ORXATTnot valid Orx attenuation parameter passed in MYKONOS_setOrxEnFloatPntFrmt()
MYKONOS_ERR_FLOATFRMT_INV_ORXENnot valid enable parameter passed in MYKONOS_setOrxEnFloatPntFrmt()

◆ MYKONOS_setRx1GainCtrlPin()

mykonosGpioErr_t MYKONOS_setRx1GainCtrlPin ( mykonosDevice_t device,
uint8_t  incStep,
uint8_t  decStep,
mykonosGpioSelect_t  rx1GainIncPin,
mykonosGpioSelect_t  rx1GainDecPin,
uint8_t  enable 
)

This API function configures the GPIO inputs for controlling RX gain.

This API function configures the GPIO input pin and step size to allow the BBP to control gain changes in Rx1 signal chain. A high pulse on the 'rx1GainIncPin' in pin control mode will increment the gain by the value set in incStep'. A high pulse on the 'rx1GainDecPin' in pin control mode will decrement the gain by the value set in 'decStep'. Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
incStepThis sets the change (increase) in gain index that is applied when the increment gain pin (in MGC pin control mode) is pulsed.
decStepThis configures the decrement in gain index that should be applied when the decrement gain pin (in MGC pin control mode) is pulsed.
rx1GainIncPinmykonosGpioSelect_t These bits select the GPIO used as the enable for the Rx1 Manual Increment gain input according to the following: MYKGPIO0 or MYKGPIO10
rx1GainDecPinmykonosGpioSelect_t These bits select the GPIO used as the enable for the Rx1 Manual Decrement gain input according to the following: MYKGPIO1 or MYKGPIO11
enable0 = Disable the gain pin control for Rx1 1 = enable the gain pin control for Rx1
Return values
MYKONOS_ERR_MGCRX1_STEP_INV_PARAMif an invalid step size has been passed
MYKONOS_ERR_MGCRX1_GPIO_INCPIN_INV_PARAMif invalid increment pin has been passed
MYKONOS_ERR_MGCRX1_GPIO_DECPIN_INV_PARAMif invalid decrement pin has been passed
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setRx2GainCtrlPin()

mykonosGpioErr_t MYKONOS_setRx2GainCtrlPin ( mykonosDevice_t device,
uint8_t  incStep,
uint8_t  decStep,
mykonosGpioSelect_t  rx2GainIncPin,
mykonosGpioSelect_t  rx2GainDecPin,
uint8_t  enable 
)

This API function configures the GPIO inputs for controlling RX gain.

This API function configures the GPIO input pin and step size to allow the BBP to control gain changes in Rx2 signal chain. A high pulse on the 'rx2GainIncPin' in pin control mode will increment the gain by the value set in incStep'. A high pulse on the 'rx2GainDecPin' in pin control mode will decrement the gain by the value set in 'decStep'.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
incStepThis sets the change (increase) in gain index that is applied when the increment gain pin (in MGC pin control mode) is pulsed.
decStepThis configures the decrement in gain index that should be applied when the decrement gain pin (in MGC pin control mode) is pulsed.
rx2GainIncPinmykonosGpioSelect_t These bits select the GPIO used as the enable for the Rx2 Manual Increment gain input according to the following: MYKGPIO3 or MYKGPIO13
rx2GainDecPinmykonosGpioSelect_t These bits select the GPIO used as the enable for the Rx2 Manual Decrement gain input according to the following: MYKGPIO4 or MYKGPIO14
enable0 = Disable the gain pin control for Rx2 1 = enable the gain pin control for Rx2
Return values
MYKONOS_ERR_MGCRX2_STEP_INV_PARAMif an invalid step size is passed
MYKONOS_ERR_MGCRX2_GPIO_INCPIN_INV_PARAMif invalid increment pin has been passed
MYKONOS_ERR_MGCRX2_GPIO_DECPIN_INV_PARAMif invalid decrement pin has been passed
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setRxAgcEnSyncPin()

mykonosGpioErr_t MYKONOS_setRxAgcEnSyncPin ( mykonosDevice_t device,
mykonosGpioSelect_t  rx1AgcSyncPin,
mykonosGpioSelect_t  rx2AgcSyncPin 
)

This API function set the pins for sync AGC gain control.

In order to call this function the RX gain control should be set to AGC mode. The AGC gain sync will be controlled with the selected GPIO pin: A pulse on the 'rx1AgcSyncPin' in hybrid pin control will enable the AGC gain sync for RX1 A pulse on the 'rx2AgcSyncPin' in hybrid pin control will enable the AGC gain sync for RX2

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
rx1AgcSyncPinGPIO pin that will be used for AGC sync gain control, the available pins for RX1 channel are: MYKGPIO1 MYKGPIO10 MYKGPIO11 MYKGPIONAN for no GPIO selected
rx2AgcSyncPinGPIO pin that will be used for AGC sync gain control, the available pins for RX2 channel are: MYKGPIO4 MYKGPIO10 MYKGPIO13 MYKGPIONAN for no GPIO selected
Return values
MYKONOS_ERR_GAIN_CONTROL_NOT_AGCif the RX gain control mode is not set to AGC.
MYKONOS_ERR_GPIO_AGC_SYNC_RX1_PINif invalid pin has been passed for RX1 AGC sync gain control.
MYKONOS_ERR_GPIO_AGC_SYNC_RX2_PINif invalid pin has been passed for RX2 AGC sync gain control.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setRxEnFloatPntFrmt()

mykonosGpioErr_t MYKONOS_setRxEnFloatPntFrmt ( mykonosDevice_t device,
uint8_t  rx1Att,
uint8_t  rx2Att,
uint8_t  enable 
)

Floating point formatter enable/disable Rx1 and Rx2 function.

The floating point formatter block is a function that works in conjunction with the gain compensating block, as the gain compensation requires increased dynamic range which increases the bit-width in the digital data-path.

Dependencies

  • device->spiSettings->chipSelectIndex
  • Gain compensation block has to be enabled in order to user floating point formatter
Parameters
deviceis a pointer to the device settings structure
rx1Attthis parameter sets the integer data attenuation for the Rx1 channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
rx2Attthis parameter sets the integer data attenuation for the Rx2 channel in 6dB steps to enable the entire data range to be represented in the selected floating point format.
enablethis parameter enables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_FLOATFRMT_SET_INV_RX1ATTnot valid rx1 attenuation parameter passed in MYKONOS_setRxEnFloatPntFrmt()
MYKONOS_ERR_FLOATFRMT_SET_INV_RX2ATTnot valid rx2 attenuation parameter passed in MYKONOS_setRxEnFloatPntFrmt()
MYKONOS_ERR_FLOATFRMT_SET_INV_ENnot valid enable parameter passed in MYKONOS_setRxEnFloatPntFrmt()

◆ MYKONOS_setRxGainCompensation()

mykonosGpioErr_t MYKONOS_setRxGainCompensation ( mykonosDevice_t device,
mykonosGainComp_t gainComp,
uint8_t  enable 
)

Gain compensation enable and setup function.

The gain compensation block is a function that compensates for the attenuation in the internal attenuator for the Rx channels.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
gainCompwhich is a mykonosGainComp_t structure.
enablethis parameter enables or disables the gain compensation block. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_GAINCOMP_SET_NULL_STRUCTgain compensation structure gainComp is not initialised
MYKONOS_ERR_GAINCOMP_INV_RX1_OFFSETgain compensation structure gainComp->rx1Offset is invalid
MYKONOS_ERR_GAINCOMP_INV_RX2_OFFSETgain compensation structure gainComp->rx2Offset is invalid
MYKONOS_ERR_GAINCOMP_INV_STEPgain compensation structure gainComp->compStep is invalid
MYKONOS_ERR_GAINCOMP_INV_ENenable is not valid

◆ MYKONOS_setRxHybridGainChangePin()

mykonosGpioErr_t MYKONOS_setRxHybridGainChangePin ( mykonosDevice_t device,
mykonosGpioSelect_t  rx1GainChangePin,
mykonosGpioSelect_t  rx2GainChangePin 
)

This API function set the pins for hybrid gain control.

In order to call this function the gain mode should be set to Hybrid. The AGC gain change will be controlled with the selected GPIO pin: A pulse on the 'rx1GainChangePin' in hybrid pin control will enable the AGC gain change for RX1 A pulse on the 'rx2GainChangePin' in hybrid pin control will enable the AGC gain change for RX2

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
rx1GainChangePinGPIO pin that will be used for hybrid gain change control, the available pins for RX1 channel hybrid control are: MYKGPIO1 MYKGPIO10 MYKGPIO11 MYKGPIONAN for no GPIO selected
rx2GainChangePinGPIO pin that will be used for hybrid gain change control, the available pins for RX2 channel hybrid control are: MYKGPIO4 MYKGPIO10 MYKGPIO13 MYKGPIONAN for no GPIO selected
Return values
MYKONOS_ERR_GAIN_CONTROL_NOT_HYBRIDif gain control is not hybrid
MYKONOS_ERR_GPIO_HYBRID_RX1_PINif invalid pin has been passed for RX1 hybrid gain control.
MYKONOS_ERR_GPIO_HYBRID_RX2_PINif invalid pin has been passed for RX2 hybrid gain control.
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setRxSlicerCtrl()

mykonosGpioErr_t MYKONOS_setRxSlicerCtrl ( mykonosDevice_t device,
uint8_t  slicerStep,
mykonosRxSlicer_t  rx1Pins,
mykonosRxSlicer_t  rx2Pins,
uint8_t  enable 
)

Slicer control over GPIO inputs.

The user can control the slicer position via 3 GPIO inputs per channel. There are various configurations for the GPIO pins, this configurations are enumerated in the mykonosRxSlicer_t.

Dependencies

  • device->spiSettings->chipSelectIndex
  • Gain compensation block has to be enabled in order to user the slicer control
Parameters
deviceis a pointer to the device settings structure
slicerStepconfigures the step size of the slicer when external pin contol mode is enabled. Slicer gain in this mode is determined by multiplying the step size by the input bit code from the BBP. Step sizes are as follows:
sllicerStep step
0 1
1 2
2 3
3 4
rx1PinsRx1 slicer inputs can take values from one of the following combinations that are specified in mykonosRxSlicer_t enum: -GPIO_2, GPIO_1, and GPIO_0 -GPIO_7, GPIO_6, and GPIO_5 -GPIO_10, GPIO_9, and GPIO_8
rx2PinsRx2 slicer inputs can take values from one of the following combinations that are specified in mykonosRxSlicer_t enum: -GPIO_7, GPIO_6, and GPIO_5 -GPIO_13, GPIO_12, and GPIO_11
enablethis parameter enables the external pin control mode so the BBP can control the slicer setting. enable = 1 disable = 0
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SLICER_INV_RX1_SELinvalid RX1 GPIO pin selection for Slicer control
MYKONOS_ERR_SLICER_INV_RX2_SELinvalid RX2 GPIO pin selection for Slicer control
MYKONOS_ERR_SLICER_STEP_OUT_OF_RANGEslicer step is out of range
MYKONOS_ERR_SLICER_EN_INVinvalid enable

◆ MYKONOS_setTx1AttenCtrlPin()

mykonosGpioErr_t MYKONOS_setTx1AttenCtrlPin ( mykonosDevice_t device,
uint8_t  stepSize,
mykonosGpioSelect_t  tx1AttenIncPin,
mykonosGpioSelect_t  tx1AttenDecPin,
uint8_t  enable,
uint8_t  useTx1ForTx2 
)

This API function configures the GPIO inputs for controlling Tx attenuation settings.

This allows to control the TX attenuation using GPIO inputs. When a low to high transition is applied to the configure GPIO input the attenuation will change by the desire step. The stepSize parameter will set the attenuation change applied.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
stepSizethe step that will increase or decrease the Tx1 channel attenuation. This parameter sets the change in Tx attenuation for each increment or decrement signal received in incr/decr mode. Step of 1 changes attenuation by 0.05dB.
tx1AttenIncPinThis parameter is the GPIO pin configuration that will be controlling the increment of Tx attenuation. Available pins are: Tx1 increment: MYKGPIO4 or MYKGPIO12
tx1AttenDecPinThis parameter is the GPIO pin configuration that will be controlling the decrement of Tx attenuation. Available pins are: Tx1 decrement: MYKGPIO5 or MYKGPIO13
enable0 = Disable the attenuation pin control for Tx1 1 = enable the attenuation pin control for Tx1
useTx1ForTx2is used to return if TX1 settings are used for TX2 channel.
Return values
MYKONOS_ERR_TPCTX1_GPIO_STEP_INV_PARAMif an invalid step size is passed
MYKONOS_ERR_TPCTX1_GPIO_INCPIN_INV_PARAMif an invalid channel for TX is passed
MYKONOS_ERR_TPCTX1_GPIO_DECPIN_INV_PARAMif an invalid channel for TX is passed
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setTx2AttenCtrlPin()

mykonosGpioErr_t MYKONOS_setTx2AttenCtrlPin ( mykonosDevice_t device,
uint8_t  stepSize,
mykonosGpioSelect_t  tx2AttenIncPin,
mykonosGpioSelect_t  tx2AttenDecPin,
uint8_t  enable 
)

This API function configures the GPIO inputs for controlling Tx attenuation settings.

This allows to control the TX attenuation using GPIO inputs. when a low to high transition is applied to the configure GPIO input the attenuation will change by the desire step. The stepSize parameter will set the attenuation change applied.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the Mykonos data structure containing settings
stepSizethe step that will increase or decrease the Tx2 channel attenuation. This parameter sets the change in Tx attenuation for each increment or decrement signal received in incr/decr mode. Step of 1 changes attenuation by 0.05dB.
tx2AttenIncPinThis parameter is the GPIO pin configuration that will be controlling the increment of Tx attenuation. Available pins are: Tx2 increment: MYKGPIO6 or MYKGPIO14
tx2AttenDecPinThis parameter is the GPIO pin configuration that will be controlling the decrement of Tx attenuation. Available pins are: Tx2 decrement: MYKGPIO7 or MYKGPIO15
enable0 = Disable the attenuation pin control for Tx2 1 = enable the attenuation pin control for Tx2
Return values
MYKONOS_ERR_TPCTX2_GPIO_STEP_INV_PARAMif an invalid step size is passed
MYKONOS_ERR_TPCTX2_GPIO_INCPIN_INV_PARAMif an invalid channel for TX is passed
MYKONOS_ERR_TPCTX2_GPIO_INCPIN_INV_PARAMif an invalid channel for TX is passed
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_setupAuxAdcs()

mykonosGpioErr_t MYKONOS_setupAuxAdcs ( mykonosDevice_t device,
uint8_t  adcDecimation,
uint8_t  enable 
)

Sets up the auxiliary ADC.

This function configures the AuxADC with the requested decimation. The AuxADC clock is set as close as possible to 40MHz. The AuxADC conversion time = (1/40Mhz) * decimation, where the decimation ranges from 256 AuxADC clock cycles to 32768 AuxADc clock cycles.

Note: The AuxADC is intended for relative measurements. Two back to back measurements can allow a delta measurement with 12bit resolution. If absolute measurements are required, an accurate reference should be first measured on AuxADC0 input and used to calibrate the offset/gain error of the AuxADC. The reference would need to be measured before each measurement to account for measurement variations caused by the transmitter/receiver transients as other circuits in the device are being powered up/down.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
devicePointer to the device settings structure
adcDecimationADC decimation factor (0-7). Decimates by 256 * 2^(adcDecimation) ADC clock cycles.
enableStop/run ADC (0/1)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SETUPAUXADC_INV_VCODIVCLKPLL VCO divider is invalid - Check CLKPLL setup
MYKONOS_ERR_INV_AUX_ADC_DEC_PARMAuxADC decimation out of range (valid 0-7)

◆ MYKONOS_setupAuxDacs()

mykonosGpioErr_t MYKONOS_setupAuxDacs ( mykonosDevice_t device)

Sets up the 10 AuxDACs on the Mykonos device.

This function uses the configuration in the Mykonos device data structure AuxIO substructure to setup which of the ten AuxDACs are enabled, their slope, Vref(mid point) and their initial DAC code.

This function can be called any time after MYKONOS_initialize() to reconfigure, enable, disable the different AuxDAC outputs. The AuxDACs are used in manual control mode. After calling this setup function, it is possible to change a particular AuxDAC code by calling the writeAuxDac() function.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->auxDacEnable: 1= enabled, 0 = disabled
  • device->auxIo->auxDacSlope[i]: 0 = 1.404mv/code, 1= 0.702mV/code
  • device->auxIo->auxDacVref: 0 = 1v midpoint, 1 = 1.5v midpoint, 2 = 2v midpoint, 3 = 2.5v midpoint
  • device->auxIo->auxDacValue[i]: 10bit DAC code (0-1023)
Parameters
deviceis a pointer to the device settings structure
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SETUPAUXDAC_NULL_PARAMdevice->auxIo structure has a NULL pointer
MYKONOS_ERR_SETUPAUXDAC_INV_AUXDACCODEauxDAC code is out of range (valid 0-1023)

◆ MYKONOS_setupGpio()

mykonosGpioErr_t MYKONOS_setupGpio ( mykonosDevice_t device)

Sets the Mykonos low voltage GPIO configuration registers.

Sets the low voltage GPIO pin direction for each low voltage GPIO pin and sets the source control mode (feature) for each group of 4 GPIO pins.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio - all members
Parameters
deviceis a pointer to the device settings structure
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SET_GPIO_1V8_INV_POINTERdevice->auxIo->gpio pointer is NULL
MYKONOS_ERR_SET_GPIO_1V8_INV_MODEgpio structure members have invalid enum value for the GPIO source control mode.

◆ MYKONOS_setupGpio3v3()

mykonosGpioErr_t MYKONOS_setupGpio3v3 ( mykonosDevice_t device)

Sets the Mykonos 3.3 VDC GPIO configuration registers.

This function sets the GPIO 3.3v pin direction (1=output, 0=input) and sets the mode of each nibble of GPIO 3.3v pins. See the mykonosGpio3v3Mode_t enum for possible modes.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->gpio3v3 - all members
Parameters
deviceis a pointer to the device settings structure
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_SET_GPIO_3V3_INV_POINTERdevice->auxIo->gpio3v3 pointer is NULL
MYKONOS_ERR_SET_GPIO_3V3_INV_MODEgpio3v3 members have invalid enum value for the GPIO3v3 source control mode.

◆ MYKONOS_setupTempSensor()

mykonosGpioErr_t MYKONOS_setupTempSensor ( mykonosDevice_t device,
mykonosTempSensorConfig_t tempSensor 
)

Sets up the Temperature Sensor.

Before using this function to set up the temp sensor, make sure that you call the MYKONOS_setupAuxADC() function to ensure that the AuxADC clock is setup and running correctly at 40 MHz, and that the structure mykonosTempSensorConfig_t tempSensor is populated.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
tempSensoris a pointer to the mykonosTempSensorConfig_t which holds the configuration settings for the temperature sensor
Return values
MYKONOS_ERR_SETUPTEMPSENSOR_NULL_PARAMFunction parameter tempSensor is a NULL pointer
MYKONOS_ERR_SETUPTEMPSENSOR_INV_TEMPDECIMATIONtempDecimation value out of range (0-7)
MYKONOS_ERR_SETUPTEMPSENSOR_INV_OFFSEToffset value out of range (0-255)
MYKONOS_ERR_SETUPTEMPSENSOR_INV_TEMPWINDOWtempWindow out of range (0-15)
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_spi2GpioSetup()

mykonosGpioErr_t MYKONOS_spi2GpioSetup ( mykonosDevice_t device,
uint8_t  enable,
uint8_t  updateTxAttenPinSelect 
)

This API function configures and enables the secondary SPI port.

This port allows control compatibility with BBPs that employ dual SPI ports. The GPIO mapping for the SPI2 is fixed:

SPI signal GPIO
CSB_2 GPIO 3
SCLK_2 GPIO 2
SDO_2 GPIO 1
SDO_2/SDI2 GPIO 0

The secondary SPI port only has a small subset of registers that affect the attenuation of the TX channels. It uses a fifth GPIO pin in order to decide which TxAttenuation word is active. The Tx Attenuation words in the 2nd SPI port are different than the first SPI port. On the 2nd SPI port, each transmitter has two Tx Attenuation words (an active word and an inactive word). The BBIC should write to the inactive TxAttenuation word. Then the fifth GPIO pin should be asserted to make the inactive TxAttenuation word active. This allows the BBIC to tightly control in real time when the TxAttenuation updates.

Dependencies

  • device->spiSettings
  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
enableThis is parameter will enable the secondary SPI port: 1 = enable, 0 = disable
updateTxAttenPinSelectThis parameter set the GPIO pin to be toggle for using the inactive attenuation words for both channels
tx update GPIO
0x00 GPIO 4
0x01 GPIO 8
0x02 GPIO 14
0x03 none selected
Return values
MYKONOS_ERR_SPI2_INV_GPIOif an invalid GPIO pin configuration is passed
MYKONOS_ERR_HAL_LAYERif HAL function error is passed
MYKONOS_ERR_OKFunction completed successfully

◆ MYKONOS_startTempMeasurement()

mykonosGpioErr_t MYKONOS_startTempMeasurement ( mykonosDevice_t device)

Initiates temperature measurement.

This function will initiate the Temperature sensor measurement.

Precondition
MYKONOS_setupTempSensor() function to set the temperature sensor. MYKONOS_setAuxAdcChannel() function with the AuxADC setting for Temperature sensor channel MYK_TEMPSENSOR from the enum type mykonosAuxAdcChannels_t.
Postcondition
Internal temperature sensor will perform measurement and updated register values, read back using MYKONOS_readTempSensor() function.

Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis a pointer to the device settings structure
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully

◆ MYKONOS_writeAuxDac()

mykonosGpioErr_t MYKONOS_writeAuxDac ( mykonosDevice_t device,
uint8_t  auxDacIndex,
uint16_t  auxDacCode 
)

Writes the current AuxDAC code for a particular AuxDAC.

This function updates the 10bit code that controls the AuxDAC output voltage. The auxDacCode is updated for the specified auxDAC. Also the auxDacCode is written to the device data structure for future reference.

Dependencies

  • device->spiSettings->chipSelectIndex
  • device->auxIo->auxDacValue[i]
Parameters
deviceis a pointer to the device settings structure
auxDacIndexAuxDAC to set the DAC code for (0-9)
auxDacCodeDAC code to update the AuxDAC to. Sets the output voltage of the DAC (valid 0-1023)
Return values
MYKONOS_ERR_GPIO_OKFunction completed successfully
MYKONOS_ERR_WRITEAUXDAC_INV_AUXDACCODEAuxDac code invalid (valid 0-1023)
MYKONOS_ERR_WRITEAUXDAC_INV_AUXDACINDEXAuxDAC index out of range (valid 0-9)
MYKONOS_ERR_WRITEAUXDAC_NULL_AUXIOdevice->auxIo has NULL pointer