インテルのみ表示可能 — GUID: wtv1476294356570
Ixiasoft
1. 概要
2. Avalon® -ST Multi-Channel Shared Memory FIFOコア
3. Avalon® -STシングルクロックFIFOコアおよびデュアルクロックFIFOコア
4. Avalon® -STシリアル・ペリフェラル・インターフェイス・コア
5. SPIコア
6. SPI Slave to Avalon® Master Bridgeコア/JTAG to Avalon® Master Bridgeコア
7. インテル eSPIスレーブコア
8. eSPI to LPCブリッジコア
9. イーサネットMDIOコア
10. インテルFPGA 16550互換UARTコア
11. UARTコア
12. JTAG UARTコア
13. インテル FPGA Avalon® Mailboxコア
14. インテル FPGA Avalon® ミューテックス・コア
15. インテル FPGA Avalon® I2C (Master) コア
16. インテル FPGA I2C Slave to Avalon® -MM Master Bridgeコア
17. インテルFPGA Avalon® コンパクト・フラッシュ・コア
18. EPCS/EPCQAシリアル・フラッシュ・コントローラー・コア
19. インテルFPGAシリアル・フラッシュ・コントローラー・コア
20. インテルFPGAシリアル・フラッシュ・コントローラーIIコア
21. インテルFPGA汎用クアッドSPIコントローラー・コア
22. インテルFPGA汎用クアッドSPIコントローラーIIコア
23. インターバル・タイマー・コア
24. インテルFPGA Avalon FIFOメモリーコア
25. オンチップメモリー (RAMおよびROM) コア
26. Optrex 16207 LCDコントローラー・コア
27. PIOコア
28. PLLコア
29. DMAコントローラー・コア
30. Modular Scatter-Gather DMAコア
31. Scatter-Gather DMAコントローラー・コア
32. SDRAMコントローラー・コア
33. トライステートSDRAMコア
34. Video Sync GeneratorコアとPixel Converterコア
35. インテル FPGA Interrupt Latency Counterコア
36. パフォーマンス・カウンター・ユニット・コア
37. ベクトル割り込みコントローラー・コア
38. Avalon® -STデータ・パターン・ジェネレーター・コアとデータ・パターン・チェッカー・コア
39. Avalon® -STテスト・パターン・ジェネレーター・コアとテスト・パターン・チェッカー・コア
40. システムIDペリフェラル・コア
41. Avalon® Packets to Transactions Converterコア
42. Avalon® -STマルチプレクサー・コアとデマルチプレクサー・コア
43. Avalon® -ST Bytes to Packets ConverterコアとPackets to Bytes Converterコア
44. Avalon® -ST Delayコア
45. Avalon® -STラウンド・ロビン・スケジューラー・コア
46. Avalon® -ST Splitterコア
47. Avalon® -MM DDR Memory Half Rate Bridgeコア
48. インテル FPGA GMII to RGMIIコンバーター・コア
49. インテル FPGA MII to RMIIコンバーター・コア
50. インテルFPGA HPS GMII to TSE 1000BASE-X/SGMII PCSブリッジコア
51. インテル FPGA HPS EMAC to Multi-rate PHY GMIIアダプターコア
52. インテル FPGA MSI to GICジェネレーター・コア
15.5.2.1. Transfer Command FIFO (TFR_CMD)
15.5.2.2. Receive Data FIFO (RX_DATA)
15.5.2.3. Control Register (CTRL)
15.5.2.4. Interrupt Status Enable Register (ISER)
15.5.2.5. Interrupt Status Register (ISR)
15.5.2.6. Status Register (STATUS)
15.5.2.7. TFR CMD FIFO Level (TFR CMD FIFO LVL)
15.5.2.8. RX Data FIFO Level (RX Data FIFO LVL)
15.5.2.9. SCL Low Count (SCL LOW)
15.5.2.10. SCL High Count (SCL HIGH)
15.5.2.11. SDA Hold Count (SDA HOLD)
24.6.1. altera_avalon_fifo_init()
24.6.2. altera_avalon_fifo_read_status()
24.6.3. altera_avalon_fifo_read_ienable()
24.6.4. altera_avalon_fifo_read_almostfull()
24.6.5. altera_avalon_fifo_read_almostempty()
24.6.6. altera_avalon_fifo_read_event()
24.6.7. altera_avalon_fifo_read_level()
24.6.8. altera_avalon_fifo_clear_event()
24.6.9. altera_avalon_fifo_write_ienable()
24.6.10. altera_avalon_fifo_write_almostfull()
24.6.11. altera_avalon_fifo_write_almostempty()
24.6.12. altera_avalon_write_fifo()
24.6.13. altera_avalon_write_other_info()
24.6.14. altera_avalon_fifo_read_fifo()
24.6.15. altera_avalon_fifo_read_other_info()
30.5.1. Statusレジスター
30.5.2. Controlレジスター
30.5.3. Write Fill Levelレジスター
30.5.4. Read Fill Levelレジスター
30.5.5. Response Fill Levelレジスター
30.5.6. Write Sequence Numberレジスター
30.5.7. Read Sequence Numberレジスター
30.5.8. Component Configuration 1レジスター
30.5.9. Component Configuration 2レジスター
30.5.10. Component Typeレジスター
30.5.11. Component Versionレジスター
30.8.1. alt_msgdma_standard_descriptor_async_transfer
30.8.2. alt_msgdma_extended_descriptor_async_transfer
30.8.3. alt_msgdma_descriptor_async_transfer
30.8.4. alt_msgdma_standard_descriptor_sync_transfer
30.8.5. alt_msgdma_extended_descriptor_sync_transfer
30.8.6. alt_msgdma_descriptor_sync_transfer
30.8.7. alt_msgdma_construct_standard_st_to_mm_descriptor
30.8.8. alt_msgdma_construct_standard_mm_to_st_descriptor
30.8.9. alt_msgdma_construct_standard_mm_to_mm_descriptor
30.8.10. alt_msgdma_construct_standard_descriptor
30.8.11. alt_msgdma_construct_extended_st_to_mm_descriptor
30.8.12. alt_msgdma_construct_extended_mm_to_st_descriptor
30.8.13. alt_msgdma_construct_extended_mm_to_mm_descriptor
30.8.14. alt_msgdma_construct_extended_descriptor
30.8.15. alt_msgdma_register_callback
30.8.16. alt_msgdma_open
30.8.17. alt_msgdma_write_standard_descriptor
30.8.18. alt_msgdma_write_extended_descriptor
30.8.19. alt_msgdma_init
30.8.20. alt_msgdma_irq
31.7.1. データ構造
31.7.2. SG-DMAのAPI
31.7.3. alt_avalon_sgdma_do_async_transfer()
31.7.4. alt_avalon_sgdma_do_sync_transfer()
31.7.5. alt_avalon_sgdma_construct_mem_to_mem_desc()
31.7.6. alt_avalon_sgdma_construct_stream_to_mem_desc()
31.7.7. alt_avalon_sgdma_construct_mem_to_stream_desc()
31.7.8. alt_avalon_sgdma_enable_desc_poll()
31.7.9. alt_avalon_sgdma_disable_desc_poll()
31.7.10. alt_avalon_sgdma_check_descriptor_status()
31.7.11. alt_avalon_sgdma_register_callback()
31.7.12. alt_avalon_sgdma_start()
31.7.13. alt_avalon_sgdma_stop()
31.7.14. alt_avalon_sgdma_open()
37.5.6.1. altera_vic_driver.enable_preemption
37.5.6.2. altera_vic_driver.enable_preemption_into_new_register_set
37.5.6.3. altera_vic_driver.enable_preemption_rs_<n>
37.5.6.4. altera_vic_driver.linker_section
37.5.6.5. altera_vic_driver.<name>.vec_size
37.5.6.6. altera_vic_driver.<name>.irq<n>_rrs
37.5.6.7. altera_vic_driver.<name>.irq<n>_ril
37.5.6.8. altera_vic_driver.<name>.irq<n>_rnmi
37.5.6.9. RRSおよびRILのデフォルトの設定
37.5.6.10. インテルFPGA HALの実装に向けたVIC BSPのデザイン規則
37.5.6.11. RTOSに関する考慮事項
39.7.1. data_source_reset()
39.7.2. data_source_init()
39.7.3. data_source_get_id()
39.7.4. data_source_get_supports_packets()
39.7.5. data_source_get_num_channels()
39.7.6. data_source_get_symbols_per_cycle()
39.7.7. data_source_set_enable()
39.7.8. data_source_get_enable()
39.7.9. data_source_set_throttle()
39.7.10. data_source_get_throttle()
39.7.11. data_source_is_busy()
39.7.12. data_source_fill_level()
39.7.13. data_source_send_data()
39.8.1. data_sink_reset()
39.8.2. data_sink_init()
39.8.3. data_sink_get_id()
39.8.4. data_sink_get_supports_packets()
39.8.5. data_sink_get_num_channels()
39.8.6. data_sink_get_symbols_per_cycle()
39.8.7. data_sink_set enable()
39.8.8. data_sink_get_enable()
39.8.9. data_sink_set_throttle()
39.8.10. data_sink_get_throttle()
39.8.11. data_sink_get_packet_count()
39.8.12. data_sink_get_symbol_count()
39.8.13. data_sink_get_error_count()
39.8.14. data_sink_get_exception()
39.8.15. data_sink_exception_is_exception()
39.8.16. data_sink_exception_has_data_error()
39.8.17. data_sink_exception_has_missing_sop()
39.8.18. data_sink_exception_has_missing_eop()
39.8.19. data_sink_exception_signalled_error()
39.8.20. data_sink_exception_channel()
インテルのみ表示可能 — GUID: wtv1476294356570
Ixiasoft
15.7.6. プログラミング・モデル
次のフローチャートは、推奨されるコアのプログラミング・フローを示しています。
図 54. プログラミング・モデルのフローチャート
注: ARBLOST_DETまたはNACK_DETのいずれかが発生している場合は、エラー処理手順でそれぞれの割り込みステータス・レジスター・ビットをクリアしてから、新しいI2C転送を続行する必要があります。新しいI2C転送は、コアを無効にするかしないかに関係なく開始することができます。
APIの使用方法
int main() { ALT_AVALON_I2C_DEV_t *i2c_dev; //pointer to instance structure alt_u8 txbuffer[0x200]; alt_u8 rxbuffer[0x200]; int i; ALT_AVALON_I2C_STATUS_CODE status; //get a pointer to the avalon i2c instance i2c_dev = alt_avalon_i2c_open("/dev/i2c_0"); if (NULL==i2c_dev) { printf("Error: Cannot find /dev/i2c_0\n"); return 1; } //set the address of the device using alt_avalon_i2c_master_target_set(i2c_dev,0x51) //write data to an eeprom at address 0x0200 txbuffer[0]=2; txbuffer[1]=0; //The eeprom address which will be sent as first two bytes of data for (i=0;i<0x10;i++) txbuffer[i+2]=i; //some data to write status=alt_avalon_i2c_master_tx(i2c_dev,txbuffer, 0x10+2, ALT_AVALON_I2C_NO_INTERRUPTS); if (status!=ALT_AVALON_I2C_SUCCESS) return 1; //FAIL //read back the data into rxbuffer //This command sends the 2 byte eeprom data address required by the eeprom //Then does a restart and receives the data. status=alt_avalon_i2c_master_tx_rx(i2c_dev, txbuffer, 2, rxbuffer, 0x10, ALT_AVALON_I2C_NO_INTERRUPTS); if (status!=ALT_AVALON_I2C_SUCCESS) return 1; //FAIL return 0; }
//Using the optional irq callback: int main() { ALT_AVALON_I2C_DEV_t *i2c_dev; //pointer to instance structure alt_u8 txbuffer[0x210]; alt_u8 rxbuffer[0x200]; int i; ALT_AVALON_I2C_STATUS_CODE status; //storage for the optional provided interrupt handler structure IRQ_DATA_t irq_data; //get a pointer to the avalon i2c instance i2c_dev = alt_avalon_i2c_open("/dev/i2c_0"); if (NULL==i2c_dev) { printf("Error: Cannot find /dev/i2c_0\n"); return 1; } //register the optional interrupt callback. alt_avalon_i2c_register_optional_irq_handler(i2c_dev,&irq_data); //set the address of the device we will be using alt_avalon_i2c_master_target_set(i2c_dev,0x51); //assume an eeprom at address 0x51 //write data to an eeprom at address (within the eeprom) 0x0200 txbuffer[0]=2; txbuffer[1]=0; //The eeprom data address which will be sent as first two bytes of data for (i=0;i<0x10;i++) txbuffer[i+2]=i; //some data to write while (1) { //for function retry status=alt_avalon_i2c_master_tx(i2c_dev, txbuffer, 0x10+2, ALT_AVALON_I2C_USE_INTERRUPTS); if (status!=ALT_AVALON_I2C_SUCCESS) return 1; //FAIL //Completion should be checked by using the alt_avalon_i2c_interrupt_transaction_status function. //Note: Interrupt and non-interrupt transactions can be mixed in any sequence, so if desired this short address setup transaction can use ALT_AVALON_I2C_NO_INTERRUPTS. while (alt_avalon_i2c_interrupt_transaction_status(i2c_dev) == ALT_AVALON_I2C_BUSY) { } //Did the transaction complete OK? If yes then break out of this retry loop, otherwise, have to do the transaction again //You may want to have a retry limit instead of while (1) if (alt_avalon_i2c_interrupt_transaction_status(i2c_dev) == ALT_AVALON_I2C_SUCCESS) break; } while (1) { //for function retry, read back the data into rxbuffer status=alt_avalon_i2c_master_tx_rx(i2c_dev, txbuffer, 2, rxbuffer, 0x10, ALT_AVALON_I2C_USE_INTERRUPTS); if (status!=ALT_AVALON_I2C_SUCCESS) return 1; //FAIL //For this example we will just waste the time in a loop. while (alt_avalon_i2c_interrupt_transaction_status(i2c_dev) == ALT_AVALON_I2C_BUSY) { } //Did the transaction complete OK if (alt_avalon_i2c_interrupt_transaction_status(i2c_dev) == ALT_AVALON_I2C_SUCCESS) break; } return 0; }