Skip to content

Instantly share code, notes, and snippets.

@electronut
Created August 18, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save electronut/7520ad8a063c940ada30d2bb1cde68de to your computer and use it in GitHub Desktop.
Save electronut/7520ad8a063c940ada30d2bb1cde68de to your computer and use it in GitHub Desktop.
I2S setup
nrf_drv_i2s_config_t config = NRF_DRV_I2S_DEFAULT_CONFIG;
config.sdin_pin = I2S_SDIN_PIN;
config.sdout_pin = I2S_SDOUT_PIN;
config.mck_setup = NRF_I2S_MCK_32MDIV10; ///< 32 MHz / 10 = 3.2 MHz.
config.ratio = NRF_I2S_RATIO_32X; ///< LRCK = MCK / 32.
config.channels = NRF_I2S_CHANNELS_STEREO;
err_code = nrf_drv_i2s_init(&config, data_handler);
APP_ERROR_CHECK(err_code);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment