nrf5/pwm: Moving out object types to header file so that it can be resused by other modules.
This commit is contained in:
parent
67683722c8
commit
ad4149cc80
10
nrf5/pwm.c
10
nrf5/pwm.c
@ -42,11 +42,6 @@
|
||||
#include "hal_pwm.h"
|
||||
#endif
|
||||
|
||||
typedef struct _pyb_pwm_obj_t {
|
||||
mp_obj_base_t base;
|
||||
PWM_HandleTypeDef *pwm;
|
||||
} pyb_pwm_obj_t;
|
||||
|
||||
#ifdef MICROPY_HW_PWM0_NAME
|
||||
PWM_HandleTypeDef PWMHandle0 = {.instance = NULL};
|
||||
#endif
|
||||
@ -236,11 +231,6 @@ STATIC MP_DEFINE_CONST_DICT(machine_pwm_locals_dict, machine_pwm_locals_dict_tab
|
||||
|
||||
/* code for hard implementation ***********************************************/
|
||||
|
||||
typedef struct _machine_hard_pwm_obj_t {
|
||||
mp_obj_base_t base;
|
||||
const pyb_pwm_obj_t *pyb;
|
||||
} machine_hard_pwm_obj_t;
|
||||
|
||||
STATIC const machine_hard_pwm_obj_t machine_hard_pwm_obj[] = {
|
||||
{{&machine_hard_pwm_type}, &machine_pwm_obj[0]},
|
||||
};
|
||||
|
12
nrf5/pwm.h
12
nrf5/pwm.h
@ -24,6 +24,18 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hal_pwm.h"
|
||||
|
||||
typedef struct _pyb_pwm_obj_t {
|
||||
mp_obj_base_t base;
|
||||
PWM_HandleTypeDef *pwm;
|
||||
} pyb_pwm_obj_t;
|
||||
|
||||
typedef struct _machine_hard_pwm_obj_t {
|
||||
mp_obj_base_t base;
|
||||
const pyb_pwm_obj_t *pyb;
|
||||
} machine_hard_pwm_obj_t;
|
||||
|
||||
void pwm_init0(void);
|
||||
|
||||
extern const mp_obj_type_t machine_hard_pwm_type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user