{"id":301,"date":"2023-06-28T09:25:44","date_gmt":"2023-06-28T09:25:44","guid":{"rendered":"http:\/\/localhost\/embeddedwala\/?p=301"},"modified":"2023-07-27T04:13:53","modified_gmt":"2023-07-27T04:13:53","slug":"getting-started-with-i2c-code-example","status":"publish","type":"post","link":"https:\/\/embeddedwala.com\/beta\/blogs\/digital-communication\/getting-started-with-i2c-code-example\/","title":{"rendered":"Getting Started with I2C: Code Example"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"301\" class=\"elementor elementor-301\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t\t\t\t<section data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-section elementor-top-section elementor-element elementor-element-484981d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"484981d\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-64f2a06\" data-id=\"64f2a06\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<section data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-section elementor-inner-section elementor-element elementor-element-599009f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"599009f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-8e2a476\" data-id=\"8e2a476\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-dce1f9b elementor-widget elementor-widget-text-editor\" data-id=\"dce1f9b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>In\u00a0<strong>I2C<\/strong>\u00a0communication, one device acts as the\u00a0<strong>master<\/strong>\u00a0and initiates the communication, while the other devices act as\u00a0<strong>slaves<\/strong>\u00a0and respond to the master&#8217;s commands. The master generates the clock signal and controls the data transfer, while the slaves respond to the commands sent by the master.<\/p><p>Each device on the bus is identified by a unique 7-bit or 10-bit address, which is used by the master to address the slave device for data transfer. It also supports different data transfer formats such as byte mode, page mode, and sequential mode. The I2C protocol also includes\u00a0<strong>error detection<\/strong>\u00a0and\u00a0<strong>correction<\/strong>\u00a0mechanisms such as ACK\/NACK signals and\u00a0<strong>CRC<\/strong>\u00a0checks to ensure reliable data transfer. In this article, master-slave code implementation is covered in detail.<\/p><p>Image shared below is explaining the\u00a0<strong>flow chart<\/strong>\u00a0of the code.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-309 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/flow-chart-I2C.png\" alt=\"\" width=\"1775\" height=\"1080\" \/><\/p><p><strong>Each module detail for I2C Master is as below:<\/strong><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-303 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Main-subround.png\" alt=\"\" width=\"1840\" height=\"1057\" \/><\/p><ul><li><strong>I2C Initialization:<\/strong><ul><li><span class=\"S1PPyQ\">Enable the I2C Peripheral Clock<\/span><\/li><li><span class=\"S1PPyQ\">Enable to GPIO Peripheral Clock<\/span><\/li><li><span class=\"S1PPyQ\">Configures the GPIO peripheral with the following settings:<\/span><ul><li><span class=\"S1PPyQ\">GPIO Mode<\/span><\/li><li><span class=\"S1PPyQ\">GPIO Speed<\/span><\/li><li><span class=\"S1PPyQ\">GPIO Output Type<\/span><\/li><\/ul><\/li><li><span class=\"S1PPyQ\">Configures the I2C1 peripheral with the following settings:<\/span><ul><li><span class=\"S1PPyQ\">I2C clock speed<\/span><\/li><li><span class=\"S1PPyQ\">I2C mode<\/span><\/li><li><span class=\"S1PPyQ\">I2C duty cycle<\/span><\/li><li><span class=\"S1PPyQ\">I2C own address<\/span><\/li><li><span class=\"S1PPyQ\">I2C acknowledgement<\/span><\/li><li><span class=\"S1PPyQ\">I2C acknowledged address: 7-bit<\/span><\/li><\/ul><\/li><\/ul><\/li><\/ul><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-304 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/I2c-installation-blog-image.png\" alt=\"\" width=\"1667\" height=\"1051\" \/><\/p><ul><li><strong>Main Subroutine:<\/strong><ul><li><span class=\"S1PPyQ\"><strong>Initiate the transmission by<\/strong>:<\/span><ul><li><span class=\"S1PPyQ\">Sending the start condition on SDA line from high to low while keeping SCL line high.<\/span><\/li><li>Sending the slave address.<\/li><li>7-bit or 10-bit slave address along with the additional bit indicating whether master wants to read from or write to the slave.<\/li><li>Data Transfer if wants to Write<\/li><li>Else Read the Data<\/li><li>Send the Stop Condition by pulling the SDA line from Low to High while keeping the SCL line High.<\/li><\/ul><\/li><\/ul><\/li><\/ul><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-307 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Start-treansmission.png\" alt=\"\" width=\"1920\" height=\"1080\" \/><\/p><ul><li><strong><span class=\"S1PPyQ\">Start Transmission:<\/span><\/strong><ul><li><span class=\"S1PPyQ\">It waits until the I2C1 is not busy, sends a start condition, waits for the start condition to be sent successfully, sends the slave address with the write bit, waits for the slave address to be sent successfully, sends the data byte by byte, and waits for each data byte to be sent successfully.<\/span><\/li><li><span class=\"S1PPyQ\">If the stop bit is set, it sends a stop condition.<\/span><\/li><\/ul><\/li><\/ul><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-306 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Read-Data.png\" alt=\"\" width=\"1613\" height=\"1057\" \/><\/p><ul><li><span class=\"S1PPyQ\"><strong>Reads data<\/strong>:<\/span><ul><li><span class=\"S1PPyQ\">It waits until the I2C1 is not busy, sends a start condition, waits for the start condition to be sent successfully, sends the slave address with the read bit, waits for the slave address to be sent successfully, receives the data byte by byte, and waits for each data byte to be received successfully.<\/span><\/li><li><span class=\"S1PPyQ\">If the stop bit is set, it sends a stop condition.<\/span><\/li><\/ul><\/li><\/ul><p><strong>Each modules details for I2C Slave is as below:<\/strong><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-303 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Main-subround.png\" alt=\"\" width=\"1840\" height=\"1057\" \/><\/p><p><strong><span class=\"S1PPyQ\">I<\/span><\/strong><strong><span class=\"S1PPyQ\">2C Initialization<\/span><\/strong><\/p><ul><li><ul><li>Same as I2C Master Initialization<\/li><\/ul><\/li><\/ul><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-308 size-full\" src=\"https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/I2C-instalazation.png\" alt=\"\" width=\"1468\" height=\"1057\" \/><\/p><ul><li><strong><span class=\"S1PPyQ\">Main Subroutine:<\/span><\/strong><\/li><li><ul><li><span class=\"S1PPyQ\">An infinite loop waiting for a start condition from the master by checking:<\/span><ul><li><span class=\"S1PPyQ\">&#8216;I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED&#8217; event<\/span><\/li><li><span class=\"S1PPyQ\">After getting the start condition, reads 2 bytes of data from master by waiting for &#8216;I2C_EVENT_SLAVE_BYTE_RECEIVED&#8217; event<\/span><\/li><li><span class=\"S1PPyQ\">Call &#8216;I2C_ReceiveData()&#8217; to retrieve the received data.<\/span><\/li><li><span class=\"S1PPyQ\">Receives the data<\/span><\/li><li><span class=\"S1PPyQ\">Finally, the loop waits for a stop condition from the master by checking the I2C_EVENT_SLAVE_STOP_DETECTED event<\/span><\/li><li><span class=\"S1PPyQ\">Clears the stop flag using I2C_ClearFlag()`.<\/span><\/li><\/ul><\/li><\/ul><\/li><\/ul><p><strong>Note:\u00a0<\/strong>The\u00a0code examples are just a basic example to get started with I2C communication<\/p><p>The following code examples are written in C language and assume that the I2C peripheral is connected to an external I2C device with a 7-bit slave address of 0x50.<\/p><p><strong>Sample Code for I2C Master:<\/strong><\/p><div><pre>\/*Include all the header files as per the selected controller*\/\n\/*In current example STM32F4 Microcontroller is used as a master device*\/\n#include \"stm32f4xx.h\"\n#include \"stm32f4xx_i2c.h\"\n#include \"stm32f4xx_rcc.h\"\n\n#define I2C_SPEED              100000 \/*100 KHz*\/\n#define I2C_SLAVE_ADDRESS      0xA0   \/*Slave address would be mentioned in the Datasheet of the device working as a Slave*\/\n\nI2C_InitTypeDef I2C_InitStruct;\n\nvoid I2C1_Init(void)\n{\n    GPIO_InitTypeDef GPIO_InitStruct;\n\n    \/*Enable the I2C peripheral clock*\/\n    RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);\n\n    \/*Enable GPIO peripheral clock*\/\n    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);\n\n    \/\/ Configure the GPIO pins for I2C1\n    GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;\n    GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;\n    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;\n    GPIO_InitStruct.GPIO_OType = GPIO_OType_OD;\n    GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP;\n    GPIO_Init(GPIOB, &amp;GPIO_InitStruct);\n\n    \/*Connect I2C1 pins to the alternate function (AF4)*\/\n    GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);\n    GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);\n\n    \/*Initialize I2C1 peripheral*\/\n    I2C_DeInit(I2C1);\n    I2C_InitStruct.I2C_ClockSpeed = I2C_SPEED;\n    I2C_InitStruct.I2C_Mode = I2C_Mode_I2C;\n    I2C_InitStruct.I2C_DutyCycle = I2C_DutyCycle_2;\n    I2C_InitStruct.I2C_OwnAddress1 = 0x00;\n    I2C_InitStruct.I2C_Ack = I2C_Ack_Enable;\n    I2C_InitStruct.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;\n    I2C_Init(I2C1, &amp;I2C_InitStruct);\n\n    \/*Enable I2C1 peripheral*\/\n    I2C_Cmd(I2C1, ENABLE);\n}\n\nvoid I2C1_StartTransmission(uint8_t slaveAddr, uint8_t *buffer, uint8_t length, uint8_t stopBit)\n{\n    \/\/ Wait until I2C1 is not busy\n    while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY));\n\n    \/\/ Send start condition\n    I2C_GenerateSTART(I2C1, ENABLE);\n\n    \/\/ Wait for start condition sent successfully\n    while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));\n\n    \/\/ Send slave address\n    I2C_Send7bitAddress(I2C1, slaveAddr, I2C_Direction_Transmitter);\n\n    \/\/ Wait for slave address sent successfully\n    while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));\n\n    \/\/ Send data\n    for (uint8_t i = 0; i &lt; length; i++) \n    {\n        I2C_SendData(I2C1, buffer[i]);\n\n        \/\/ Wait for data sent successfully\n        while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED));\n    }\n\n    if (stopBit) \n    {\n        \/*Send stop condition*\/\n        I2C_GenerateSTOP(I2C1, ENABLE);\n    }\n}\n\nvoid I2C1_ReadData(uint8_t slaveAddr, uint8_t *buffer, uint8_t length)\n{\n   \/*Wait until I2C1 is not busy *\/\n   while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY));\n\n   \/* Send start condition *\/\n   I2C_GenerateSTART(I2C1, ENABLE);\n\n   \/* Wait for start condition sent successfully *\/\n  while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT));\n\n  \/* Send slave address*\/\n  I2C_Send7bitAddress(I2C1, slaveAddr, I2C_Direction_Receiver);\n\n  \/* Wait for slave address sent successfully *\/\n  while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED));\n\n  \/* Read data *\/\n  for (uint8_t i = 0; i &lt; length; i++) \n  {\n    if (i == (length - 1)) \n    {\n        \/* Disable Acknowledgement *\/\n        I2C_AcknowledgeConfig(I2C1, DISABLE);\n    }\n\n    \/* Wait for data received successfully *\/\n    while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED));\n\n    buffer[i] = I2C_ReceiveData(I2C1);\n  }\n\n\/* Enable Acknowledgement *\/\nI2C_AcknowledgeConfig(I2C1, ENABLE);\n\n\/* Send stop condition *\/\nI2C_GenerateSTOP(I2C1, ENABLE);\n}\n\nint main (void) \n{\n  \n    uint8_t data[2];\n  \n    \/*Initialize I2C1*\/\n    I2C1_Init ();\n  \n    \/*Read data from the sensor*\/\n    I2C1_StartTransmission (I2C_SLAVE_ADDRESS, data, 2, 1);\n \n    \/*Process the received data*\/\n    \n    \/*Write data to the sensor*\/\n    data[0] = 0x01;\n    data[1] = 0x02;\n    I2C1_StartTransmission (I2C_SLAVE_ADDRESS, data, 2, 1);<br \/>\n    while (1);\n    return 0;\n\n}<\/pre><\/div><p><span class=\"S1PPyQ\"><strong>Sample Code for I2C Slave:<\/strong><\/span><\/p><div><pre>#include \"stm32f10x.h\"\n\n\/*Slave Address, would be different for each slave device*\/\n#define I2C_SLAVE_ADDRESS 0x50\n\nvoid I2C1_Init(void)\n{\n    GPIO_InitTypeDef GPIO_InitStruct;\n    I2C_InitTypeDef I2C_InitStruct;\n\n    \/*Enable the I2C &amp; GPIO peripheral clock*\/\n    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);\n    RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);\n\n    \/*GPIO Configuration*\/\n    GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;\n    GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;\n    GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_OD;\n    GPIO_Init(GPIOB, &amp;GPIO_InitStruct);\n\n    \/*I2C Configuration*\/\n    I2C_InitStruct.I2C_Mode = I2C_Mode_I2C;\n    I2C_InitStruct.I2C_DutyCycle = I2C_DutyCycle_2;\n    I2C_InitStruct.I2C_OwnAddress1 = I2C_SLAVE_ADDRESS &lt;&lt; 1;\n    I2C_InitStruct.I2C_Ack = I2C_Ack_Enable;\n    I2C_InitStruct.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;\n    I2C_InitStruct.I2C_ClockSpeed = 100000;\n    I2C_Init(I2C1, &amp;I2C_InitStruct);\n\n    \/*Enable I2C*\/\n    I2C_Cmd(I2C1, ENABLE);\n}\n\nint main(void)\n{\n    uint8_t data[2];\n\n    \/*I2C Initialization*\/\n    I2C1_Init();\n\n    while (1) \n    {\n        \/*Wait for the start condition*\/\n        while (!I2C_CheckEvent(I2C1, I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED));\n\n        \/*Check the data*\/\n        for (uint8_t i = 0; i &lt; 2; i++) \n        {\n            while (!I2C_CheckEvent(I2C1, I2C_EVENT_SLAVE_BYTE_RECEIVED));\n            data[i] = I2C_ReceiveData(I2C1);\n        }\n\n        \/\/ Process data\n\n        \/*Wait for stop condition*\/\n        while (!I2C_CheckEvent(I2C1, I2C_EVENT_SLAVE_STOP_DETECTED));\n        I2C_ClearFlag(I2C1, I2C_FLAG_STOPF);\n    }\n\n    return 0;\n}\n<\/pre><\/div><p><span class=\"S1PPyQ\">In conclusion, the I2C communication protocol is a widely used standard for communication between multiple devices in embedded systems. In master-slave mode, one device acts as the master and initiates the communication, while the other devices act as slaves and respond to the master&#8217;s requests. With the help of the code example provided, user can get started with I2C communication and build more complex applications that require multiple devices to communicate with each other.<\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In\u00a0I2C\u00a0communication, one device acts as the\u00a0master\u00a0and initiates the communication, while the other devices act as\u00a0slaves\u00a0and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":6338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[54,80,79,73],"class_list":["post-301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital-communication","tag-i2c","tag-i2c-code","tag-i2c-firmware","tag-serial-communication"],"acf":[],"views":825,"featured_image_urls":{"full":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"thumbnail":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image-150x150.png",150,150,true],"medium":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image-300x202.png",300,202,true],"medium_large":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"large":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"1536x1536":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"2048x2048":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"tp-image-grid":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"covernews-slider-full":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"covernews-slider-center":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"covernews-featured":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",520,350,false],"covernews-medium":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",505,340,false],"covernews-medium-square":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",371,250,false],"_nx_notification_thumb":["https:\/\/embeddedwala.com\/beta\/wp-content\/uploads\/2023\/06\/Getting-Started-with-I2C-blog-image.png",100,67,false]},"author_info":{"display_name":"embeddedwala","author_link":"https:\/\/embeddedwala.com\/beta\/author\/embeddedwala\/"},"category_info":"<a href=\"https:\/\/embeddedwala.com\/beta\/category\/blogs\/digital-communication\/\" rel=\"category tag\">Digital Communication<\/a>","tag_info":"Digital Communication","comment_count":"0","_links":{"self":[{"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":11,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":6345,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/posts\/301\/revisions\/6345"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/media\/6338"}],"wp:attachment":[{"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embeddedwala.com\/beta\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}