stm32: add dma_get_number_of_data
Original discussion at: https://github.com/libopencm3/libopencm3/pull/702
This commit is contained in:
parent
824beaa472
commit
743513a4b1
@ -613,6 +613,7 @@ void dma_disable_stream(uint32_t dma, uint8_t stream);
|
|||||||
void dma_set_peripheral_address(uint32_t dma, uint8_t stream, uint32_t address);
|
void dma_set_peripheral_address(uint32_t dma, uint8_t stream, uint32_t address);
|
||||||
void dma_set_memory_address(uint32_t dma, uint8_t stream, uint32_t address);
|
void dma_set_memory_address(uint32_t dma, uint8_t stream, uint32_t address);
|
||||||
void dma_set_memory_address_1(uint32_t dma, uint8_t stream, uint32_t address);
|
void dma_set_memory_address_1(uint32_t dma, uint8_t stream, uint32_t address);
|
||||||
|
uint16_t dma_get_number_of_data(uint32_t dma, uint8_t stream);
|
||||||
void dma_set_number_of_data(uint32_t dma, uint8_t stream, uint16_t number);
|
void dma_set_number_of_data(uint32_t dma, uint8_t stream, uint16_t number);
|
||||||
|
|
||||||
END_DECLS
|
END_DECLS
|
||||||
|
@ -410,6 +410,7 @@ void dma_disable_channel(uint32_t dma, uint8_t channel);
|
|||||||
void dma_set_peripheral_address(uint32_t dma, uint8_t channel,
|
void dma_set_peripheral_address(uint32_t dma, uint8_t channel,
|
||||||
uint32_t address);
|
uint32_t address);
|
||||||
void dma_set_memory_address(uint32_t dma, uint8_t channel, uint32_t address);
|
void dma_set_memory_address(uint32_t dma, uint8_t channel, uint32_t address);
|
||||||
|
uint16_t dma_get_number_of_data(uint32_t dma, uint8_t channel);
|
||||||
void dma_set_number_of_data(uint32_t dma, uint8_t channel, uint16_t number);
|
void dma_set_number_of_data(uint32_t dma, uint8_t channel, uint16_t number);
|
||||||
|
|
||||||
END_DECLS
|
END_DECLS
|
||||||
|
@ -774,6 +774,20 @@ void dma_set_memory_address_1(uint32_t dma, uint8_t stream, uint32_t address)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/** @brief DMA Stream Get the Transfer Block Size
|
||||||
|
|
||||||
|
@param[in] dma unsigned int32. DMA controller base address: DMA1 or DMA2
|
||||||
|
@param[in] stream unsigned int8. Stream number: @ref dma_st_number
|
||||||
|
@returns unsigned int16. Number of remaining data words to transfer (65535
|
||||||
|
maximum).
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint16_t dma_get_number_of_data(uint32_t dma, uint8_t stream)
|
||||||
|
{
|
||||||
|
return DMA_SNDTR(dma, stream);
|
||||||
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/** @brief DMA Stream Set the Transfer Block Size
|
/** @brief DMA Stream Set the Transfer Block Size
|
||||||
|
|
||||||
|
@ -415,6 +415,20 @@ void dma_set_memory_address(uint32_t dma, uint8_t channel, uint32_t address)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/** @brief DMA Channel Get the Transfer Block Size
|
||||||
|
|
||||||
|
@param[in] dma unsigned int32. DMA controller base address: DMA1 or DMA2
|
||||||
|
@param[in] channel unsigned int8. Channel number: 1-7 for DMA1 or 1-5 for DMA2
|
||||||
|
@returns unsigned int16. Number of remaining data words to transfer (65535
|
||||||
|
maximum).
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint16_t dma_get_number_of_data(uint32_t dma, uint8_t channel)
|
||||||
|
{
|
||||||
|
return DMA_CNDTR(dma, channel);
|
||||||
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/** @brief DMA Channel Set the Transfer Block Size
|
/** @brief DMA Channel Set the Transfer Block Size
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user