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

This commit is contained in:
pcirillo 2013-06-01 08:46:31 +00:00
parent 09b9d8de34
commit ee5f454577
15 changed files with 89 additions and 103 deletions

View File

@ -39,20 +39,14 @@
#define SPC5_HAS_DSPI2 TRUE #define SPC5_HAS_DSPI2 TRUE
#define SPC5_HAS_DSPI3 FALSE #define SPC5_HAS_DSPI3 FALSE
#define SPC5_DSPI_FIFO_DEPTH 16 #define SPC5_DSPI_FIFO_DEPTH 16
#define SPC5_DSPI1_TX1_DMA_DEV_ID 12 #define SPC5_DSPI1_TX_DMA_DEV_ID 12
#define SPC5_DSPI1_TX2_DMA_DEV_ID 25
#define SPC5_DSPI1_RX_DMA_DEV_ID 13 #define SPC5_DSPI1_RX_DMA_DEV_ID 13
#define SPC5_DSPI2_TX1_DMA_DEV_ID 14 #define SPC5_DSPI2_TX_DMA_DEV_ID 14
#define SPC5_DSPI2_TX2_DMA_DEV_ID 26
#define SPC5_DSPI2_RX_DMA_DEV_ID 15 #define SPC5_DSPI2_RX_DMA_DEV_ID 15
#define SPC5_DSPI1_EOQF_HANDLER vector132 #define SPC5_DSPI1_EOQF_HANDLER vector132
#define SPC5_DSPI1_EOQF_NUMBER 132 #define SPC5_DSPI1_EOQF_NUMBER 132
#define SPC5_DSPI1_TFFF_HANDLER vector133
#define SPC5_DSPI1_TFFF_NUMBER 133
#define SPC5_DSPI2_EOQF_HANDLER vector137 #define SPC5_DSPI2_EOQF_HANDLER vector137
#define SPC5_DSPI2_EOQF_NUMBER 137 #define SPC5_DSPI2_EOQF_NUMBER 137
#define SPC5_DSPI2_TFFF_HANDLER vector138
#define SPC5_DSPI2_TFFF_NUMBER 138
#define SPC5_DSPI1_ENABLE_CLOCK() #define SPC5_DSPI1_ENABLE_CLOCK()
#define SPC5_DSPI1_DISABLE_CLOCK() #define SPC5_DSPI1_DISABLE_CLOCK()
#define SPC5_DSPI2_ENABLE_CLOCK() #define SPC5_DSPI2_ENABLE_CLOCK()
@ -119,7 +113,7 @@
#define SPC5_EMIOS_FLAG_F15_NUMBER 66 #define SPC5_EMIOS_FLAG_F15_NUMBER 66
#define SPC5_EMIOS_FLAG_F23_NUMBER 209 #define SPC5_EMIOS_FLAG_F23_NUMBER 209
#define SPC5_EMIOS_CLK (64000000 / \ #define SPC5_EMIOS_CLK (SPC5_SYSCLK / \
SPC5_EMIOS_GLOBAL_PRESCALER) SPC5_EMIOS_GLOBAL_PRESCALER)
#define SPC5_EMIOS_ENABLE_CLOCK() #define SPC5_EMIOS_ENABLE_CLOCK()
#define SPC5_EMIOS_DISABLE_CLOCK() #define SPC5_EMIOS_DISABLE_CLOCK()

View File

@ -112,7 +112,7 @@
#define SPC5_EMIOS_FLAG_F22_NUMBER 208 #define SPC5_EMIOS_FLAG_F22_NUMBER 208
#define SPC5_EMIOS_FLAG_F23_NUMBER 209 #define SPC5_EMIOS_FLAG_F23_NUMBER 209
#define SPC5_EMIOS_CLK (64000000 / \ #define SPC5_EMIOS_CLK (SPC5_SYSCLK / \
SPC5_EMIOS_GLOBAL_PRESCALER) SPC5_EMIOS_GLOBAL_PRESCALER)
#define SPC5_EMIOS_ENABLE_CLOCK() #define SPC5_EMIOS_ENABLE_CLOCK()
#define SPC5_EMIOS_DISABLE_CLOCK() #define SPC5_EMIOS_DISABLE_CLOCK()

View File

@ -707,7 +707,7 @@ void pwm_lld_start(PWMDriver *pwmp) {
pwmp->emiosp->CH[pwmp->ch_number].CBDR.R = pwmp->config->period; pwmp->emiosp->CH[pwmp->ch_number].CBDR.R = pwmp->config->period;
pwmp->emiosp->CH[pwmp->ch_number].CCR.R |= pwmp->emiosp->CH[pwmp->ch_number].CCR.R |=
EMIOSC_BSL(EMIOS_BSL_INTERNAL_COUNTER) | EMIOS_CCR_MODE_OPWFMB | 2U; EMIOSC_BSL(EMIOS_BSL_INTERNAL_COUNTER) | EMIOS_CCR_MODE_OPWFMB | 2U;
pwmp->emiosp->CH[pwmp->ch_number].CCR.R |= EMIOSC_UCPREN;; pwmp->emiosp->CH[pwmp->ch_number].CCR.R |= EMIOSC_UCPREN;
/* Set output polarity.*/ /* Set output polarity.*/
if (pwmp->config->channels[0].mode == PWM_OUTPUT_ACTIVE_LOW) { if (pwmp->config->channels[0].mode == PWM_OUTPUT_ACTIVE_LOW) {

View File

@ -67,7 +67,8 @@
#define EMIOS_CCR_MODE_MC_CME 17 #define EMIOS_CCR_MODE_MC_CME 17
#define EMIOS_CCR_MODE_MC_UP_DOWN 18 #define EMIOS_CCR_MODE_MC_UP_DOWN 18
#define EMIOS_CCR_MODE_OPWMT 38 #define EMIOS_CCR_MODE_OPWMT 38
#define EMIOS_CCR_MODE_MCB 84 #define EMIOS_CCR_MODE_MCB_UP 80
#define EMIOS_CCR_MODE_MCB_UP_DOWN 84
#define EMIOS_CCR_MODE_OPWFMB 88 #define EMIOS_CCR_MODE_OPWFMB 88
#define EMIOS_CCR_MODE_OPWMCB_TE 92 #define EMIOS_CCR_MODE_OPWMCB_TE 92
#define EMIOS_CCR_MODE_OPWMCB_LE 93 #define EMIOS_CCR_MODE_OPWMCB_LE 93

View File

@ -128,7 +128,7 @@
* @brief Enables the SERIAL subsystem. * @brief Enables the SERIAL subsystem.
*/ */
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL TRUE #define HAL_USE_SERIAL FALSE
#endif #endif
/** /**

View File

@ -1,21 +1,21 @@
/* /*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio * Licensed under ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at:
you may not use this file except in compliance with the License. *
You may obtain a copy of the License at * http://www.st.com/software_license_agreement_liberty_v2
*
http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
See the License for the specific language governing permissions and
limitations under the License.
*/ */
#include "ch.h" /* Inclusion of the main header files of all the imported components in the
#include "hal.h" order specified in the application wizard. The file is generated
automatically.*/
#include "components.h"
static void pwmpcb(PWMDriver *pwmp) { static void pwmpcb(PWMDriver *pwmp) {
@ -30,8 +30,8 @@ static void pwmc1cb(PWMDriver *pwmp) {
} }
static PWMConfig pwmcfg = { static PWMConfig pwmcfg = {
80000, /* 80kHz PWM clock frequency.*/ 100000, /* 100kHz PWM clock frequency.*/
20000, /* Initial PWM period 0.25s.*/ 20000, /* Initial PWM period 0.2s.*/
pwmpcb, pwmpcb,
{ {
{PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb} {PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb}
@ -40,7 +40,6 @@ static PWMConfig pwmcfg = {
}; };
icucnt_t last_width, last_period; icucnt_t last_width, last_period;
icucnt_t last_width2, last_period2;
static void icuwidthcb(ICUDriver *icup) { static void icuwidthcb(ICUDriver *icup) {
@ -56,7 +55,7 @@ static void icuperiodcb(ICUDriver *icup) {
static ICUConfig icucfg = { static ICUConfig icucfg = {
ICU_INPUT_ACTIVE_HIGH, ICU_INPUT_ACTIVE_HIGH,
80000, /* 80kHz ICU clock frequency.*/ 100000, /* 100kHz ICU clock frequency.*/
icuwidthcb, icuwidthcb,
icuperiodcb, icuperiodcb,
NULL NULL
@ -67,15 +66,11 @@ static ICUConfig icucfg = {
*/ */
int main(void) { int main(void) {
/* /* Initialization of all the imported components in the order specified in
* System initializations. the application wizard. The function is generated automatically.*/
* - HAL initialization, this also initializes the configured device drivers componentsInit();
* and performs the board-specific initializations.
* - Kernel initialization, the main() function becomes a thread and the palClearPad(PORT11, P11_LED4);
* RTOS is active.
*/
halInit();
chSysInit();
/* /*
* Initializes the PWM driver 8 and ICU driver 1. * Initializes the PWM driver 8 and ICU driver 1.

View File

@ -1,21 +1,21 @@
/* /*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio * Licensed under ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at:
you may not use this file except in compliance with the License. *
You may obtain a copy of the License at * http://www.st.com/software_license_agreement_liberty_v2
*
http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
See the License for the specific language governing permissions and
limitations under the License.
*/ */
#include "ch.h" /* Inclusion of the main header files of all the imported components in the
#include "hal.h" order specified in the application wizard. The file is generated
automatically.*/
#include "components.h"
static void pwmpcb(PWMDriver *pwmp) { static void pwmpcb(PWMDriver *pwmp) {
@ -30,8 +30,8 @@ static void pwmc1cb(PWMDriver *pwmp) {
} }
static PWMConfig pwmcfg = { static PWMConfig pwmcfg = {
80000, /* 80kHz PWM clock frequency.*/ 187500, /* 187500Hz PWM clock frequency.*/
20000, /* Initial PWM period 0.25s.*/ 19500, /* Initial PWM period 0.1040s.*/
pwmpcb, pwmpcb,
{ {
{PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb} {PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb}
@ -40,7 +40,6 @@ static PWMConfig pwmcfg = {
}; };
icucnt_t last_width, last_period; icucnt_t last_width, last_period;
icucnt_t last_width2, last_period2;
static void icuwidthcb(ICUDriver *icup) { static void icuwidthcb(ICUDriver *icup) {
@ -56,7 +55,7 @@ static void icuperiodcb(ICUDriver *icup) {
static ICUConfig icucfg = { static ICUConfig icucfg = {
ICU_INPUT_ACTIVE_HIGH, ICU_INPUT_ACTIVE_HIGH,
80000, /* 80kHz ICU clock frequency.*/ 187500, /* 187500Hz ICU clock frequency.*/
icuwidthcb, icuwidthcb,
icuperiodcb, icuperiodcb,
NULL NULL
@ -66,15 +65,12 @@ static ICUConfig icucfg = {
* Application entry point. * Application entry point.
*/ */
int main(void) { int main(void) {
/*
* System initializations. /* Initialization of all the imported components in the order specified in
* - HAL initialization, this also initializes the configured device drivers the application wizard. The function is generated automatically.*/
* and performs the board-specific initializations. componentsInit();
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active. palClearPad(PORT11, P11_LED4);
*/
halInit();
chSysInit();
/* /*
* Initializes the PWM driver 6 and ICU driver 3. * Initializes the PWM driver 6 and ICU driver 3.