First, write a clock divider to the PMBCTRL
register CLKDIV field to produce a bit clock frequency with respect to the module's configured speed. To activate controller mode, set the CONTROLLER_EN bit and clear
the TARGET_EN bit in the PMBCTRL
register. For each transaction, set up the PMBCCR register. The following
options are configurable:
- Target
address (TARGET_ADDR): Sets the target address for the
next transaction.
- PEC enable (PEC_ENA): If Packet Error Checking (PEC) is used on the bus, set this bit.
- Extended command code enable (EXT_CMD): When set, uses two bytes for commands.
- Command code enable (CMD_ENA): When set, sends a command byte at the start of the transaction.
- Byte count (BYTE_COUNT): Determines the number of data bytes to transfer. This does not include the block length byte, which is generated automatically when needed.
- Special command enables (GRP_CMD and PRC_CALL): Enables special behavior for group commands and process calls.
Writing to the PMBCCR register starts a
transfer.
Manual acknowledgment of received data is not
needed.