|
DS160PR810 HAL Based Library 1.0.0
This library is a software library that works with the DS160PR810 PCIe 4.0 16-Gbps 8-channel linear redriver. This library provides a convenient and efficient way to access the I2C interfaces of the chip, allowing developers to easily integrate this redriver into their systems.
|
#include "ds160pr810.h"Functions | |
| Status | DS160PR810_init (DS160PR810 *self, I2C_HandleTypeDef *hi2c, uint8_t BANK0_I2C_ADDR) |
| Initialize the DS160PR810 with the given config. | |
| Status | DS160PR810_resetRegisters (DS160PR810 *self) |
| Resets the DS160PR810 registers. | |
| Status | __DS160PR810_writeByte (DS160PR810 *self, BankNumber bank_number, uint8_t MemAddress) |
| Write a byte of data to DS160PR810 from the ds160pr810::_reg::raw_data. | |
| Status | __DS160PR810_readByte (DS160PR810 *self, BankNumber bank_number, uint8_t MemAddress) |
| Read a byte of data from DS160PR810 and stores in the ds160pr810::_reg::raw_data. | |
| Status | __DS160PR810_setChannelConfig (DS160PR810 *self, ApplyTo target, uint8_t ChannelRegister) |
Configures the channel registers for the DS160PR810 This function writes configuration values to a specific channel register or broadcasts the configuration to all channels depending on the target parameter. | |
| Status | __DS160PR810_getChannelConfig (DS160PR810 *self, ApplyTo target, uint8_t ChannelRegister) |
| Reads the configuration of a channel register of the DS160PR810 This function reads configuration values of a specific channel register. | |
| Status | DS160PR810_setCTLE (DS160PR810 *self, ApplyTo target, EQStage1Bypass isByPassed, uint8_t Stage1, uint8_t Stage2) |
| Set the CTLE setting of the DS160PR810. | |
| Status | DS160PR810_setResetRxDetectStateMachine (DS160PR810 *self, ApplyTo target) |
| Resets the RX detect state machine. | |
| Status | DS160PR810_setClearRxDetectStateMachine (DS160PR810 *self, ApplyTo target) |
| Clear the reset flag of the RX detect state machine. | |
| Status | DS160PR810_setDCGain (DS160PR810 *self, ApplyTo target, TxVOD tx_vod, EQDCGain dc_gain) |
| Set the DC gain settings of the DS160PR810. | |
| EQStage1Bypass | DS160PR810_getCTLE_EQStage1Bypass (DS160PR810 *self, ApplyTo target) |
| Reads the DS160PR810 CTLE first stage status. This function reads status of the first stage of CTLE. | |
| uint8_t | DS160PR810_getCTLE_Stage1 (DS160PR810 *self, ApplyTo target) |
| Reads the DS160PR810 CTLE first stage gain index. This function reads gain index of the first stage of CTLE. | |
| uint8_t | DS160PR810_getCTLE_Stage2 (DS160PR810 *self, ApplyTo target) |
| Reads the DS160PR810 CTLE second stage gain index. This function reads gain index of the second stage of CTLE. | |
| TxVOD | DS160PR810_getDCGain_TxVOD (DS160PR810 *self, ApplyTo target) |
| Reads the TX VOD of the DS160PR810. | |
| EQDCGain | DS160PR810_getDCGain_EQDCGain (DS160PR810 *self, ApplyTo target) |
| Reads the DC gain of the DS160PR810. | |
| RxDetectStatus | DS160PR810_getRxDetectStatus (DS160PR810 *self, ApplyTo target) |
| Reads the RX detect status of the DS160PR810. | |
| uint8_t | DS160PR810_getDevID0 (DS160PR810 *self, BankNumber bank_number) |
| Reads device ID0 of the specific bank of th DS160PR810. | |
| uint8_t | DS160PR810_getDevID1 (DS160PR810 *self, BankNumber bank_number) |
| Reads device ID1 of the specific bank of th DS160PR810. | |
| uint8_t | DS160PR810_getEELoadComplete (DS160PR810 *self, BankNumber bank_number) |
| uint8_t | DS160PR810_getEELoadFail (DS160PR810 *self, BankNumber bank_number) |
| uint8_t | DS160PR810_getEEAtemptCount (DS160PR810 *self, BankNumber bank_number) |
| Status __DS160PR810_getChannelConfig | ( | DS160PR810 * | self, |
| ApplyTo | target, | ||
| uint8_t | ChannelRegister ) |
Reads the configuration of a channel register of the DS160PR810 This function reads configuration values of a specific channel register.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| ChannelRegister | The base address of the channel register to read. |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status __DS160PR810_readByte | ( | DS160PR810 * | self, |
| BankNumber | bank_number, | ||
| uint8_t | MemAddress ) |
Read a byte of data from DS160PR810 and stores in the ds160pr810::_reg::raw_data.
| self | A pointer to the ds160pr810 object (struct) |
| bank_number | Index of the bank you want to read the data |
| MemAddress | Address of the target register |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status __DS160PR810_setChannelConfig | ( | DS160PR810 * | self, |
| ApplyTo | target, | ||
| uint8_t | ChannelRegister ) |
Configures the channel registers for the DS160PR810 This function writes configuration values to a specific channel register or broadcasts the configuration to all channels depending on the target parameter.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target.
|
| ChannelRegister | The base address of the channel register to configure. |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status __DS160PR810_writeByte | ( | DS160PR810 * | self, |
| BankNumber | bank_number, | ||
| uint8_t | MemAddress ) |
Write a byte of data to DS160PR810 from the ds160pr810::_reg::raw_data.
| self | A pointer to the ds160pr810 object (struct) |
| bank_number | Index of the bank you want to write the data |
| MemAddress | Address of the target register |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| EQStage1Bypass DS160PR810_getCTLE_EQStage1Bypass | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the DS160PR810 CTLE first stage status. This function reads status of the first stage of CTLE.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| EQ_STAGE1_BYPASS_DISABLE | Stage1 is active |
| EQ_STAGE1_BYPASS_ENABLE | Stage1 is bypassed |
| uint8_t DS160PR810_getCTLE_Stage1 | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the DS160PR810 CTLE first stage gain index. This function reads gain index of the first stage of CTLE.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| From | 0 to 7 |
| uint8_t DS160PR810_getCTLE_Stage2 | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the DS160PR810 CTLE second stage gain index. This function reads gain index of the second stage of CTLE.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| From | 0 to 7 |
| EQDCGain DS160PR810_getDCGain_EQDCGain | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the DC gain of the DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| EQ_DC_GAIN_0db | 0.0db |
| EQ_DC_GAIN_3db5 | 3.5db |
| TxVOD DS160PR810_getDCGain_TxVOD | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the TX VOD of the DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| TX_VOD_0db | 0.0db |
| TX_VOD_m1db6 | -1.6db |
| TX_VOD_m3db5 | -3.5db |
| TX_VOD_m6db | -6.0db |
| uint8_t DS160PR810_getDevID0 | ( | DS160PR810 * | self, |
| BankNumber | bank_number ) |
Reads device ID0 of the specific bank of th DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| bank_number | The bank index |
| uint8_t DS160PR810_getDevID1 | ( | DS160PR810 * | self, |
| BankNumber | bank_number ) |
Reads device ID1 of the specific bank of th DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| bank_number | The bank index |
| uint8_t DS160PR810_getEEAtemptCount | ( | DS160PR810 * | self, |
| BankNumber | bank_number ) |
| uint8_t DS160PR810_getEELoadComplete | ( | DS160PR810 * | self, |
| BankNumber | bank_number ) |
| uint8_t DS160PR810_getEELoadFail | ( | DS160PR810 * | self, |
| BankNumber | bank_number ) |
| RxDetectStatus DS160PR810_getRxDetectStatus | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Reads the RX detect status of the DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target. |
| RX_DET_NONE | |
| RX_DET_N | |
| RX_DET_P | |
| RX_DET_BOTH |
| Status DS160PR810_init | ( | DS160PR810 * | self, |
| I2C_HandleTypeDef * | hi2c, | ||
| uint8_t | BANK0_I2C_ADDR ) |
Initialize the DS160PR810 with the given config.
| self | A pointer to the ds160pr810 object (struct) |
| hi2c | A pointer to the I2C handler that is connected to DS160PR810 |
| BANK0_I2C_ADDR | The I2C address of the bank0 of the DS160PR810. It depends on the state of ADDR0 and ADDR1 pins of the chip. |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status DS160PR810_resetRegisters | ( | DS160PR810 * | self | ) |
Resets the DS160PR810 registers.
| self | A pointer to the ds160pr810 object (struct) |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status DS160PR810_setClearRxDetectStateMachine | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Clear the reset flag of the RX detect state machine.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target.
|
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status DS160PR810_setCTLE | ( | DS160PR810 * | self, |
| ApplyTo | target, | ||
| EQStage1Bypass | isByPassed, | ||
| uint8_t | Stage1, | ||
| uint8_t | Stage2 ) |
Set the CTLE setting of the DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target.
|
| isByPassed | Determines the status of first stage of CTLE |
| Stage1 | Determines the gain index of first stage of CTLE. This s value between 0 to 7. |
| Stage2 | Determines the gain index of second stage of CTLE. This s value between 0 to 7. |
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status DS160PR810_setDCGain | ( | DS160PR810 * | self, |
| ApplyTo | target, | ||
| TxVOD | tx_vod, | ||
| EQDCGain | dc_gain ) |
Set the DC gain settings of the DS160PR810.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target.
|
| tx_vod | Specifies the VOD
|
| dc_gain | Specifies the DC gain
|
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |
| Status DS160PR810_setResetRxDetectStateMachine | ( | DS160PR810 * | self, |
| ApplyTo | target ) |
Resets the RX detect state machine.
| self | A pointer to the ds160pr810 object (struct) |
| target | Specifies the target.
|
| STATUS_OK | in case of success |
| STATUS_TimeOut | in case of failure |