no-OS
Classes | Macros | Enumerations | Functions | Variables
common.h File Reference

Contains type definitions and prototype declarations for common.c. More...

#include "stdint.h"
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  spiSettings_t
 Data structure to hold SPI settings for all system device types. More...
 

Macros

#define THROW_ERROR()
 
#define SPIARRAYSIZE   1024
 
#define SPIARRAYTRIPSIZE   ((SPIARRAYSIZE / 3) * 3)
 

Enumerations

enum  ADI_ERR {
  ADIERR_OK = 0,
  ADIERR_INV_PARM,
  ADIERR_FAILED
}
 
enum  commonErr_t {
  COMMONERR_OK = 0,
  COMMONERR_FAILED
}
 
enum  ADI_LOGLEVEL {
  ADIHAL_LOG_NONE = 0x0,
  ADIHAL_LOG_MESSAGE = 0x1,
  ADIHAL_LOG_WARNING = 0x2,
  ADIHAL_LOG_ERROR = 0x4,
  ADIHAL_LOG_SPI = 0x8,
  ADIHAL_LOG_AXI_REG = 0x10,
  ADIHAL_LOG_AXI_MEM = 0x20,
  ADIHAL_LOG_ALL = 0x3F
}
 

Functions

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_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_openLog (const char *filename)
 
commonErr_t CMB_closeLog (void)
 
commonErr_t CMB_writeToLog (ADI_LOGLEVEL level, uint8_t deviceIndex, uint32_t errorCode, const char *comment)
 
commonErr_t CMB_flushLog (void)
 
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)
 
int32_t platform_init (void)
 Initialize the power controller and set the core and peripherals clock divider. More...
 
int32_t platform_remove (void)
 

Variables

ADI_LOGLEVEL CMB_LOGLEVEL
 

Detailed Description

Contains type definitions and prototype declarations for common.c.

Macro Definition Documentation

◆ SPIARRAYSIZE

#define SPIARRAYSIZE   1024

◆ SPIARRAYTRIPSIZE

#define SPIARRAYTRIPSIZE   ((SPIARRAYSIZE / 3) * 3)

◆ THROW_ERROR

#define THROW_ERROR ( )

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.

Enumeration Type Documentation

◆ ADI_ERR

enum ADI_ERR
Enumerator
ADIERR_OK 
ADIERR_INV_PARM 
ADIERR_FAILED 

◆ ADI_LOGLEVEL

Enumerator
ADIHAL_LOG_NONE 
ADIHAL_LOG_MESSAGE 
ADIHAL_LOG_WARNING 
ADIHAL_LOG_ERROR 
ADIHAL_LOG_SPI 
ADIHAL_LOG_AXI_REG 
ADIHAL_LOG_AXI_MEM 
ADIHAL_LOG_ALL 

◆ commonErr_t

Enumerator
COMMONERR_OK 
COMMONERR_FAILED 

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.
Here is the caller graph for this function:

◆ platform_remove()

int32_t platform_remove ( void  )

Variable Documentation

◆ CMB_LOGLEVEL

ADI_LOGLEVEL CMB_LOGLEVEL

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.