git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3426 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2011-10-05 17:00:13 +00:00
parent 85cf040f27
commit 1351fded5a
5 changed files with 82 additions and 32 deletions

View File

@ -100,8 +100,8 @@ const stm32_dma_stream_t _stm32_dma_streams[STM32_DMA_STREAMS] = {
* @brief DMA ISR redirector type. * @brief DMA ISR redirector type.
*/ */
typedef struct { typedef struct {
stm32_dmaisr_t dma_func; stm32_dmaisr_t dma_func; /**< @brief DMA callback function. */
void *dma_param; void *dma_param; /**< @brief DMA callback parameter. */
} dma_isr_redir_t; } dma_isr_redir_t;
/** /**

View File

@ -153,6 +153,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief Associates a peripheral data register to a DMA stream. * @brief Associates a peripheral data register to a DMA stream.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @param[in] addr value to be written in the CPAR register * @param[in] addr value to be written in the CPAR register
@ -166,6 +168,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief Associates a memory destination to a DMA stream. * @brief Associates a memory destination to a DMA stream.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @param[in] addr value to be written in the CMAR register * @param[in] addr value to be written in the CMAR register
@ -179,6 +183,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief Sets the number of transfers to be performed. * @brief Sets the number of transfers to be performed.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @param[in] size value to be written in the CNDTR register * @param[in] size value to be written in the CNDTR register
@ -192,6 +198,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief Returns the number of transfers to be performed. * @brief Returns the number of transfers to be performed.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @return The number of transfers to be performed. * @return The number of transfers to be performed.
@ -203,6 +211,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief Programs the stream mode settings. * @brief Programs the stream mode settings.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @param[in] mode value to be written in the CCR register * @param[in] mode value to be written in the CCR register
@ -216,6 +226,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief DMA stream enable. * @brief DMA stream enable.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* *
@ -228,6 +240,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief DMA stream disable. * @brief DMA stream disable.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* *
@ -240,6 +254,8 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
/** /**
* @brief DMA stream interrupt sources clear. * @brief DMA stream interrupt sources clear.
* @note This function can be invoked in both ISR or thread context. * @note This function can be invoked in both ISR or thread context.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
* *
* @param[in] dmastp pointer to a stm32_dma_stream_t structure * @param[in] dmastp pointer to a stm32_dma_stream_t structure
* *
@ -249,6 +265,45 @@ typedef void (*stm32_dmaisr_t)(void *p, uint32_t flags);
*(dmastp)->ifcr = STM32_DMA_ISR_MASK << (dmastp)->ishift; \ *(dmastp)->ifcr = STM32_DMA_ISR_MASK << (dmastp)->ishift; \
} }
/**
* @brief Starts a memory to memory operation using the specified stream.
* @note The default transfer data mode is "byte to byte" but it can be
* changed by specifying extra options in the @p mode parameter.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
*
* @param[in] dmastp pointer to a stm32_dma_stream_t structure
* @param[in] mode value to be written in the CCR register, this value
* is implicitly ORed with:
* - @p STM32_DMA_CR_MINC
* - @p STM32_DMA_CR_PINC
* - @p STM32_DMA_CR_DIR_M2M
* - @p STM32_DMA_CR_EN
* .
* @param[in] src source address
* @param[in] dst destination address
* @param[in] n number of data units to copy
*/
#define dmaStartMemCopy(dmastp, mode, src, dst, n) { \
dmaStreamSetPeripheral(dmastp, src); \
dmaStreamSetMemory0(dmastp, dst); \
dmaStreamGetTransactionSize(dmastp, n); \
dmaStreamSetMode(dmastp, (mode) | \
STM32_DMA_CR_MINC | STM32_DMA_CR_PINC | \
STM32_DMA_CR_DIR_M2M | STM32_DMA_CR_EN); \
}
/**
* @brief Polled wait for DMA transfer end.
* @pre The stream must have been allocated using @p dmaStreamAllocate().
* @post After use the stream can be released using @p dmaStreamRelease().
*
* @param[in] dmastp pointer to a stm32_dma_stream_t structure
*/
#define dmaWaitCompletion(dmastp) \
while (((dmastp)->channel->CNDTR > 0) && \
((dmastp)->channel->CCR & STM32_DMA_CR_EN))
/*===========================================================================*/ /*===========================================================================*/
/* External declarations. */ /* External declarations. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -251,13 +251,14 @@ __attribute__((naked))
void ResetHandler(void) { void ResetHandler(void) {
uint32_t psp, ctl; uint32_t psp, ctl;
/* Process Stack initialization, it is allocated below the main stack. The /* Process Stack initialization, it is allocated starting from the
main stack is assumed to be allocated starting from @p __ram_end__ symbol __process_stack_end__ and its lower limit is the symbol
extending downward.*/ __process_stack_base__.*/
asm volatile ("cpsid i"); asm volatile ("cpsid i");
psp = SYMVAL(__process_stack_end__); psp = SYMVAL(__process_stack_end__);
asm volatile ("msr PSP, %0" : : "r" (psp)); asm volatile ("msr PSP, %0" : : "r" (psp));
/* CPU mode initialization.*/
ctl = CRT0_CONTROL_INIT; ctl = CRT0_CONTROL_INIT;
asm volatile ("msr CONTROL, %0" : : "r" (ctl)); asm volatile ("msr CONTROL, %0" : : "r" (ctl));
asm volatile ("isb"); asm volatile ("isb");

View File

@ -63,7 +63,8 @@
+--testhal/ - HAL integration test demos. +--testhal/ - HAL integration test demos.
| +--LPC11xx/ - LPC11xx HAL test demos. | +--LPC11xx/ - LPC11xx HAL test demos.
| +--LPC13xx/ - LPC13xx HAL test demos. | +--LPC13xx/ - LPC13xx HAL test demos.
| +--STM32/ - STM32 HAL test demos. | +--STM32F1xx/ - STM32F1xx HAL test demos.
| +--STM32L1xx/ - STM32L1xx HAL test demos.
| +--STM8S/ - STM8S HAL test demos. | +--STM8S/ - STM8S HAL test demos.
+--tools - Various tools. +--tools - Various tools.
+--eclipse - Eclipse enhancements. +--eclipse - Eclipse enhancements.
@ -75,6 +76,7 @@
*** 2.3.4 *** *** 2.3.4 ***
- FIX: Fixed broken TIM8 support in STM32 PWM driver (bug 3418620). - FIX: Fixed broken TIM8 support in STM32 PWM driver (bug 3418620).
- FIX: Fixed halconf.h file corrupted in some STM32 demos (bug 3418626). - FIX: Fixed halconf.h file corrupted in some STM32 demos (bug 3418626).
- NEW: Added memory copy functionality to the STM32 DMA driver.
*** 2.3.3 *** *** 2.3.3 ***
- FIX: Fixed uninitialized variable in STM32 PWM and ICU drivers (bug 3413558). - FIX: Fixed uninitialized variable in STM32 PWM and ICU drivers (bug 3413558).

View File

@ -6,39 +6,31 @@ X = In progress, some work done.
N = Decided against. N = Decided against.
Current Pipeline (2.3.x): Current Pipeline (2.3.x):
* lwIP 1.4.0 integration and test. - USB driver enhancements.
* Named threads. - USB and USB_SERIAL APIs reclassification.
* Call protocol check debug option. - Incorporate the USB bus attach/detach handling in usbStart()/usbStop().
* Improved stack overflow checking, support main() thread. - Fix zero size packets handling in USB_SERIAL driver.
* Move main stack to low memory in ARMCMx ports.
* Eclipse plugin.
* FatFs 0.8x integration.
* Kernel-only demo for users not interested in HAL (Cortex-Mx only).
- USB and USB_SERIAL APIs reclassification (if needed), incorporate the USB
bus attach/detach handling in usbStart()/usbStop().
- USB double buffering support for STM32 implementation. - USB double buffering support for STM32 implementation.
X STM32L1xx support (verify and test existing STM32F1xx drivers). - Evaluate using DMA channels for buffer copy.
- Specific ADC driver for STM32L1xx.
X STM32L-Discovery demo and article.
X STM32F2xx support (adapt and re-verify all drivers).
* New STM32 DMA helper driver abstracting differences between STM32F2xx and
other sub-families.
? Specific ADC driver for STM32F2xx.
- MMC_SPI driver revision and speedup.
X Implement the "transmission end" serial driver event on those platforms
supporting the feature, so far only done in STM32 driver.
X I2C device driver class support and at least one implementation. X I2C device driver class support and at least one implementation.
X Evaluate a modified I2C API where the synchronous mode is default and the X Evaluate a modified I2C API where the synchronous mode is default and the
callback mode optional. This would allow a portable I2C driver based on callback mode optional.
a GPT instance. - Software I2C implementation using a GPT instance for timings.
- Software I2C implementation. X STM32F2xx/STM32F4xx support (adapt and re-verify all drivers).
* New STM32 DMA helper driver abstracting differences between
STM32F2xx/STM32F4xx and other sub-families.
- Specific ADC driver for STM32F2xx/STM32F4xx.
- MMC_SPI driver revision and speedup.
- FatFs 0.9x integration.
Within 2.x.x
X File System infrastructure.
X Implement the "transmission end" serial driver event on those platforms
supporting the feature, so far only done in STM32 driver.
- Add a CH_THREAD macro for threads declaration in order to hide - Add a CH_THREAD macro for threads declaration in order to hide
compiler-specific optimizations for thread functions. All demos will have compiler-specific optimizations for thread functions. All demos will have
to be updated. to be updated.
- LPC17xx support. - LPC17xx support.
Within 2.x.x
X File System infrastructure.
- Test suite overhaul, the API should be more generic in order to be used - Test suite overhaul, the API should be more generic in order to be used
with different subsystems and not just the kernel. with different subsystems and not just the kernel.
- Reduce number of demos globally, add demos to a repository or on web site. - Reduce number of demos globally, add demos to a repository or on web site.