1 #ifndef _ADF7030_1__MEM_H_ 2 #define _ADF7030_1__MEM_H_ 4 #include <drivers/spi/adi_spi.h> 5 #include <devices/rf/adf703x/adi_adf7030-1_reg.h> 15 extern uint32_t ADF7030_1_SPI_PNTR[8];
35 const uint8_t WordXfer;
45 uint16_t build_number;
49 uint8_t full_layer_num;
84 #define PHY_MEM_READ true 85 #define PHY_MEM_WRITE false 90 ADI_SPI_HANDLE hSPIDevice,
96 ADI_SPI_HANDLE hSPIDevice,
102 ADI_SPI_HANDLE hSPIDevice,
108 ADI_SPI_HANDLE hSPIDevice,
116 ADI_SPI_HANDLE hSPIDevice,
123 ADI_SPI_HANDLE hSPIDevice,
130 ADI_SPI_HANDLE hSPIDevice,
136 ADI_SPI_HANDLE hSPIDevice,
143 ADI_SPI_HANDLE hSPIDevice,
149 ADI_SPI_HANDLE hSPIDevice,
156 ADI_SPI_HANDLE hSPIDevice,
162 ADI_SPI_HANDLE hSPIDevice,
169 ADI_SPI_HANDLE hSPIDevice,
175 ADI_SPI_HANDLE hSPIDevice,
183 ADI_SPI_HANDLE hSPIDevice,
190 ADI_SPI_HANDLE hSPIDevice,
199 ADI_SPI_HANDLE hSPIDevice,
206 #define adf7030_1__WRITE_FIELD(fName, fValue) adf7030_1__SPI_SetField( hSPIDevice, \ 213 #define adf7030_1__WRITE_FIELD2(fName, fValue) \ 216 uint32_t fStartByte = (fName##_Pos >> 3); \ 217 uint32_t fPos_fromStartByte = fName##_Pos - (fStartByte << 3); \ 218 uint32_t fLenBytes = ((fName##Size - 1) >> 3) + 1; \ 221 uint32_t fVal = adf7030_1__SPI_GetBytes( hSPIDevice, Addr + fStartByte, fLenBytes); \ 224 uint32_t fMsk = ((1 << fName##_Size) - 1) << fPos_fromStartByte; \ 227 fValue <<= fPos_fromStartByte; \ 237 adf7030_1__SPI_SetBytes( hSPIDevice, Addr + fStartByte, fValue, fLenBytes); \ 242 #define adf7030_1__READ_FIELD(fName) adf7030_1__SPI_GetField( hSPIDevice, \ 248 #define adf7030_1__READ_FIELD2(fName) \ 253 uint32_t fStartByte = (fName##_Pos >> 3); \ 254 uint32_t fPos_fromStartByte = fName##_Pos - (fStartByte << 3); \ 255 uint32_t fLenBytes = ((fName##Size - 1) >> 3) + 1; \ 258 fVal = adf7030_1__SPI_GetBytes( hSPIDevice, Addr + fStartByte, fLenBytes); \ 261 uint32_t fMsk = ((1 << fName##_Size) - 1) << fPos_fromStartByte; \ 267 fVal >>= fPos_fromStartByte; \ 274 #define adf7030_1__WRITE_REG(rName, rValue) adf7030_1__SPI_SetBytes( hSPIDevice, \ 280 #define adf7030_1__READ_REG(rName) adf7030_1__SPI_GetBytes( hSPIDevice, \ 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.
uint16_t Size
String with name of memory bloc.
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.
void adf7030_1__SPI_SetMem8(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint8_t Value)
Write a single 8bits memory location via the SPI.
void adf7030_1__SPI_SetMem24(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value)
Write a single 24bits memory location via the SPI.
uint32_t adf7030_1__SPI_GetBytes(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t nbBytes)
Read "nbBytes" memory location via the SPI.
uint16_t nbBlock
Total size of the configuration.
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.
uint16_t Size
String with name of configuration sequence.
uint8_t adf7030_1__SPI_GetMem8(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Read a 8bits memory location via the SPI.
const uint8_t unused
Byte size of the Block to transfer.
uint8_t ByteMode
size of the memory bloc
MEM_DESCRIPTOR_Type * pNextBloc
descriptor for random access
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.
DATA_BLOCK_DESCRIPTOR_Type BLOCKS[]
Pointer to the next configuration sequence if desired, else NULL.
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.
void * pBuffRef
pointer to the start of the shadow memory bloc in the host memory space
uint8_t * pOffset
Size of the Offset list.
config_info_t * pInfo
Number of data blocks.
uint16_t adf7030_1__SPI_GetMem16(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Read a 16bits memory location via the SPI.
void * pBuff
address of the memory bloc in the PHY memory space
uint32_t adf7030_1__SPI_GetMem32(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Read a single 32bits memory location via the SPI.
uint32_t PhyAddr
0->Block, 1->Random SPI transfer mode
const uint8_t * pData
Address of the memory bloc in the PHY memory space.
const uint32_t Addr
If !NULL, force 32bits SPI transfer.
uint32_t adf7030_1__SPI_GetMem24(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Read a 24bits memory location via the SPI.
uint32_t adf7030_1__ReadConfig(ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
Function call to read Configuration from Radio PHY.
void adf7030_1__SPI_SetMem16(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint16_t Value)
Write a single 16bits memory location via the SPI.
uint16_t Offset
Byte size of the Block to transfer.
MEM_CFG_DESCRIPTOR_Type * pNext
Pointer to the configuration info structure in the host memory.
RANDOM_XFER_DESCRIPTOR_Type RandXfer
descriptor for block access
uint8_t XferMode
0->8bits, 1->32bits SPI transfert mode, 2->8bits Only, 3->32bits only
void adf7030_1__SPI_SetMem32(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, uint32_t Value)
Write a single 32bits memory location via the SPI.
uint32_t adf7030_1__WriteConfig(ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
Function call to write Configuration to Radio PHY.
BLOCK_XFER_DESCRIPTOR_Type BlockXfer
pointer to the initial value of the shadow memory bloc in the host memory space
uint32_t adf7030_1__VerifyConfig(ADI_SPI_HANDLE hSPIDevice, MEM_CFG_DESCRIPTOR_Type *pCONFIG)
Function call to verify the integrity of the patch.