Skip to content

Commit 24ac9fd

Browse files
author
Laurent MEUNIER
committed
[STM32F4] place holder for common object definition
Some of the objects in object.h are the same for all targets. Create a place where to define those common definitions, and start using it for pwm object.
1 parent fd4941f commit 24ac9fd

File tree

18 files changed

+75
-153
lines changed

18 files changed

+75
-153
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ struct i2c_s {
9595
uint32_t slave;
9696
};
9797

98-
struct pwmout_s {
99-
PWMName pwm;
100-
PinName pin;
101-
uint32_t period;
102-
uint32_t pulse;
103-
uint8_t channel;
104-
uint8_t inverted;
105-
};
106-
98+
#include "common_objects.h"
10799
#include "gpio_object.h"
108100

109101
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,12 @@ struct i2c_s {
102102
uint32_t slave;
103103
};
104104

105-
struct pwmout_s {
106-
PWMName pwm;
107-
PinName pin;
108-
uint32_t period;
109-
uint32_t pulse;
110-
uint8_t channel;
111-
uint8_t inverted;
112-
};
113-
114105
struct can_s {
115106
CANName can;
116107
int index; // Used by irq
117108
};
118109

110+
#include "common_objects.h"
119111
#include "gpio_object.h"
120112

121113
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,7 @@ struct i2c_s {
9090
uint32_t slave;
9191
};
9292

93-
struct pwmout_s {
94-
PWMName pwm;
95-
PinName pin;
96-
uint32_t period;
97-
uint32_t pulse;
98-
uint8_t channel;
99-
uint8_t inverted;
100-
};
101-
93+
#include "common_objects.h"
10294
#include "gpio_object.h"
10395

10496
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F407VG/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ struct i2c_s {
9595
uint32_t slave;
9696
};
9797

98-
struct pwmout_s {
99-
PWMName pwm;
100-
PinName pin;
101-
uint32_t period;
102-
uint32_t pulse;
103-
uint8_t channel;
104-
uint8_t inverted;
105-
};
106-
98+
#include "common_objects.h"
10799
#include "gpio_object.h"
108100

109101
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,12 @@ struct i2c_s {
9595
uint32_t slave;
9696
};
9797

98-
struct pwmout_s {
99-
PWMName pwm;
100-
PinName pin;
101-
uint32_t period;
102-
uint32_t pulse;
103-
uint8_t channel;
104-
uint8_t inverted;
105-
};
106-
10798
struct can_s {
10899
CANName can;
109100
int index;
110101
};
111102

103+
#include "common_objects.h"
112104
#include "gpio_object.h"
113105

114106
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,12 @@ struct i2c_s {
9595
uint32_t slave;
9696
};
9797

98-
struct pwmout_s {
99-
PWMName pwm;
100-
PinName pin;
101-
uint32_t period;
102-
uint32_t pulse;
103-
uint8_t channel;
104-
uint8_t inverted;
105-
};
106-
10798
struct can_s {
10899
CANName can;
109100
int index;
110101
};
111102

103+
#include "common_objects.h"
112104
#include "gpio_object.h"
113105

114106
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,7 @@ struct i2c_s {
9090
uint32_t slave;
9191
};
9292

93-
struct pwmout_s {
94-
PWMName pwm;
95-
PinName pin;
96-
uint32_t period;
97-
uint32_t pulse;
98-
uint8_t channel;
99-
uint8_t inverted;
100-
};
101-
93+
#include "common_objects.h"
10294
#include "gpio_object.h"
10395

10496
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,7 @@ struct i2c_s {
9090
uint32_t slave;
9191
};
9292

93-
struct pwmout_s {
94-
PWMName pwm;
95-
PinName pin;
96-
uint32_t period;
97-
uint32_t pulse;
98-
uint8_t channel;
99-
uint8_t inverted;
100-
};
101-
93+
#include "common_objects.h"
10294
#include "gpio_object.h"
10395

10496
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ struct i2c_s {
9595
uint32_t slave;
9696
};
9797

98-
struct pwmout_s {
99-
PWMName pwm;
100-
PinName pin;
101-
uint32_t period;
102-
uint32_t pulse;
103-
uint8_t channel;
104-
uint8_t inverted;
105-
};
106-
98+
#include "common_objects.h"
10799
#include "gpio_object.h"
108100

109101
#ifdef __cplusplus

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/objects.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,7 @@ struct i2c_s {
9090
uint32_t slave;
9191
};
9292

93-
struct pwmout_s {
94-
PWMName pwm;
95-
PinName pin;
96-
uint32_t period;
97-
uint32_t pulse;
98-
uint8_t channel;
99-
uint8_t inverted;
100-
};
101-
93+
#include "common_objects.h"
10294
#include "gpio_object.h"
10395

10496
#ifdef __cplusplus

0 commit comments

Comments
 (0)