45 #include "alt_clock_manager.h"
46 #include "socal/alt_i2c.h"
47 #include "socal/alt_rstmgr.h"
48 #include "socal/hps.h"
49 #include "socal/socal.h"
123 typedef struct ALT_I2C_DEV_s
126 alt_freq_t clock_freq;
127 uint32_t last_target;
138 #if defined(soc_cv_av)
139 ALT_I2C_I2C2 = (int)ALT_I2C2_OFST,
140 ALT_I2C_I2C3 = (
int)ALT_I2C3_OFST
141 #elif defined(soc_a10)
144 ALT_I2C_I2C2 = (int)ALT_I2C_EMAC_0_I2C_OFST,
145 ALT_I2C_I2C3 = (
int)ALT_I2C_EMAC_1_I2C_OFST,
146 ALT_I2C_I2C4 = (int)ALT_I2C_EMAC_2_I2C_OFST
790 uint32_t * speed_in_hz);
813 uint32_t speed_in_hz);
818 #define alt_i2c_cfg_to_speed(i2c_dev, speed_in_hz, cfg) alt_i2c_master_config_speed_get((i2c_dev), (cfg), (speed_in_hz))
823 #define alt_i2c_speed_to_cfg(i2c_dev, speed_in_hz, cfg) alt_i2c_master_config_speed_set((i2c_dev), (cfg), (speed_in_hz))
880 #if defined (soc_cv_av)
898 ALT_STATUS_CODE alt_i2c_sda_hold_time_get(ALT_I2C_DEV_t *i2c_dev,
899 uint16_t *hold_time);
918 ALT_STATUS_CODE alt_i2c_sda_hold_time_set(ALT_I2C_DEV_t *i2c_dev,
919 const uint16_t hold_time);
920 #elif defined (soc_a10)
938 ALT_STATUS_CODE alt_i2c_sda_tx_hold_time_get(ALT_I2C_DEV_t *i2c_dev,
939 uint16_t *tx_hold_time);
958 ALT_STATUS_CODE alt_i2c_sda_rx_hold_time_get(ALT_I2C_DEV_t *i2c_dev,
959 uint16_t *rx_hold_time);
977 ALT_STATUS_CODE alt_i2c_sda_tx_hold_time_set(ALT_I2C_DEV_t *i2c_dev,
978 const uint16_t tx_hold_time);
996 ALT_STATUS_CODE alt_i2c_sda_rx_hold_time_set(ALT_I2C_DEV_t *i2c_dev,
997 const uint16_t rx_hold_time);
1083 ALT_STATUS_CODE
alt_i2c_read(ALT_I2C_DEV_t *i2c_dev, uint8_t *val);
1110 ALT_STATUS_CODE
alt_i2c_write(ALT_I2C_DEV_t *i2c_dev,
const uint8_t val);
1160 const uint8_t data);
1315 const uint8_t issue_restart,
1316 const uint8_t issue_stop);
1382 const uint8_t issue_restart,
1383 const uint8_t issue_stop);
1433 const uint8_t issue_restart,
1434 const uint8_t issue_stop);
1486 const uint8_t value,
1487 const uint8_t issue_restart,
1488 const uint8_t issue_stop);
1572 const uint8_t issue_restart,
1573 const uint8_t issue_stop);
1835 #define ALT_I2C_RX_FIFO_NUM_ENTRIES 64
1884 uint32_t *num_entries);
1903 uint8_t *threshold);
1922 const uint8_t threshold);
1944 #define ALT_I2C_TX_FIFO_NUM_ENTRIES 64
1993 uint32_t *num_entries);
2012 uint8_t *threshold);
2031 const uint8_t threshold);