app_pwm_dma.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file app_pwm_dma.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of PWM app library.
7  *
8  ****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  ****************************************************************************************
36  */
37 
38 #ifndef _APP_PWM_DMA_H_
39 #define _APP_PWM_DMA_H_
40 
41 /** @addtogroup PERIPHERAL Peripheral Driver
42  * @{
43  */
44 
45 /** @addtogroup APP_DRIVER APP DRIVER
46  * @{
47  */
48 
49 /** @defgroup APP_PWM PWM
50  * @brief PWM APP module driver.
51  * @{
52  */
53 
54 
55 #include "app_io.h"
56 #include "app_dma.h"
57 #include "app_pwm.h"
58 #include "app_drv_error.h"
59 #include "app_drv_config.h"
60 #include <stdbool.h>
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 #ifdef HAL_PWM_MODULE_ENABLED
67 #ifdef APP_PWM_CODING_ENABLE
68 
69 /* Exported functions --------------------------------------------------------*/
70 /** @addtogroup APP_PWM_DMA_DRIVER_FUNCTIONS Functions
71  * @{
72  */
73 /**
74  ****************************************************************************************
75  * @brief Initialize the APP PWM DMA DRIVER according to the specified parameters
76  * in the app_pwm_params_t and app_pwm_evt_handler_t.
77  *
78  * @param[in] p_params: Pointer to app_pwm_params_t parameter which contains the
79  * configuration information for the specified PWM module.
80  *
81  * @return Result of initialization.
82  ****************************************************************************************
83  */
84 uint16_t app_pwm_dma_init(app_pwm_params_t *p_params);
85 
86 /**
87  ****************************************************************************************
88  * @brief De-initialize the APP PWM DRIVER peripheral.
89  *
90  * @param[in] id: De-initialize for a specific ID.
91  *
92  * @return Result of De-initialization.
93  ****************************************************************************************
94  */
95 uint16_t app_pwm_dma_deinit(app_pwm_id_t id);
96 
97 /**
98  ****************************************************************************************
99  * @brief Start generate wave form in DMA mode
100  *
101  * @param[in] id: which PWM module want to config.
102  * @param[in] p_data: the coding data address.
103  * @param[in] size: coding data size.
104  *
105  * @return Result of operation.
106  ****************************************************************************************
107  */
108 uint16_t app_pwm_start_coding_with_dma(app_pwm_id_t id, uint32_t *p_data, uint16_t size);
109 
110 /** @} */
111 
112 
113 #endif
114 
115 #endif
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif
122 
123 /** @} */
124 /** @} */
125 /** @} */
app_io.h
Header file containing functions prototypes of GPIO app library.
app_pwm_id_t
app_pwm_id_t
PWM module Enumerations definition.
Definition: app_pwm.h:84
app_dma.h
Header file containing functions prototypes of DMA app library.
app_pwm_params_t
PWM parameters structure definition.
Definition: app_pwm.h:233
app_pwm.h
Header file containing functions prototypes of PWM app library.
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.