no-OS
|
#include "ADRV9025_stream_image.h"
#include "ActiveUtilInit_profile.h"
#include "ActiveUseCase_profile.h"
#include "ADRV9025_TxAttenTable.h"
#include "ADRV9025_RxGainTable.h"
#include "ADRV9025_DPDCORE_FW.h"
#include "adi_common_error.h"
#include "no_os_print_log.h"
#include "no_os_platform.h"
#include "adi_platform.h"
#include "no_os_delay.h"
#include "common_data.h"
#include "ADRV9025_FW.h"
#include "no_os_alloc.h"
#include "parameters.h"
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
Functions | |
int32_t | no_os_LogFileOpen (void *devHalCfg, const char *filename) |
Opens a logFile. If the file is already open it will be closed and reopened. More... | |
int32_t | no_os_LogFileFlush (void *devHalCfg) |
Flushes the logFile buffer to the currently open log file. More... | |
int32_t | no_os_LogFileClose (void *devHalCfg) |
Gracefully closes the log file(s). More... | |
int32_t | no_os_LogLevelSet (void *devHalCfg, int32_t logLevel) |
Sets the log level, allowing the end user to select the granularity of what events get logged. More... | |
int32_t | no_os_LogLevelGet (void *devHalCfg, int32_t *logLevel) |
Gets the currently set log level: the mask of different types of log events that are currently enabled to be logged. More... | |
int32_t | no_os_LogWrite (void *devHalCfg, int32_t logLevel, const char *comment, va_list argp) |
Writes a message to the currently open logFile specified in the adi_hal_LogCfg_t of the devHalCfg structure passed. More... | |
int32_t | no_os_SpiOpen (void *devHalCfg) |
Opens/allocates any necessary resources to communicate via SPI to a particular device specified in the devHalCfg structure. More... | |
int32_t | no_os_SpiClose (void *devHalCfg) |
Closes any resources open/allocated for a specific SPI device. More... | |
int32_t | no_os_SpiInit (void *devHalCfg) |
Initializes the SPI device driver mode, bits per word, and speed. More... | |
int32_t | no_os_SpiWrite (void *devHalCfg, const uint8_t txData[], uint32_t numTxBytes) |
Write an array of 8-bit data to a SPI device. More... | |
int32_t | no_os_SpiRead (void *devHalCfg, const uint8_t txData[], uint8_t rxData[], uint32_t numTxRxBytes) |
Read one or more bytes from the device specified by the devHalCfg structure. More... | |
int32_t | no_os_TimerOpen (void *devHalCfg) |
Function to open/allocate any necessary resources for the timer wait functions below. More... | |
int32_t | no_os_TimerClose (void *devHalCfg) |
Function to close any necessary resources for the timer wait functions below. More... | |
int32_t | no_os_TimerInit (void *devHalCfg) |
Function to initialize any necessary resources for the timer wait functions below. More... | |
int32_t | no_os_TimerWait_us (void *devHalCfg, uint32_t time_us) |
Provides a blocking delay of the current thread. More... | |
int32_t | no_os_TimerWait_ms (void *devHalCfg, uint32_t time_ms) |
Provides a blocking delay of the current thread. More... | |
int32_t | no_os_HwOpen (void *devHalCfg) |
Opens all neccessary files and device drivers for a specific device. More... | |
int32_t | no_os_HwClose (void *devHalCfg) |
Gracefully shuts down the the hardware closing any open resources such as log files, I2C, SPI, GPIO drivers, timer resources, etc. More... | |
int32_t | no_os_HwReset (void *devHalCfg, uint8_t pinLevel) |
This function control a BBIC GPIO pin that connects to the reset pin of each device. More... | |
int32_t | no_os_image_page_get (void *devHalCfg, const char *ImagePath, uint32_t pageIndex, uint32_t pageSize, uint8_t *rdBuff) |
long int | ftell (FILE *stream) |
FILE * | __fopen (const char *filename, const char *mode) |
int | fseek (FILE *stream, long int offset, int origin) |
int | __fclose (FILE *stream) |
char * | fgets (char *dst, int num, FILE *stream) |
size_t | fread (void *ptr, size_t size, size_t count, FILE *stream) |
size_t | fwrite (const void *ptr, size_t size, size_t count, FILE *stream) |
Variables | |
CUSTOM_FILE | profile |
int32_t(* | adi_hal_HwOpen )(void *devHalCfg) = no_os_HwOpen |
int32_t(* | adi_hal_HwClose )(void *devHalCfg) = no_os_HwClose |
int32_t(* | adi_hal_HwReset )(void *devHalCfg, uint8_t pinLevel) = no_os_HwReset |
int32_t(* | adi_hal_SpiInit )(void *devHalCfg) |
void *(* | adi_hal_DevHalCfgCreate )(uint32_t interfaceMask, uint8_t spiChipSelect, const char *logFilename) = NULL |
int32_t(* | adi_hal_DevHalCfgFree )(void *devHalCfg) = NULL |
int32_t(* | adi_hal_HwVerify )(void *devHalCfg) = no_os_HwOpen |
int32_t(* | adrv9025_hal_SpiWrite )(void *devHalCfg, const uint8_t txData[], uint32_t numTxBytes) = no_os_SpiWrite |
int32_t(* | adrv9025_hal_SpiRead )(void *devHalCfg, const uint8_t txData[], uint8_t rxData[], uint32_t numRxBytes) = no_os_SpiRead |
int32_t(* | adi_hal_CustomSpiStreamWrite )(void *devHalCfg, const uint16_t address, const uint8_t txData[], uint32_t numTxBytes, uint8_t numBytesofAddress, uint8_t numBytesOfDataPerStream) = NULL |
int32_t(* | adi_hal_CustomSpiStreamRead )(void *devHalCfg, const uint16_t address, uint8_t rxData[], uint32_t numRxBytes, uint8_t numBytesofAddress, uint8_t numBytesOfDataPerStream) = NULL |
int32_t(* | adi_hal_LogFileOpen )(void *devHalCfg, const char *filename) = no_os_LogFileOpen |
int32_t(* | adi_hal_LogLevelSet )(void *devHalCfg, int32_t logLevel) = no_os_LogLevelSet |
int32_t(* | adi_hal_LogLevelGet )(void *devHalCfg, int32_t *logLevel) = no_os_LogLevelGet |
int32_t(* | adi_hal_LogWrite )(void *devHalCfg, int32_t logLevel, const char *comment, va_list args) = no_os_LogWrite |
int32_t(* | adi_hal_LogFileClose )(void *devHalCfg) = no_os_LogFileClose |
int32_t(* | adi_hal_Wait_ms )(void *devHalCfg, uint32_t time_ms) = no_os_TimerWait_ms |
int32_t(* | adi_hal_Wait_us )(void *devHalCfg, uint32_t time_us) = no_os_TimerWait_us |
int32_t(* | adi_hal_ArmImagePageGet )(void *devHalCfg, const char *ImagePath, uint32_t pageIndex, uint32_t pageSize, uint8_t *rdBuff) = no_os_image_page_get |
int32_t(* | adi_hal_StreamImagePageGet )(void *devHalCfg, const char *ImagePath, uint32_t pageIndex, uint32_t pageSize, uint8_t *rdBuff) = no_os_image_page_get |
int __fclose | ( | FILE * | stream | ) |
FILE* __fopen | ( | const char * | filename, |
const char * | mode | ||
) |
char* fgets | ( | char * | dst, |
int | num, | ||
FILE * | stream | ||
) |
size_t fread | ( | void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
int fseek | ( | FILE * | stream, |
long int | offset, | ||
int | origin | ||
) |
long int ftell | ( | FILE * | stream | ) |
size_t fwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | count, | ||
FILE * | stream | ||
) |
int32_t no_os_HwClose | ( | void * | devHalCfg | ) |
Gracefully shuts down the the hardware closing any open resources such as log files, I2C, SPI, GPIO drivers, timer resources, etc.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
int32_t no_os_HwOpen | ( | void * | devHalCfg | ) |
Opens all neccessary files and device drivers for a specific device.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
errors | returned by other function calls. |
int32_t no_os_HwReset | ( | void * | devHalCfg, |
uint8_t | pinLevel | ||
) |
This function control a BBIC GPIO pin that connects to the reset pin of each device.
This function is called by each device API giving access to the Reset pin connected to each device.
devHalCfg | Pointer to device instance specific platform settings |
pinLevel | The desired pin logic level 0=low, 1=high to set the GPIO pin to. |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
int32_t no_os_image_page_get | ( | void * | devHalCfg, |
const char * | ImagePath, | ||
uint32_t | pageIndex, | ||
uint32_t | pageSize, | ||
uint8_t * | rdBuff | ||
) |
int32_t no_os_LogFileClose | ( | void * | devHalCfg | ) |
Gracefully closes the log file(s).
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
ADI_HAL_LOGGING_FAIL | Error while flushing or closing the log file. |
int32_t no_os_LogFileFlush | ( | void * | devHalCfg | ) |
Flushes the logFile buffer to the currently open log file.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
int32_t no_os_LogFileOpen | ( | void * | devHalCfg, |
const char * | filename | ||
) |
Opens a logFile. If the file is already open it will be closed and reopened.
This function opens the file for writing and saves the resulting file descriptor to the devHalCfg structure.
devHalCfg | Pointer to device instance specific platform settings |
filename | The user provided name of the file to open. |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
ADI_HAL_LOGGING_FAIL | If the function failed to open or write to the specified filename |
int32_t no_os_LogLevelGet | ( | void * | devHalCfg, |
int32_t * | logLevel | ||
) |
Gets the currently set log level: the mask of different types of log events that are currently enabled to be logged.
devHalCfg | Pointer to device instance specific platform settings |
logLevel | Returns the current log level mask. |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
int32_t no_os_LogLevelSet | ( | void * | devHalCfg, |
int32_t | logLevel | ||
) |
Sets the log level, allowing the end user to select the granularity of what events get logged.
devHalCfg | Pointer to device instance specific platform settings |
logLevel | A mask of valid log levels to allow to be written to the log file. |
ADI_COMMON_ACT_ERR_CHECK_PARAM | Recovery action for bad parameter check |
ADI_COMMON_ACT_NO_ACTION | Function completed successfully, no action required |
int32_t no_os_LogWrite | ( | void * | devHalCfg, |
int32_t | logLevel, | ||
const char * | comment, | ||
va_list | argp | ||
) |
Writes a message to the currently open logFile specified in the adi_hal_LogCfg_t of the devHalCfg structure passed.
Uses the vfprintf functionality to allow the user to supply the format and the number of aguments that will be logged.
devHalCfg | Pointer to device instance specific platform settings |
logLevel | the log level to be written into |
comment | the string to include in the line added to the log. |
argp | variable argument list to be printed |
ADI_HAL_OK | Function completed successfully, no action required |
ADI_HAL_NULL_PTR | The function has been called with a null pointer |
ADI_HAL_LOGGING_FAIL | If the function failed to flush to write |
int32_t no_os_SpiClose | ( | void * | devHalCfg | ) |
Closes any resources open/allocated for a specific SPI device.
Any information needed to close the particular SPI device should be passed in the devHalCfg structure.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | function completed successfully, no action required |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
ADI_HAL_SPI_FAIL | the device driver was not closed successfully |
int32_t no_os_SpiInit | ( | void * | devHalCfg | ) |
Initializes the SPI device driver mode, bits per word, and speed.
Any settings needed should be passed in the devHalCfg structure
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | function completed successfully, no action required |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
ADI_HAL_SPI_FAIL | the SPI initialization failed |
int32_t no_os_SpiOpen | ( | void * | devHalCfg | ) |
Opens/allocates any necessary resources to communicate via SPI to a particular device specified in the devHalCfg structure.
This function should perform any necessary steps to open the SPI master resource on the BBIC to enable SPI communications to a particular SPI device.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | function completed successfully, no action required |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
ADI_HAL_SPI_FAIL | the device driver was not opened successfully |
int32_t no_os_SpiRead | ( | void * | devHalCfg, |
const uint8_t | txData[], | ||
uint8_t | rxData[], | ||
uint32_t | numTxRxBytes | ||
) |
Read one or more bytes from the device specified by the devHalCfg structure.
The function will read numTxRxBytes number of bytes from the SPI device selected in the devHalCfg parameter and store the resulting data sent by the device in the rxData data buffer.
For each byte in txData written to the device, a byte is read and returned by this function at the pointer provided by the rxData parameter.
devHalCfg | Pointer to device instance specific platform settings |
txData | Pointer to byte array that has numTxRxBytes number of bytes |
rxData | Pointer to byte array where read back data will be returned, that is at least numTxRxBytes in size. |
numTxRxBytes | The length of txData and rxData arrays |
ADI_HAL_OK | function completed successfully, no action required |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
ADI_HAL_SPI_FAIL | the data was not read successfully |
int32_t no_os_SpiWrite | ( | void * | devHalCfg, |
const uint8_t | txData[], | ||
uint32_t | numTxBytes | ||
) |
Write an array of 8-bit data to a SPI device.
The function will write numTxBytes number of bytes to the SPI device selected in the devHalCfg structure.
devHalCfg | Pointer to device instance specific platform settings |
txData | Pointer to byte array txData buffer that has numTxBytes number of bytes |
numTxBytes | The length of txData array |
ADI_HAL_OK | function completed successfully, no action required |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
ADI_HAL_SPI_FAIL | the data was not written successfully |
int32_t no_os_TimerClose | ( | void * | devHalCfg | ) |
Function to close any necessary resources for the timer wait functions below.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully |
int32_t no_os_TimerInit | ( | void * | devHalCfg | ) |
Function to initialize any necessary resources for the timer wait functions below.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully |
int32_t no_os_TimerOpen | ( | void * | devHalCfg | ) |
Function to open/allocate any necessary resources for the timer wait functions below.
devHalCfg | Pointer to device instance specific platform settings |
ADI_HAL_OK | Function completed successfully |
int32_t no_os_TimerWait_ms | ( | void * | devHalCfg, |
uint32_t | time_ms | ||
) |
Provides a blocking delay of the current thread.
devHalCfg | Pointer to device instance specific platform settings |
time_ms | the Time to delay in milli seconds |
ADI_HAL_OK | Function completed successfully |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
int32_t no_os_TimerWait_us | ( | void * | devHalCfg, |
uint32_t | time_us | ||
) |
Provides a blocking delay of the current thread.
devHalCfg | Pointer to device instance specific platform settings |
time_us | the time to delay in mico seconds |
ADI_HAL_OK | Function completed successfully |
ADI_HAL_NULL_PTR | the function has been called with a null pointer |
int32_t(* adi_hal_ArmImagePageGet) (void *devHalCfg, const char *ImagePath, uint32_t pageIndex, uint32_t pageSize, uint8_t *rdBuff) = no_os_image_page_get |
int32_t(* adi_hal_CustomSpiStreamRead) (void *devHalCfg, const uint16_t address, uint8_t rxData[], uint32_t numRxBytes, uint8_t numBytesofAddress, uint8_t numBytesOfDataPerStream) = NULL |
int32_t(* adi_hal_CustomSpiStreamWrite) (void *devHalCfg, const uint16_t address, const uint8_t txData[], uint32_t numTxBytes, uint8_t numBytesofAddress, uint8_t numBytesOfDataPerStream) = NULL |
void*(* adi_hal_DevHalCfgCreate) (uint32_t interfaceMask, uint8_t spiChipSelect, const char *logFilename) = NULL |
int32_t(* adi_hal_DevHalCfgFree) (void *devHalCfg) = NULL |
int32_t(* adi_hal_HwClose) (void *devHalCfg) = no_os_HwClose |
int32_t(* adi_hal_HwOpen) (void *devHalCfg) = no_os_HwOpen |
int32_t(* adi_hal_HwReset) (void *devHalCfg, uint8_t pinLevel) = no_os_HwReset |
int32_t(* adi_hal_HwVerify) (void *devHalCfg) = no_os_HwOpen |
int32_t(* adi_hal_LogFileClose) (void *devHalCfg) = no_os_LogFileClose |
int32_t(* adi_hal_LogFileOpen) (void *devHalCfg, const char *filename) = no_os_LogFileOpen |
int32_t(* adi_hal_LogLevelGet) (void *devHalCfg, int32_t *logLevel) = no_os_LogLevelGet |
int32_t(* adi_hal_LogLevelSet) (void *devHalCfg, int32_t logLevel) = no_os_LogLevelSet |
int32_t(* adi_hal_LogWrite) (void *devHalCfg, int32_t logLevel, const char *comment, va_list args) = no_os_LogWrite |
BBIC Logging functions
int32_t(* adi_hal_SpiInit) (void *devHalCfg) |
int32_t(* adi_hal_StreamImagePageGet) (void *devHalCfg, const char *ImagePath, uint32_t pageIndex, uint32_t pageSize, uint8_t *rdBuff) = no_os_image_page_get |
int32_t(* adi_hal_Wait_ms) (void *devHalCfg, uint32_t time_ms) = no_os_TimerWait_ms |
int32_t(* adi_hal_Wait_us) (void *devHalCfg, uint32_t time_us) = no_os_TimerWait_us |
BBIC Timer functions
int32_t(* adrv9025_hal_SpiRead) (void *devHalCfg, const uint8_t txData[], uint8_t rxData[], uint32_t numRxBytes) = no_os_SpiRead |
int32_t(* adrv9025_hal_SpiWrite) (void *devHalCfg, const uint8_t txData[], uint32_t numTxBytes) = no_os_SpiWrite |
CUSTOM_FILE profile |
Copyright 2015 - 2023 Analog Devices Inc. Released under the ADRV9025 API license, for more information. see the "LICENSE.txt" file in this zip file.