Buffers in PDM module

Hi

I'm working with a PDM mic for nRF52832 SDK v17.1 on a project and I have a questions about PDM driver working.

Whats the difference between the buffer pointer in nrfx_pdm_buffer_set(int16_t * buffer, uint16_t buffer_length) and p_evt->buffer_released set after a buffer_request event? Do they point to the same data?

2. How do I access the data in p_evt->buffer_released? I saw this thread but it's for Thingy 52 and another one for the Smart Remote but could you tell me how to implement it in 52832? I tried this code but it only displays zero.

p_buffer_released = p_evt->buffer_released;
pdm_buf = *p_buffer_released;
printf("\n\rOut: %08X",pdm_buf);
 

Unrelated question: nrf_gpio_pin_set() will set a pin to HIGH and nrf_gpio_pin_clear() will set it to LOW. I saw a couple of examples which had it vice versa. Is my assumption right or does nrf_gpio_pin_set() set a pin to LOW?

Regards

Raj

Parents
  • Hi Raj,


    Whats the difference between the buffer pointer in nrfx_pdm_buffer_set(int16_t * buffer, uint16_t buffer_length) and p_evt->buffer_released set after a buffer_request event? Do they point to the same data?

    Could you provide more information about the pointers buffer and p_evt->buffer_released? 


    How do I access the data in p_evt->buffer_released? I saw this thread but it's for Thingy 52 and another one for the Smart Remote but could you tell me how to implement it in 52832? I tried this code but it only displays zero.

    It might be that the code displays zero because that is the content of the buffer. You would need to check the content of the buffer and verify that it is not zero.


    Unrelated question: nrf_gpio_pin_set() will set a pin to HIGH and nrf_gpio_pin_clear() will set it to LOW. I saw a couple of examples which had it vice versa. Is my assumption right or does nrf_gpio_pin_set() set a pin to LOW?

    Could you specify the examples that you saw?

    Best regards,
    Dejan

Reply
  • Hi Raj,


    Whats the difference between the buffer pointer in nrfx_pdm_buffer_set(int16_t * buffer, uint16_t buffer_length) and p_evt->buffer_released set after a buffer_request event? Do they point to the same data?

    Could you provide more information about the pointers buffer and p_evt->buffer_released? 


    How do I access the data in p_evt->buffer_released? I saw this thread but it's for Thingy 52 and another one for the Smart Remote but could you tell me how to implement it in 52832? I tried this code but it only displays zero.

    It might be that the code displays zero because that is the content of the buffer. You would need to check the content of the buffer and verify that it is not zero.


    Unrelated question: nrf_gpio_pin_set() will set a pin to HIGH and nrf_gpio_pin_clear() will set it to LOW. I saw a couple of examples which had it vice versa. Is my assumption right or does nrf_gpio_pin_set() set a pin to LOW?

    Could you specify the examples that you saw?

    Best regards,
    Dejan

Children
No Data
Related