-
Notifications
You must be signed in to change notification settings - Fork 14
/
dac.h
28 lines (21 loc) · 904 Bytes
/
dac.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DAC_H
#define __DAC_H
/* Includes ------------------------------------------------------------------*/
#include "utils.h"
#include "pin.h"
/* Exported constants --------------------------------------------------------*/
//PA.04 (DAC_OUT1), PA.05 (DAC_OUT2)
#define DAC_OUT1 GPIO_Pin_4
#define DAC_OUT2 GPIO_Pin_5
#define DAC_GPIO GPIOA
//#define DAC_ALIGN DAC_Align_8b_R
#define DAC_ALIGN DAC_Align_12b_R
#define DAC_SIGNAL_SINUS_LENGTH 32
#define DAC_SIGNAL_TRIANGLE_LENGTH 32
#define DAC_SIGNAL_SAWTOOTH_LENGTH 32
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void dac_init(uint32_t DAC_Channel_X);
void dac_set(uint32_t DAC_Channel_X, uint16_t value);
#endif /* __DAC_H */