Lines Matching refs:m_cb

56 static adc_cb_t m_cb;  variable
64 if (m_cb.state != NRFX_DRV_STATE_UNINITIALIZED) in nrfx_adc_init()
83 m_cb.event_handler = event_handler; in nrfx_adc_init()
84 m_cb.state = NRFX_DRV_STATE_INITIALIZED; in nrfx_adc_init()
93 NRFX_ASSERT(m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_uninit()
103 m_cb.p_head = NULL; in nrfx_adc_uninit()
105 m_cb.state = NRFX_DRV_STATE_UNINITIALIZED; in nrfx_adc_uninit()
111 return (m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_init_check()
119 if (m_cb.p_head == NULL) in nrfx_adc_channel_enable()
121 m_cb.p_head = p_channel; in nrfx_adc_channel_enable()
125 nrfx_adc_channel_t * p_curr_channel = m_cb.p_head; in nrfx_adc_channel_enable()
139 NRFX_ASSERT(m_cb.p_head); in nrfx_adc_channel_disable()
142 nrfx_adc_channel_t * p_curr_channel = m_cb.p_head; in nrfx_adc_channel_disable()
156 m_cb.p_head = p_curr_channel->p_next; in nrfx_adc_channel_disable()
166 m_cb.p_head = NULL; in nrfx_adc_all_channels_disable()
171 NRFX_ASSERT(m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_sample()
181 NRFX_ASSERT(m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_sample_convert()
182 if (m_cb.state == NRFX_DRV_STATE_POWERED_ON) in nrfx_adc_sample_convert()
192 m_cb.state = NRFX_DRV_STATE_POWERED_ON; in nrfx_adc_sample_convert()
205 m_cb.state = NRFX_DRV_STATE_INITIALIZED; in nrfx_adc_sample_convert()
209 NRFX_ASSERT(m_cb.event_handler); in nrfx_adc_sample_convert()
210 m_cb.p_buffer = NULL; in nrfx_adc_sample_convert()
225 m_cb.p_buffer[m_cb.idx] = (nrf_adc_value_t)nrf_adc_result_get(NRF_ADC); in adc_sample_process()
226 m_cb.idx++; in adc_sample_process()
227 if (m_cb.idx < m_cb.size) in adc_sample_process()
230 if (m_cb.p_current_conv->p_next == NULL) in adc_sample_process()
234 NRFX_ASSERT(m_cb.p_head); in adc_sample_process()
236 m_cb.p_current_conv = m_cb.p_head; in adc_sample_process()
240 m_cb.p_current_conv = m_cb.p_current_conv->p_next; in adc_sample_process()
243 nrf_adc_init(NRF_ADC, &m_cb.p_current_conv->config); in adc_sample_process()
259 NRFX_ASSERT(m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_buffer_convert()
266 if (m_cb.state == NRFX_DRV_STATE_POWERED_ON) in nrfx_adc_buffer_convert()
276 m_cb.state = NRFX_DRV_STATE_POWERED_ON; in nrfx_adc_buffer_convert()
277 m_cb.p_current_conv = m_cb.p_head; in nrfx_adc_buffer_convert()
278 m_cb.size = size; in nrfx_adc_buffer_convert()
279 m_cb.idx = 0; in nrfx_adc_buffer_convert()
280 m_cb.p_buffer = buffer; in nrfx_adc_buffer_convert()
281 nrf_adc_init(NRF_ADC, &m_cb.p_current_conv->config); in nrfx_adc_buffer_convert()
284 if (m_cb.event_handler) in nrfx_adc_buffer_convert()
296 m_cb.state = NRFX_DRV_STATE_INITIALIZED; in nrfx_adc_buffer_convert()
311 NRFX_ASSERT(m_cb.state != NRFX_DRV_STATE_UNINITIALIZED); in nrfx_adc_is_busy()
312 return (m_cb.state == NRFX_DRV_STATE_POWERED_ON) ? true : false; in nrfx_adc_is_busy()
317 if (m_cb.p_buffer == NULL) in nrfx_adc_irq_handler()
328 m_cb.state = NRFX_DRV_STATE_INITIALIZED; in nrfx_adc_irq_handler()
329 m_cb.event_handler(&evt); in nrfx_adc_irq_handler()
337 evt.data.done.p_buffer = m_cb.p_buffer; in nrfx_adc_irq_handler()
338 evt.data.done.size = m_cb.size; in nrfx_adc_irq_handler()
339 m_cb.state = NRFX_DRV_STATE_INITIALIZED; in nrfx_adc_irq_handler()
341 NRFX_LOG_HEXDUMP_DEBUG((uint8_t *)m_cb.p_buffer, m_cb.size * sizeof(nrf_adc_value_t)); in nrfx_adc_irq_handler()
342 m_cb.event_handler(&evt); in nrfx_adc_irq_handler()