Microchip® Advanced Software Framework

unit_tests.c File Reference

Unit tests for GPBR driver.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <board.h>
#include <sysclk.h>
#include "gpbr.h"
#include <string.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include <conf_test.h>
#include <conf_board.h>
#include "rtt.h"
#include "supc.h"
#include "flash_efc.h"

Macros

#define BACKUP_MODE_FLAG   0xAA55AA55
 Backup mode flag. More...
 
#define FLASH_WAIT_STATE_NBR   6
 Flash wait state number. More...
 
#define GPBR_UNIT_TEST_CONST_DATA   (0xdeadbeef)
 GPBR unit test const written data. More...
 
#define NORMAL_MODE_FLAG   0xffffffff
 Normal mode flag. More...
 
#define RTT_WAIT_TIME   2
 RTT wait time. More...
 

Functions

static void gpbr_test_configure_rtt (void)
 RTT configuration function. More...
 
int main (void)
 Run GPBR driver unit tests. More...
 
void RTT_Handler (void)
 Interrupt handler for the RTT. More...
 
static void run_gpbr_test (const struct test_case *test)
 Test GPBR read/write interfaces. More...
 

#define BACKUP_MODE_FLAG   0xAA55AA55

Backup mode flag.

Referenced by run_gpbr_test().

#define FLASH_WAIT_STATE_NBR   6

Flash wait state number.

Referenced by run_gpbr_test().

#define GPBR_UNIT_TEST_CONST_DATA   (0xdeadbeef)

GPBR unit test const written data.

Referenced by run_gpbr_test().

#define NORMAL_MODE_FLAG   0xffffffff

Normal mode flag.

Referenced by run_gpbr_test().

#define RTT_WAIT_TIME   2

RTT wait time.

Referenced by run_gpbr_test().

static void gpbr_test_configure_rtt ( void  )
static

RTT configuration function.

Configures the RTT to generate a one second tick, which triggers the RTT alarms interrupt.

References rtt_enable_interrupt(), rtt_init(), and rtt_read_timer_value().

Referenced by run_gpbr_test().

void RTT_Handler ( void  )

Interrupt handler for the RTT.

Get current RTT status.

References rtt_get_status().