Type Alias esp_idf_sys::sample_to_rmt_t
source · pub type sample_to_rmt_t = Option<unsafe extern "C" fn(src: *const c_void, dest: *mut rmt_item32_t, src_size: usize, wanted_num: usize, translated_size: *mut usize, item_num: *mut usize)>;
Expand description
@brief User callback function to convert uint8_t type data to rmt format(rmt_item32_t).
This function may be called from an ISR, so, the code should be short and efficient.
@param src Pointer to the buffer storing the raw data that needs to be converted to rmt format. @param[out] dest Pointer to the buffer storing the rmt format data. @param src_size The raw data size. @param wanted_num The number of rmt format data that wanted to get. @param[out] translated_size The size of the raw data that has been converted to rmt format, it should return 0 if no data is converted in user callback. @param[out] item_num The number of the rmt format data that actually converted to, it can be less than wanted_num if there is not enough raw data, but cannot exceed wanted_num. it should return 0 if no data was converted.
@note
In fact, item_num should be a multiple of translated_size, e.g. :
When we convert each byte of uint8_t type data to rmt format data,
the relation between item_num and translated_size should be item_num = translated_size*8
.
Aliased Type§
enum sample_to_rmt_t {
None,
Some(unsafe extern "C" fn(_: *const c_void, _: *mut rmt_item32_t, _: usize, _: usize, _: *mut usize, _: *mut usize)),
}
Variants§
None
No value.
Some(unsafe extern "C" fn(_: *const c_void, _: *mut rmt_item32_t, _: usize, _: usize, _: *mut usize, _: *mut usize))
Some value of type T
.