void Core2ForAWS_Port_A_I2C_Close(I2CDevice_t device)
Frees the configuration pointer to the I2C peripheral connected on port A.
Definition: core2forAWS.c:530
void * I2CDevice_t
A pointer to the I2C peripheral configuration.
Definition: i2c_device.h:41
Frees the configuration pointer to the I2C peripheral connected on port A.
This function frees the allocated memory for the pointer that holds the configuration for the I2C device connected on expansion port A. I2C can have multiple peripherals connected on the same bus, using this function to close/free one will not impact the others.
Read more about I2C capabilities of the ESP32 microcontroller and available APIs in the ESP-IDF.
The example code allocates a I2C peripheral called port_A_peripheral of type I2CDevice_t at the standard baud rate. It then closes/frees that device configuration.
Example:
#include <stdio.h>
#include <stdlib.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "esp_log.h"
#define DEVICE_ADDRESS 0xA0 >> 1
static const char *
TAG =
"MAIN";
void app_main()
{
}
I2CDevice_t Core2ForAWS_Port_A_I2C_Begin(uint8_t device_address, uint32_t baud)
Allocates a peripheral connected to expansion port A.
Definition: core2forAWS.c:518
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.
#define PORT_A_I2C_STANDARD_BAUD
The standard baud rate for I2C peripherals connected to Port A.
Definition: core2forAWS.h:191
#define TAG
Definition: i2c_device.c:10
- Parameters
-
| [in] | device | The device configuration pointer. |