Page 148
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 149
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 150
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 151
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 152
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 153
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 173. Type D I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name/ FUNC = 1 FUNC = 2...
Page 154
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx Table 175. Type A I/O Control registers: FUNC values and pin functions Value of FUNC field in IOCON register Reg name FUNC = 0 FUNC = 1 FUNC = 2...
Page 306
UM10912 Chapter 18: LPC546xx Repetitive Interrupt Timer (RIT) Rev. 1.7 — 14 April 2017 User manual 18.1 How to read this chapter This timer is available on all LPC546xx devices. 18.2 Features • 48-bit counter running from the main clock. Counter can be free-running or be reset by a generated interrupt.
Page 308
UM10912 NXP Semiconductors Chapter 18: LPC546xx Repetitive Interrupt Timer (RIT) 18.5 Register description Table 319. Register overview: Repetitive Interrupt Timer (RIT) (base address 0x4002 D000) Name Access Address Description Reset value Reference COMPVAL 0x000 Compare value LSB register. Holds the 32 LSBs of the 0xFFFF FFFF 18.5.1...
Page 309
UM10912 NXP Semiconductors Chapter 18: LPC546xx Repetitive Interrupt Timer (RIT) Table 322. RI Control register (CTRL, address 0x4002 D008) bit description Symbol Value Description Reset value RITENCLR Timer enable clear The timer will be cleared to 0 whenever the counter value equals the masked compare value specified by the contents of COMPVAL/COMPVAL_H and MASK/MASK_H registers.
Page 310
UM10912 NXP Semiconductors Chapter 18: LPC546xx Repetitive Interrupt Timer (RIT) Table 326. RI Counter MSB register (COUNTER_H, address 0x4002 D01C) bit description Symbol Description Reset value 15:0 RICOUNTER 16 LSBs of the up counter. Counts continuously unless RITEN bit in RICTRL register is cleared or debug mode is entered (if enabled by the RITNEBR bit in RICTRL).
Page 311
UM10912 NXP Semiconductors Chapter 18: LPC546xx Repetitive Interrupt Timer (RIT) 18.6 RI timer operation Following reset, the counter begins counting up from 0. (The RIT bit must be set in the AHBCLKCTRL1 register to enable the clock to the RIT.) Whenever the counter value equals the 48-bit value programmed into the COMPVAL and COMPVAL_H registers, the interrupt flag will be set.
Page 468
UM10912 Chapter 27: LPC546xx SD/MMC and SDIO interface Rev. 1.7 — 14 April 2017 User manual 27.1 How to read this chapter The SD/MMC card interface is available on all LPC546xx devices. 27.2 Features The SD/MMC card interface supports the following features: •...
Page 469
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • Pins: Configure pins that will be used for this peripheral in the IOCON register block. Chapter 7 for IOCON details, and Section 27.5 for recommended IOCON settings for the SDIO.
Page 470
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.5 Pin description Table 462. SD/MMC pin description Pin function Type Description SD_CLK SD/SDIO/MMC clock. SD_CARD_DET_N SDIO card detect for single slot. A 0 represents the presence of a card.
Page 471
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6 Register description Figure 91 shows the memory map of the SDIO peripheral. Fig 91. SDIO memory map Table 464. Register overview: SDMMC (base address: 0x4009 B000) Name Access Offset...
Page 473
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 465. Control register (CTRL, offset 0x000) bit description Symbol Value Description Reset value DMA_RESET DMA reset. To reset DMA interface, software should set bit to 1. This bit is auto-cleared after two AHB clocks.
Page 474
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 465. Control register (CTRL, offset 0x000) bit description Symbol Value Description Reset value SEND_AUTO_STOP_CCSD Send auto stop ccsd. NOTE: Always set SEND_AUTO_STOP_CCSD and SEND_CCSD bits together; SEND_AUTO_STOP_CCSD should not be set independent of SEND_CCSD.
Page 475
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.3 Clock Divider register Table 467. Clock Divider register (CLKDIV, offset 0x008) bit description Symbol Description Reset value CLK_DIVIDER0 Clock divider-0 value. Clock division is 2*n. For example, value of 0 means divide by 2 * 0 = 0 (no division, bypass), value of 1 means divide by 2 * 1 = 2, value of “FF”...
Page 477
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 473. Interrupt Mask register (INTMASK, offset 0x024) bit description Symbol Description Reset value Auto command done. Bits used to mask unwanted interrupts. Value of 0 masks interrupt; value of 1 enables interrupt.
Page 478
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 475. Command register (CMD, offset 0x02C) bit description Symbol Value Description Reset value SEND_AUTO_STOP Send auto stop. When set, the SD/MMC interface sends stop command to SD_MMC_CEATA cards at end of data transfer.
Page 479
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 475. Command register (CMD, offset 0x02C) bit description Symbol Value Description Reset value UPDATE_CLOCK_REGISTERS_ Update clock registers only. Following register values transferred ONLY into card clock domain: CLKDIV, CLRSRC, CLKENA. Changes card clocks (change frequency, truncate off or on, and set low-frequency mode);...
Page 480
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 475. Command register (CMD, offset 0x02C) bit description Symbol Value Description Reset value BOOT_MODE Boot Mode Mandatory Boot operation Alternate Boot operation VOLT_SWITCH Voltage switch bit Disabled. No voltage switching Enabled.
Page 481
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.15 Response register 3 Table 479. Response register 3 (RESP3, offset 0x03C) bit description Symbol Description Reset value 31:0 RESPONSE3 Bit[127:96] of long response 27.6.16 Masked Interrupt Status register Table 480. Masked Interrupt Status register (MINTSTS, offset 0x040) bit description...
Page 482
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.17 Raw Interrupt Status register Table 481. Raw Interrupt Status register (RINTSTS, offset 0x044) bit description Symbol Description Reset value CDET Card detect. Writes to bits clear status bit. Value of 1 clears status bit, and value of 0 leaves bit intact.
Page 483
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.18 Status register Table 482. Status register (STATUS, offset 0x048) bit description Symbol Description Reset value FIFO_RX_WATERMARK FIFO reached Receive watermark level; not qualified with data transfer. FIFO_TX_WATERMARK FIFO reached Transmit watermark level; not qualified with data transfer.
Page 484
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.19 FIFO Threshold Watermark register Table 483. FIFO Threshold Watermark register (FIFOTH, offset 0x04C) bit description Symbol Value Description Reset value 11:0 TX_WMARK - FIFO threshold watermark level when transmitting data to card. When FIFO data count is less than or equal to this number, DMA/FIFO request is raised.
Page 485
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 483. FIFO Threshold Watermark register (FIFOTH, offset 0x04C) bit description Symbol Value Description Reset value 30:28 DMA_MTS Burst size of multiple transaction; should be programmed same as DW-DMA controller multiple-transaction-size SRC/DEST_MSIZE.The units for transfers is the...
Page 486
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.6.22 Transferred CIU Card Byte Count register Table 486. Transferred CIU Card Byte Count register (TCBCNT, offset 0x05C) bit description Symbol Description Reset value 31:0 TRANS_CARD_BYTE_COUNT Number of bytes transferred by CIU unit to card.
Page 487
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 490. Bus Mode register (BMOD, offset 0x080) bit description Symbol Value Description Reset value 10:8 Programmable Burst Length. These bits indicate the maximum number of beats to be performed in one SD/MMC DMA transaction. The SD/MMC DMA will always attempt to burst as specified in PBL each time it starts a Burst transfer on the host bus.
Page 488
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 493. Internal DMAC Status register (IDSTS, offset 0x08C) bit description Symbol Description Reset value Card error summary. Indicates the status of the transaction to/from the card; also present in RINTSTS.
Page 489
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 494. Internal DMAC Interrupt Enable register (IDINTEN, offset 0x090) bit description Symbol Description Reset value Card error summary interrupt enable. When set, it enables the Card Interrupt summary. Reserved Normal interrupt summary enable.
Page 490
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 497. Card Threshold Control register (CARDTHRCTL, offset 0x100) bit description Symbol Value Description Reset value 15:2 Reserved 23:16 CARDTHRESHOLD - Card threshold size. Sets the read and/or write threshold within the 32-entry FIFOs.
Page 491
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.7 Functional description 27.7.1 Power/pull-up control and card detection unit Signal pull-up resistors can be enabled for the SD pins in IOCON by enabling the pull-up for the pads. The approximate pull-up value for a pin is about 50 kOhm. For designs that need to support legacy MMC cards in open-drain mode, an external pull-up controlled with a general purpose output and FET will be needed for the CMD line.
Page 492
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 499. SEND_AUTO_STOP bit Card Type Transfer Type Byte Count SEND_AUTO_STOP bit set Comments SDMEM Multiple-block write >0 Auto-stop after all bytes transfer SDIO Single-block read >0 Byte count = 0 is illegal...
Page 493
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface CPU wants to terminate the data transfer before the data transfer is complete, it can issue a stop or abort command, in which case the Module does not generate an auto-stop command.
Page 494
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface If the software issues a CONTROLLER_RESET command by setting control register (CTRL) bit[0] to 1, all the CIU state machines are reset; the FIFO is not cleared. The DMA sends all remaining bytes to the CPU. In addition to a card-reset, if a FIFO reset is also issued, then: •...
Page 495
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface ResponseTimeOut = 0x40 DataTimeOut = highest of one of the following: – (10 ((TAAC Fop) + (100 NSAC)) – CPU FIFO read/write latency from FIFO empty/full FIFO threshold value in bytes in the FIFOTH register. Typically, the threshold value can be set to half the FIFO depth (= 32/2);...
Page 496
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface – If ATA mode is supported, the CPU should select the ATA mode by setting the ATA bit (bit 4) of the EXT_CSD register slice 191(CMD_SET) to activate the ATA command set for use.
Page 497
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 3. Wait for command acceptance by CPU. The following happens when the command is loaded into the Module: – Module accepts the command for execution and clears the START_CMD bit in the CMD register, unless one command is in process, at which point the Module can load and keep the second command in the buffer.
Page 498
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.8.2.5 Data transfer commands Data transfer commands transfer data between the memory card and the Module. To send a data command, the Module needs a command argument, total data size, and block size.
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 4. Software should look for data error interrupts; that is, bits 7, 9, 13, and 15 of the RINTSTS register. If required, software can terminate the data transfer by sending a STOP command.
Page 500
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 5. Program the Command register with the parameters listed in Table 502. For SD and MMC cards, use CMD24 for a single-block write and CMD25 for a multiple-block write. For SDIO cards, use CMD53 for both single-block and multiple-block transfers.
Page 501
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.8.2.8 Stream read A stream read is like the block read mentioned in "Single-Block or Multiple-Block Read", except for the following bits in the Command register (CMD): TRANSFER_MODE = 1; //Stream transfer CMD_INDEX = CMD20;...
Page 502
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface – Send ABORT command - Can be used with only an SDIO_IOONLY or SDIO_COMBO card. To abort the function that is transferring data, program the function number in ASx bits (CCCR register of card, address 0x06, bits (0-2) using CMD52.
Page 503
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface To suspend the transfer, set BR (bit 2) of the CCCR register. Poll for clear status of bits BR (bit 1) and BS (bit 0) of the CCCR. The BS (Bus Status) bit is 1 when the currently-selected function is using the data bus;...
Page 504
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 504. Parameters for CMDARG register Bits Contents Value 25-9 Register address 0x0D Don’t care Write data Function number to be aborted 27.8.2.13 Read_Wait Sequence Read_wait is used with only the SDIO card and can temporarily stall the data transfer-either from function or memory-and allow the CPU to send commands to any function within the SDIO device.
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface The CPU software stack should write the task file image to the FIFO before setting the CMDARG and CMD registers. The CPU processor then sets the address and byte count in the CMDARG-offset 0x28 in the BIU register space-before setting the CMD (offset 0x2C) register bits.
Page 506
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 506. CMD register settings Name Value Comment CMD_INDEX Command index RESPONSE_LENGTH RESPONSE_EXPECT User-selectable USE_HOLD_REG CMD and DATA sent to card bypassing HOLD register. CMD and DATA sent to card through the HOLD register. Hold settings applied through the SDIOCLKCTRL register in Syscon.
Page 507
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 509. Parameters for CMDARG register Bits Contents Value 23:16 Reserved 15:8 Data Count Unit [15:8] Data count Data Count Unit [7:0] Data count • Program the Command (CMD) register as shown below.
Page 508
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • Send CCSD - Module sends CCSD to the CE-ATA device if the SEND_CCSD bit is set in the CTRL register; this bit is set only after a response is received for the RW_BLK.
Page 509
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • CMD register settings: – ccs_expect set to 1 – DATA_EXPECTED set to 1 • CMDARG register settings: – Bit [31] set to 0 (Read operation) Data Count set to 1 (16'h0001) •...
Page 510
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • BLKSIZ register bits [15:0] and BYTCNT register - Set to 16 27.8.2.15 Controller/DMA/FIFO reset usage Communication with the card involves the following: • Controller - Controls all functions of the Module.
Page 511
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 513. Card Read Threshold for Round Trip Delay Model Round Trip Delay Is Stopping of Card Card Read Threshold (Delay_R = Delay_O + tODLY + Delay_I) Clock Allowed? Required? SDR25 Delay_R >...
Page 512
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 1. Choose Block Size The block size must be based on the following: – Rule 1 – DWORD-aligned Block Size The block size requested by the application from the card for the read transfer card must be DWORD-aligned.
Page 513
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface – Internal DMA (IDMAC) mode The size of the data buffer (BuffSize in bytes) for each descriptor must be a multiple of MSIZE * H_DATA_WIDTH / 8. For example, BuffSize = n * MSIZE * H_DATA_WIDTH / 8, where n = 1, 2, 3…...
Page 514
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface The following shows how to program the CardRdThreshold when BlkSize is greater than ½ FifoDepth. 1. Choose a DWORD-aligned BlkSize less than FifoDepth. If Block Size is 192 bytes, then BlkSize = 192 * 8/F_DATA_WIDTH = 48 FIFO locations 2.
Page 515
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface For example, RX_WMARK = 16 - 1 = 15 FIFO locations. 4. Since BlkSize < ½ FifoDepth, choose CardRdThreshold = Block Size. CardRdThreshold = 64 bytes. Fig 93. FIFO contents when BlkSize < ½ FifoDepth 27.8.2.17 Back-end power...
Page 516
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Fig 95. Flowchart for card power requirements 1. The driver reads the SMPC register. 2. If the value is 0, then the total power requirement is less than or equal to 720 mW.
Page 517
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 514. FBR registers for power tuning Addr: Field Type Description Support Power Selection • SPS = 0: Has no Power Selection; EPS is zero. • SPS = 1: Has two power modes selected by EPS.
Page 518
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface – If the value of SPS is 0, the function does not support power selection. – If the value of SPS is 1, the driver reads the EPS register. If the value of EPS is 0, the function is set to High Current Mode.
Page 519
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • Write operation - Any MMC Transport layer error known to the device causes an outstanding ATA command to be terminated. The ERR bits are set in the ATA status registers and the appropriate error code is sent to the ATA Error register.
Page 520
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Fig 98. Dual buffer descriptor structure Fig 99. Chain descriptor structure 27.8.3.1 SD/MMC DMA descriptors 27.8.3.1.1 SD/MMC DMA descriptor DESC0 The DES0 descriptor contains control and status information. Table 515. SD/MMC DMA DESC0 descriptor...
Page 521
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 515. SD/MMC DMA DESC0 descriptor Symbol Description First Descriptor When set, this bit indicates that this descriptor contains the first buffer of the data. If the size of the first buffer is 0, next Descriptor contains the beginning of the data.
Page 522
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 517. SD/MMC DMA DESC2 descriptor Symbol Description 31:0 BAP1 Buffer Address Pointer 1 These bits indicate the physical address of the first data buffer. The SD/MMC DMA ignores DES2 [1:0], corresponding to the bus width of 64/32/16, internally.
Page 523
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.8.3.2.3 Buffer size calculations The driver knows the amount of data to transmit or receive. For transmitting to the card, the IDMAC transfers the exact number of bytes to the FIFO, indicated by the buffer size field of DES1.
Page 524
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 3. The Host will program the required receive threshold level (RX_WMARK field in FIFOTH register). 4. The SD/MMC DMA determines that a read data transfer needs to be done as a consequence of step 2.
Page 525
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 1. When the host issues CMD12 when a data transfer on the card data lines is in progress, the FSM closes the present descriptor after completing the transfer of data until a DTO interrupt is asserted.
Page 526
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 519. PBL and watermark levels PBL (number of transfers) Transmit/receive watermark value greater than or equal to 1 greater than or equal to 4 greater than or equal to 8...
Page 527
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface is inserted, the card-detect pin is shorted to ground, which makes card_detect_n go to 0. Similarly in SD cards, when the write-protect switch is toward the left, it shorts the SD_WR_PRT port to ground.
Page 528
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 2.2 RC = rise-time = 1/400 kHz R = 1/(2.2 * C * 100 kHz = 1/(2.2 x 20 x 10**-12 x 400 x 10**3 = 1/(1.76 x 10**-5 = 56.8K The Rod and Rcmd should be adjusted in such a way that the effective pull-up is at the maximum 5.68K during enumeration.
Page 529
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.9 Clocking and timing guidelines The SDMMC/SDIO interface (also referred to as the host controller) has four input clocks and one output clock. 27.9.1 Clock domains The SDMMC/SDIO interface has the following clocks: Table 520.
Page 530
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface – During data transfers, in order to avoid data loss when the host does not push or pop data to or from the FIFO at the rate the data is sent or received from the cards;...
Page 531
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface • tODLY = cclk_out to card output delay (varies across card manufactures and speed modes) • Delay_S = Delay by which cclk_in_sample is phase-shifted with regard to cclk_in • Delay_D = Delay by which cclk_in_drv is phase-shifted with regard to cclk_in •...
Page 532
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Table 521. Timing requirements Speed Mode Max cclk_out Frequency Min Hold Min Setup Max tODLY Time Time tODLY SDR12 14.0 0.35 Identification Mode 2500 50.0 0.02 MMC High Speed (DAT and CMD) 50 13.7...
Page 533
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface Fig 107. Timing diagram for phase-shifted clocks 27.9.2.3 SDIOCLKCTRL register The SDIOCLKCTRL is a 32-bit SYSCON register that allows delay the SD/MMC internal input clock for both sampling of input data from the SD card and delay of data output (drive) from the LPC54xxx to the SD card.
Page 534
UM10912 NXP Semiconductors Chapter 27: LPC546xx SD/MMC and SDIO interface 27.9.3 Stop clock Alternatively, you can avoid a stop-clock scenario by correctly enabling the Card Read Threshold feature and programming the Card Read Threshold Size—RX_WMARK and MSIZE; for details, refer to “Card Read Threshold Programming Sequence” on page 227.
Page 711
UM10912 Chapter 33: LPC546xx Ethernet Rev. 1.7 — 14 April 2017 User manual 33.1 How to read this chapter The Ethernet controller is available on all LPC546xx devices. 33.2 Features • 10/100 Mbit/s. • Ethernet MAC IEEE 802.3-2008. • DMA support. •...
Page 712
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • Set the Ethernet mode to RMII or MII in the ETHPHYSEL register (see Table 111). • Set the sideband flow control for each channel. See Section 4.5.75. 33.4 General description The Ethernet block enables a host to transmit and receive data over Ethernet in compliance with the IEEE 802.3-2008 standard.
Page 717
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 692. Register overview: Ethernet MAC and DMA (base address 0x4009 2000) …continued Name Access Offset Description Reset value Section DMA_CH1_CUR_HST_TXBUF 0x11D4 The channel 1 current host transmit 33.6.79 buffer address. DMA_CH1_CUR_HST_RXBUF 0x11DC The channel 1 current host receive 33.6.80...
Page 718
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.1 MAC configuration register The MAC configuration register establishes receive and transmit operating modes of the MAC. Table 693. MAC configuration register (MAC_CONFIG, offset 0x0000) bit description Symbol Value Description Reset value Receiver enable.
Page 719
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 693. MAC configuration register (MAC_CONFIG, offset 0x0000) bit description …continued Symbol Value Description Reset value Back-off limit. The back-off limit determines the random integer number (r) of slot time delays (4,096 bit times for 1000 Mbps and 512 bit times for 10/100 Mbps) the MAC waits before rescheduling a transmission attempt during retries after a collision.
Page 720
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 693. MAC configuration register (MAC_CONFIG, offset 0x0000) bit description …continued Symbol Value Description Reset value Loopback mode. When this bit is set, the MAC operates in loopback mode at MII. The MII receive clock input is required for the loopback to work properly, as the transmit clock is not looped-back internally.
Page 721
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 693. MAC configuration register (MAC_CONFIG, offset 0x0000) bit description …continued Symbol Value Description Reset value Watchdog disable. When this bit is set, the MAC disables the watchdog timer on the receiver, and can receive frames of up to 16,384 bytes.
Page 722
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 693. MAC configuration register (MAC_CONFIG, offset 0x0000) bit description …continued Symbol Value Description Reset value GPSLCE Giant packet size limit control enable. When this bit is set, the MAC considers the value in GPSL field in MAC extended configuration register to declare a received packet as giant packet.
Page 723
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 694. MAC extended configuration register (MAC_EXT_CONFIG, offset 0x0004) bit description Symbol Value Description Reset value 13:0 GPSL Giant packet size limit. If the received packet size is greater than the value programmed in this field in units of bytes, the MAC declares the received packet as giant packet.
Page 724
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 695. MAC frame filter register (MAC_FRAME_FILTER, offset 0x0008) bit description Symbol Value Description Reset value Access Promiscuous mode. When this bit is set, the address filter module passes all incoming frames regardless of its destination or source address. The SA/DA filter fails status bits of the receive status word will always be cleared when PR is set.
Page 725
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 695. MAC frame filter register (MAC_FRAME_FILTER, offset 0x0008) bit description …continued Symbol Value Description Reset value Access Source address filter enable. When this bit is set, the MAC compares the SA field of the received packets with the values programmed in the enabled SA registers.
Page 726
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 696. MAC watchdog timeout register (MAC_WD_TIMEROUT, offset 0x000C) bit description Symbol Value Description Reset value Watchdog timeout. When the PWE bit is set and the WD bit of the MAC configuration register Table 693 is reset, this field is used as watchdog timeout for a received packet.
Page 727
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.5 MAC VLAN tag register The VLAN tag register identifies the IEEE 802.1Q VLAN type packets. Table 697. MAC VLAN tag register (MAC_VLAN_TAG, offset 0x0050) bit description Symbol Description Reset value 15:0 VLAN tag identifier for receive packets.
Page 728
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 697. MAC VLAN tag register (MAC_VLAN_TAG, offset 0x0050) bit description …continued Symbol Description Reset value VTHM VLAN tag hash table match enable. When this bit is set, the most significant four bits of CRC of VLAN tag are used to index the content of the MAC_VLAN_Hash_Table register.
Page 729
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 698. MAC transmit flow control register (MAC_TX_FLOW_CTRL_Q0, offset 0x0070 and MAC_TX_FLOW_CTRL_Q1, offset 0x0074) bit description Symbol Value Description Reset value Flow control busy/backpressure activate. This register field can be read by the application (read), can be set to 1 by the application with a register write of 1 (write set), and is cleared to 0 by the core (self clear).
Page 730
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 698. MAC transmit flow control register (MAC_TX_FLOW_CTRL_Q0, offset 0x0070 and MAC_TX_FLOW_CTRL_Q1, offset 0x0074) bit description …continued Symbol Value Description Reset value DZPQ Disable zero-quanta pause. When set, this bit disables the automatic generation of zero-quanta pause control frames on the deassertion of the flow-control signal from the FIFO layer.
Page 731
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 700. MAC Tx Queue priority mapping register (MAC_TXQ_PRIO_MAP, offset 0x0098) bit description Symbol Description Reset value PSTQ0 Priorities selected in Tx Queue 0. This field holds the priorities assigned to Tx Queue 0 by the software. This field determines if Tx Queue 0 should be blocked from transmitting specified pause time when a PFC packet is received with priorities matching the priorities programmed in this field.
Page 732
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 702. MAC Rx Queue control 1 register (MAC_RXQ_CTRL1, offset 0x00A4) bit description …continued Symbol Value Description Reset value AVPTPQ AV PTP packets queue. This field specifies the Rx Queue on which the PTP packets sent over the Ethernet payload (not over IPv4 or IPv6) are routed.
Page 733
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.11 MAC Rx Queue control 2 register The Rx Queue control 2 register controls the routing of tagged packets based on the USP (user priority) field of the received packets to the Rx Queues 0 to 3. This register is present when multiple Rx Queues are selected while configuring the core.
Page 734
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 704. MAC interrupt status register (MAC_INTR_STAT, offset 0x00B0) bit description Symbol Value Description Reset value Reserved. PHYIS PHY interrupt. This bit is set when rising edge is detected on the PHY interrupt input signal. This bit is cleared when this register is read.
Page 735
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 704. MAC interrupt status register (MAC_INTR_STAT, offset 0x00B0) bit description …continued Symbol Value Description Reset value TXSTSIS Transmit status interrupt. This bit indicates the status of transmitted packets. This bit is set when any of the following bits is set in the MAC receive transmit status register.
Page 736
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 705. MAC interrupt enable register (MAC_INTR_EN, offset 0x00B4) bit description …continued Symbol Value Description Reset value TXSTSIE Transmit status interrupt enable. When this bit is set, it enables the assertion of the interrupt signal because of the...
Page 737
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 706. MAC receive transmit status register (MAC_RXTX_STAT, offset 0x00B8) bit description …continued Symbol Description Reset value Reserved. Receive watchdog timeout. This bit is set when a packet with length greater than 2,048 bytes is received (10,240 bytes...
Page 738
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 707. MAC PMT control status register (MAC_PMT_CTRL_STAT, offset 0x00C0) bit description Symbol Description Reset Access value RWKPFE Remote wake-up packet forwarding enable. When this bit is set along with RWKPKTEN, the MAC receiver drops all received frames until it receives the expected wake-up frame.
Page 739
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.17 MAC LPI control status register The LPI control and status register controls the LPI functions and provides the LPI interrupt status. The status bits are cleared when this register is read. This register is present only when you select the energy efficient Ethernet feature while configuring the core.
Page 740
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 709. MAC LPI control status register (MAC_LPI_CTRL_STAT, offset 0x00D0) bit description …continued Symbol Description Reset Access value LPITXA LPI Tx automate. This bit controls the behavior of the MAC when it is entering or coming out of the LPI mode on the transmit side.
Page 741
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 710. MAC LPI timer control register (MAC_LPI_TIMER_CTRL, offset 0x00D4) bit description Symbol Description Reset value 15:0 LPI TW timer. This field specifies the minimum time (in microseconds) for which the MAC waits after it stops transmitting the LPI pattern to the PHY and before it resumes the normal transmission.
Page 742
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 713. MAC Version register (MAC_VERSION, offset 0x0110) bit description Symbol Description Reset value SNPVER NXP defined version. 0x10 15:8 USERVER User defined version. 31:16 - Reserved. 33.6.22 MAC debug register The debug register provides the debug status of various MAC blocks.
Page 743
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 715. MAC HW Feature0 register (MAC_HW_FEAT0, offset 0x011C) bit description …continued Symbol Value Description Reset value VLHASH Hash table based filtering option. Disabled Enabled SMASEL SMA (MDIO) interface. Disable station management (MDIO interface)
Page 744
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 715. MAC HW Feature0 register (MAC_HW_FEAT0, offset 0x011C) bit description …continued Symbol Value Description Reset value 30:28 ACTPHYSEL Active PHY selected. 0x00 RMII. All other values reserved. Reserved. 33.6.24 MAC HW feature1 register The MAC HW feature1 register indicates the presence of the optional features or functions.
Page 745
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 716. MAC HW Feature1 register (MAC_HW_FEAT1, offset 0x0120) bit description …continued Symbol Value Description Reset value DBGMEMA DMA debug register feature. Disable Enable AVSEL Audio video bridging feature. Disable Enable 23:21 - Reserved.
Page 746
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.26 MAC MDIO address register The MDIO address register controls the management cycles to external PHY through a management interface. Table 718. MAC MDIO address register (MAC_MDIO_ADDR, offset 0x0200) bit description Symbol Value Description Reset value MII busy.
Page 747
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 718. MAC MDIO address register (MAC_MDIO_ADDR, offset 0x0200) bit description …continued Symbol Value Description Reset value Back to back transactions. When this bit is set and the NTC has value greater than 0, then the MAC will inform the completion of a read or write command at the end of frame transfer (before the trailing clocks are transmitted).
Page 748
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 720. MAC address high register (MAC_ADDR_HIGH, offset 0x0300) bit description Symbol Description Reset value Access 15:0 A47_32 MAC address0[47:32]. 0xFFFF This field contains the upper 16 bits (47:32) of the 6-byte first MAC address. This is used by the MAC for filtering for received frames and for inserting the MAC address in the transmit flow control (PAUSE) frames.
Page 749
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 722. MAC timestamp control register (MAC_TIMESTAMP_CTRL, offset 0x0B00) bit description …continued Symbol Description Reset value TSUPDT Update timestamp. When this bit is set, the system time is updated (added or subtracted) with the...
Page 750
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 722. MAC timestamp control register (MAC_TIMESTAMP_CTRL, offset 0x0B00) bit description …continued Symbol Description Reset value TSEVTENA Enable timestamp snapshot for event messages. When this bit is set, the timestamp snapshot is taken only for event messages (SYNC, Delay_Req, Pdelay_Req, or Pdelay_Resp).
Page 752
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 726. System time nanoseconds register (MAC_SYS_TIME_NCND, offset 0x0B0C) bit description Symbol Description Reset value 30:0 TSSS Timestamp sub seconds. The value in this field has the sub second representation of time, with an accuracy of 0.46 nano-second.
Page 753
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.37 System time higher words seconds register This register contains the most significant 16-bits of the timestamp seconds value. Table 730. System time higher words seconds register (MAC_SYS_TIME_HWORD_SCND, offset 0x0B1C) bit description Symbol Description...
Page 754
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 733. Tx timestamp status seconds register (MAC_Tx_TIMESTMP_STAT_SECONDS, offset 0x0B34) bit description Symbol Description Reset value 31:0 TXTSSTSHI Transmit timestamp status high. This field contains the lower 32 bits of the seconds field of transmit packet's captured timestamp.
Page 755
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 736. MTL operation mode register (MTL_OP_MODE, offset 0x0C00) bit description …continued Symbol Description Reset value Access SCHALG Tx scheduling algorithm. This field indicates the algorithm for Tx scheduling: 0x00: WRR algorithm 0x1: Reserved...
Page 756
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.45 MTL Rx Queue and DMA channel mapping register Table 738. MTL Rx Queue and DMA channel mapping register (MTL_RXQ_DMA_MAP, offset 0x0C30) bit description Symbol Description Reset value Q0MDMACH Queue 0 mapped to DMA channel.
Page 757
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 739. MTL TxQ operation mode register (MTL_TXQ0_OP_MODE, offset 0x0D00) and MTL_TXQ1_OP_MODE, offset 0x0D40 bit description Symbol Description Reset value Flush Tx Queue. When this bit is set, the Tx Queue controller logic is reset to its default values. Therefore, all the data in the Tx Queue is lost or flushed.
Page 758
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 740. MTL TxQ Underflow register (MTL_TXQ0_UNDRFLW, offset 0x0D04 and MTL_TXQ1_UNDRFLW, offset 0x0D44) bit description Symbol Description Reset value 10:0 UFFRMCNT Underflow packet counter. This field indicates the number of packets aborted by the controller because of Tx Queue underflow.
Page 759
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 741. MTL TxQ debug register (MTL_TXQ0_DBG, offset 0x0D08 and MTL_TXQ1_DBG, offset 0x0D48) bit description …continued Symbol Description Reset value Reserved. 22:20 STSXSTSF Number of status words in Tx status FIFO of queue.
Page 760
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 743. MTL TxQ ETS status register (MTL_TXQ0_ETS_STAT, offset 0x0D14 and MTL_TXQ1_ETS_STAT, offset 0x0D54) bit description Symbol Description Reset value 23:0 Average bits per slot. This field contains the average transmitted bits per slot.
Page 761
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.53 MTL TxQ1 SendSlopeCredit register The SendSlopeCredit register contains the SendSlope credit value required for the credit-based shaper algorithm for the queue. Table 746. MTL TxQ1 SendSlopCredit register (MTL_TXQ1_SNDSLP_CRDT, offset 0x0D5C) bit description...
Page 762
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.56 MTL TxQ interrupt control status register This register contains the interrupt enable and status bits for the queue interrupts. Table 749. MTL TxQ interrupt control status register (MTL_TXQ0_INTCTRL_STAT, offset 0x0D2C and MTL_TXQ1_INTCTRL_STAT, offset 0x0D6C) bit description...
Page 763
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 750. MTL RxQ operation mode register (MTL_RXQ0_OP_MODE, offset 0x0D30 and MTL_RXQ1_OP_MODE, offset 0x0D70) bit description Symbol Description Reset value Access Rx Queue threshold control. These bits control the threshold level of the MTL Rx Queue (in bytes):...
Page 764
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.58 MTL RxQ missed packet overflow counter register The queue missed packet and overflow counter register contains the counter for packets missed because of Rx Queue packet flush and packets discarded because of Rx Queue overflow.
Page 765
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.60 MTL RxQ control register The queue receive control register controls the receive arbitration and passing of received packets to the application. Table 753. MTL RxQ control register (MTL_RXQ0_CTRL, offset 0x0D3C and MTL_RXQ1_CTRL, offset 0x0D7C) bit...
Page 766
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 754. DMA mode register (DMA_MODE, offset 0x1000) bit description Symbol Description Reset value Software reset. When this bit is set, the MAC and the OMA controller reset the logic and all internal registers of the OMA, MTL, and MAC.
Page 767
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 755. DMA system bus mode register (DMA_SYSBUS_MODE, offset 0x1004) bit description Symbol Description Reset value Access Fixed burst length. When this bit is set to 1, the AHB master will initiate burst transfers of specified length (INCRx or SINGLE).
Page 768
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 756. DMA interrupt status register (DMA_INTR_STAT, offset 0x1008) bit description …continued Symbol Description Reset value MTLIS MTL interrupt status. This bit indicates an interrupt event in the MTL. To reset this bit to 0, the software must read the corresponding register in the MTL to get the exact cause of the interrupt and clear its source.
Page 769
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 757. DMA debug status register (DMA_DBG_STAT, offset 0x100C) bit description …continued Symbol Description Reset value 19:16 RPS1 DMA channel 1 receive process state. This field indicates the Rx DMA FSM state for channel 1. This field is similar to the RPS0 field.
Page 770
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 759. DMA channel transmit control register (DMA_CH0_TX_CTRL, offset 0x1104 and DMA_CH1_TX_CTRL, offset 0x1184) bit description Symbol Description Reset value Start or stop transmission command. When this bit is set, transmission is placed in the running state. The DMA checks the transmit list at the current position for a packet to be transmitted.
Page 771
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 760. DMA channel receive control register (DMA_CH0_RX_CTRL, offset 0x1108 and DMA_CH1_RX_CTRL, offset 0x1188) bit description Symbol Description Reset value Start or stop receive. When this bit is set, the DMA tries to acquire the from the receive list and processes the incoming packets.
Page 772
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 760. DMA channel receive control register (DMA_CH0_RX_CTRL, offset 0x1108 and DMA_CH1_RX_CTRL, offset 0x1188) bit description …continued Symbol Description Reset value 21:16 RxPBL Receive programmable burst length. These bits indicate the maximum number of beats to be transferred in one DMA data transfer.
Page 773
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.70 DMA channel transmit tail pointer register The channel Tx tail pointer register points to an offset from the base and indicates the location of the last valid. When this register is read, it always returns zero.
Page 774
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.74 DMA channel interrupt enable register The channel interrupt enable register enables the interrupts reported by the status register. Table 767. DMA interrupt enable register (DMA_CH0_INT_EN, offset 0x1134 and DMA_CH1_INT_EN, offset 0x11B4) bit description...
Page 775
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 767. DMA interrupt enable register (DMA_CH0_INT_EN, offset 0x1134 and DMA_CH1_INT_EN, offset 0x11B4) bit description …continued Symbol Description Reset value Abnormal interrupt summary enable. When this bit is set, an abnormal interrupt summary is enabled. When this bit is reset, an abnormal interrupt is disabled.
Page 776
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 769. DMA slot function control register (DMA_CH_SLOT_FUNC_CTRL_STAT, CH0 offset 0x113C,CH1 offset 0x11BC) bit description Symbol Description Reset value Access Enable slot comparison. When set, this bit enables the checking of the slot numbers programmed in the Tx descriptor with the current reference given in the RSN field.
Page 777
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.6.79 DMA channel current host transmit buffer address register The current host transmit buffer address register points to the current transmit buffer address being read by the DMA. Table 772. DMA current host transmit buffer address register (DMA_CH_CUR_HST_TXBUF, CH0 offset 0x1154 and...
Page 778
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 774. DMA channel status register (DMA_CH_STAT, CH0 offset 0x1160 and CH1 offset 0x11E0) bit description Symbol Description Reset value Receive buffer unavailable. This bit indicates that the application owns the next in the receive list, and the DMA cannot acquire it.
Page 779
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 774. DMA channel status register (DMA_CH_STAT, CH0 offset 0x1160 and CH1 offset 0x11E0) bit description Symbol Description Reset value Normal interrupt summary. Normal interrupt summary bit value is the logical OR of the following bits when the...
Page 780
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 775. DMA channel miss frame count (DMA_CH0_MISS_FRAME_CNT, offset 0x116C and DMA_CH1_MISS_FRAME_CNT, offset 0x11EC) bit description …continued Symbol Description Reset value 14:11 - Reserved. MFCO Overflow status of the MFC counter. When this bit is set then the MFC counter does not get incremented further. The bit gets cleared when this register is read.
Page 781
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7 Functional description 33.7.1 Power management block and low power modes This section describes the power management (PMT) mechanisms supported by the MAC. PMT supports the reception of network (remote) wake-up frames and magic packet frames.
Page 782
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 4. Updates the status (TLPIEN bit of MAC LPI control status register Table 709) and generates an interrupt. To bring the PHY out of the LPI state, that is, when the software resets the LPIEN bit, the MAC performs the following tasks: a.
Page 783
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.1.1.4 LPI Timers The transmitter maintains the following two timers that are loaded with the respective values from the MAC_LPI_Timers_Control register: • LPI LS Timer – The LPI LS TIMER counts, in milliseconds, the time expired since the link status is up.
Page 784
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Only magic packets that are addressed to the device or a broadcast address will be checked to determine whether they meet the wake-up requirements. Magic packets that pass the address filtering (unicast or broadcast) will be checked to determine whether they meet the remote wake-on-LAN data format of 6 bytes of all ones followed by a MAC address appearing 16 times.
Page 785
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 144. Wake-up frame filter register Filter i byte mask This register defines which bytes of the frame are examined by filter i (0, 1, 2, and 3) in order to determine whether or not the frame is a wake-up frame. The MSB (thirty-first bit) must be zero.
Page 786
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet When the MAC is in sleep mode and the remote wake-up bit is enabled in PMT control and status register (0x00C0), normal operation is resumed after receiving a remote wake-up frame. The application writes all eight wake-up filter registers by performing a sequential write to address (0x00C4).
Page 787
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 3. Wait until the receive DMA empties all the frames from the Rx FIFO.This can be done by reading the appropriate bits of Debug registers in the DMA and MTL CSR space. 4. Enable power-down mode by appropriately configuring the PMT registers.
Page 788
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet When the FCB bit is set, the MAC generates and transmits a single pause packet. If the FCB bit is set again after the pause packet transmission is complete, the MAC sends another pause packet irrespective of whether the pause time is complete or not. To...
Page 789
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 777. Tx MAC flow control EFC TFE DM Description The MAC transmitter performs backpressure when bit 0 of MAC_Q0_Tx_Flow_Ctrl register is set or the sideband signal sbd_flowctrl_i is 1. In addition, the MAC Tx performs backpressure when Rx Queue level crosses the threshold set by bits 10:8 of MTL_RxQ0_Operation_Mode register.
Page 790
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 145. Multiple channels and queues 33.7.4.1 Support in the transmit path Ethernet block supports up to two Tx Queues. The fixed priority scheme is the default priority scheme for the DMA channels. In fixed priority scheme, the channel with highest priority always wins the arbitration when it requests the bus.
Page 791
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Each Rx DMA indicates when it is ready to transfer data and the size of the burst-length (number of beats) that it has to transfer. The scheduler checks whether sufficient data (of requested burst length) is available to be transferred to these DMAs and then selects the Rx DMA that gets serviced using the programmed priorities.
Page 792
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.4.5 Rx Queue to DMA mapping The packets in the MTL Rx Queues can be routed to any one of the two DMA channels by programming the MTL RxQ DMA map registers for queues 0, 1. The following types of Rx Queue to DMA mapping is possible through programming: 1.
Page 793
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet and the weights programmed in the corresponding queue receive control register. The arbitration is done among queues for which DMA is ready to service. After the Rx Queue is selected, PBL (Programmable Burst Length) amount of data is read out from that queue and is routed to the Rx DMA channel based on the Rx channel selection criteria.
Page 794
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The transmit paths of additional queues support traffic management by using the credit-based shaper algorithm. For a queue, the credit-based shaper algorithm determines that a queue is available for transmission if the following conditions are true: 1.
Page 795
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet control1 register Table 701. 33.7.4.9.3 Credit based shaper algorithm The MTL queue scheduler uses the credit-based shaper algorithm to arbitrate the AV traffic in all queues and the legacy Ethernet traffic in Queue 0. You can program the additional queues to use the credit-based shaper algorithm.The following sections provide...
Page 796
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet loCredit values are 12,000 bits and 3,036 bits respectively, the values to be programmed in the hiCredit and loCredit registers of the corresponding channel are 12,000 x 1,024 bits and two's complement of 3,036 x1,024, respectively.
Page 797
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Check the following sections for AV programming: Programming guidelines for initializing the DMA Section 33.7.11.9.1. Programming guidelines for enabling slot number checking Section 33.7.11.9.2. Programming guidelines for enabling average bits per slot reporting Section 33.7.11.9.3.
Page 798
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The checksum for TCP, UDP, or ICMP is calculated over a complete packet, and then inserted into its corresponding header field.It must be made sure that the Tx FIFO is deep enough to store a complete packet before that packet is transferred to the MAC transmitter.
Page 799
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 780. Transmit checksum offload engine functions for different frame types Frame type Hardware IP header Hardware TCP/UDP checksum insertion checksum insertion Non-IPv4 or IPv6 frame IPv4 frame is greater than 1,522 bytes (2,000 bytes when IEEE 802.3ad Support for 2K frames is enabled in MAC) but less than or...
Page 800
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet version, or when the received packet does not have enough bytes, as indicated by the Length field of the IPv4 header (or when fewer than 20 bytes are available in an IPv4 or IPv6 header).
Page 801
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.6 Loopback mode The MAC supports loopback of transmitted packets to its receiver. To enable this feature, program the LM bit of the MAC configuration register.Lopback mode can be enabled for all PHY interfaces. The data is always looped back on the MII interface irrespective of which PHY interface is selected.
Page 802
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.8 IEEE 1588 timestamps The IEEE 1588 standard defines a protocol, Precision Time Protocol (PTP), that enables precise synchronization of clocks in measurement and control systems implemented with technologies such as network communication, local computing, and distributed objects.
Page 803
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 782. Ordinary clock: PTP messages for snapshot Master Slave Delay_Req SYNC For an ordinary clock, you can take the snapshot of either one of the following PTP message types: version 1 or version 2. You cannot take the snapshots for both PTP message types.
Page 804
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 784. End-to-end transparent clock: PTP messages for which a snapshot is taken for transparent clock implementation SYNC Pdelay_Req Pdelay_Resp The transparent clock corrects only the sync and follow-up message. As discussed earlier this can be achieved using the message status provided.
Page 805
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 1. The master broadcasts the PTP sync messages to all its nodes. The sync message contains the master.s reference time information. The time at which this message leaves the master.s system is t1. This time must be captured, for Ethernet ports, at MII.
Page 806
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 147. Propagation delay calculation in clocks supporting peer-to-peer path correction The propagation delay is calculated in the following way: 1. Port-1 issues a Pdelay_Req message and generates a timestamp, t1, for the Pdelay_Req message.
Page 807
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.8.4 Frequency range of the reference timing clock The timestamp information is transferred across asynchronous clock domains, that is, from MAC clock domain to application clock domain. Therefore, a minimum delay is required between two consecutive timestamp captures. This delay is 4 clock cycles of II and 3 clock cycles of PTP clocks.
Page 808
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • PTP Frames Over IPv6 • PTP Frames Over Ethernet 33.7.8.5.1 PTP frames over IPv4 Table 4-6 provides information about the fields that are matched to control snapshot for the PTP packets sent over UDP over IPv4 for IEEE 1588 version 1 and 2. The octet positions for the tagged frames are offset by 4.
Page 809
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 788. IPv6-UDP PTP frame fields required for control and status Field Matched Octet Position Matched Value Description MAC Frame Type 12, 13 0x86DD IP datagram IP version 14(bits 7:4) IP version is IPv6...
Page 810
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 789. Ethernet PTP frame fields required for control and status Field Matched Octet Position Matched Value Description PTP Control Field 0x00/0x01/0x02/ 0x00 – SYNC (IEEE version 1) 0x03/0x04 0x01 – Delay_Req 0x02 – Follow_Up 0x03 –...
Page 811
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • Enable snapshot for IEEE 1588 version 1 or version 2 timestamp. • Enable snapshot for PTP packets transmitted directly over Ethernet or UDP-IP-Ethernet. • Enable timestamp snapshot for the received packet for IPv4 or IPv6.
Page 812
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet – Digital rollover mode: In digital rollover mode, the maximum value in the nanoseconds field is 0x3B9A_C9FF, that is, (10e9-1) nanoseconds. – Binary rollover mode: In binary rollover mode, the nanoseconds field rolls over and increments the seconds field after value 0x7FFF_FFFF.
Page 813
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 148. System update using fine method The system time update logic requires a 50 MHz clock frequency to achieve 20 ns accuracy. The frequency division is the ratio of the reference clock frequency to the required clock frequency.
Page 814
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The frequency division (FreqDivisionRatio) is the ratio of the reference clock frequency to the required clock frequency. If MasterToSlaveDelay is initially assumed to be the same for consecutive sync messages, the algorithm described below must be applied. After a few sync cycles, frequency lock occurs.
Page 815
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet memory, and transmit data frames from the transmit buffer in the system memory. Descriptors that reside in the system memory act as pointers to these buffers. There are two descriptor lists; one for reception, and one for transmission.The DMA supports up to two Tx and two Rx descriptor lists (or DMA channels).
Page 816
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.9.1 Host bus burst access The DMA attempts to execute fixed-length Burst transfers on the AHB master interface if configured to do so (FB bit of DMA system bus mode register 0). The maximum burst length is indicated and limited by the PBL field (DMA register 0[13:8]).
Page 817
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet If the receive buffer address is 0x0000 0FF2 (for 64-bit data bus) and 16 bytes of a received frame need to be transferred, then the DMA writes 3 full words from address 0x0000 0FF0. But the first 2 bytes of first transfer and the last 6 bytes of the third transfer have dummy data.
Page 818
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.9.5 Transmission 33.7.9.5.1 TxDMA operation: Default (non-OSF) mode The transmit DMA engine in default mode proceeds as follows: 1. The host sets up the transmit descriptor (TDES0-TDES3) and sets the OWN bit (TDES0[31]) after setting up the corresponding data buffer(s) with Ethernet frame data.
Page 819
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 150. Transmit DMA operation in default mode 33.7.9.5.2 TxDMA operation: OSF mode In the run state, if bit 4 is set in the transmit control register of corresponding DMA channel, the transmit process can simultaneously acquire two packets without closing the status descriptor of the first frame.
Page 820
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet frame, it immediately polls the transmit descriptor list for the second frame. If the second frame is valid, the transmit process transfers this frame before writing the first frame’s status information. In OSF mode, the run state transmit DMA operates in the following sequence: 1.
Page 822
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.9.5.3 Timestamp Correction According to the IEEE 1588 specification, a timestamp must be captured when the message timestamp point (leading edge of the first bit of the octet immediately following the Start Frame Delimiter octet) crosses the boundary between the node and the network.
Page 823
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The egress latency correction between the recommended capture point and the internal timestamp snapshot point is done by adding the latency value (EGRESS_LATENCY) with the captured timestamp as follows: Egress Correction = EGRESS_SYNC_CORR + EGRESS_LATENCY Egress correction is performed by programming the TSEC field in the MAC timestamp egress correction register.
Page 824
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The actual frame transmission begins after the MTL Tx Queue has reached either a programmable transmit threshold (DMA operation mode register, bits 6:4), or a full frame is contained in the FIFO. There is also an option for store and forward mode (MTL operation mode register, bit 1).
Page 825
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 152. DMA transmit channel arbitration process When there is any request in the Tx Queue, the DMA arbiter checks the type of the request: packet buffer fetch or descriptor fetch request. The descriptor fetch requests have higher priority than the buffer requests.
Page 826
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • Fixed priority (FP): In fixed priority mode, channel 0 has the lowest priority and the last selected channel has the highest priority. The weight programmed in the transmit control register of a channel is ignored.
Page 827
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 153. Receive DMA operation 33.7.9.5.8 Receive descriptor acquisition The receive engine always attempts to acquire an extra descriptor in anticipation of an incoming frame. Descriptor acquisition is attempted if any of the following conditions is satisfied: •...
Page 828
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • The controller has completed frame reception, but the current receive descriptor is not yet closed. • A receive poll demand has been issued. 33.7.9.5.9 Receive frame processing The MAC transfers the received frames to the host memory only when the frame passes...
Page 829
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Remark: The DMA interrupt status register (Table 756) is the (interrupt) status register. The interrupt pin is asserted because of any event in this status register only if the corresponding interrupt enable bit is set in DMA interrupt enable register (Table 767).
Page 830
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet The DMA goes into the suspend mode when this condition occurs. The application must perform a write to the descriptor tail pointer register and update the tail pointer so that the following condition is true: Current descriptor pointer <...
Page 831
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 155. Descriptor structure 33.7.10.2 Descriptor endianness The data bus can be configured for little-endian format. 33.7.10.3 Transmit descriptor The DMA in Ethernet core requires at least one descriptor for a transmit packet. In...
Page 832
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 790. Transmit descriptor word 0(TDES0) Symbol Description 31:0 BUF1AP Buffer 1 address pointer or TSO header address pointer. These bits indicate the physical address of buffer 1. These bits indicate the TSO header address pointer...
Page 833
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 793. Transmit descriptor word 3 (TDES3) Symbol Description 22:19 SLOTNUM Slot number control bits in AV mode. These bits indicate the slot interval in which the data should be fetched from the corresponding buffers addressed by TDES0 or TDES1.
Page 834
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Fig 157. Transmitter descriptor write-back Format 33.7.10.3.3 TDES0 normal descriptor (write-back format) This format is only applicable to the last descriptor of a packet. Table 794. TDES0 normal descriptor (write-back Format) Symbol Description 31:0 TTSL Transmit packet timestamp low.
Page 835
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 797. TDES3 normal descriptor (write-back format) Symbol Description IP header error. When IP header error is set, this bit indicates that the checksum offload engine detected an IP header error. If COE detects an IP header error, it still inserts an IPv4 header checksum if the Ethernet type field indicates an IPv4 payload.
Page 836
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 797. TDES3 normal descriptor (write-back format) Symbol Description Error summary. This bit indicates the logical OR of the following bits: • TDES3[0]: IP header error • TDES3[14]: jabber timeout • TDES3[13]: packet flush •...
Page 837
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet In the receive descriptor (read format), if the buffer address field is all 0s, Ethernet does not transfer data to that buffer and skips to the next buffer or next descriptor. Fig 158. Receive normal descriptor (read format) 33.7.10.4.1 Receive normal descriptor (read format)
Page 838
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 801. RDES3 normal descriptor (read format) Symbol Description 23:0 Reserved. BUF1V Buffer 1 address valid. When set, this indicates to the DMA that the buffer 1 address specified in RDES1 is valid.
Page 839
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 803. RDES1 normal descriptor (write-back format) Symbol Description Payload type. These bits indicate the type of payload encapsulated in the IP datagram processed by the receive checksum offload engine (COE): • 0x0: Unknown type or IP/AV payload not processed •...
Page 840
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 803. RDES1 normal descriptor (write-back format) …continued Symbol Description 11:8 PTP message type. These bits are encoded to give the type of the message received: • 0x0: No PTP message received •...
Page 841
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.10.4.6 RDES3 normal descriptor (write-back format) Table 805. RDES3 normal descriptor (write-back format) Symbol Description 14:0 Packet length. These bits indicate the byte length of the received packet that was transferred to system memory (including CRC).
Page 842
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Table 805. RDES3 normal descriptor (write-back format) Symbol Description Giant packet. When this bit is set, it indicates that the packet length exceeds the specified maximum Ethernet size of 1518, 1522, or 2000 bytes (9,018 or 9,022 bytes if jumbo packet enable is set).
Page 843
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet • Programming guidelines for AV feature • Programming guidelines for energy efficient Ethernet 33.7.11.1 Initializing DMA Follow these steps to initialize the DMA controller: 1. Assert a software reset by setting bit 0 of DMA mode register Table 754.
Page 844
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 3. Program the following fields to initialize the mode of operation in the MTL TxQ0 operation mode register Table 739 a. Transmit store and forward (TSF) or transmit threshold control (TTC) in case of threshold mode b.
Page 845
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 33.7.11.3.1 Host bus burst access The DMA attempts to execute fixed-length burst transfers on the AHB master interface if configured to do so (FB bit of DMA register 0). The maximum burst length is indicated and limited by the PBL field (DMA register 0[13:8]).
Page 846
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet If the receive buffer address is 0x0000 0FF2 (for 64-bit data bus) and 16 bytes of a received frame need to be transferred, then the DMA writes 3 full words from address 0x0000 0FF0. But the first 2 bytes of first transfer and the last 6 bytes of the third transfer have dummy data.
Page 847
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 1. For normal transmit and receive interrupts, read the interrupt status. Then, poll the descriptors, reading the status of the descriptor owned by the host (either transmit or receive). 2. If the descriptors are not owned by the DMA (or no descriptor is available), the DMA goes into SUSPEND state.
Page 848
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 1. Program the Tx Queue size in the TQS field of MTL TxQ0 operation mode register Table 739 if queue 0 is used or MTL TxQ1 operation mode register Table 739 queue1 is used. Based on the value programmed in TQS field, the size of the queue is determined.
Page 849
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 3. Wait for any previous frame transmissions to complete. It can be checked this by reading the appropriate bits of MTL_TXQ0_DBG register (TRCSTS is not 01). or Flush the Tx FIFO for faster empty operation.
Page 851
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet Programming guidelines for IEEE 1588 timestamping 33.7.11.8 33.7.11.8.1 Initialization guideline for system time generation The timestamp feature can be enabled by setting bit 0 of the MAC timestamp control register Table 722. However, it is essential that the timestamp counter should be initialized after this bit is set.
Page 852
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 5. Set bit 4 in MAC timestamp control register Table 722. 6. When this trigger causes an interrupt, read MAC interrupt status register Table 704. 7. Reprogram MAC timestamp addend register with the old value and set bit 5 again Table 729.
Page 853
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 12. Start the receive and transmit DMA by setting bit 0 of the DMA channel 0, channel 1 transmit control register and bit 0 of DMA channel 0, channel 1 receive control register.
Page 854
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 2. Program the PHY registers through the MDIO interface (including the RX CLK stoppable bit that indicates to the PHY whether to stop Rx clock in LPI mode.) 3. Program bits 25:16 and bits 15:0 in MAC LPI Timer control register Table 710.
Page 855
UM10912 NXP Semiconductors Chapter 33: LPC546xx Ethernet 3. Set bit 0 (ESC) of the slot function control and status register of a channel to enable the slot number checking Table 769. Gating off the CSR clock in the Rx LPI mode:...
Page 879
UM10912 Chapter 35: LPC546xx USB0 Full-speed Host controller Rev. 1.7 — 14 April 2017 User manual 35.1 How to read this chapter The USB full-speed controller is available on all LPC546xx devices. This chapter describes the host functionality of the controller. 35.2 Introduction This section describes the host portion of the USB0 Full-speed controllerUSB 2.0 The USB is a four-wire bus that supports communication between a host and a number...
Page 881
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller • Wake-up: Activity on the USB bus port can wake up the microcontroller from deep-sleep mode. See Section 35.6.2.1. • Interrupts: The USB0_IRQ interrupt is connected to interrupt slot # 28 in the NVIC.
Page 882
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.6 Interfaces 35.6.1 Pin description Table 823. USB Host pin description Pin name Port pin IOCON function, Mode Direction Description USB0_DP PIO5_25 Function 0 Positive differential data. Mode: pull-up USB0_DM...
Page 883
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 6. Enable the wake-up from deep-sleep mode on the USB activity interrupt by enabling the USB0_NEEDCLK signal in the STARTER0 register (Section 4.5.90). 7. Clear pending USB0 Activity Interrupt, USB0_NEEDCLK (Section 3.3.1) before...
Page 884
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 824. Register overview: USB Host register address definitions (base address 0x400A 2000) Name Access Offset Description Reset value Section HCFMREMAINING 0x38 A 14-bit counter showing the bit time remaining in 35.7.15...
Page 885
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.1 Host controller revision register Table 825. Host controller revision register (HCREVISION, offset 0x00) bit description Symbol Description Reset value Revision. This read-only field contains the BCD representation of the 0x10 version of the HCI specification that is implemented by this HC.
Page 886
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 826. Host controller control register (HCCONTROL, offset 0x04) bit description Symbol Description Reset value BulkListEnable This bit is set to enable the processing of the Bulk list in the next Frame. If cleared by HCD, processing of the Bulk list does not occur after the next SOF.
Page 887
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.3 Host controller command status register Table 827. Host controller command status register (HCCOMMANDSTATUS, offset 0x08) bit description Symbol Description Reset value HostControllerReset This bit is set by HCD to initiate a software reset of HC. Regardless of the functional state of HC, it moves to the USBSUSPEND state in which most of the operational registers are reset except those stated otherwise;...
Page 888
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller enabled in the HcInterruptEnable register (see Section 7.1.5) and the MasterInterruptEnable bit is set. The Host Controller Driver may clear specific bits in this register by writing 1 to bit positions to be cleared. The Host Controller Driver may not set any of these bits.
Page 889
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Writing a '1' to a bit in this register sets the corresponding bit, whereas writing a '0' to a bit in this register leaves the corresponding bit unchanged. On read, the current value of this register is returned.
Page 890
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 830. Host controller interrupt disable register (HCINTERRUPTDISABLE, offset 0x14) bit description Symbol Value Description Reset value Scheduling Overrun interrupt. No effect. Disables interrupt. HcDoneHead Writeback interrupt. No effect. Disables interrupt.
Page 891
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.7 Host controller communication area register Table 831. Host controller communication area register (HCHCCA, offset 0x18) bit description Symbol Description Reset value Reserved 31:8 HCCA Base address of the Host Controller Communication Area.
Page 892
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.11 Host controller bulk head ED register Table 835. Host controller bulk head ED register (HCBULKHEADED, offset 0x28) bit description Symbol Description Reset value Reserved 31:4 BHED BulkHeadED HC traverses the bulk list starting with the HcBulkHeadED pointer. The content is loaded from HCCA during the initialization of HC.
Page 893
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.14 Host controller frame interval register Table 838. Host controller frame interval register (HCFMINTERVAL, offset 0x34) bit description Symbol Description Reset value 13:0 FrameInterval 0x2EDF This specifies the interval between two consecutive SOFs in bit times. The nominal value is set to be 11,999.
Page 894
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.15 Host controller frame remaining register The Host controller frame remaining register is a 14-bit down counter showing the bit time remaining in the current frame. Table 839. Host controller frame remaining register (HCFMREMAINING, offset 0x38) bit description...
Page 895
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.17 Host controller periodic start register The Host controller periodic start register has a 14-bit programmable value that determines the earliest time when HC should start processing the periodic list.
Page 896
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 843. Host controller root hub descriptor register (HCRHDESCRIPTORA offset 0x48) bit description Symbol Description Reset value NumberDownstreamPorts These bits specify the number of downstream ports supported by the root hub.
Page 897
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller 35.7.20 Host controller root hub descriptor B register The host controller root hub descriptor B register is the second register describing the characteristics of the root hub. These fields are written during initialization to correspond with the system implementation.
Page 898
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 845. Host controller root hub status register (HCRHSTATUS register offset 0x50) bit description Symbol Description Reset value DRWE (read) DeviceRemoteWakeupEnable This bit enables a ConnectStatusChange bit as a resume event, causing a USBSUSPEND to USBRESUME state transition and setting the ResumeDetected interrupt.
Page 899
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 846. Host controller root hub port status register (HCRHPORTSTATUS[1:NDP] register offset 0x54) bit description Symbol Description Reset value (read) CurrentConnectStatus This bit reflects the current state of the downstream port.
Page 900
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 846. Host controller root hub port status register (HCRHPORTSTATUS[1:NDP] register offset 0x54) bit description …continued Symbol Description Reset value POCI (read) PortOverCurrentIndicator This bit is only valid when the Root Hub is configured in such a way that overcurrent conditions are reported on a per-port basis.
Page 901
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 846. Host controller root hub port status register (HCRHPORTSTATUS[1:NDP] register offset 0x54) bit description …continued Symbol Description Reset value LSDA (read) LowSpeedDeviceAttached This bit indicates the speed of the device attached to this port. When set, a Low Speed device is attached to this port.
Page 902
UM10912 NXP Semiconductors Chapter 35: LPC546xx USB0 Full-speed Host controller Table 846. Host controller root hub port status register (HCRHPORTSTATUS[1:NDP] register offset 0x54) bit description …continued Symbol Description Reset value OCIC PortOverCurrentIndicatorChange This bit is valid only if overcurrent conditions are reported on a per-port basis.
Page 952
UM10912 Chapter 38: LPC546xx USB ROM API Rev. 1.7 — 14 April 2017 User manual 38.1 How to read this chapter The USB ROM driver routines are available on all LPC546xx devices. USB on-chip drivers are provided via the USB Stack in SDK and LPCOpen software packages.
Page 953
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API • Communication Device Class (CDC) function driver. This module contains an internal implementation of the USB CDC Class. User applications can use this class driver instead of implementing the CDC-ACM class manually via the low-level USBD_HW and USBD_Core APIs.
Page 954
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API – HID class API functions structure. This structure contains pointers to all the functions exposed by the HID function driver module (Table 924 “USBD_HW_API class structure”). • USB device controller driver –...
Page 955
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4 USB API 38.4.1 __WORD_BYTE Table 891. __WORD_BYTE class structure Member Description uint16_t __WORD_BYTE::W data member to do 16 bit access WB_TWB_T __WORD_BYTE::WB data member to do 8 bit access 38.4.2 _BM_T Table 892.
Page 956
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.5 _CDC_HEADER_DESCRIPTOR Table 895. _CDC_HEADER_DESCRIPTOR class structure Member Description bFunctionLength uint8_t _CDC_HEADER_DESCRIPTOR::bFunctionLength bDescriptorType uint8_t _CDC_HEADER_DESCRIPTOR::bDescriptorType bDescriptorSubtype uint8_t _CDC_HEADER_DESCRIPTOR::bDescriptorSubtype bcdCDC uint16_t _CDC_HEADER_DESCRIPTOR::bcdCDC 38.4.6 _CDC_LINE_CODING Table 896. _CDC_LINE_CODING class structure Member Description dwDTERate...
Page 957
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.10 _HID_DESCRIPTOR HID class-specific HID Descriptor. Table 900. _HID_DESCRIPTOR class structure Member Description bLength uint8_t _HID_DESCRIPTOR::bLength Size of the descriptor, in bytes. bDescriptorType uint8_t _HID_DESCRIPTOR::bDescriptorType Type of HID descriptor. bcdHID uint16_t _HID_DESCRIPTOR::bcdHID BCD encoded version that the HID descriptor and device complies to.
Page 958
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.13 _MSC_CBW Table 903. _MSC_CBW class structure Member Description dSignature uint32_t _MSC_CBW::dSignature dTag uint32_t _MSC_CBW::dTag dDataLength uint32_t _MSC_CBW::dDataLength bmFlags uint8_t _MSC_CBW::bmFlags bLUN uint8_t _MSC_CBW::bLUN bCBLength uint8_t _MSC_CBW::bCBLength uint8_t _MSC_CBW::CB[16][16] 38.4.14 _MSC_CSW Table 904.
Page 959
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.17 _USB_CORE_DESCS_T USB descriptors data structure. Table 907. _USB_CORE_DESCS_T class structure Member Description device_desc uint8_t * _USB_CORE_DESCS_T::device_desc Pointer to USB device descriptor string_desc uint8_t * _USB_CORE_DESCS_T::string_desc Pointer to array of USB string descriptors...
Page 960
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.19 _USB_DFU_FUNC_DESCRIPTOR Table 909. _USB_DFU_FUNC_DESCRIPTOR class structure Member Description bLength uint8_t _USB_DFU_FUNC_DESCRIPTOR::bLength bDescriptorType uint8_t _USB_DFU_FUNC_DESCRIPTOR::bDescriptorType bmAttributes uint8_t _USB_DFU_FUNC_DESCRIPTOR::bmAttributes wDetachTimeOut uint16_t _USB_DFU_FUNC_DESCRIPTOR::wDetachTimeOut wTransferSize uint16_t _USB_DFU_FUNC_DESCRIPTOR::wTransferSize bcdDFUVersion uint16_t _USB_DFU_FUNC_DESCRIPTOR::bcdDFUVersion 38.4.20 _USB_INTERFACE_DESCRIPTOR Table 910. _USB_INTERFACE_DESCRIPTOR class structure...
Page 961
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.21 _USB_OTHER_SPEED_CONFIGURATION Table 911. _USB_OTHER_SPEED_CONFIGURATION class structure Member Description bLength uint8_t _USB_OTHER_SPEED_CONFIGURATION::bLength Size of descriptor bDescriptorType uint8_t _USB_OTHER_SPEED_CONFIGURATION::bDescriptorType Other_speed_Configuration Type wTotalLength uint16_t _USB_OTHER_SPEED_CONFIGURATION::wTotalLength Total length of data returned bNumInterfaces uint8_t _USB_OTHER_SPEED_CONFIGURATION::bNumInterfaces...
Page 962
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.23 _USB_STRING_DESCRIPTOR Table 913. _USB_STRING_DESCRIPTOR class structure Member Description bLength uint8_t _USB_STRING_DESCRIPTOR::bLength Size of this descriptor in bytes bDescriptorType uint8_t _USB_STRING_DESCRIPTOR::bDescriptorType STRING Descriptor Type bString uint16_t _USB_STRING_DESCRIPTOR::bString UNICODE encoded string 38.4.24 _WB_T Table 914.
Page 963
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 915. USBD_API class structure Member Description const USBD_CDC_API_T* USBD_API::cdc Pointer to function table which exposes functions provided by CDC-ACM function driver module. reserved6 const uint32_t* USBD_API::reserved6 Reserved for future function driver module.
Page 964
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 916. USBD_API_INIT_PARAM class structure Member Description USB_Resume_Event USB_CB_T USBD_API_INIT_PARAM::USB_Resume_Event Event for USB wake up or resume. This event fires when a the USB device interface is suspended and the host wakes up the device by supplying Start Of Frame pulses. This is generally hooked to pull the user application out of a low power state and back into normal operating mode.
Page 965
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 916. USBD_API_INIT_PARAM class structure Member Description USB_Configure_Event USB_CB_T USBD_API_INIT_PARAM::USB_Configure_Event Event for USB configuration number changed. This event fires when a the USB host changes the selected configuration number. On receiving configuration change request from host, the stack enables/configures the endpoints needed by the new configuration before calling this callback function.
Page 966
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 917. USBD_CDC_API class structure Member Description init ErrorCode_t(*ErrorCode_t USBD_CDC_API::init)(USBD_HANDLE_T hUsb, USBD_CDC_INIT_PARAM_T *param, USBD_HANDLE_T *phCDC) Function to initialize CDC function driver module. This function is called by application layer to initialize CDC function driver module.
Page 967
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.28 USBD_CDC_INIT_PARAM Communication Device Class function driver initialization parameter data structure. Table 918. USBD_CDC_INIT_PARAM class structure Member Description mem_base uint32_t USBD_CDC_INIT_PARAM::mem_base Base memory location from where the stack can allocate data and buffers.
Page 968
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 918. USBD_CDC_INIT_PARAM class structure Member Description CIC_SetRequest ErrorCode_t(* USBD_CDC_INIT_PARAM::CIC_SetRequest)(USBD_HANDLE_T hCdc, USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t length) Communication Interface Class specific set request call-back function. This function is provided by the application software. This function gets called when host sends a CIC management element requests.
Page 969
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 918. USBD_CDC_INIT_PARAM class structure Member Description CDC_BulkOUT_Hdlr ErrorCode_t(* USBD_CDC_INIT_PARAM::CDC_BulkOUT_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event))(USBD_HANDLE_T hUsb, void *data, uint32_t event) Communication Device Class specific BULK OUT endpoint handler. The application software should provide the BULK OUT endpoint handler. Applications should transfer data depending on the communication protocol type set in descriptors.
Page 970
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 918. USBD_CDC_INIT_PARAM class structure Member Description SetCommFeature ErrorCode_t(* USBD_CDC_INIT_PARAM::SetCommFeature)(USBD_HANDLE_T hCDC, uint16_t feature, uint8_t *buffer, uint16_t len) Abstract control model(ACM) subclass specific SET_COMM_FEATURE request call-back function. This function is provided by the application software. This function gets called when host sends a SET_COMM_FEATURE set request.
Page 971
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 918. USBD_CDC_INIT_PARAM class structure Member Description ClrCommFeature ErrorCode_t(* USBD_CDC_INIT_PARAM::ClrCommFeature)(USBD_HANDLE_T hCDC, uint16_t feature) Abstract control model(ACM) subclass specific CLEAR_COMM_FEATURE request call-back function. This function is provided by the application software. This function gets called when host sends a CLEAR_COMM_FEATURE request.
Page 972
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 918. USBD_CDC_INIT_PARAM class structure Member Description SetLineCode ErrorCode_t(* USBD_CDC_INIT_PARAM::SetLineCode)(USBD_HANDLE_T hCDC, CDC_LINE_CODING *line_coding) Abstract control model(ACM) subclass specific SET_LINE_CODING request call-back function. This function is provided by the application software. This function gets called when host sends a SET_LINE_CODING request.
Page 973
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.29 USBD_CORE_API USBD stack Core API functions structure. Table 919. USBD_CORE_API class structure Member Description RegisterClassHandler ErrorCode_t(*ErrorCode_t USBD_CORE_API::RegisterClassHandler)(USBD_HANDLE_T hUsb, USB_EP_HANDLER_T pfn, void *data) Function to register class specific EP0 event handler with USB device stack.
Page 974
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 919. USBD_CORE_API class structure Member Description SetupStage void(*void USBD_CORE_API::SetupStage)(USBD_HANDLE_T hUsb) Function to set EP0 state machine in setup state. This function is called by USB stack and the application layer to set the EP0 state machine in setup state.
Page 975
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 919. USBD_CORE_API class structure Member Description StatusOutStage void(*void USBD_CORE_API::StatusOutStage)(USBD_HANDLE_T hUsb) Function to set EP0 state machine in status_out state. This function is called by USB stack and the application layer to set the EP0 state machine in status_out state.
Page 976
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 920. USBD_DFU_API class structure Member Description init ErrorCode_t(*ErrorCode_t USBD_DFU_API::init)(USBD_HANDLE_T hUsb, USBD_DFU_INIT_PARAM_T *param, uint32_t init_state) Function to initialize DFU function driver module. This function is called by application layer to initialize DFU function driver module.
Page 977
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 921. USBD_DFU_INIT_PARAM class structure Member Description DFU_Write uint8_t(*uint8_t(* USBD_DFU_INIT_PARAM::DFU_Write)(uint32_t block_num, uint8_t **src, uint32_t length, uint8_t *bwPollTimeout))(uint32_t block_num, uint8_t **src, uint32_t length, uint8_t *bwPollTimeout) DFU Write callback function. This function is provided by the application software. This function gets called when host sends a write command.
Page 978
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 921. USBD_DFU_INIT_PARAM class structure Member Description DFU_Ep0_Hdlr ErrorCode_t(* USBD_DFU_INIT_PARAM::DFU_Ep0_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event) Optional user overridable function to replace the default DFU class handler. The application software could override the default EP0 class handler with their own by providing the handler function address as this data member of the parameter structure.
Page 979
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 922. USBD_HID_API class structure Member Description init ErrorCode_t(*ErrorCode_t USBD_HID_API::init)(USBD_HANDLE_T hUsb, USBD_HID_INIT_PARAM_T *param) Function to initialize HID function driver module. This function is called by application layer to initialize HID function driver module. On successful initialization the function returns a handle to HID function driver module in passed param structure.
Page 980
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 923. USBD_HID_INIT_PARAM class structure Member Description HID_GetReport ErrorCode_t(* USBD_HID_INIT_PARAM::HID_GetReport)(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t **pBuffer, uint16_t *length) HID get report callback function. This function is provided by the application software. This function gets called when host sends a HID_REQUEST_GET_REPORT request.
Page 981
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 923. USBD_HID_INIT_PARAM class structure Member Description HID_GetPhysDesc ErrorCode_t(* USBD_HID_INIT_PARAM::HID_GetPhysDesc)(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t **pBuf, uint16_t *length) Optional callback function to handle HID_GetPhysDesc request. The application software could provide this callback HID_GetPhysDesc handler to handle get physical descriptor requests sent by the host.
Page 982
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 923. USBD_HID_INIT_PARAM class structure Member Description HID_SetProtocol ErrorCode_t(* USBD_HID_INIT_PARAM::HID_SetProtocol)(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t protocol) Optional callback function to handle HID_REQUEST_SET_PROTOCOL request. The application software could provide this callback to handle HID_REQUEST_SET_PROTOCOL requests sent by the host.
Page 983
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 923. USBD_HID_INIT_PARAM class structure Member Description HID_EpOut_Hdlr ErrorCode_t(* USBD_HID_INIT_PARAM::HID_EpOut_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event) Optional Interrupt OUT endpoint event handler. The application software could provide Interrupt OUT endpoint event handler. Application which receives reports from host on interrupt endpoint should provide an endpoint event handler through this data member.
Page 984
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 923. USBD_HID_INIT_PARAM class structure Member Description HID_Ep0_Hdlr ErrorCode_t(* USBD_HID_INIT_PARAM::HID_Ep0_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event) Optional user overridable function to replace the default HID class handler. The application software could override the default EP0 class handler with their own by providing the handler function address as this data member of the parameter structure.
Page 985
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description Connect void(*void USBD_HW_API::Connect)(USBD_HANDLE_T hUsb, uint32_t con) Function to make USB device visible/invisible on the USB bus. This function is called after the USB initialization. This function uses the soft connect feature to make the device visible on the USB bus.
Page 986
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description WakeUpCfg void(*void USBD_HW_API::WakeUpCfg)(USBD_HANDLE_T hUsb, uint32_t cfg) Function to configure USB device controller to walk-up host on remote events. This function is called by application layer to configure the USB device controller to wake up on remote events.
Page 987
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description ConfigEP void(*void USBD_HW_API::ConfigEP)(USBD_HANDLE_T hUsb, USB_ENDPOINT_DESCRIPTOR *pEPD) Function to configure USB Endpoint according to descriptor. This function is called automatically when USB_REQUEST_SET_CONFIGURATION request is received by the stack from USB host.
Page 988
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description DisableEP void(*void USBD_HW_API::DisableEP)(USBD_HANDLE_T hUsb, uint32_t EPNum) Function to disable selected USB endpoint. This function disables interrupts on selected endpoint. Parameters: 1. hUsb = Handle to the USB device stack.
Page 989
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description ReadEP uint32_t(*uint32_t USBD_HW_API::ReadEP)(USBD_HANDLE_T hUsb, uint32_t EPNum, uint8_t *pData) Function to read data received on the requested endpoint. This function is called by USB stack and the application layer to read the data received on the requested endpoint.
Page 990
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 924. USBD_HW_API class structure Member Description WakeUp void(*void USBD_HW_API::WakeUp)(USBD_HANDLE_T hUsb) Function to generate resume signaling on bus for remote host wake-up. This function is called by application layer to remotely wake up host controller when system is in suspend state.
Page 991
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API 38.4.36 USBD_MSC_INIT_PARAM Mass Storage class function driver initialization parameter data structure. Table 926. USBD_MSC_INIT_PARAM class structure Member Description mem_base uint32_t USBD_MSC_INIT_PARAM::mem_base Base memory location from where the stack can allocate data and buffers.
Page 992
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 926. USBD_MSC_INIT_PARAM class structure Member Description MSC_Read void(*void(* USBD_MSC_INIT_PARAM::MSC_Read)(uint32_t offset, uint8_t **dst, uint32_t length))(uint32_t offset, uint8_t **dst, uint32_t length) MSC Read callback function. This function is provided by the application software. This function gets called when host sends a read command.
Page 993
UM10912 NXP Semiconductors Chapter 38: LPC546xx USB ROM API Table 926. USBD_MSC_INIT_PARAM class structure Member Description MSC_Ep0_Hdlr ErrorCode_t(* USBD_MSC_INIT_PARAM::MSC_Ep0_Hdlr)(USBD_HANDLE_T hUsb, void *data, uint32_t event) Optional user overridable function to replace the default MSC class handler. The application software could override the default EP0 class handler with their own by providing the handler function address as this data member of the parameter structure.
Need help?
Do you have a question about the LPC546 Series and is the answer not in the manual?
Questions and answers