forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PwmOut API support for STM32H5 (#299)
* Enable PwmOut API * remove pins with LpTimer * Prepare for H563 * Change source of us ticker from TIM2 to TIM3 --------- Co-authored-by: Jan Kamidra <[email protected]>
- Loading branch information
Showing
8 changed files
with
165 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* mbed Microcontroller Library | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
****************************************************************************** | ||
* | ||
* Copyright (c) 2015-2024 STMicroelectronics. | ||
* All rights reserved. | ||
* | ||
* This software component is licensed by ST under BSD 3-Clause license, | ||
* the "License"; You may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* opensource.org/licenses/BSD-3-Clause | ||
* | ||
****************************************************************************** | ||
*/ | ||
|
||
#include "cmsis.h" | ||
#include "pwmout_api.h" | ||
#include "pwmout_device.h" | ||
|
||
#if DEVICE_PWMOUT | ||
|
||
const pwm_apb_map_t pwm_apb_map_table[] = { | ||
{PWM_1, PWMOUT_ON_APB1}, | ||
{PWM_2, PWMOUT_ON_APB1}, | ||
{PWM_3, PWMOUT_ON_APB2}, | ||
#if defined(TIM4_BASE) | ||
{PWM_4, PWMOUT_ON_APB2}, | ||
#endif | ||
#if defined(TIM5_BASE) | ||
{PWM_5, PWMOUT_ON_APB1}, | ||
#endif | ||
#if defined(TIM8_BASE) | ||
{PWM_8, PWMOUT_ON_APB2}, | ||
#endif | ||
#if defined(TIM12_BASE) | ||
{PWM_12, PWMOUT_ON_APB1}, | ||
#endif | ||
#if defined(TIM13_BASE) | ||
{PWM_13, PWMOUT_ON_APB2}, | ||
#endif | ||
#if defined(TIM14_BASE) | ||
{PWM_14, PWMOUT_ON_APB1}, | ||
#endif | ||
#if defined(TIM15_BASE) | ||
{PWM_15, PWMOUT_ON_APB2}, | ||
#endif | ||
#if defined(TIM16_BASE) | ||
{PWM_16, PWMOUT_ON_APB1}, | ||
#endif | ||
#if defined(TIM17_BASE) | ||
{PWM_17, PWMOUT_ON_APB2}, | ||
#endif | ||
{(PWMName) 0, PWMOUT_UNKNOWN} | ||
}; | ||
|
||
#endif // DEVICE_PWMOUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* mbed Microcontroller Library | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
****************************************************************************** | ||
* | ||
* Copyright (c) 2015-2024 STMicroelectronics. | ||
* All rights reserved. | ||
* | ||
* This software component is licensed by ST under BSD 3-Clause license, | ||
* the "License"; You may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* opensource.org/licenses/BSD-3-Clause | ||
* | ||
****************************************************************************** | ||
*/ | ||
|
||
#ifndef MBED_PWMOUT_DEVICE_H | ||
#define MBED_PWMOUT_DEVICE_H | ||
|
||
#include "cmsis.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#if DEVICE_PWMOUT | ||
|
||
typedef enum { | ||
PWMOUT_ON_APB1 = 0, | ||
PWMOUT_ON_APB2 = 1, | ||
PWMOUT_UNKNOWN = 2 | ||
} PwmoutApb; | ||
|
||
/* Structure to describe Timers to APB */ | ||
typedef struct pwm_apb_map { | ||
PWMName pwm; // an index entry for each EXIT line | ||
PwmoutApb pwmoutApb; | ||
} pwm_apb_map_t; | ||
|
||
extern const pwm_apb_map_t pwm_apb_map_table[]; | ||
|
||
#endif // DEVICE_PWMOUT | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3098,7 +3098,6 @@ | |
"ANALOGOUT", | ||
"ANALOGIN", | ||
"FLASH", | ||
"PWMOUT", | ||
"LPTICKER", | ||
"CAN", | ||
"SERIAL_FC", | ||
|