Lines Matching refs:nrf
273 nrf_comp_input_t *nrf) in shim_nrf_comp_psel_to_nrf() argument
279 *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; in shim_nrf_comp_psel_to_nrf()
284 nrf_comp_input_t *nrf) in shim_nrf_comp_psel_to_nrf() argument
288 *nrf = NRF_COMP_INPUT_0; in shim_nrf_comp_psel_to_nrf()
292 *nrf = NRF_COMP_INPUT_1; in shim_nrf_comp_psel_to_nrf()
296 *nrf = NRF_COMP_INPUT_2; in shim_nrf_comp_psel_to_nrf()
300 *nrf = NRF_COMP_INPUT_3; in shim_nrf_comp_psel_to_nrf()
305 *nrf = NRF_COMP_INPUT_4; in shim_nrf_comp_psel_to_nrf()
311 *nrf = NRF_COMP_INPUT_5; in shim_nrf_comp_psel_to_nrf()
317 *nrf = NRF_COMP_INPUT_6; in shim_nrf_comp_psel_to_nrf()
323 *nrf = NRF_COMP_INPUT_7; in shim_nrf_comp_psel_to_nrf()
329 *nrf = NRF_COMP_VDD_DIV2; in shim_nrf_comp_psel_to_nrf()
335 *nrf = NRF_COMP_VDDH_DIV5; in shim_nrf_comp_psel_to_nrf()
348 nrf_comp_sp_mode_t *nrf) in shim_nrf_comp_sp_mode_to_nrf() argument
352 *nrf = NRF_COMP_SP_MODE_LOW; in shim_nrf_comp_sp_mode_to_nrf()
357 *nrf = NRF_COMP_SP_MODE_NORMAL; in shim_nrf_comp_sp_mode_to_nrf()
362 *nrf = NRF_COMP_SP_MODE_HIGH; in shim_nrf_comp_sp_mode_to_nrf()
374 nrf_isource_t *nrf) in shim_nrf_comp_isource_to_nrf() argument
378 *nrf = NRF_COMP_ISOURCE_OFF; in shim_nrf_comp_isource_to_nrf()
383 *nrf = NRF_COMP_ISOURCE_IEN_2UA5; in shim_nrf_comp_isource_to_nrf()
389 *nrf = NRF_COMP_ISOURCE_IEN_5UA; in shim_nrf_comp_isource_to_nrf()
395 *nrf = NRF_COMP_ISOURCE_IEN_10UA; in shim_nrf_comp_isource_to_nrf()
409 nrf_comp_ext_ref_t *nrf) in shim_nrf_comp_extrefsel_to_nrf() argument
415 *nrf = shim_nrf_comp_ain_map[(uint32_t)shim]; in shim_nrf_comp_extrefsel_to_nrf()
420 nrf_comp_ext_ref_t *nrf) in shim_nrf_comp_extrefsel_to_nrf() argument
424 *nrf = NRF_COMP_EXT_REF_0; in shim_nrf_comp_extrefsel_to_nrf()
428 *nrf = NRF_COMP_EXT_REF_1; in shim_nrf_comp_extrefsel_to_nrf()
432 *nrf = NRF_COMP_EXT_REF_2; in shim_nrf_comp_extrefsel_to_nrf()
436 *nrf = NRF_COMP_EXT_REF_3; in shim_nrf_comp_extrefsel_to_nrf()
441 *nrf = NRF_COMP_EXT_REF_4; in shim_nrf_comp_extrefsel_to_nrf()
447 *nrf = NRF_COMP_EXT_REF_5; in shim_nrf_comp_extrefsel_to_nrf()
453 *nrf = NRF_COMP_EXT_REF_6; in shim_nrf_comp_extrefsel_to_nrf()
459 *nrf = NRF_COMP_EXT_REF_7; in shim_nrf_comp_extrefsel_to_nrf()
472 nrf_comp_ref_t *nrf) in shim_nrf_comp_refsel_to_nrf() argument
476 *nrf = NRF_COMP_REF_INT_1V2; in shim_nrf_comp_refsel_to_nrf()
481 *nrf = NRF_COMP_REF_INT_1V8; in shim_nrf_comp_refsel_to_nrf()
487 *nrf = NRF_COMP_REF_INT_2V4; in shim_nrf_comp_refsel_to_nrf()
493 *nrf = NRF_COMP_REF_AVDDAO1V8; in shim_nrf_comp_refsel_to_nrf()
499 *nrf = NRF_COMP_REF_VDD; in shim_nrf_comp_refsel_to_nrf()
504 *nrf = NRF_COMP_REF_AREF; in shim_nrf_comp_refsel_to_nrf()
515 nrfx_comp_config_t *nrf) in shim_nrf_comp_se_config_to_nrf() argument
517 if (shim_nrf_comp_refsel_to_nrf(shim->refsel, &nrf->reference)) { in shim_nrf_comp_se_config_to_nrf()
521 if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { in shim_nrf_comp_se_config_to_nrf()
525 nrf->main_mode = NRF_COMP_MAIN_MODE_SE; in shim_nrf_comp_se_config_to_nrf()
531 nrf->threshold.th_down = shim->th_down; in shim_nrf_comp_se_config_to_nrf()
532 nrf->threshold.th_up = shim->th_up; in shim_nrf_comp_se_config_to_nrf()
534 if (shim_nrf_comp_sp_mode_to_nrf(shim->sp_mode, &nrf->speed_mode)) { in shim_nrf_comp_se_config_to_nrf()
538 nrf->hyst = NRF_COMP_HYST_NO_HYST; in shim_nrf_comp_se_config_to_nrf()
541 if (shim_nrf_comp_isource_to_nrf(shim->isource, &nrf->isource)) { in shim_nrf_comp_se_config_to_nrf()
550 if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { in shim_nrf_comp_se_config_to_nrf()
554 nrf->interrupt_priority = 0; in shim_nrf_comp_se_config_to_nrf()
559 nrfx_comp_config_t *nrf) in shim_nrf_comp_diff_config_to_nrf() argument
561 nrf->reference = NRF_COMP_REF_AREF; in shim_nrf_comp_diff_config_to_nrf()
563 if (shim_nrf_comp_extrefsel_to_nrf(shim->extrefsel, &nrf->ext_ref)) { in shim_nrf_comp_diff_config_to_nrf()
567 nrf->main_mode = NRF_COMP_MAIN_MODE_DIFF; in shim_nrf_comp_diff_config_to_nrf()
568 nrf->threshold.th_down = 0; in shim_nrf_comp_diff_config_to_nrf()
569 nrf->threshold.th_up = 0; in shim_nrf_comp_diff_config_to_nrf()
571 if (shim_nrf_comp_sp_mode_to_nrf(shim->sp_mode, &nrf->speed_mode)) { in shim_nrf_comp_diff_config_to_nrf()
577 nrf->hyst = NRF_COMP_HYST_ENABLED; in shim_nrf_comp_diff_config_to_nrf()
579 nrf->hyst = NRF_COMP_HYST_DISABLED; in shim_nrf_comp_diff_config_to_nrf()
588 if (shim_nrf_comp_isource_to_nrf(shim->isource, &nrf->isource)) { in shim_nrf_comp_diff_config_to_nrf()
597 if (shim_nrf_comp_psel_to_nrf(shim->psel, &nrf->input)) { in shim_nrf_comp_diff_config_to_nrf()
601 nrf->interrupt_priority = 0; in shim_nrf_comp_diff_config_to_nrf()
676 static int shim_nrf_comp_reconfigure(const nrfx_comp_config_t *nrf) in shim_nrf_comp_reconfigure() argument
680 (void)nrfx_comp_reconfigure(nrf); in shim_nrf_comp_reconfigure()
692 nrfx_comp_config_t nrf = {}; in comp_nrf_comp_configure_se() local
696 if (shim_nrf_comp_se_config_to_nrf(config, &nrf)) { in comp_nrf_comp_configure_se()
700 return shim_nrf_comp_reconfigure(&nrf); in comp_nrf_comp_configure_se()
706 nrfx_comp_config_t nrf = {}; in comp_nrf_comp_configure_diff() local
710 if (shim_nrf_comp_diff_config_to_nrf(config, &nrf)) { in comp_nrf_comp_configure_diff()
714 return shim_nrf_comp_reconfigure(&nrf); in comp_nrf_comp_configure_diff()
732 nrfx_comp_config_t nrf = {}; in shim_nrf_comp_init() local
743 (void)shim_nrf_comp_se_config_to_nrf(&shim_nrf_comp_config0, &nrf); in shim_nrf_comp_init()
745 (void)shim_nrf_comp_diff_config_to_nrf(&shim_nrf_comp_config0, &nrf); in shim_nrf_comp_init()
748 if (nrfx_comp_init(&nrf, shim_nrf_comp_event_handler) != NRFX_SUCCESS) { in shim_nrf_comp_init()