Skip to content

Commit

Permalink
STMicro: Improve PWM resolution (#283)
Browse files Browse the repository at this point in the history
* STMicro: Improve PWM resolution

* Update all objects.h, rename counts -> top_count

* Revert pin mode change, seems to be not needed
  • Loading branch information
multiplemonomials authored Jun 20, 2024
1 parent f442436 commit 687a94b
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 193 deletions.
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@
extern "C" {
#endif

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F1/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ struct port_s {
__IO uint32_t *reg_out;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F2/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,6 @@ struct i2c_s {
#endif
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

#if DEVICE_CAN
struct can_s {
CAN_HandleTypeDef CanHandle;
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F3/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@
extern "C" {
#endif

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ struct port_s {
__IO uint32_t *reg_out;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index;
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32F7/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ struct trng_s {
RNG_HandleTypeDef handle;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
11 changes: 0 additions & 11 deletions targets/TARGET_STM/TARGET_STM32G0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ struct port_s {
__IO uint32_t *reg_out;
};


struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32G4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ struct port_s {
__IO uint32_t *reg_out;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32H7/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ struct trng_s {
RNG_HandleTypeDef handle;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
11 changes: 0 additions & 11 deletions targets/TARGET_STM/TARGET_STM32L0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ struct port_s {
__IO uint32_t *reg_out;
};


struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
11 changes: 0 additions & 11 deletions targets/TARGET_STM/TARGET_STM32L1/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,6 @@ struct port_s {
__IO uint32_t *reg_out;
};


struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32L4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ struct dac_s {
};
#endif

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32L5/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ struct trng_s {
RNG_HandleTypeDef handle;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32U5/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ struct trng_s {
RNG_HandleTypeDef handle;
};

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32WB/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
extern "C" {
#endif

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
10 changes: 0 additions & 10 deletions targets/TARGET_STM/TARGET_STM32WL/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ struct dac_s {
};
#endif

struct pwmout_s {
PWMName pwm;
PinName pin;
uint32_t prescaler;
uint32_t period;
uint32_t pulse;
uint8_t channel;
uint8_t inverted;
};

struct serial_s {
UARTName uart;
int index; // Used by irq
Expand Down
1 change: 1 addition & 0 deletions targets/TARGET_STM/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "objects.h"
#include "stm_i2c_api.h"
#include "stm_spi_api.h"
#include "stm_pwmout_api.h"

#if DEVICE_USTICKER
#include "us_ticker_defines.h"
Expand Down
Loading

0 comments on commit 687a94b

Please sign in to comment.