added DAC support

pull/1412/head
Wojciech Gorniak 2015-11-03 12:59:00 +01:00
parent 09a627de19
commit 5b36773721
4 changed files with 18 additions and 1 deletions

View File

@ -40,6 +40,11 @@ typedef enum {
ADC_1 = (int)ADC1_BASE ADC_1 = (int)ADC1_BASE
} ADCName; } ADCName;
typedef enum {
DAC_1 = (int)DAC_BASE
} DACName;
typedef enum { typedef enum {
UART_1 = (int)USART1_BASE, UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE, UART_2 = (int)USART2_BASE,

View File

@ -58,6 +58,13 @@ const PinMap PinMap_ADC[] = {
{NC, NC, 0} {NC, NC, 0}
}; };
//*** DAC ***
const PinMap PinMap_DAC[] = {
{PA_5, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0xFF, 1, 0)}, // DAC_OUT1
{NC, NC, 0}
};
//*** I2C *** //*** I2C ***
const PinMap PinMap_I2C_SDA[] = { const PinMap PinMap_I2C_SDA[] = {

View File

@ -37,7 +37,7 @@
#define DEVICE_INTERRUPTIN 1 #define DEVICE_INTERRUPTIN 1
#define DEVICE_ANALOGIN 1 #define DEVICE_ANALOGIN 1
#define DEVICE_ANALOGOUT 0 // Not present on this device #define DEVICE_ANALOGOUT 1
#define DEVICE_SERIAL 1 #define DEVICE_SERIAL 1

View File

@ -60,6 +60,11 @@ struct analogin_s {
uint8_t channel; uint8_t channel;
}; };
struct dac_s {
DACName dac;
uint8_t channel;
};
struct serial_s { struct serial_s {
UARTName uart; UARTName uart;
int index; // Used by irq int index; // Used by irq