28 #ifndef _ADF7030_1__SPI_C_ 30 #define _ADF7030_1__SPI_C_ 38 #include <drivers/spi/adi_spi.h> 41 #include <devices/rf/adf703x/adf7030-1__spi.h> 42 #include <devices/rf/adf703x/adf7030-1__mem.h> 56 #pragma diag_suppress=Pm073,Pm143 78 ADI_SPI_HANDLE hSPIDevice,
102 ADI_SPI_HANDLE hSPIDevice,
128 ADI_SPI_HANDLE hSPIDevice,
157 ADI_SPI_HANDLE hSPIDevice,
166 for(uint32_t i = 0; i < pCONFIG->
nbBlock; i++)
172 if(pCONFIG->
BLOCKS[i].WordXfer == 0)
184 uint32_t size = pCONFIG->
BLOCKS[i].Size;
206 if(READ_nWRITE ==
true)
236 if(READ_nWRITE ==
true)
260 uint32_t size = pCONFIG->
BLOCKS[i].Size >> 2;
273 if(READ_nWRITE ==
true)
295 pCONFIG = pCONFIG->
pNext;
302 }
while(exit ==
false);
330 ADI_SPI_HANDLE hSPIDevice,
351 if(!(PHYAddr & 3) && !(pMEM->
BlockXfer.Size & 3))
358 if((PNTR_id) && !(PNTR_offset >> 2))
360 if(READ_nWRITE ==
true)
378 if(READ_nWRITE ==
true)
411 if(READ_nWRITE ==
true)
430 if(READ_nWRITE ==
true)
466 }
while(exit ==
false);
487 ADI_SPI_HANDLE hSPIDevice,
508 ADI_SPI_HANDLE hSPIDevice,
533 ADI_SPI_HANDLE hSPIDevice,
557 ADI_SPI_HANDLE hSPIDevice,
582 ADI_SPI_HANDLE hSPIDevice,
606 ADI_SPI_HANDLE hSPIDevice,
631 ADI_SPI_HANDLE hSPIDevice,
655 ADI_SPI_HANDLE hSPIDevice,
682 ADI_SPI_HANDLE hSPIDevice,
689 int32_t AddrDiff = (int32_t)Addr - (int32_t)ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR];
693 if((AddrDiff >= 0 ) && (AddrDiff < (255 + nbBytes)))
696 Offset = (uint8_t)AddrDiff;
702 ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] = ((Addr >> 2) << 2);
707 Offset = Addr & 0x03;
711 if((Offset == 0) && (nbBytes == 4))
741 ADI_SPI_HANDLE hSPIDevice,
747 int32_t AddrDiff = (int32_t)Addr - (int32_t)ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR];
751 if((AddrDiff >= 0 ) && (AddrDiff < (255 + nbBytes)))
754 Offset = (uint8_t)AddrDiff;
760 ADF7030_1_SPI_PNTR[PNTR_CUSTOM0_ADDR] = ((Addr >> 2) << 2);
765 Offset = Addr & 0x03;
769 if((Offset == 0) && (nbBytes == 4))
805 ADI_SPI_HANDLE hSPIDevice,
813 uint32_t fStartByte = Pos >> 3;
814 uint32_t fPos_fromStartByte = Pos - (fStartByte << 3);
815 uint32_t fLenBytes = ((Size - 1) >> 3) + 1;
821 uint32_t fMsk = ((1 << Size) - 1) << fPos_fromStartByte;
824 Val <<= fPos_fromStartByte;
859 ADI_SPI_HANDLE hSPIDevice,
866 uint32_t fStartByte = Pos >> 3;
867 uint32_t fPos_fromStartByte = Pos - (fStartByte << 3);
868 uint32_t fLenBytes = ((Size - 1) >> 3) + 1;
874 uint32_t fMsk = ((1 << Size) - 1) << fPos_fromStartByte;
880 fVal >>= fPos_fromStartByte;
uint32_t adf7030_1__SPI_wr_byte_p_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t num_xfrs, uint8_t *pDataIn)
Write a number of byte(s) from Host to memory of the adf7030-1 starting at location pointed by "pntr"...
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.
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.
uint32_t adf7030_1__SPI_rd_word_b_a(ADI_SPI_HANDLE hSPIDevice, uint32_t AddrIn, uint32_t num_xfrs, uint32_t *pDataOut)
Read a number of word(s) from the adf7030-1 to memory of Host Generic 32bits bloc address read from m...
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_SetMMapCustomPntr0(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Change the SPI Radio mmap custom pointers 0 location.
uint32_t adf7030_1__SPI_rd_byte_p_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t num_xfrs, uint8_t *pDataOut)
Read a number of bytes(s) from memory of the adf7030-1 to Host starting at location pointed by "pntr"...
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.
uint8_t adf7030_1__SPI_GetMem8(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr)
Read a 8bits memory location via the SPI.
uint32_t adf7030_1__SPI_rd_cmp_word_b_a(ADI_SPI_HANDLE hSPIDevice, uint32_t AddrIn, uint32_t num_xfrs, uint32_t *pDataOut, uint32_t *pDataRef)
Read & Compare a number of word(s) from the adf7030-1 to memory of Host Generic 32bits bloc address r...
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.
uint32_t adf7030_1__SPI_rd_cmp_byte_b_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t AddrIn, uint32_t num_xfrs, uint8_t *pDataOut, uint8_t *pDataRef)
Read & Compare a number of bytes(s) from memory of the adf7030-1 to Host starting at location pointed...
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_rd_word_b_p(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t num_xfrs, uint32_t *pDataOut)
Read a number of word(s) from memory of the adf7030-1 to Host starting at location pointed by "pntr" ...
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.
uint32_t adf7030_1__SPI_wr_word_b_p(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t num_xfrs, uint32_t *pDataIn)
Write a number of word(s) from Host to memory of the adf7030-1 starting at location pointed by "pntr"...
void adf7030_1__SPI_FindMMapPointer(ADI_SPI_HANDLE hSPIDevice, uint32_t Addr, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE *pPNTR_ID, int32_t *ByteOffset)
This function return the best Pointer id + offset for subsequent SPI transfert to the PHY "Addr" prov...
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.
ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE
uint16_t Offset
Byte size of the Block to transfer.
uint32_t adf7030_1__SPI_rd_byte_b_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t AddrIn, uint32_t num_xfrs, uint8_t *pDataOut)
Read a number of bytes(s) from memory of the adf7030-1 to Host starting at location pointed by "pntr"...
MEM_CFG_DESCRIPTOR_Type * pNext
Pointer to the configuration info structure in the host memory.
uint32_t adf7030_1__SPI_wr_word_b_a(ADI_SPI_HANDLE hSPIDevice, uint32_t AddrIn, uint32_t num_xfrs, uint32_t *pDataIn)
Write a number of word(s) from Host to memory of the adf7030-1 Generic 32bits bloc address write to m...
uint32_t adf7030_1__SPI_wr_byte_b_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t AddrIn, uint32_t num_xfrs, uint8_t *pDataIn)
Write a number of byte(s) from Host to memory of the adf7030-1 starting at location pointed by "pntr"...
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.
uint32_t adf7030_1__SPI_rd_cmp_byte_p_a(ADI_SPI_HANDLE hSPIDevice, ADI_ADF7030_1_RADIO_SPI_PNTR_TYPE pntrID, uint32_t num_xfrs, uint8_t *pDataOut, uint8_t *pDataRef)
Read & Compare a number of bytes(s) from memory of the adf7030-1 to Host starting at location pointed...
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.