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:
parent
8028c122f6
commit
f40d33139e
|
@ -602,10 +602,10 @@ void gpt_lld_start(GPTDriver *gptp) {
|
|||
|
||||
/* Timer configuration.*/
|
||||
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->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. */
|
||||
}
|
||||
|
||||
|
|
|
@ -386,6 +386,11 @@ typedef struct {
|
|||
*/
|
||||
gptcallback_t callback;
|
||||
/* 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.
|
||||
* @note The value of this field should normally be equal to zero.
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM TRUE
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt2cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt2cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt2cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -48,4 +48,5 @@
|
|||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt2cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt2cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt2cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
10000, /* 10kHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -53,6 +54,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
10000, /* 10kHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -137,6 +138,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ static void gpt3cb(GPTDriver *gptp) {
|
|||
static const GPTConfig gpt4cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt4cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -157,6 +158,7 @@ static const GPTConfig gpt4cfg = {
|
|||
static const GPTConfig gpt3cfg = {
|
||||
1000000, /* 1MHz timer clock.*/
|
||||
gpt3cb, /* Timer callback.*/
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue