LPI2C Slave Driver
LPI2C Driver
Collaboration diagram for LPI2C Slave Driver:

## Data Structures

struct | lpi2c_slave_config_t
| Structure with settings to initialize the LPI2C slave module. More...
struct | lpi2c_slave_config_t.sclStall
struct | lpi2c_slave_transfer_t
| LPI2C slave transfer structure. More...
struct | lpi2c_slave_handle_t
| LPI2C slave handle structure. More...

## Typedefs

typedef void(* | lpi2c_slave_transfer_callback_t) (LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData)
| Slave event callback function pointer type. More...

## Enumerations

enum

_lpi2c_slave_flags {
kLPI2C_SlaveTxReadyFlag = LPI2C_SSR_TDF_MASK,
kLPI2C_SlaveRxReadyFlag = LPI2C_SSR_RDF_MASK,
kLPI2C_SlaveAddressValidFlag = LPI2C_SSR_AVF_MASK,
kLPI2C_SlaveTransmitAckFlag = LPI2C_SSR_TAF_MASK,
kLPI2C_SlaveRepeatedStartDetectFlag = LPI2C_SSR_RSF_MASK,
kLPI2C_SlaveStopDetectFlag = LPI2C_SSR_SDF_MASK,
kLPI2C_SlaveBitErrFlag = LPI2C_SSR_BEF_MASK,
kLPI2C_SlaveFifoErrFlag = LPI2C_SSR_FEF_MASK,
kLPI2C_SlaveAddressMatch0Flag = LPI2C_SSR_AM0F_MASK,
kLPI2C_SlaveAddressMatch1Flag = LPI2C_SSR_AM1F_MASK,
kLPI2C_SlaveGeneralCallFlag = LPI2C_SSR_GCF_MASK,
kLPI2C_SlaveBusyFlag = LPI2C_SSR_SBF_MASK,
kLPI2C_SlaveBusBusyFlag = LPI2C_SSR_BBF_MASK
}

| LPI2C slave peripheral flags. More...
enum | lpi2c_slave_address_match_t { kLPI2C_MatchAddress0 = 0U, kLPI2C_MatchAddress0OrAddress1 = 2U, kLPI2C_MatchAddress0ThroughAddress1 = 6U }
| LPI2C slave address match options. More...
enum | lpi2c_slave_transfer_event_t { kLPI2C_SlaveAddressMatchEvent = 0x01U, kLPI2C_SlaveTransmitEvent = 0x02U, kLPI2C_SlaveReceiveEvent = 0x04U, kLPI2C_SlaveTransmitAckEvent = 0x08U, kLPI2C_SlaveRepeatedStartEvent = 0x10U, kLPI2C_SlaveCompletionEvent = 0x20U, kLPI2C_SlaveAllEvents }
| Set of events sent to the callback for nonblocking slave transfers. More...

## Slave initialization and deinitialization

void | LPI2C_SlaveGetDefaultConfig (lpi2c_slave_config_t *slaveConfig)
| Provides a default configuration for the LPI2C slave peripheral. More...
void | LPI2C_SlaveInit (LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz)
| Initializes the LPI2C slave peripheral. More...
void | LPI2C_SlaveDeinit (LPI2C_Type *base)
| Deinitializes the LPI2C slave peripheral. More...
static void | LPI2C_SlaveReset (LPI2C_Type *base)
| Perform software reset of the LPI2C slave peripheral. More...
static void | LPI2C_SlaveEnable (LPI2C_Type *base, bool enable)
| Enables or disables the LPI2C module as slave. More...

## Slave status

static uint32_t | LPI2C_SlaveGetStatusFlags (LPI2C_Type *base)
| Gets the LPI2C slave status flags. More...
static void | LPI2C_SlaveClearStatusFlags (LPI2C_Type *base, uint32_t statusMask)
| Clears the LPI2C status flag state. More...

## Slave interrupts

static void | LPI2C_SlaveEnableInterrupts (LPI2C_Type *base, uint32_t interruptMask)
| Enable LPI2C slave interrupt requests. More...
static void | LPI2C_SlaveDisableInterrupts (LPI2C_Type *base, uint32_t interruptMask)
| Disable LPI2C slave interrupt requests. More...
static uint32_t | LPI2C_SlaveGetEnabledInterrupts (LPI2C_Type *base)
| Returns the set of currently enabled LPI2C slave interrupt requests. More...

## Slave DMA control

static void | LPI2C_SlaveEnableDMA (LPI2C_Type *base, bool enableAddressValid, bool enableRx, bool enableTx)
| Enable or disable LPI2C slave peripheral DMA requests. More...

## Slave bus operations

static bool | LPI2C_SlaveGetBusIdleState (LPI2C_Type *base)
| Return whether the bus is idle. More...
static void | LPI2C_SlaveTransmitAck (LPI2C_Type *base, bool ackOrNack)
| Transmit either an Ack or Nak on the I2C bus in response to a byte from the master. More...
static uint32_t | LPI2C_SlaveGetReceivedAddress (LPI2C_Type *base)
| Returns the slave address sent by the I2C master. More...
status_t | LPI2C_SlaveSend (LPI2C_Type *base, const void *txBuff, size_t txSize, size_t *actualTxSize)
| Performs a polling send transfer on the I2C bus. More...
status_t | LPI2C_SlaveReceive (LPI2C_Type *base, void *rxBuff, size_t rxSize, size_t *actualRxSize)
| Performs a polling receive transfer on the I2C bus. More...

## Slave non-blocking

void | LPI2C_SlaveCreateHandle (LPI2C_Type *base, lpi2c_slave_handle_t *handle, lpi2c_slave_transfer_callback_t callback, void *userData)
| Create a new handle for the LPI2C slave non-blocking APIs. More...
status_t | LPI2C_SlaveTransferNonBlocking (LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask)
| Start accepting slave transfers. More...
status_t | LPI2C_SlaveGetTransferCount (LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count)
| Get slave transfer status during a non-blocking transfer. More...
void | LPI2C_SlaveAbortTransfer (LPI2C_Type *base, lpi2c_slave_handle_t *handle)
| Abort slave non-blocking transfers. More...

## Slave IRQ handler

void | LPI2C_SlaveHandleInterrupt (LPI2C_Type *base, lpi2c_slave_handle_t *handle)
| Reusable routine to handle slave interrupts. More...

## Usage Information

## Data Structure Documentation

struct lpi2c_slave_config_t

Structure with settings to initialize the LPI2C slave module.

This structure holds configuration settings for the LPI2C slave peripheral. To initialize this structure to reasonable defaults, call the LPI2C_SlaveGetDefaultConfig() function and pass a pointer to your config struct instance.

The config struct can be made const so it resides in flash.

Data Fields
uint8_t | address0 | Slave's 7-bit address.
uint8_t | address1 | Alternate slave 7-bit address.
lpi2c_slave_address_match_t | addressMatchMode | Address matching options.
uint32_t | clockHoldTime_ns | Width in nanoseconds of the clock hold time.
uint32_t | dataValidDelay_ns | Width in nanoseconds of the data valid delay.
bool | enableGeneralCall | Enable general call address matching.
bool | enableReceivedAddressRead | Enable reading the address received address as the first byte of data.
bool | enableSlave | Enable slave mode.
bool | filterDozeEnable | Enable digital glitch filter in doze mode.
bool | filterEnable | Enable digital glitch filter.
bool | ignoreAck | Continue transafers after a Nack is detected.
uint32_t | sclGlitchFilterWidth_ns | Width in nanoseconds of the digital filter on the SCL signal.
struct lpi2c_slave_config_t | sclStall |
uint32_t | sdaGlitchFilterWidth_ns | Width in nanoseconds of the digital filter on the SDA signal.

struct lpi2c_slave_config_t.sclStall

Data Fields
bool | enableAck | Enables SCL clock stretching during slave-transmit address byte(s) and slave-receiver address and data byte(s) to allow software to write the Transmit ACK Register before the ACK or NACK is transmitted. Clock stretching occurs when transmitting the 9th bit. When enableAckSCLStall is enabled, there is no need to set either enableRxDataSCLStall or enableAddressSCLStall.
bool | enableAddress | Enables SCL clock stretching when the address valid flag is asserted.
bool | enableRx | Enables SCL clock stretching when receive data flag is set during a slave-receive transfer.
bool | enableTx | Enables SCL clock stretching when the transmit data flag is set during a slave-transmit transfer.

struct lpi2c_slave_transfer_t

LPI2C slave transfer structure.

Data Fields
status_t | completionStatus | Success or error code describing how the transfer completed. Only applies for kLPI2C_SlaveCompletionEvent.
uint8_t * | data | Transfer buffer
size_t | dataSize | Transfer size
lpi2c_slave_transfer_event_t | event | Reason the callback is being invoked.
uint8_t | receivedAddress | Matching address send by master.
size_t | transferredCount | Number of bytes actually transferred since start or last repeated start.

struct _lpi2c_slave_handle

LPI2C slave handle structure.

Note
  The contents of this structure are private and subject to change.

Collaboration diagram for lpi2c_slave_handle_t:
[legend]

Data Fields
lpi2c_slave_transfer_callback_t | callback | Callback function called at transfer event.
uint32_t | eventMask | Mask of enabled events.
bool | isBusy | Whether transfer is busy.
lpi2c_slave_transfer_t | transfer | LPI2C slave transfer copy.
uint32_t | transferredCount | Count of bytes transferred.
void * | userData | Callback parameter passed to callback.
bool | wasTransmit | Whether the last transfer was a transmit.

## Typedef Documentation

typedef void(* lpi2c_slave_transfer_callback_t) (LPI2C_Type *base, lpi2c_slave_transfer_t *transfer, void *userData)

Slave event callback function pointer type.

This callback is used only for the slave non-blocking transfer API. To install a callback, use the LPI2C_SlaveSetCallback() function after you have created a handle.

Parameters

  base | Base address for the LPI2C instance on which the event occurred.
  transfer | Pointer to transfer descriptor containing values passed to and/or from the callback.
  userData | Arbitrary pointer-sized value passed from the application.

## Enumeration Type Documentation

enum _lpi2c_slave_flags

LPI2C slave peripheral flags.

The following status register flags can be cleared:

- kLPI2C_SlaveRepeatedStartDetectFlag
- kLPI2C_SlaveStopDetectFlag
- kLPI2C_SlaveBitErrFlag
- kLPI2C_SlaveFifoErrFlag

All flags except kLPI2C_SlaveBusyFlag and kLPI2C_SlaveBusBusyFlag can be enabled as interrupts.

Note
  These enums are meant to be OR'd together to form a bit mask.

Enumerator
kLPI2C_SlaveTxReadyFlag | Transmit data flag
kLPI2C_SlaveRxReadyFlag | Receive data flag
kLPI2C_SlaveAddressValidFlag | Address valid flag
kLPI2C_SlaveTransmitAckFlag | Transmit ack flag
kLPI2C_SlaveRepeatedStartDetectFlag | Repeated start detect flag
kLPI2C_SlaveStopDetectFlag | Stop detect flag
kLPI2C_SlaveBitErrFlag | Bit error flag
kLPI2C_SlaveFifoErrFlag | FIFO error flag
kLPI2C_SlaveAddressMatch0Flag | Address match 0 flag
kLPI2C_SlaveAddressMatch1Flag | Address match 1 flag
kLPI2C_SlaveGeneralCallFlag | General call flag
kLPI2C_SlaveBusyFlag | Master busy flag
kLPI2C_SlaveBusBusyFlag | Bus busy flag

enum lpi2c_slave_address_match_t

LPI2C slave address match options.

Enumerator
kLPI2C_MatchAddress0 | Match only address 0.
kLPI2C_MatchAddress0OrAddress1 | Match either address 0 or address 1.
kLPI2C_MatchAddress0ThroughAddress1 | Match a range of slave addresses from address 0 through address 1.

enum lpi2c_slave_transfer_event_t

Set of events sent to the callback for nonblocking slave transfers.

These event enums are used for two related purposes. First, a bit mask created by OR'ing together events is passed to LPI2C_SlaveTransferNonBlocking() in order to specify which events to enable. Then, when the slave callback is invoked, it is passed the current event through its transfer parameter.

Note
  These enums are meant to be OR'd together to form a bit mask of events.

Enumerator
kLPI2C_SlaveAddressMatchEvent | Received the slave address after a start or repeated start.
kLPI2C_SlaveTransmitEvent | Callback is requested to provide data to transmit (slave-transmitter role).
kLPI2C_SlaveReceiveEvent | Callback is requested to provide a buffer in which to place received data (slave-receiver role).
kLPI2C_SlaveTransmitAckEvent | Callback needs to either transmit an ack or nack.
kLPI2C_SlaveRepeatedStartEvent | A repeated start was detected.
kLPI2C_SlaveCompletionEvent | A stop was detected, completing the transfer.
kLPI2C_SlaveAllEvents | Bit mask of all available events.

## Function Documentation

void LPI2C_SlaveAbortTransfer | ( | LPI2C_Type * | base,
|  | lpi2c_slave_handle_t * | handle
| ) |  |

Abort slave non-blocking transfers.

Note
  This API could be called at any time to stop slave for handling the bus events.

Parameters

  base | The LPI2C peripheral base address.
  handle | Pointer to #lpi2c_slave_handle_t structure which stores the transfer state.

Return values

  #kStatus_Success |
  kStatus_LPI2C_Idle |

static void LPI2C_SlaveClearStatusFlags | ( | LPI2C_Type * | base,
|  | uint32_t | statusMask
| ) |  |

inlinestatic

Clears the LPI2C status flag state.

The following status register flags can be cleared:

- kLPI2C_SlaveRepeatedStartDetectFlag
- kLPI2C_SlaveStopDetectFlag
- kLPI2C_SlaveBitErrFlag
- kLPI2C_SlaveFifoErrFlag

Attempts to clear other flags will have no effect.

Parameters

  base | The LPI2C peripheral base address.
  statusMask | A bitmask of status flags that are to be cleared. The mask is composed of _lpi2c_slave_flags enumerators OR'd together. You may pass the result of a previous call to LPI2C_SlaveGetStatusFlags().

See also
  _lpi2c_slave_flags.

void LPI2C_SlaveCreateHandle | ( | LPI2C_Type * | base,
|  | lpi2c_slave_handle_t * | handle,
|  | lpi2c_slave_transfer_callback_t | callback,
|  | void * | userData
| ) |  |

Create a new handle for the LPI2C slave non-blocking APIs.

The creation of a handle is for use with the non-blocking APIs. Once a handle is created, there is not a corresponding destroy handle. If the user wants to terminate a transfer, the LPI2C_SlaveAbortTransfer() API shall be called.

Parameters

  | base | The LPI2C peripheral base address.
  [out] | handle | Pointer to the LPI2C slave driver handle.
  | callback | User provided pointer to the asynchronous callback function.
  | userData | User provided pointer to the application callback data.

void LPI2C_SlaveDeinit | ( | LPI2C_Type * | base | ) |

Deinitializes the LPI2C slave peripheral.

This function will disable the LPI2C slave peripheral and gates the clock. It also performs a software reset to restore the peripheral to reset conditions.

Parameters

  base | The LPI2C peripheral base address.

static void LPI2C_SlaveDisableInterrupts | ( | LPI2C_Type * | base,
|  | uint32_t | interruptMask
| ) |  |

inlinestatic

Disable LPI2C slave interrupt requests.

All flags except kLPI2C_SlaveBusyFlag and kLPI2C_SlaveBusBusyFlag can be enabled as interrupts.

Parameters

  base | The LPI2C peripheral base address.
  interruptMask | Bit mask of interrupts to disable. See _lpi2c_slave_flags for the set of constants that should be OR'd together to form the bit mask.

static void LPI2C_SlaveEnable | ( | LPI2C_Type * | base,
|  | bool | enable
| ) |  |

inlinestatic

Enables or disables the LPI2C module as slave.

Parameters

  base | The LPI2C peripheral base address.
  enable | Pass true to enable or false to disable the specified LPI2C as slave.

static void LPI2C_SlaveEnableDMA | ( | LPI2C_Type * | base,
|  | bool | enableAddressValid,
|  | bool | enableRx,
|  | bool | enableTx
| ) |  |

inlinestatic

Enable or disable LPI2C slave peripheral DMA requests.

Parameters

  base | The LPI2C peripheral base address.
  enableAddressValid | Enable flag for the address valid DMA request. Pass true for enable, false for disable. The address valid DMA request is shared with the receive data DMA request.
  enableRx | Enable flag for the receive data DMA request. Pass true for enable, false for disable.
  enableTx | Enable flag for the transmit data DMA request. Pass true for enable, false for disable.

static void LPI2C_SlaveEnableInterrupts | ( | LPI2C_Type * | base,
|  | uint32_t | interruptMask
| ) |  |

inlinestatic

Enable LPI2C slave interrupt requests.

All flags except kLPI2C_SlaveBusyFlag and kLPI2C_SlaveBusBusyFlag can be enabled as interrupts.

Parameters

  base | The LPI2C peripheral base address.
  interruptMask | Bit mask of interrupts to enable. See _lpi2c_slave_flags for the set of constants that should be OR'd together to form the bit mask.

static bool LPI2C_SlaveGetBusIdleState | ( | LPI2C_Type * | base | ) |

inlinestatic

Return whether the bus is idle.

Requires the slave mode to be enabled.

Parameters

  base | The LPI2C peripheral base address.

Return values

  true | Bus is busy.
  false | Bus is idle.

void LPI2C_SlaveGetDefaultConfig | ( | lpi2c_slave_config_t * | slaveConfig | ) |

Provides a default configuration for the LPI2C slave peripheral.

This function will provide the following default configuration for the LPI2C slave peripheral:

slaveConfig->enableSlave = true;
slaveConfig->address0 = 0U;
slaveConfig->address1 = 0U;
slaveConfig->addressMatchMode = kLPI2C_MatchAddress0;
slaveConfig->filterDozeEnable = true;
slaveConfig->filterEnable = true;
slaveConfig->enableGeneralCall = false;
slaveConfig->sclStall.enableAck = false;
slaveConfig->sclStall.enableTx = true;
slaveConfig->sclStall.enableRx = true;
slaveConfig->sclStall.enableAddress = true;
slaveConfig->ignoreAck = false;
slaveConfig->enableReceivedAddressRead = false;
slaveConfig->sdaGlitchFilterWidth_ns = 0; // TODO determine default width values
slaveConfig->sclGlitchFilterWidth_ns = 0;
slaveConfig->dataValidDelay_ns = 0;
slaveConfig->clockHoldTime_ns = 0;

After calling this function, you can override any settings in order to customize the configuration, prior to initializing the master driver with LPI2C_SlaveInit(). Be sure to override at least the address0 member of the configuration structure with the desired slave address.

Parameters

  [out] | slaveConfig | User provided configuration structure that will be set to default values. Refer to lpi2c_slave_config_t.

static uint32_t LPI2C_SlaveGetEnabledInterrupts | ( | LPI2C_Type * | base | ) |

inlinestatic

Returns the set of currently enabled LPI2C slave interrupt requests.

Parameters

  base | The LPI2C peripheral base address.

Returns
  A bitmask composed of _lpi2c_slave_flags enumerators OR'd together to indicate the set of enabled interrupts.

static uint32_t LPI2C_SlaveGetReceivedAddress | ( | LPI2C_Type * | base | ) |

inlinestatic

Returns the slave address sent by the I2C master.

This function should only be called if the kLPI2C_SlaveAddressValidFlag is asserted.

Parameters

  base | The LPI2C peripheral base address.

Returns
  The 8-bit address matched by the LPI2C slave. Bit 0 contains the R/w direction bit, and the 7-bit slave address is in the upper 7 bits.

static uint32_t LPI2C_SlaveGetStatusFlags | ( | LPI2C_Type * | base | ) |

inlinestatic

Gets the LPI2C slave status flags.

A bit mask with the state of all LPI2C slave status flags is returned. For each flag, the corresponding bit in the return value will be set if the flag is asserted.

Parameters

  base | The LPI2C peripheral base address.

Returns
  State of the status flags:
  - 1: related status flag is set.
  - 0: related status flag is not set.

See also
  _lpi2c_slave_flags

status_t LPI2C_SlaveGetTransferCount | ( | LPI2C_Type * | base,
|  | lpi2c_slave_handle_t * | handle,
|  | size_t * | count
| ) |  |

Get slave transfer status during a non-blocking transfer.

Parameters

  | base | The LPI2C peripheral base address.
  | handle | Pointer to i2c_slave_handle_t structure.
  [out] | count | Pointer to a value to hold the number of bytes transferred. May be NULL if the count is not required.

Return values

  #kStatus_Success |
  #kStatus_NoTransferInProgress |

void LPI2C_SlaveHandleInterrupt | ( | LPI2C_Type * | base,
|  | lpi2c_slave_handle_t * | handle
| ) |  |

Reusable routine to handle slave interrupts.

Note
  This function does not need to be called unless you are reimplementing the nonblocking API's interrupt handler routines to add special functionality.

Parameters

  base | The LPI2C peripheral base address.
  handle | Pointer to #lpi2c_slave_handle_t structure which stores the transfer state.

void LPI2C_SlaveInit | ( | LPI2C_Type * | base,
|  | const lpi2c_slave_config_t * | slaveConfig,
|  | uint32_t | sourceClock_Hz
| ) |  |

Initializes the LPI2C slave peripheral.

This function enables the peripheral clock and initializes the LPI2C slave peripheral as described by the user provided configuration.

Parameters

  base | The LPI2C peripheral base address.
  slaveConfig | User provided peripheral configuration. Use LPI2C_SlaveGetDefaultConfig() to get a set of defaults that you can override.
  sourceClock_Hz | Frequency in Hertz of the LPI2C functional clock. Used to calculate the filter widths, data valid delay, and clock hold time.

status_t LPI2C_SlaveReceive | ( | LPI2C_Type * | base,
|  | void * | rxBuff,
|  | size_t | rxSize,
|  | size_t * | actualRxSize
| ) |  |

Performs a polling receive transfer on the I2C bus.

Parameters

  | base | The LPI2C peripheral base address.
  | rxBuff | The pointer to the data to be transferred.
  | rxSize | The length in bytes of the data to be transferred.
  [out] | actualRxSize |

Returns
  Error or success status returned by API.

static void LPI2C_SlaveReset | ( | LPI2C_Type * | base | ) |

inlinestatic

Perform software reset of the LPI2C slave peripheral.

Parameters

  base | The LPI2C peripheral base address.

status_t LPI2C_SlaveSend | ( | LPI2C_Type * | base,
|  | const void * | txBuff,
|  | size_t | txSize,
|  | size_t * | actualTxSize
| ) |  |

Performs a polling send transfer on the I2C bus.

Parameters

  | base | The LPI2C peripheral base address.
  | txBuff | The pointer to the data to be transferred.
  | txSize | The length in bytes of the data to be transferred.
  [out] | actualTxSize |

Returns
  Error or success status returned by API.

status_t LPI2C_SlaveTransferNonBlocking | ( | LPI2C_Type * | base,
|  | lpi2c_slave_handle_t * | handle,
|  | uint32_t | eventMask
| ) |  |

Start accepting slave transfers.

Call this API after calling I2C_SlaveInit() and LPI2C_SlaveCreateHandle() to start processing transactions driven by an I2C master. The slave will monitor the I2C bus and pass events to the callback that was passed into the call to LPI2C_SlaveCreateHandle(). The callback is always invoked from the interrupt context.

The set of events received by the callback is customizable. To do so, set the eventMask parameter to the OR'd combination of lpi2c_slave_transfer_event_t enumerators for the events you wish to receive. The kLPI2C_SlaveTransmitEvent and kLPI2C_SlaveReceiveEvent events are always enabled and do not need to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and receive events that are always enabled. In addition, the kLPI2C_SlaveAllEvents constant is provided as a convenient way to enable all events.

Parameters

  base | The LPI2C peripheral base address.
  handle | Pointer to #lpi2c_slave_handle_t structure which stores the transfer state.
  eventMask | Bit mask formed by OR'ing together lpi2c_slave_transfer_event_t enumerators to specify which events to send to the callback. Other accepted values are 0 to get a default set of only the transmit and receive events, and kLPI2C_SlaveAllEvents to enable all events.

Return values

  #kStatus_Success | Slave transfers were successfully started.
  kStatus_LPI2C_Busy | Slave transfers have already been started on this handle.

static void LPI2C_SlaveTransmitAck | ( | LPI2C_Type * | base,
|  | bool | ackOrNack
| ) |  |

inlinestatic

Transmit either an Ack or Nak on the I2C bus in response to a byte from the master.

Use this function to send an Ack or Nak when the kLPI2C_SlaveTransmitAckFlag is asserted. This will only happen if you enable the sclStall.enableAck field of the lpi2c_slave_config_t configuration structure used to initialize the slave peripheral.

Parameters

  base | The LPI2C peripheral base address.
  ackOrNack | Pass true for an Ack or false for a Nak.