/********************************************/
/*Commands Code                             */
/*Commands between MCU and peripherals      */
/*based upon device ID                      */
/*PIC32MX795F512L-80I/PF                    */
/********************************************/

#include "xc.h"
#include "REN71V30.h"
#include "Delay.h"
#include "Delay.h"
#include "LED_Port.h"

void Get_Display_DEVID(void)
{
    //MCU writes device ID to SRAM 0x01-04
    int ver;
    int a0 = DEVID;
    int a1;
    int a2;
    int a3;
    
    ver = a0 >> 28;
    REN71V30_WR(0, ver);
    
    //MCU writes ver to SRAM 0x00
    REN71V30_WR(0, ver);
    
    a3 = a0 >> 24;
    a3 = a3 & 0x0000000f;
    REN71V30_WR(4, a3);
     
    a2 = a0 >> 16;
    a2 = a2 & 0x000000ff;
    REN71V30_WR(3, a2);

    a1 = a0 >> 8;
    a1 = a1 & 0x000000ff;
    REN71V30_WR(2, a1);
    
    a0 = a0 & 0x000000ff;
    REN71V30_WR(1, a0);
    
    //Set SRAM /INTL
    REN71V30_WR(0x3fe,0x45);

    return;
}
