no-OS
Functions | Variables
common.c File Reference

Contains Mykonos API common wrapper functions for user hardware platform drivers. More...

#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include "common.h"
#include "no_os_spi.h"
#include "spi_extra.h"
#include "gpio_extra.h"
#include "no_os_gpio.h"
#include "no_os_delay.h"
#include "parameters.h"
#include <xparameters.h>
Include dependency graph for common.c:

Functions

int32_t platform_init (void)
 Initialize the power controller and set the core and peripherals clock divider. More...
 
int32_t platform_remove (void)
 
commonErr_t CMB_closeHardware (void)
 
commonErr_t CMB_setGPIO (uint32_t GPIO)
 
commonErr_t CMB_hardReset (uint8_t spiChipSelectIndex)
 
commonErr_t CMB_setSPIOptions (spiSettings_t *spiSettings)
 
commonErr_t CMB_setSPIChannel (uint16_t chipSelectIndex)
 
commonErr_t CMB_SPIWriteByte (spiSettings_t *spiSettings, uint16_t addr, uint8_t data)
 
commonErr_t CMB_SPIWriteBytes (spiSettings_t *spiSettings, uint16_t *addr, uint8_t *data, uint32_t count)
 
commonErr_t CMB_SPIReadByte (spiSettings_t *spiSettings, uint16_t addr, uint8_t *readdata)
 
commonErr_t CMB_SPIWriteField (spiSettings_t *spiSettings, uint16_t addr, uint8_t field_val, uint8_t mask, uint8_t start_bit)
 
commonErr_t CMB_SPIReadField (spiSettings_t *spiSettings, uint16_t addr, uint8_t *field_val, uint8_t mask, uint8_t start_bit)
 
commonErr_t CMB_writeToLog (ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
 
commonErr_t CMB_openLog (const char *filename)
 
commonErr_t CMB_closeLog (void)
 
commonErr_t CMB_flushLog (void)
 
commonErr_t CMB_wait_ms (uint32_t time_ms)
 
commonErr_t CMB_wait_us (uint32_t time_us)
 
commonErr_t CMB_setTimeout_ms (uint32_t timeOut_ms)
 
commonErr_t CMB_setTimeout_us (uint32_t timeOut_us)
 
commonErr_t CMB_hasTimeoutExpired ()
 
commonErr_t CMB_regRead (uint32_t offset, uint32_t *data)
 
commonErr_t CMB_regWrite (uint32_t offset, uint32_t data)
 
commonErr_t CMB_memRead (uint32_t offset, uint32_t *data, uint32_t len)
 
commonErr_t CMB_memWrite (uint32_t offset, uint32_t *data, uint32_t len)
 

Variables

ADI_LOGLEVEL CMB_LOGLEVEL = ADIHAL_LOG_NONE
 
struct no_os_spi_descspi_ad_desc
 
struct no_os_gpio_descgpio_ad9371_resetb
 
struct no_os_gpio_descgpio_ad9528_resetb
 
struct no_os_gpio_descgpio_ad9528_sysref_req
 

Detailed Description

Contains Mykonos API common wrapper functions for user hardware platform drivers.

Function Documentation

◆ CMB_closeHardware()

commonErr_t CMB_closeHardware ( void  )

◆ CMB_closeLog()

commonErr_t CMB_closeLog ( void  )

◆ CMB_flushLog()

commonErr_t CMB_flushLog ( void  )

◆ CMB_hardReset()

commonErr_t CMB_hardReset ( uint8_t  spiChipSelectIndex)
Here is the caller graph for this function:

◆ CMB_hasTimeoutExpired()

commonErr_t CMB_hasTimeoutExpired ( )
Here is the caller graph for this function:

◆ CMB_memRead()

commonErr_t CMB_memRead ( uint32_t  offset,
uint32_t *  data,
uint32_t  len 
)

◆ CMB_memWrite()

commonErr_t CMB_memWrite ( uint32_t  offset,
uint32_t *  data,
uint32_t  len 
)

◆ CMB_openLog()

commonErr_t CMB_openLog ( const char *  filename)

◆ CMB_regRead()

commonErr_t CMB_regRead ( uint32_t  offset,
uint32_t *  data 
)

◆ CMB_regWrite()

commonErr_t CMB_regWrite ( uint32_t  offset,
uint32_t  data 
)

◆ CMB_setGPIO()

commonErr_t CMB_setGPIO ( uint32_t  GPIO)

◆ CMB_setSPIChannel()

commonErr_t CMB_setSPIChannel ( uint16_t  chipSelectIndex)

◆ CMB_setSPIOptions()

commonErr_t CMB_setSPIOptions ( spiSettings_t spiSettings)

◆ CMB_setTimeout_ms()

commonErr_t CMB_setTimeout_ms ( uint32_t  timeOut_ms)
Here is the caller graph for this function:

◆ CMB_setTimeout_us()

commonErr_t CMB_setTimeout_us ( uint32_t  timeOut_us)
Here is the caller graph for this function:

◆ CMB_SPIReadByte()

commonErr_t CMB_SPIReadByte ( spiSettings_t spiSettings,
uint16_t  addr,
uint8_t *  readdata 
)
Here is the caller graph for this function:

◆ CMB_SPIReadField()

commonErr_t CMB_SPIReadField ( spiSettings_t spiSettings,
uint16_t  addr,
uint8_t *  field_val,
uint8_t  mask,
uint8_t  start_bit 
)
Here is the caller graph for this function:

◆ CMB_SPIWriteByte()

commonErr_t CMB_SPIWriteByte ( spiSettings_t spiSettings,
uint16_t  addr,
uint8_t  data 
)
Here is the caller graph for this function:

◆ CMB_SPIWriteBytes()

commonErr_t CMB_SPIWriteBytes ( spiSettings_t spiSettings,
uint16_t *  addr,
uint8_t *  data,
uint32_t  count 
)
Here is the caller graph for this function:

◆ CMB_SPIWriteField()

commonErr_t CMB_SPIWriteField ( spiSettings_t spiSettings,
uint16_t  addr,
uint8_t  field_val,
uint8_t  mask,
uint8_t  start_bit 
)
Here is the caller graph for this function:

◆ CMB_wait_ms()

commonErr_t CMB_wait_ms ( uint32_t  time_ms)
Here is the caller graph for this function:

◆ CMB_wait_us()

commonErr_t CMB_wait_us ( uint32_t  time_us)

◆ CMB_writeToLog()

commonErr_t CMB_writeToLog ( ADI_LOGLEVEL  level,
uint8_t  deviceIndex,
uint32_t  errorCode,
const char *  comment 
)
Here is the caller graph for this function:

◆ platform_init()

int32_t platform_init ( void  )

Initialize the power controller and set the core and peripherals clock divider.

Returns
0 in case of success or error code otherwise.

◆ platform_remove()

int32_t platform_remove ( void  )

Variable Documentation

◆ CMB_LOGLEVEL

ADI_LOGLEVEL CMB_LOGLEVEL = ADIHAL_LOG_NONE

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.

◆ gpio_ad9371_resetb

struct no_os_gpio_desc* gpio_ad9371_resetb

◆ gpio_ad9528_resetb

struct no_os_gpio_desc* gpio_ad9528_resetb

◆ gpio_ad9528_sysref_req

struct no_os_gpio_desc* gpio_ad9528_sysref_req

◆ spi_ad_desc

struct no_os_spi_desc* spi_ad_desc