STM32 GPT enhancements.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6758 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2014-03-07 18:01:52 +00:00
parent 8028c122f6
commit f40d33139e
12 changed files with 25 additions and 3 deletions

View File

@ -602,10 +602,10 @@ void gpt_lld_start(GPTDriver *gptp) {
/* Timer configuration.*/ /* Timer configuration.*/
gptp->tim->CR1 = 0; /* Initially stopped. */ gptp->tim->CR1 = 0; /* Initially stopped. */
gptp->tim->CR2 = STM32_TIM_CR2_CCDS; /* DMA on UE (if any). */ gptp->tim->CR2 = gptp->config->cr2;
gptp->tim->PSC = psc; /* Prescaler value. */ gptp->tim->PSC = psc; /* Prescaler value. */
gptp->tim->DIER = gptp->config->dier & /* DMA-related DIER bits. */ gptp->tim->DIER = gptp->config->dier & /* DMA-related DIER bits. */
STM32_TIM_DIER_IRQ_MASK; ~STM32_TIM_DIER_IRQ_MASK;
gptp->tim->SR = 0; /* Clear pending IRQs. */ gptp->tim->SR = 0; /* Clear pending IRQs. */
} }

View File

@ -386,6 +386,11 @@ typedef struct {
*/ */
gptcallback_t callback; gptcallback_t callback;
/* End of the mandatory fields.*/ /* End of the mandatory fields.*/
/**
* @brief TIM CR2 register initialization data.
* @note The value of this field should normally be equal to zero.
*/
uint32_t cr2;
/** /**
* @brief TIM DIER register initialization data. * @brief TIM DIER register initialization data.
* @note The value of this field should normally be equal to zero. * @note The value of this field should normally be equal to zero.

View File

@ -137,7 +137,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_TM TRUE #define CH_CFG_USE_TM FALSE
/** /**
* @brief Threads registry APIs. * @brief Threads registry APIs.

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt2cfg = { static const GPTConfig gpt2cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt2cb, /* Timer callback.*/ gpt2cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt2cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -48,4 +48,5 @@
</scannerConfigBuildInfo> </scannerConfigBuildInfo>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
</cproject> </cproject>

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt2cfg = { static const GPTConfig gpt2cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt2cb, /* Timer callback.*/ gpt2cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt2cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -44,6 +44,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
10000, /* 10kHz timer clock.*/ 10000, /* 10kHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -53,6 +54,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
10000, /* 10kHz timer clock.*/ 10000, /* 10kHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -128,6 +128,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -137,6 +138,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };

View File

@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
static const GPTConfig gpt4cfg = { static const GPTConfig gpt4cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt4cb, /* Timer callback.*/ gpt4cb, /* Timer callback.*/
0,
0 0
}; };
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
static const GPTConfig gpt3cfg = { static const GPTConfig gpt3cfg = {
1000000, /* 1MHz timer clock.*/ 1000000, /* 1MHz timer clock.*/
gpt3cb, /* Timer callback.*/ gpt3cb, /* Timer callback.*/
0,
0 0
}; };