Exemple #1
0
void init() {
    
    CyGlobalIntEnable;
    rx_int_StartEx(RX_INT);             // start RX interrupt (look for CY_ISR with RX_INT address)
                                        // for code that writes received bytes to LCD.
    
    UART_Start();                       // initialize UART
    UART_ClearRxBuffer();
    
    // Init Electronic Components
    PGA_TOP_GND_Start();
    PGA_REF_Start();
    PGA_GAIN_Start();
    IDAC8_REF_Start();
    ADC_SAR_1_Start();
    //ADC_SAR_1_StartConvert();
    
    // Init muxes
    TOP_MUX_GND_Start();
    TOP_MUX_VREF_Start();
    BOTTOM_MUX_SENSE_Start();
    zeroAllPins();
}
Exemple #2
0
int main()
{
    CyGlobalIntEnable; /* Enable global interrupts. */
    
    // Set up LCD screen
    LCD_Start();
	LCD_ClearDisplay();
    
    rx_isr_StartEx(rx_isr);             // start RX interrupt (look for CY_ISR with RX_INT address)
                                        // for code that writes received bytes to LCD.
    
    UART_Start();                       // initialize UART
    UART_ClearRxBuffer();
    
    // Check status message
    UART_PutString("AT\r\n");
    CyDelay(1000);\
    LCD_ClearDisplay();
    
    // Set name to VizDude
    UART_PutString("AT+NAME=VizDude\r\n");
    CyDelay(1000);\
    LCD_ClearDisplay();
    
    // Set rate to 115200 Baud, 1 stop bit, no parity
    UART_PutString("AT+UART=115200,1,0\r\n");
    CyDelay(1000);\
    LCD_ClearDisplay();

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

    for(;;)
    {
        /* Place your application code here. */
    }
}