nrf5/hal: Updating PWM header file with init function prototype. Also added PWM_HandleTypeDef structure that can be used in the pwm python module.
This commit is contained in:
parent
7bfe001d22
commit
abd945fde1
@ -31,11 +31,9 @@
|
|||||||
|
|
||||||
#include "nrf.h"
|
#include "nrf.h"
|
||||||
|
|
||||||
#if NRF51
|
// TODO: nrf51 series need Soft PWM. Not part of HAL.
|
||||||
|
|
||||||
// TODO: create software PWM.
|
#if NRF52
|
||||||
|
|
||||||
#elif NRF52
|
|
||||||
|
|
||||||
#define PWM0 ((NRF_PWM_Type *)NRF_PWM0_BASE)
|
#define PWM0 ((NRF_PWM_Type *)NRF_PWM0_BASE)
|
||||||
#define PWM0_IRQ_NUM PWM1_IRQn
|
#define PWM0_IRQ_NUM PWM1_IRQn
|
||||||
@ -58,4 +56,17 @@ typedef struct {
|
|||||||
uint8_t pwm_pin;
|
uint8_t pwm_pin;
|
||||||
} hal_pwm_init_t;
|
} hal_pwm_init_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief PWM handle Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct __PWM_HandleTypeDef
|
||||||
|
{
|
||||||
|
NRF_PWM_Type *instance; /* PWM registers base address */
|
||||||
|
hal_pwm_init_t init; /* PWM initialization parameters */
|
||||||
|
} PWM_HandleTypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
void hal_pwm_init(NRF_PWM_Type * p_instance, hal_pwm_init_t const * p_pwm_init);
|
||||||
|
|
||||||
|
|
||||||
#endif // HAL_PWM_H__
|
#endif // HAL_PWM_H__
|
||||||
|
Loading…
Reference in New Issue
Block a user