エンベデッド・ペリフェラルIPユーザーガイド

ID 683130
日付 9/21/2020
Public
ドキュメント目次
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ジェネレーター・コア

10.3.5.3. UARTデバイスの構造

UARTデバイスの構造1

typedef enum stopbit { STOPB_1 = 0,STOPB_2 } StopBit;
typedef enum paritybit { ODD_PARITY = 0, EVEN_PARITY, MARK_PARITY, SPACE_PARITY, NO_PARITY } ParityBit;
typedef enum databit { CS_5 = 0, CS_6, CS_7, CS_8, CS_9 = 256} DataBit;
typedef enum baud
{
BR9600 = B9600,
BR19200 = B19200,
BR38400 = B38400,
BR57600 = B57600,
BR115200 = B115200
} Baud;
typedef enum rx_fifo_level_e { RXONECHAR = 0, RXQUARTER, RXHALF, RXFULL } Rx_FifoLvl;
typedef enum tx_fifo_level_e { TXEMPTY = 0, TXTWOCHAR, TXQUARTER, TXHALF } Tx_FifoLvl;
typedef struct uart_config_s
{
StopBit stop_bit;
ParityBit parity_bit;
DataBit data_bit;
Baud baudrate;
alt_u32 fifo_mode;
Rx_FifoLvl rx_fifo_level;
Tx_FifoLvl tx_fifo_level;
alt_u32 hwfc;
} UartConfig;

UARTデバイスの構造2

typedef struct altera_16550_uart_state_s
{ 
alt_dev dev; 
void* base; /* The base address of the device */ 
alt_u32 clock; 
alt_u32 hwfifomode; 
alt_u32 ctrl; /* Shadow value of the LSR register */ 
volatile alt_u32 rx_start; /* Start of the pending receive data */ 
volatile alt_u32 rx_end; /* End of the pending receive data */ 
volatile alt_u32 tx_start; /* Start of the pending transmit data */ 
volatile alt_u32 tx_end; /* End of the pending transmit data */ 
alt_u32 freq; /* Current clock freq rate */ 
UartConfig config; /* Uart setting */ 
#ifdef ALTERA_16550_UART_USE_IOCTL 
struct termios termios; 
#endif 
alt_u32 flags; /* Configuration flags */ 
ALT_FLAG_GRP (events) /* Event flags used for 
* foreground/background in mult-threaded 
* mode */ 
ALT_SEM (read_lock) /* Semaphore used to control access to the 
* read buffer in multi-threaded mode */ 
ALT_SEM (write_lock) /* Semaphore used to control access to the 
* write buffer in multi-threaded mode */ 
volatile wchar_t rx_buf[ALT_16550_UART_BUF_LEN]; /* The receive buffer */ 
volatile wchar_t tx_buf[ALT_16550_UART_BUF_LEN]; /* The transmit buffer */ 
line_status_reg line_status; /* line register status for the current read byte data of RBR or data at the top of FIFO*/ 
alt_u8 error_ignore; /* received data will be discarded 
for the current read byte data of RBR or data at the top of FIFO if pe, fe and bi errors detected after error_ignore is set to '0' */ 
} altera_16550_uart_state;