Lines Matching refs:p_rmt_obj

112 static rmt_obj_t *p_rmt_obj[RMT_CHANNEL_MAX] = {0};  variable
323 p_rmt_obj[channel]->rx_item_start_idx = 0; in rmt_rx_start()
324 p_rmt_obj[channel]->rx_item_len = 0; in rmt_rx_start()
729 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_driver_isr_default()
751 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_driver_isr_default()
803 rmt_obj_t *p_rmt = p_rmt_obj[RMT_ENCODE_RX_CHANNEL(channel)]; in rmt_driver_isr_default()
845 rmt_obj_t *p_rmt = p_rmt_obj[RMT_ENCODE_RX_CHANNEL(channel)]; in rmt_driver_isr_default()
871 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_driver_isr_default()
894 rmt_obj_t *p_rmt = p_rmt_obj[RMT_ENCODE_RX_CHANNEL(channel)]; in rmt_driver_isr_default()
909 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_driver_isr_default()
929 if (p_rmt_obj[channel] == NULL) { in rmt_driver_uninstall()
933 if (p_rmt_obj[channel]->wait_done) { in rmt_driver_uninstall()
934 xSemaphoreTake(p_rmt_obj[channel]->tx_sem, portMAX_DELAY); in rmt_driver_uninstall()
939 if (p_rmt_obj[channel]->rx_buf) { in rmt_driver_uninstall()
956 if (p_rmt_obj[channel]->tx_sem) { in rmt_driver_uninstall()
957 vSemaphoreDelete(p_rmt_obj[channel]->tx_sem); in rmt_driver_uninstall()
958 p_rmt_obj[channel]->tx_sem = NULL; in rmt_driver_uninstall()
960 if (p_rmt_obj[channel]->rx_buf) { in rmt_driver_uninstall()
961 vRingbufferDelete(p_rmt_obj[channel]->rx_buf); in rmt_driver_uninstall()
962 p_rmt_obj[channel]->rx_buf = NULL; in rmt_driver_uninstall()
964 if (p_rmt_obj[channel]->tx_buf) { in rmt_driver_uninstall()
965 free(p_rmt_obj[channel]->tx_buf); in rmt_driver_uninstall()
966 p_rmt_obj[channel]->tx_buf = NULL; in rmt_driver_uninstall()
968 if (p_rmt_obj[channel]->sample_to_rmt) { in rmt_driver_uninstall()
969 p_rmt_obj[channel]->sample_to_rmt = NULL; in rmt_driver_uninstall()
972 if (p_rmt_obj[channel]->rx_item_buf) { in rmt_driver_uninstall()
973 free(p_rmt_obj[channel]->rx_item_buf); in rmt_driver_uninstall()
974 p_rmt_obj[channel]->rx_item_buf = NULL; in rmt_driver_uninstall()
975 p_rmt_obj[channel]->rx_item_buf_size = 0; in rmt_driver_uninstall()
979 free(p_rmt_obj[channel]); in rmt_driver_uninstall()
980 p_rmt_obj[channel] = NULL; in rmt_driver_uninstall()
990 if (p_rmt_obj[channel]) { in rmt_driver_install()
1003 p_rmt_obj[channel] = calloc(1, sizeof(rmt_obj_t)); in rmt_driver_install()
1006 p_rmt_obj[channel] = calloc(1, sizeof(rmt_obj_t)); in rmt_driver_install()
1008p_rmt_obj[channel] = heap_caps_calloc(1, sizeof(rmt_obj_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); in rmt_driver_install()
1012 if (p_rmt_obj[channel] == NULL) { in rmt_driver_install()
1017 p_rmt_obj[channel]->tx_len_rem = 0; in rmt_driver_install()
1018 p_rmt_obj[channel]->tx_data = NULL; in rmt_driver_install()
1019 p_rmt_obj[channel]->channel = channel; in rmt_driver_install()
1020 p_rmt_obj[channel]->tx_offset = 0; in rmt_driver_install()
1021 p_rmt_obj[channel]->tx_sub_len = 0; in rmt_driver_install()
1022 p_rmt_obj[channel]->wait_done = false; in rmt_driver_install()
1023 p_rmt_obj[channel]->loop_autostop = false; in rmt_driver_install()
1024 p_rmt_obj[channel]->translator = false; in rmt_driver_install()
1025 p_rmt_obj[channel]->sample_to_rmt = NULL; in rmt_driver_install()
1026 if (p_rmt_obj[channel]->tx_sem == NULL) { in rmt_driver_install()
1028 p_rmt_obj[channel]->tx_sem = xSemaphoreCreateBinary(); in rmt_driver_install()
1030 p_rmt_obj[channel]->intr_alloc_flags = intr_alloc_flags; in rmt_driver_install()
1032 p_rmt_obj[channel]->tx_sem = xSemaphoreCreateBinary(); in rmt_driver_install()
1034p_rmt_obj[channel]->tx_sem = xSemaphoreCreateBinaryStatic(&p_rmt_obj[channel]->tx_sem_buffer); in rmt_driver_install()
1037 xSemaphoreGive(p_rmt_obj[channel]->tx_sem); in rmt_driver_install()
1039 if (p_rmt_obj[channel]->rx_buf == NULL && rx_buf_size > 0) { in rmt_driver_install()
1040 p_rmt_obj[channel]->rx_buf = xRingbufferCreate(rx_buf_size, RINGBUF_TYPE_NOSPLIT); in rmt_driver_install()
1044 if (p_rmt_obj[channel]->rx_item_buf == NULL && rx_buf_size > 0) { in rmt_driver_install()
1046 p_rmt_obj[channel]->rx_item_buf = calloc(1, rx_buf_size); in rmt_driver_install()
1048 if (!(p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM)) { in rmt_driver_install()
1049 p_rmt_obj[channel]->rx_item_buf = calloc(1, rx_buf_size); in rmt_driver_install()
1051p_rmt_obj[channel]->rx_item_buf = heap_caps_calloc(1, rx_buf_size, MALLOC_CAP_INTERNAL | MALLOC_CA… in rmt_driver_install()
1054 if (p_rmt_obj[channel]->rx_item_buf == NULL) { in rmt_driver_install()
1058 p_rmt_obj[channel]->rx_item_buf_size = rx_buf_size; in rmt_driver_install()
1087 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_write_items()
1093 if (p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM) { in rmt_write_items()
1100 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_write_items()
1146 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_wait_tx_done()
1147 if (xSemaphoreTake(p_rmt_obj[channel]->tx_sem, wait_time) == pdTRUE) { in rmt_wait_tx_done()
1148 p_rmt_obj[channel]->wait_done = false; in rmt_wait_tx_done()
1149 xSemaphoreGive(p_rmt_obj[channel]->tx_sem); in rmt_wait_tx_done()
1163 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_get_ringbuf_handle()
1165 *buf_handle = p_rmt_obj[channel]->rx_buf; in rmt_get_ringbuf_handle()
1181 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_translator_init()
1185 if (p_rmt_obj[channel]->tx_buf == NULL) { in rmt_translator_init()
1187 p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)calloc(1, block_size); in rmt_translator_init()
1189 if (p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM) { in rmt_translator_init()
1190p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)heap_caps_calloc(1, block_size, MALLOC_CAP_INTERNAL |… in rmt_translator_init()
1192 p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)calloc(1, block_size); in rmt_translator_init()
1195 if (p_rmt_obj[channel]->tx_buf == NULL) { in rmt_translator_init()
1200 p_rmt_obj[channel]->sample_to_rmt = fn; in rmt_translator_init()
1201 p_rmt_obj[channel]->tx_context = NULL; in rmt_translator_init()
1202 p_rmt_obj[channel]->sample_size_remain = 0; in rmt_translator_init()
1203 p_rmt_obj[channel]->sample_cur = NULL; in rmt_translator_init()
1211 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_translator_set_context()
1213 p_rmt_obj[channel]->tx_context = context; in rmt_translator_set_context()
1232 ESP_RETURN_ON_FALSE(p_rmt_obj[channel], ESP_FAIL, TAG, RMT_DRIVER_ERROR_STR); in rmt_write_sample()
1233 … ESP_RETURN_ON_FALSE(p_rmt_obj[channel]->sample_to_rmt, ESP_FAIL, TAG, RMT_TRANSLATOR_UNINIT_STR); in rmt_write_sample()
1237 if (p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM) { in rmt_write_sample()
1245 rmt_obj_t *p_rmt = p_rmt_obj[channel]; in rmt_write_sample()
1284 if (p_rmt_obj[i]) { in rmt_get_channel_status()
1285 if (p_rmt_obj[i]->tx_sem) { in rmt_get_channel_status()
1286 if (xSemaphoreTake(p_rmt_obj[i]->tx_sem, (TickType_t)0) == pdTRUE) { in rmt_get_channel_status()
1288 xSemaphoreGive(p_rmt_obj[i]->tx_sem); in rmt_get_channel_status()
1359 p_rmt_obj[channel]->loop_autostop = en; in rmt_enable_tx_loop_autostop()