Petaluma (MAXREFDES30#) Code Documentation  V01.00
16-Bit, 8-Ch, +/-10V input, Simultaneous-Sampling Analog Front End
 All Data Structures Files Functions Variables Macros Pages
axi_max11046.h File Reference
#include "xbasic_types.h"
#include "xstatus.h"
#include "xil_io.h"

Go to the source code of this file.

Macros

#define AXI_MAX11046_USER_SLV_SPACE_OFFSET   (0x00000000)
 
#define AXI_MAX11046_ADC_DATA_CH0_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000000)
 
#define AXI_MAX11046_ADC_DATA_CH1_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000004)
 
#define AXI_MAX11046_ADC_DATA_CH2_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000008)
 
#define AXI_MAX11046_ADC_DATA_CH3_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x0000000C)
 
#define AXI_MAX11046_ADC_DATA_CH4_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000010)
 
#define AXI_MAX11046_ADC_DATA_CH5_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000014)
 
#define AXI_MAX11046_ADC_DATA_CH6_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000018)
 
#define AXI_MAX11046_ADC_DATA_CH7_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x0000001C)
 
#define AXI_MAX11046_ADC_START_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000020)
 
#define AXI_MAX11046_WRITE_CR_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000024)
 
#define AXI_MAX11046_DELAY_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000028)
 
#define AXI_MAX11046_IP_INTR_STATUS_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000030)
 
#define AXI_MAX11046_IP_INTR_ENABLE_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000034)
 
#define AXI_MAX11046_CR_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000038)
 
#define AXI_MAX11046_mWriteReg(BaseAddress, RegOffset, Data)   Xil_Out32((BaseAddress) + (RegOffset), (Xuint32)(Data))
 
#define AXI_MAX11046_mReadReg(BaseAddress, RegOffset)   Xil_In32((BaseAddress) + (RegOffset))
 

Functions

void AXI_MAX11046_Config_ADC (u32 BaseAddress, u32 Value)
 Config ADC.
 
void AXI_MAX11046_Start_Conversion (u32 BaseAddress)
 Start ADC Conversion.
 
void AXI_MAX11046_Stop_Conversion (u32 BaseAddress)
 Stop ADC Conversion.
 
void AXI_MAX11046_Write_Delay_Reg (u32 BaseAddress, u32 Value)
 Write Value to the delay register.
 
void AXI_MAX11046_Interrupt_Enable (u32 BaseAddress)
 Enable the interrupt.
 
void AXI_MAX11046_Interrupt_Disable (u32 BaseAddress)
 Disable the interrupt.
 
u32 AXI_MAX11046_Read_Data (u32 BaseAddress, u8 Channel)
 Read sampled data.
 
u32 AXI_MAX11046_Read_Interrupt_Status (u32 BaseAddress)
 Read interrupt status.
 
void AXI_MAX11046_Single_Convert (u32 BaseAddress, u8 Channel, u16 *uSample)
 Read one ADC sample.
 

Macro Definition Documentation

#define AXI_MAX11046_ADC_DATA_CH0_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000000)

Definition at line 24 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH1_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000004)

Definition at line 25 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH2_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000008)

Definition at line 26 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH3_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x0000000C)

Definition at line 27 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH4_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000010)

Definition at line 28 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH5_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000014)

Definition at line 29 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH6_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000018)

Definition at line 30 of file axi_max11046.h.

#define AXI_MAX11046_ADC_DATA_CH7_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x0000001C)

Definition at line 31 of file axi_max11046.h.

#define AXI_MAX11046_ADC_START_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000020)

Definition at line 32 of file axi_max11046.h.

#define AXI_MAX11046_CR_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000038)

Definition at line 38 of file axi_max11046.h.

#define AXI_MAX11046_DELAY_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000028)

Definition at line 34 of file axi_max11046.h.

#define AXI_MAX11046_IP_INTR_ENABLE_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000034)

Definition at line 37 of file axi_max11046.h.

#define AXI_MAX11046_IP_INTR_STATUS_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000030)

Definition at line 36 of file axi_max11046.h.

#define AXI_MAX11046_mReadReg (   BaseAddress,
  RegOffset 
)    Xil_In32((BaseAddress) + (RegOffset))

Read a value from a AXI_MAX11046 register. A 32 bit read is performed. If the component is implemented in a smaller width, only the least significant data is read from the register. The most significant data will be read as 0.

Parameters
BaseAddressis the base address of the AXI_MAX11046 device.
RegOffsetis the register offset from the base to write to.
Returns
Data is the data from the register.
Note
C-style signature: Xuint32 AXI_MAX11046_mReadReg(Xuint32 BaseAddress, unsigned RegOffset)

Definition at line 82 of file axi_max11046.h.

#define AXI_MAX11046_mWriteReg (   BaseAddress,
  RegOffset,
  Data 
)    Xil_Out32((BaseAddress) + (RegOffset), (Xuint32)(Data))

Write a value to a AXI_MAX11046 register. A 32 bit write is performed. If the component is implemented in a smaller width, only the least significant data is written.

Parameters
BaseAddressis the base address of the AXI_MAX11046 device.
RegOffsetis the register offset from the base to write to.
Datais the data written to the register.
Returns
None.
Note
C-style signature: void AXI_MAX11046_mWriteReg(Xuint32 BaseAddress, unsigned RegOffset, Xuint32 Data)

Definition at line 62 of file axi_max11046.h.

#define AXI_MAX11046_USER_SLV_SPACE_OFFSET   (0x00000000)

User Logic Slave Space Offsets

Definition at line 23 of file axi_max11046.h.

#define AXI_MAX11046_WRITE_CR_REG_OFFSET   (AXI_MAX11046_USER_SLV_SPACE_OFFSET + 0x00000024)

Definition at line 33 of file axi_max11046.h.

Function Documentation

void AXI_MAX11046_Config_ADC ( u32  BaseAddress,
u32  Value 
)

Config ADC.

Details
This function write a value to the config register of the ADC
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
None

Definition at line 66 of file axi_max11046.c.

void AXI_MAX11046_Interrupt_Disable ( u32  BaseAddress)

Disable the interrupt.

Details
This function writes a 0 to the interrupt enable register to disable the interrupt
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
None

Definition at line 146 of file axi_max11046.c.

void AXI_MAX11046_Interrupt_Enable ( u32  BaseAddress)

Enable the interrupt.

Details
This function writes a 1 to the interrupt enable register to enable the interrupt. When the interrupt is enabled, the AXI_MAX11046 IP core will raise an interrupt when the sampled data is available.
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
None

Definition at line 129 of file axi_max11046.c.

u32 AXI_MAX11046_Read_Data ( u32  BaseAddress,
u8  Channel 
)

Read sampled data.

Details
This function reads the ADC sampled data register. The data register will be overwritten when the new sampled data is available.
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
ADCsampled data

Definition at line 161 of file axi_max11046.c.

u32 AXI_MAX11046_Read_Interrupt_Status ( u32  BaseAddress)

Read interrupt status.

Details
This function reads the interrupt status register. When the value is one, sampled data is available in the data register. Interrupt status register is a clear-on-read register
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
Interruptstatus

Definition at line 177 of file axi_max11046.c.

void AXI_MAX11046_Single_Convert ( u32  BaseAddress,
u8  Channel,
u16 *  uSample 
)

Read one ADC sample.

Details
This function starts an ADC conversion and returns one ADC sample.
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
OneADC sample

Definition at line 194 of file axi_max11046.c.

void AXI_MAX11046_Start_Conversion ( u32  BaseAddress)

Start ADC Conversion.

Details
This function writes a 1 to the start conversion register of the AXI_MAX11046 ip core to start the conversion
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
None

Definition at line 81 of file axi_max11046.c.

void AXI_MAX11046_Stop_Conversion ( u32  BaseAddress)

Stop ADC Conversion.

Details
This function writes a 0 to the start conversion register of the AXI_MAX11046 ip core to stop the conversion
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
Return values
None

Definition at line 96 of file axi_max11046.c.

void AXI_MAX11046_Write_Delay_Reg ( u32  BaseAddress,
u32  Value 
)

Write Value to the delay register.

Details
This function writes a value to the delay register. The delay register is used to control the sampling rate by inserting delay between each SPI frames. Sampling rate = 2*(SCLK rate)/(Delay_register+48)
Parameters
[in]BaseAddress- Base address of the AXI_MAX11046 IP core
[in]Value- a value to be written to the delay register
Return values
None

Definition at line 111 of file axi_max11046.c.