[][src]Function mynewt::hw::hal::hal_spi_data_mode_breakout

pub unsafe extern "C" fn hal_spi_data_mode_breakout(
    data_mode: u8,
    out_cpol: *mut c_int,
    out_cpha: *mut c_int
) -> c_int

Extracts CPOL and CPHA values from a data-mode constant. Utility function, defined once for every MCU.

  • data_mode: The HAL_SPI_MODE value to convert.
  • out_cpol: The CPOL gets written here on success.
  • out_cpha: The CPHA gets written here on success.

Return: 0 on success; nonzero on invalid input.