ADF7030-1 Device Drivers API Reference Manual  Alpha 0.0.1
Device Drivers for ADF7030-1 Transceiver
PHY Memory Interface
Collaboration diagram for PHY Memory Interface:

Data Structures

struct  BLOCK_XFER_DESCRIPTOR_Type
 
struct  config_info_t
 
struct  DATA_BLOCK_DESCRIPTOR_Type
 
struct  MEM_CFG_DESCRIPTOR_Type
 
struct  MEM_DESCRIPTOR_Type
 
struct  RANDOM_XFER_DESCRIPTOR_Type
 

Macros

#define adf7030_1__READ_FIELD(fName)
 
#define adf7030_1__READ_FIELD2(fName)
 
#define adf7030_1__READ_REG(rName)
 
#define adf7030_1__WRITE_FIELD(fName, fValue)
 
#define adf7030_1__WRITE_FIELD2(fName, fValue)
 
#define adf7030_1__WRITE_REG(rName, rValue)
 
#define PHY_MEM_READ   true
 
#define PHY_MEM_WRITE   false
 

Typedefs

typedef struct MEM_CFG_DESCRIPTOR_Type MEM_CFG_DESCRIPTOR_Type
 
typedef struct MEM_DESCRIPTOR_Type MEM_DESCRIPTOR_Type
 

Functions

uint32_t adf7030_1__ReadConfig (ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
 Function call to read Configuration from Radio PHY. More...
 
uint32_t adf7030_1__SPI_GetBytes (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t nbBytes)
 Read "nbBytes" memory location via the SPI. More...
 
uint32_t adf7030_1__SPI_GetField (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Pos, uint32_t Size)
 Generic readback of a bitfield value from the Radio PHY via the SPI. More...
 
uint16_t adf7030_1__SPI_GetMem16 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
 Read a 16bits memory location via the SPI. More...
 
uint32_t adf7030_1__SPI_GetMem24 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
 Read a 24bits memory location via the SPI. More...
 
uint32_t adf7030_1__SPI_GetMem32 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
 Read a single 32bits memory location via the SPI. More...
 
uint8_t adf7030_1__SPI_GetMem8 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
 Read a 8bits memory location via the SPI. More...
 
void adf7030_1__SPI_SetBytes (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value, uint32_t nbBytes)
 Writes "nbBytes" memory location via the SPI. More...
 
void adf7030_1__SPI_SetField (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Pos, uint32_t Size, uint32_t Val)
 Generic setting of a Radio PHY bitfield to a value via the SPI. More...
 
void adf7030_1__SPI_SetMem16 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint16_t Value)
 Write a single 16bits memory location via the SPI. More...
 
void adf7030_1__SPI_SetMem24 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value)
 Write a single 24bits memory location via the SPI. More...
 
void adf7030_1__SPI_SetMem32 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value)
 Write a single 32bits memory location via the SPI. More...
 
void adf7030_1__SPI_SetMem8 (ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint8_t Value)
 Write a single 8bits memory location via the SPI. More...
 
uint32_t adf7030_1__SPI_Xfer_Mem (ADI_SPI_HANDLE hSPIDevice, MEM_DESCRIPTOR_Type *pMEM, bool READ_nWRITE)
 Generic memory transfers function between Host shadow and the Radio PHY. More...
 
uint32_t adf7030_1__VerifyConfig (ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
 Function call to verify the integrity of the patch. More...
 
uint32_t adf7030_1__WriteConfig (ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
 Function call to write Configuration to Radio PHY. More...
 
uint32_t adf7030_1__XferConfig (ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG, bool READ_nWRITE, bool CHECK_ONLY)
 Generic Configuration transfers function between Host and the Radio PHY. More...
 

Variables

uint32_t ADF7030_1_SPI_PNTR [8]
 

Detailed Description

Macro Definition Documentation

#define adf7030_1__READ_FIELD (   fName)
Value:
fName##_Addr, \
fName##_Pos, \
fName##_Size )
uint32_t adf7030_1__SPI_GetField(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Pos, uint32_t Size)
Generic readback of a bitfield value from the Radio PHY via the SPI.

Definition at line 242 of file adf7030-1__mem.h.

#define adf7030_1__READ_FIELD2 (   fName)
Value:
({ \
uint32_t fVal; \
\
/* Compute Bitfields parameters */ \
uint32_t fStartByte = (fName##_Pos >> 3); \
uint32_t fPos_fromStartByte = fName##_Pos - (fStartByte << 3); \
uint32_t fLenBytes = ((fName##Size - 1) >> 3) + 1; \
\
/* Read Bitfield vis SPI */ \
fVal = adf7030_1__SPI_GetBytes( hSPIDevice, Addr + fStartByte, fLenBytes); \
\
/* Compute the Mask */ \
uint32_t fMsk = ((1 << fName##_Size) - 1) << fPos_fromStartByte; \
\
/* And SPI returned value with Mask */ \
fVal &= fMsk; \
\
/* Shift right by fPos_fromStartByte */ \
fVal >>= fPos_fromStartByte; \
\
fVal; \
});
uint32_t adf7030_1__SPI_GetBytes(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t nbBytes)
Read "nbBytes" memory location via the SPI.

Definition at line 248 of file adf7030-1__mem.h.

#define adf7030_1__READ_REG (   rName)
Value:
rName##_Addr, \
4 )
uint32_t adf7030_1__SPI_GetBytes(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t nbBytes)
Read "nbBytes" memory location via the SPI.

Definition at line 280 of file adf7030-1__mem.h.

#define adf7030_1__WRITE_FIELD (   fName,
  fValue 
)
Value:
fName##_Addr, \
fName##_Pos, \
fName##_Size, \
fValue )
void adf7030_1__SPI_SetField(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Pos, uint32_t Size, uint32_t Val)
Generic setting of a Radio PHY bitfield to a value via the SPI.

Definition at line 206 of file adf7030-1__mem.h.

#define adf7030_1__WRITE_FIELD2 (   fName,
  fValue 
)
Value:
{ \
/* Compute Bitfields parameters */ \
uint32_t fStartByte = (fName##_Pos >> 3); \
uint32_t fPos_fromStartByte = fName##_Pos - (fStartByte << 3); \
uint32_t fLenBytes = ((fName##Size - 1) >> 3) + 1; \
\
/* Read Bitfield vis SPI */ \
uint32_t fVal = adf7030_1__SPI_GetBytes( hSPIDevice, Addr + fStartByte, fLenBytes); \
\
/* Compute the Mask */ \
uint32_t fMsk = ((1 << fName##_Size) - 1) << fPos_fromStartByte; \
\
/* Bound Val to the Mask */ \
fValue <<= fPos_fromStartByte; \
fValue &= fMsk; \
\
/* And SPI returned value with inverted Mask */ \
fVal &= (~fMsk); \
\
/* Or SPI returned value with fValue */ \
fVal |= fValue; \
\
/* Write back Bitfield vis SPI */ \
adf7030_1__SPI_SetBytes( hSPIDevice, Addr + fStartByte, fValue, fLenBytes); \
};
uint32_t adf7030_1__SPI_GetBytes(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t nbBytes)
Read "nbBytes" memory location via the SPI.

Definition at line 213 of file adf7030-1__mem.h.

#define adf7030_1__WRITE_REG (   rName,
  rValue 
)
Value:
rName##_Addr, \
rValue, \
4 )
void adf7030_1__SPI_SetBytes(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value, uint32_t nbBytes)
Writes "nbBytes" memory location via the SPI.

Definition at line 274 of file adf7030-1__mem.h.

Function Documentation

uint32_t adf7030_1__ReadConfig ( ADI_SPI_HANDLE  hSPIDevice,
MEM_CFG_DESCRIPTOR_Type pCONFIG 
)

Function call to read Configuration from Radio PHY.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]pCONFIGPointer to Host configuration structure.
Note
Configuration data is provided by ADI RF Setting Calculator.
See also
USER_CONFIG_20.h for an example.
Returns
Status
  • #SUCCESS If the Configuration was readback successfully in the Host.
  • #FAILURE [D] If the Configuration transfert failed.

Definition at line 101 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__SPI_GetBytes ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  nbBytes 
)

Read "nbBytes" memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
See also
adf7030_1__SPI_rd_byte_b_a()
Parameters
[in]AddrPHY Address location at which the SPI will write.
[in]nbBytesNumber of Bytes to read (1, 2, 3 or 4);
Returns
Value 32bits readback value.

Definition at line 740 of file adf7030-1__mem.c.

Referenced by adf7030_1__SPI_GetField(), adf7030_1__SPI_GetMem16(), adf7030_1__SPI_GetMem24(), adf7030_1__SPI_GetMem32(), adf7030_1__SPI_GetMem8(), and adf7030_1__SPI_SetField().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t adf7030_1__SPI_GetField ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  Pos,
uint32_t  Size 
)

Generic readback of a bitfield value from the Radio PHY via the SPI.

Note
This function does not support "SPI Error Status". Call adf7030_1__SPI_GetBytes and apply appropriate masking to the SPI value readback.
See also
adf7030_1__SPI_GetBytes().
Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]Addr32bit alligned PHY Address location of the bitfield.
[in]PosStarting bit position withing the 32bits word.
[in]SizeBit lenght of the bitfield.
Returns
fVal Bitfield value

Definition at line 858 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint16_t adf7030_1__SPI_GetMem16 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr 
)

Read a 16bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
Returns
Value 16bits readback value.

Definition at line 605 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__SPI_GetMem24 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr 
)

Read a 24bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
Returns
Value 24bits readback value.

Definition at line 556 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__SPI_GetMem32 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr 
)

Read a single 32bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]AddrPHY Address location at which the SPI will write.
Note
This function does not support "SPI Error Status"
Returns
Value 32bits readback value.

Definition at line 507 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint8_t adf7030_1__SPI_GetMem8 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr 
)

Read a 8bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
Returns
Value 8bits readback value.

Definition at line 654 of file adf7030-1__mem.c.

Here is the call graph for this function:

void adf7030_1__SPI_SetBytes ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  Value,
uint32_t  nbBytes 
)

Writes "nbBytes" memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
[in]ValueValue to write.
[in]nbBytesNumber of Bytes to writes (1, 2, 3 or 4);
Returns
None

Definition at line 681 of file adf7030-1__mem.c.

Referenced by adf7030_1__SPI_SetField(), adf7030_1__SPI_SetMem16(), adf7030_1__SPI_SetMem24(), adf7030_1__SPI_SetMem32(), and adf7030_1__SPI_SetMem8().

Here is the call graph for this function:

Here is the caller graph for this function:

void adf7030_1__SPI_SetField ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  Pos,
uint32_t  Size,
uint32_t  Val 
)

Generic setting of a Radio PHY bitfield to a value via the SPI.

Note
This function does not support "SPI Error Status". Call adf7030_1__SPI_GetBytes and adf7030_1__SPI_GetBytes and apply appropriate masking to the SPI value readback.
See also
adf7030_1__SPI_GetBytes().
adf7030_1__SPI_SetBytes().
Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]Addr32bit alligned PHY Address location of the bitfield.
[in]PosStarting bit position withing the 32bits word.
[in]SizeBit lenght of the bitfield.
[in]ValBitfield value.
Returns
None

Definition at line 804 of file adf7030-1__mem.c.

Here is the call graph for this function:

void adf7030_1__SPI_SetMem16 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint16_t  Value 
)

Write a single 16bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
[in]Value16bits Value to write.
Returns
None

Definition at line 581 of file adf7030-1__mem.c.

Here is the call graph for this function:

void adf7030_1__SPI_SetMem24 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  Value 
)

Write a single 24bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
[in]Value24bits Value to write.
Returns
None

Definition at line 532 of file adf7030-1__mem.c.

Here is the call graph for this function:

void adf7030_1__SPI_SetMem32 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint32_t  Value 
)

Write a single 32bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]AddrPHY Address location at which the SPI will write.
[in]Value32bits Value to write.
Note
This function does not support "SPI Error Status"
Returns
None

Definition at line 486 of file adf7030-1__mem.c.

Here is the call graph for this function:

void adf7030_1__SPI_SetMem8 ( ADI_SPI_HANDLE  hSPIDevice,
uint32_t  Addr,
uint8_t  Value 
)

Write a single 8bits memory location via the SPI.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
Note
This function is changing SPI custom pointer0, ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] and the PHY SPI pntr are overwritten. It also does not support "SPI Error Status".
Parameters
[in]AddrPHY Address location at which the SPI will write.
[in]Value8bits Value to write.
Returns
None

Definition at line 630 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__SPI_Xfer_Mem ( ADI_SPI_HANDLE  hSPIDevice,
MEM_DESCRIPTOR_Type pMEM,
bool  READ_nWRITE 
)

Generic memory transfers function between Host shadow and the Radio PHY.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]pMEMDescriptor to the paired Host/PHY memory region.
[in]READ_nWRITEBoolean -TRUE to write from Host shadow to the Radio PHY -FALSE to read from Radio PHY back to Host shadow
Note
This function assume the following:
  • Both Host shadow block (&(pMEM->pBuff)) and PHY memory blocks (pMEM->PhyAddr) are starting at a word alligned location.
  • ADF7030_1_SPI_PNTR[] is in sync with PHY value.
Returns
Status
  • #SUCCESS If the transfert was succesfull to the adf7030-1.
  • #FAILURE [D] If the transfert failed.

Definition at line 329 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__VerifyConfig ( ADI_SPI_HANDLE  hSPIDevice,
MEM_CFG_DESCRIPTOR_Type pCONFIG 
)

Function call to verify the integrity of the patch.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]pCONFIGPointer to Host configuration structure.
Note
This function only disable the patch, it can be re-enable at a later stage by calling the adf7030_1__InjectPatch() function. This function modifies ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR].
Returns
Status
  • #SUCCESS If the Configuration in the PHY matches the reference in the Host.
  • #FAILURE [D] If the Configuration is different.

Definition at line 127 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__WriteConfig ( ADI_SPI_HANDLE  hSPIDevice,
MEM_CFG_DESCRIPTOR_Type pCONFIG 
)

Function call to write Configuration to Radio PHY.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]pCONFIGPointer to Host configuration structure.
Note
Configuration data is provided by ADI RF Setting Calculator.
See also
USER_CONFIG_20.h for an example.
Returns
Status
  • #SUCCESS If the Configuration was written successfully in the Host.
  • #FAILURE [D] If the patch transfert failed.

Definition at line 77 of file adf7030-1__mem.c.

Here is the call graph for this function:

uint32_t adf7030_1__XferConfig ( ADI_SPI_HANDLE  hSPIDevice,
MEM_CFG_DESCRIPTOR_Type pCONFIG,
bool  READ_nWRITE,
bool  CHECK_ONLY 
)

Generic Configuration transfers function between Host and the Radio PHY.

Parameters
[in]hSPIDeviceHandle to Glue SPI peripheral device used to communicate with the adf7030-1.
[in]pCONFIGPointer to Host configuration structure.
[in]READ_nWRITEBoolean -TRUE to write Config from Host to the Radio PHY -FALSE to read Config from Radio PHY back to Host
[in]CHECK_ONLYBoolean -TRUE to check PHY Config versus Host Reference -FALSE [D] to perform READ_nWRITE operation
Note
This function can modify ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR].
Returns
Status
  • #SUCCESS If the transfert was succesfull to the adf7030-1.
  • #FAILURE [D] If the transfert failed.

Definition at line 156 of file adf7030-1__mem.c.

Referenced by adf7030_1__ReadConfig(), adf7030_1__VerifyConfig(), and adf7030_1__WriteConfig().

Here is the call graph for this function:

Here is the caller graph for this function: