esp_err_t Core2ForAWS_Port_B_DAC_WriteMilliVolts(uint16_t mvolts)
Outputs the specified voltage (millivolts) to the DAC.
Definition: core2forAWS.c:544
Outputs the specified voltage (millivolts) to the DAC.
- Note
- pin_mode_t for PORT_B_DAC_PIN must be set to DAC before using Core2ForAWS_Port_B_DAC_WriteMilliVolts.
This function accepts a range from 0 to a maximum of VDD3P3_RTC (~3300mV).
The example code sets the PORT_B_DAC_PIN (GPIO 26) pin mode to DAC and outputs 1,500mV.
Example:
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
void app_main(void){
}
esp_err_t Core2ForAWS_Port_PinMode(gpio_num_t pin, pin_mode_t mode)
Sets the pin mode of the specified pin.
Definition: core2forAWS.c:431
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
Functions to initialize and access Core2 for AWS IoT EduKit hardware features.
@ DAC
Enable DAC mode. Only available on Port B—GPIO 26.
Definition: core2forAWS.h:219
#define PORT_B_DAC_PIN
The DAC pin on expansion port B.
Definition: core2forAWS.h:148
- Parameters
-
| [in] | mvolts | The voltage level to set the DAC pin in millivolts. |
- Returns
- esp_err_t. 0 or
ESP_OK if successful.