Logo
MSP430IEC60730SWPackage
Gpio_test_api

Functions

uint8_t IEC60730_GPIO_TEST_testGpioOutput (uint16_t port, uint16_t gpioPin)
 
uint8_t IEC60730_GPIO_TEST_testGpioInput (uint16_t port, uint16_t gpioPin, uint16_t expectedValue)
 

Detailed Description

Function Documentation

uint8_t IEC60730_GPIO_TEST_testGpioInput ( uint16_t  port,
uint16_t  gpioPin,
uint16_t  expectedValue 
)

Tests input functionality of GPIO module

Parameters
portis the port number to be tested. Consult device datasheet to determine which ports are available in your device. Valid values are PORT_1 PORT_2 PORT_3 PORT_4 PORT_5 PORT_6 PORT_7 PORT_8 PORT_9 PORT_10 PORT_11 PORT_A PORT_B PORT_C PORT_D PORT_E PORT_F PORT_J
gpioPinis the GPIO pin number(s) that will be test. The following values can be ORed to test multiple pins. Valid values are PIN0 PIN1 PIN2 PIN3 PIN4 PIN5 PIN6 PIN7 PIN8 PIN9 PIN10 PIN11 PIN12 PIN13 PIN14 PIN15
expectedis the GPIO pin number(s) that will be test. Valid values are PIN0_HIGH PIN0_LOW PIN1_HIGH PIN1_LOW PIN2_HIGH PIN2_LOW PIN3_HIGH PIN3_LOW PIN4_HIGH PIN4_LOW PIN5_HIGH PIN5_LOW PIN6_HIGH PIN6_LOW PIN7_HIGH PIN7_LOW PIN8_HIGH PIN8_LOW PIN9_HIGH PIN9_LOW PIN10_HIGH PIN10_LOW PIN11_HIGH PIN11_LOW PIN12_HIGH PIN12_LOW PIN13_HIGH PIN13_LOW PIN14_HIGH PIN14_LOW PIN15_HIGH PIN15_LOW

This function performs an input plausibility check on the GPIO module. The function compares the current state in PxIN with the expectedValue and the test is passed if both values are equal. If the MSP430 device does not have the selected PORTx or if the value value for gpioPin is outside the valid range, the function will call IEC60730_FAIL_SAFE_failSafe() if JUMP_TO_FAILSAFE is enabled in "IEC60730_user_config.h" otherwise TEST_FAILURE is returned.

These are the valid parameters for gpioPin: -PORT1-PORT11 valid range (0x0000-0x00FF) -PORTA-PORTF valid range (0x0000-0xFFFF) -PORTJ valid range (0x0000-0x000F)

Returns
If the test passes.- SIG_GPIO_TEST If the test fails.- TEST_FAILURE
uint8_t IEC60730_GPIO_TEST_testGpioOutput ( uint16_t  port,
uint16_t  gpioPin 
)

Tests output functionality of GPIO module

Parameters
portis the port number to be tested. Consult device datasheet to determine which ports are available in your device. Valid values are PORT_1 PORT_2 PORT_3 PORT_4 PORT_5 PORT_6 PORT_7 PORT_8 PORT_9 PORT_10 PORT_11 PORT_A PORT_B PORT_C PORT_D PORT_E PORT_F PORT_J
gpioPinis the GPIO pin number(s) that will be test. The following values can be ORed to test multiple pins. Valid values are PIN0 PIN1 PIN2 PIN3 PIN4 PIN5 PIN6 PIN7 PIN8 PIN9 PIN10 PIN11 PIN12 PIN13 PIN14 PIN15

This function performs an output plausibility check on the GPIO module. The function sets and clears the pin specified by gpioPin. The function will check if the user has passed valid port and gpioPin values. If the MSP430 device does not have the selected PORTx or if the value value for gpioPin is outside the valid range, the function will call IEC60730_FAIL_SAFE_failSafe() if JUMP_TO_FAILSAFE is enabled in "IEC60730_user_config.h", otherwise TEST_FAILURE is returned.

These are the valid parameters for gpioPin: -PORT1-PORT11 valid range (0x0000-0x00FF) -PORTA-PORTF valid range (0x0000-0xFFFF) -PORTJ valid range (0x0000-0x000F)

PxOUT are modified by this test but the original state of PxOUT, if test is PASSED.

Modified registers are PxOUT.

Returns
If the test passes.- SIG_GPIO_TEST If the test fails.- TEST_FAILURE